diff --git a/CollectItemsWithSword.asm b/CollectItemsWithSword.asm index c8a5eba..c247572 100644 --- a/CollectItemsWithSword.asm +++ b/CollectItemsWithSword.asm @@ -6,7 +6,7 @@ pushpc org $86F725 - JSL collectSword + JSL collectSword pullpc @@ -18,25 +18,30 @@ STA $09 LDA $79 BEQ $01 RTL -LDA $0E20,x + +LDA $0E20, X SEC SBC #$D8 BCS $01 RTL -LDA $0E20,x + +LDA $0E20, X SEC SBC #$E7 BCC $01 RTL + PHY LDY $3C BPL $02 PLY RTL -LDA $F571,y + +LDA $F571, Y BEQ $02 PLY RTL + PHX LDA $2F ASL A @@ -49,7 +54,7 @@ INX LDY #$00 LDA $45 CLC -ADC $F46D,x +ADC $F46D, X BPL $01 DEY CLC @@ -61,7 +66,7 @@ STA $08 LDY #$00 LDA $44 CLC -ADC $F4EF,x +ADC $F4EF, X BPL $01 DEY CLC @@ -70,9 +75,9 @@ STA $01 TYA ADC $21 STA $09 -LDA $F4AE,x +LDA $F4AE, X STA $02 -LDA $F530,x +LDA $F530, X STA $03 PLX PLY diff --git a/CollisionTables.asm b/CollisionTables.asm index 62f5f6a..336ddb1 100644 --- a/CollisionTables.asm +++ b/CollisionTables.asm @@ -57,11 +57,31 @@ org $E9000 ; 00 01 02 03 04 05 06 dw $0000, $0000, $0000, $0080, $0080, $0100, $0100 ; 07 08 09 10 11 12 13 - dw $0100, $0180, $0200, $0100, $0200, $0280, $0300 + dw $0100, $0180, $0200, $0100, $0180, $0280, $0300 ; 14 15 16 17 18 19 20 dw $0380, $0100, $0100, $0080, $0100, $0380, $0100 +; Animated Tile Edits for Shadow Castle +; Room Blocksets 0; 1; 2; 9 (PC: $7102A > $710A9) (SNES: $E902A > $E90A9) - Group 00 +; ----------------------------------------------------------------------------------- +org $E902A + +; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F +; 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 +; ----------------------------------------------------------------------------------- + db $02, $02, $02, $02, $02, $02, $6E, $6F, $01, $6C, $02, $01, $01, $01, $01, $01 + db $02, $02, $02, $02, $02, $02, $00, $00, $00, $00, $02, $01, $01, $01, $01, $01 + db $01, $01, $01, $01, $01, $01, $6E, $6F, $01, $6C, $02, $02, $02, $02, $01, $02 + db $00, $00, $22, $00, $00, $00, $02, $02, $02, $02, $02, $02, $00, $00, $01, $00 + + db $01, $01, $01, $01, $01, $01, $01, $02, $02, $02, $02, $02, $02, $02, $02, $02 + db $01, $01, $01, $01, $01, $01, $01, $02, $02, $02, $02, $02, $02, $02, $02, $02 + db $02, $02, $02, $02, $18, $00, $00, $00, $00, $00, $02, $02, $01, $01, $01, $01 + db $6B, $6A, $02, $01, $02, $02, $08, $08, $08, $08, $09, $09, $09, $09, $68, $69 ; Animated Tiles + + + ; Final Boss Room ; Room Blockset = 08 (PC: 711AA > 71229) (SNES: E91AA > E9229) - group 4 ; --------------------------------------------------------------------------------- @@ -180,6 +200,6 @@ org $E93AA org $2811E ; 00 01 02 03 04 05 06 07 08 09 0A 0B - db $5D, $5D, $5D, $5D, $5D, $5D, $5D, $5F, $5D, $63, $5F, $5E + db $5E, $5D, $5E, $5D, $5E, $5D, $5D, $5F, $5D, $63, $5F, $5E ; 0C 0D 0E 0F 10 11 12 13 14 15 16 17 db $5F, $5E, $63, $5D, $5D, $5E, $5D, $5D, $5D, $5D, $5D, $5D diff --git a/DungeonMaps.asm b/DungeonMaps.asm index b3f6f0b..6a09d94 100644 --- a/DungeonMaps.asm +++ b/DungeonMaps.asm @@ -3,9 +3,71 @@ ; Special thanks to Letterbomb for tracing the 8x8 tilemap data. ; =============================================================================== +; =============================================================================== +; Disable Dungeon Maps +; =============================================================================== + +; org $0288FD ; Replace a BEQ by a BRA +; db $80 + + +; =============================================================================== +; DungeonMap_DrawRoomMarkers +; =============================================================================== + +; .offset_x_base +; org $0AE7F7 : dw $0090 + +; .fairy_rooms +org $0AE7F9 : dw $004C ; ROOM 004C - Manor Anti-Fairy Room +; org $0AE7FB : dw $00A7 ; ROOM 00A7 - Hera fairy room +; org $0AE7FD : dw $004F ; ROOM 004F - Ice Palace fairy room + +; .fairy_room_replacements +org $0AE7FF : dw $005B ; ROOM 005B - Manor Rectangle Floor Drop Room +; org $0AE801 : dw $0077 ; ROOM 0077 - Hera lobby +; org $0AE803 : dw $00BE ; ROOM 00BE - Ice Palace block switch room + +; .floor_threshold +; org $0AE805 : dw $0004 + + +; =============================================================================== +; Boss Skulls +; =============================================================================== + +; .offsets +org $0AEE5D : db $FF, $FF, $FF, $FF +org $0AEE61 : db $08, $08, $08, $00 +org $0AEE65 : db $FF, $FF, $08, $00 +org $0AEE69 : db $04, $04, $08, $00 +org $0AEE6D : db $08, $08, $00, $08 +org $0AEE71 : db $08, $08, $08, $08 +org $0AEE75 : db $08, $00, $08, $00 + +; ------------------------------------------------------------------------------- + +; DungeonMap_BossRoomFloor: +; org $0AEE79 : dw $FFFF ; // - Sewers +; org $0AEE7B : dw $FFFF ; // - Hyrule Castle +org $0AEE7D : dw $00FF ; B1 - Pumpkin Patch (Eastern Palace) +org $0AEE7F : dw $00FF ; 2F - Living spooM (Desert Palace) +org $0AEE81 : dw $FFFF ; // - Shadow Castle (Agahnim's Tower) +; org $0AEE83 : dw $00FF ; B1 - Swamp Palace +org $0AEE85 : dw $00FE ; B1 - Abandoned Mineshaft (Palace of Darkness) +; org $0AEE87 : dw $00FF ; B1 - Misery Mire +; org $0AEE89 : dw $00FE ; B2 - Skull Woods +; org $0AEE8B : dw $00F9 ; B7 - Ice Palace +org $0AEE8D : dw $00FE ; B2 - Haunted Manor (Tower of Hera) +; org $0AEE8F : dw $00FF ; B1 - Thieves' Town +; org $0AEE91 : dw $00FD ; B3 - Turtle Rock +; org $0AEE93 : dw $0006 ; 7F - Ganon's Tower + + +; =============================================================================== ; Pumpkin Patch ; By Jeimuzu -; ------------------------------------------------------------------------------- +; =============================================================================== org $219090 dw $0b40, $0b41, $0b42, $0b43, $0b44, $0b45, $0b48, $0b49 @@ -18,9 +80,10 @@ dw $0b5e, $0b5f, $0b60, $0b61, $0b63, $4b63, $1362, $5362 dw $575f, $4b5e, $4b61, $4b60, $0b00, $0b00, $0b00, $0b64 +; =============================================================================== ; Living spooM ; By Jeimuzu -; ------------------------------------------------------------------------------- +; =============================================================================== org $219110 dw $0b65, $0b66, $0b6b, $0b00, $0b67, $0b68, $0b6c, $0b6d @@ -33,20 +96,19 @@ dw $0b84, $0b85, $0b8a, $0b8b, $0b68, $0b86, $0b8c, $0b8d dw $0b87, $4b87, $0b8e, $0b8f, $0b88, $0b89, $4b7e, $0b90 dw $0b92, $0b00, $1391, $0b00 + +; =============================================================================== ; The Haunted Manor ; By Jeimuzu -; ------------------------------------------------------------------------------- +; =============================================================================== org $219018 -dw $1341, $5341, $0b43, $4b43 - -org $219020 -dw $4b44, $0b00, $cb44, $0b00 +dw $1341, $5341, $0b43, $4b43, $cb5b, $0b00, $4b5b, $0b00 org $219030 -dw $1345, $4b45, $0b46, $4b46, $1744, $0b47, $8b44, $8b47 -dw $1348, $5348, $8b48, $cb48, $4b47, $4b42, $cb47, $cb42 -dw $1349, $134a, $8b49, $8b4a, $8b4b, $cb4b, $134b, $534b +dw $1345, $4b45, $0b46, $4b46, $1744, $0b47, $0b5b, $8b47 +dw $1348, $5348, $8b48, $cb48, $4b47, $0b5c, $cb47, $cb42 +dw $1349, $134a, $0b5d, $8b4a, $8b4b, $cb4b, $134b, $534b dw $4b40, $0b4c, $0b4d, $cb44, $134e, $0b4f, $0b50, $0b51 dw $0b00, $0b52, $0b53, $0b54, $0b45, $0b55, $0b56, $0b57 dw $1358, $1359, $0b00, $8b4c, $0b00, $0b00, $0b00, $0b5a @@ -55,11 +117,48 @@ org $219410 dw $0b00, $0b40, $0b00, $1342 +; =============================================================================== ; Abandoned Mineshaft -; By -; ------------------------------------------------------------------------------- +; By Jeimuzu & Letterbomb +; =============================================================================== + +org $219280 +dw $1382, $5382, $0b83, $4b83, $0b84, $0b85, $0b86, $0b87 +dw $0b88, $4b88, $0b89, $4b89 +org $2192A0 +dw $0b8e, $0b8f, $0b00, $0b00, $0b90, $4b90, $0b91, $4b91 +dw $0b92, $4b8e, $0b00, $0b00, $0b93, $0b94, $0b95, $8b94 +dw $1796, $5796, $0b97, $4b97, $0b98, $4b84, $0b99, $0b9a +dw $0b9b, $0b9c, $8b9b, $cb9b, $0b9d, $0b9e, $0b9f, $0ba0 +dw $0ba1, $0ba2, $0ba3, $0ba4, $0ba5, $0ba6, $0ba7, $0ba8 +dw $0b84, $4b84, $4ba8, $0ba8, $0ba9, $0baa, $0bab, $0bac +dw $0bad, $4bad, $13ae, $53ae, $0baf, $0bb0, $0bb1, $0bb2 +dw $0bb3, $0bb4, $0bb5, $0bb6, $0bb7, $0bb8, $0bb9, $0bba +dw $0bbb, $4bbb, $8bbb, $cbbb, $0b80, $4b80, $0b81, $4b81 +dw $0b8a, $0b8b, $0b8c, $0b8d + +; =============================================================================== ; Shadow Castle -; By -; ------------------------------------------------------------------------------- +; By Jeimuzu +; =============================================================================== + +; dw $0b00, $0b00, $0b93, $0b00 ; Room 21 +; dw $0b94, $1376, $0b74, $4b74 ; Room 31 + +org $2191A8 +dw $0b00, $8b74, $0b97, $cb97 +dw $0b95, $1396, $0b00, $0b00, $0b74, $136f, $0b00, $0b00 +dw $0b98, $1399, $0b73, $0b00, $139b, $0b00, $0b9c, $0b9d +dw $0b94, $0b00, $4b74, $0b00, $0b00, $0b00, $4b6f, $0b9f +dw $0b97, $139e, $4b74, $0b00, $13a0, $0b94, $0ba1, $4b74 +dw $8b74, $136f, $0ba2, $0b00, $8b73, $0b00, $8b98, $13a3 +dw $13a4, $53a4, $0ba5, $4ba5, $8b74, $cb74, $1794, $13a6 +dw $13a7, $53a7, $13a8, $53a8, $0b00, $0b98, $0b00, $0b73 +dw $8b8e, $cb8e, $578f, $178f, $0ba9, $0b9a, $0baa, $0bab +dw $0b00, $0bac, $0b00, $4b73, $4b51, $0b51, $0b00, $0b00 +dw $0bad, $0bae, $0baf, $0bb0, $13b1, $13b2, $0bb6, $0bb7 +dw $13b3, $53b3, $13b8, $53b8, $0bb4, $0bb5, $0bb9, $0bba +dw $93a8, $d3a8, $0bbb, $4ba8, $0bbc, $0bbd, $0bbf, $4b74 +dw $0ba9, $0bbe, $cbbe, $cba9, $4bbe, $0bbe, $8ba9, $8bbe diff --git a/FallingTiles.asm b/FallingTiles.asm index f659df1..5720274 100644 --- a/FallingTiles.asm +++ b/FallingTiles.asm @@ -299,7 +299,7 @@ Overlord_SpecialCrumbleTilePath: db $00, $00, $00, $00, $04, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; B0 db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; C0 db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; D0 - db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; E0 + db $00, $05, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; E0 db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; F0 TilePathPtrs: @@ -308,6 +308,7 @@ Overlord_SpecialCrumbleTilePath: dw TilePath02 dw TilePath03 dw TilePath04 + dw TilePath05 ;================================================ ; Commands can be @@ -405,4 +406,51 @@ TilePath04: db $3F<<2, !left, !left db $FF -; ============================================================================== \ No newline at end of file +; Shadow Castle Random Drop +TilePath05: + db $00 ; Initial Delay + db !right, $FE, 1<<2, !right, $FE, $08<<2, !down + + db $FE, 1<<2, !left, !down, $FE, $08<<2 + + db !right, $FE, 1<<2, !right, $FE, $08<<2, !down + + db $FE, 1<<2, !left, $FE, $08<<2, !down + + db $FE, 1<<2, !left, !left, $FE, $08<<2, !right + + db $FE, 1<<2, !right, !right, !down, $FE, $08<<2, !down + + db $FE, 1<<2, !left, !left, $FE, $08<<2, !down + + db !right, !down + + db $FE, 1<<2, !left, !left, $FE, $08<<2, !down + + db $FE, 1<<2, !right, !right, !right, $FE, $08<<2, !down + + db !left, $FE, 1<<2, !left, $FE, $08<<2, !left, $FE, 1<<2, !down, $FE, $08<<2 + + db !right, $FE, 1<<2, !right, !down, $FE, $08<<2 + + db !right, !down + + db $FE, 1<<2, !left, !left, $FE, $08<<2, !down + + db $FE, 1<<2, !right, $FE, $08<<2, !down + + db $FE, 1<<2, !left, !left, $FE, $08<<2, !down + + db $FE, 1<<2, !right, $FE, $08<<2, !right, $FE, 1<<2, !right, $FE, $08<<2, !down + + db $FE, 1<<2, !left, !left, $FE, $08<<2, !left, $FE, 1<<2, !down, $FE, $08<<2 + + db !right, $FE, 1<<2, !right, !right, $FE, $08<<2, !down + + db !left, $FE, 1<<2, !left, $FE, $08<<2, !down + + db $FE, 1<<2, !right, $FE, $08<<2, !down + + db $FF + +; ============================================================================== diff --git a/HitBoxProperties.asm b/HitBoxProperties.asm index e0ab8db..031470d 100644 --- a/HitBoxProperties.asm +++ b/HitBoxProperties.asm @@ -35,101 +35,101 @@ ; (SNES: 0DB44C) (PC: $06B44C) $0F60 Alive / hit box property org $0DB44C -; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F +; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F db $00, $00, $00, $43, $43, $43, $43, $43, $00, $00, $00, $40, $1C, $00, $00, $02 -; 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F +; 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F db $01, $03, $00, $00, $43, $C0, $47, $00, $00, $00, $47, $45, $43, $40, $40, $4D -; 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F +; 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F db $00, $40, $00, $00, $00, $40, $00, $40, $47, $47, $47, $47, $47, $47, $4D, $47 -; 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F +; 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F db $47, $47, $47, $43, $47, $47, $47, $40, $43, $47, $4D, $40, $47, $47, $00, $40 -; 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F +; 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F db $49, $12, $12, $12, $12, $12, $12, $12, $12, $12, $12, $12, $00, $00, $00, $00 -; 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F +; 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F db $80, $12, $09, $09, $00, $40, $00, $0C, $00, $40, $40, $40, $40, $50, $50, $6E -; 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F +; 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F db $6E, $40, $5E, $53, $00, $4A, $00, $00, $00, $00, $12, $12, $40, $00, $00, $40 -; 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F +; 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F db $19, $00, $40, $4A, $4D, $4A, $4A, $80, $4A, $41, $00, $40, $00, $49, $40, $40 -; 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F - db $C0, $40, $40, $00, $00, $40, $00, $00, $09, $80, $C0, $00, $40, $00, $00, $80 +; 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F + db $C0, $00, $40, $00, $00, $40, $00, $00, $09, $80, $C0, $00, $40, $00, $00, $80 -; 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F +; 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F db $40, $00, $18, $5A, $00, $D4, $D4, $D4, $D4, $00, $40, $00, $80, $80, $40, $40 -; A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF +; A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF db $40, $00, $09, $1D, $00, $00, $00, $00, $00, $00, $00, $40, $40, $4A, $5B, $5B -; B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF +; B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF db $5B, $5B, $41, $40, $43, $47, $47, $43, $0A, $40, $41, $4A, $4A, $09, $00, $00 -; C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF +; C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF db $40, $00, $09, $00, $40, $40, $40, $00, $40, $00, $40, $89, $80, $80, $00, $1C -; D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF +; D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF db $00, $40, $00, $00, $1C, $47, $03, $03, $44, $44, $44, $44, $44, $44, $44, $44 -; E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF +; E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF db $44, $44, $44, $43, $44, $43, $40, $C0, $C0, $C7, $C3, $C3, $C0, $5B, $48, $5B -; F0 F1 F2 +; F0 F1 F2 db $5B, $5B, $43 ; VANILLA -; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F +; 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F ; db $00, $00, $00, $43, $43, $43, $43, $43, $00, $00, $00, $00, $1C, $00, $00, $02 -; 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F +; 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F ; db $01, $03, $00, $00, $03, $C0, $07, $00, $00, $00, $07, $45, $43, $00, $40, $0D -; 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F +; 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F ; db $00, $00, $00, $00, $00, $00, $00, $00, $07, $07, $07, $07, $07, $07, $0D, $07 -; 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F +; 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F ; db $07, $07, $07, $03, $07, $07, $07, $40, $03, $07, $0D, $00, $07, $07, $00, $00 -; 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F +; 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F ; db $09, $12, $12, $12, $12, $12, $12, $12, $12, $12, $12, $12, $00, $00, $00, $00 -; 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F +; 50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F ; db $80, $12, $09, $09, $00, $40, $00, $0C, $00, $00, $00, $40, $40, $10, $10, $2E -; 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F +; 60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F ; db $2E, $40, $1E, $53, $00, $0A, $00, $00, $00, $00, $12, $12, $40, $00, $00, $40 -; 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F +; 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F ; db $19, $00, $00, $0A, $0D, $0A, $0A, $80, $0A, $41, $00, $40, $00, $49, $00, $00 -; 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F +; 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F ; db $C0, $00, $40, $00, $00, $40, $00, $00, $09, $80, $C0, $00, $40, $00, $00, $80 -; 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F +; 90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F ; db $00, $00, $18, $5A, $00, $D4, $D4, $D4, $D4, $00, $40, $00, $80, $80, $40, $40 -; A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF +; A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF ; db $40, $00, $09, $1D, $00, $00, $00, $00, $00, $00, $00, $00, $00, $0A, $1B, $1B -; B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF +; B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF ; db $1B, $1B, $41, $00, $03, $07, $07, $03, $0A, $00, $01, $0A, $0A, $09, $00, $00 -; C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF +; C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF ; db $00, $00, $09, $00, $00, $40, $40, $00, $00, $00, $00, $89, $80, $80, $00, $1C -; D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF +; D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF ; db $00, $40, $00, $00, $1C, $07, $03, $03, $44, $44, $44, $44, $44, $44, $44, $44 -; E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF +; E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF ; db $44, $44, $44, $43, $44, $43, $40, $C0, $C0, $C7, $C3, $C3, $C0, $1B, $08, $1B -; F0 F1 F2 +; F0 F1 F2 ; db $1B, $1B, $03 diff --git a/Misc.asm b/Misc.asm index ca197f5..a28c464 100644 --- a/Misc.asm +++ b/Misc.asm @@ -150,4 +150,28 @@ org $05DEF8 ; ============================================================================== -pullpc \ No newline at end of file +; OverworldSpritesPaletteSet: +; org $0ED580 : db $FF, $FF ; Palette 00 +; org $0ED582 : db $03, $0A ; Palette 01 +; org $0ED584 : db $03, $06 ; Palette 02 +; org $0ED586 : db $03, $01 ; Palette 03 +; org $0ED588 : db $00, $02 ; Palette 04 +; org $0ED58A : db $03, $0E ; Palette 05 +; org $0ED58C : db $03, $02 ; Palette 06 +; org $0ED58E : db $13, $01 ; Palette 07 +; org $0ED590 : db $0B, $0C ; Palette 08 +org $0ED592 : db $03, $06 ; Palette 09 +; org $0ED594 : db $07, $05 ; Palette 0A +; org $0ED596 : db $11, $00 ; Palette 0B +; org $0ED598 : db $09, $0B ; Palette 0C +; org $0ED59A : db $0F, $05 ; Palette 0D +; org $0ED59C : db $03, $05 ; Palette 0E +; org $0ED59E : db $03, $07 ; Palette 0F +; org $0ED5A0 : db $0F, $02 ; Palette 10 +; org $0ED5A2 : db $0A, $02 ; Palette 11 +; org $0ED5A4 : db $05, $01 ; Palette 12 +; org $0ED5A6 : db $0C, $0E ; Palette 13 + +; ============================================================================== + +pullpc diff --git a/SpookyInventory.asm b/SpookyInventory.asm index 9f52d71..3fdd6cf 100644 --- a/SpookyInventory.asm +++ b/SpookyInventory.asm @@ -70,15 +70,16 @@ pullpc ;World Map Disable (TEMP CODE) ;------------------------------------------------------------------------------------- -pushpc +;pushpc -org $0288FD ; Replace a BEQ by a BRA (dungeon map removed) - db $80 +;Moved to DungeonMaps.asm +;org $0288FD ; Replace a BEQ by a BRA (dungeon map removed) + ;db $80 ;org $02A55E ; Replace a BEQ by a BRA (overworld map removed) ;db $80 -pullpc +;pullpc ;------------------------------------------------------------------------------------- ;Sword and Shield Textbox Fix @@ -594,4 +595,4 @@ org $0DEB68 pullpc -;------------------------------------------------------------------------------------- \ No newline at end of file +;------------------------------------------------------------------------------------- diff --git a/masks/AllMasks.asm b/masks/AllMasks.asm index 94927c2..24844fe 100644 --- a/masks/AllMasks.asm +++ b/masks/AllMasks.asm @@ -14,6 +14,9 @@ incbin fierce_deity.bin !FierceDeityId = #$2D +org $07D576 +Hookshot_CheckTileCollision: + pullpc print "AllMasks ", pc UpdateTmntPalette: @@ -67,7 +70,7 @@ UpdateFierceDeityLinkPalette: dw #$3125, #$49A7, #$39CE, #$56ED, #$6350, #$1571, #$4A52, #$0F5F } -NewBookCode: +StalfosMask_Jump: { JSL $07983A ; Reset swim state LDA $46 : BNE .cantuseit @@ -112,8 +115,36 @@ NewBookCode: RTL } +incsrc "Goldstar.asm" + +FixShockPalette: +{ + LDA $02B2 : BEQ .i_am_link + LDA $02B2 : CMP.b #$01 : BEQ .tmnt + CMP.b #$02 : BEQ .stalfos + CMP.b #$03 : BEQ .fierce_deity + + .tmnt + JSL UpdateTmntPalette + RTL + .stalfos + JSL UpdateStalfosPalette + RTL + .fierce_deity + JSL UpdateFierceDeityLinkPalette + RTL + + .i_am_link + JSL $0ED6C0 ; RefreshLinkEquipmentPalettes_sword_and_mail + RTL +} + pushpc - + +org $07998C + JSL FixShockPalette + + ; ============================================================================= ; Press R to transform @@ -121,25 +152,44 @@ pushpc org $07A569 LinkItem_Bombos: { - %CheckNewR_ButtonPress() : BEQ .return - LDA $6C : BNE .return ; in a doorway - LDA $0FFC : BNE .return ; can't open menu - - %PlayerTransform() - - LDA $02B2 : CMP #$01 : BEQ .unequip ; is the hood already on? - JSL UpdateTmntPalette - LDA !TurtleId : STA $BC ; change link's sprite - LDA #$01 : STA $02B2 - BRA .return + %CheckNewR_ButtonPress() : BEQ .no_transform_input + LDA $6C : BNE .no_transform_input ; in a doorway + LDA $0FFC : BNE .no_transform_input ; can't open menu + + %PlayerTransform() + + LDA $02B2 : CMP #$01 : BEQ .unequip ; is the hood already on? + JSL UpdateTmntPalette + LDA !TurtleId : STA $BC ; change link's sprite + LDA #$01 : STA $02B2 + BRA .no_transform_input ; We just transformed, skip the reset. .unequip - %ResetToLinkGraphics() + %ResetToLinkGraphics() -.return - CLC - RTS + .no_transform_input + + LDA $02B2 : CMP #$01 : BNE .done + ; BIT $3A : BVS .done ;if Y or B are already pressed + LDA $6C : BNE .done ; if we are standing in a dooray or not + + ; Link_CheckNewY_ButtonPress + JSR $B073 : BCC .done ; Check if we just pressed Y Button + JSL CheckForBallChain + JSL Hookshot_Init + JSL BallChain_StartAnimationFlag + LDY.b #$03 + LDA.b #$1F ; ANCILLA 1F + JSL $099B10 ; AncillaAdd_Hookshot + JSL TransferGFXinRAM + + + .done + CLC + RTS } +warnpc $07A5D8 + ; Stalfos Mask org $07A64B LinkItem_Quake: @@ -165,9 +215,9 @@ LinkItem_Quake: LDA $6C : BNE .done ; if we are standing in a dooray or not ; Link_CheckNewY_ButtonPress - JSR $B073 : BCC .done ; Check if we just pressed Y Button + JSR $B073 : BCC .done ; Check if we just pressed Y Button LDA.b #$13 : STA $012F - JSL NewBookCode + JSL StalfosMask_Jump .done diff --git a/masks/Goldstar.asm b/masks/Goldstar.asm new file mode 100644 index 0000000..5d9f3bb --- /dev/null +++ b/masks/Goldstar.asm @@ -0,0 +1,1207 @@ +; Goldstar ASM disassembly/restoration +; Originally from the all in patch by Conn +; Restored by scawful with help from Zarby + +; 22C700 + +; 22D2B4 +Routine_22D2B4: +{ + LDA $7EF342 + CMP #$02 + BEQ + ; $22D2BD + RTL ++ + REP #$30 + LDA #$2556 + STA $16D8 + LDA #$255E + STA $16DA + LDA #$255B + STA $16DC + LDA #$2553 + STA $16DE + LDA #$2562 + STA $16E0 + LDA #$2563 + STA $16E2 + LDA #$2550 + STA $16E4 + LDA #$2561 + STA $16E6 + SEP #$30 + RTL +} + +; 22D100 +; db $FF $FF $FF $FF $FF $FF $FF $F8 +; db $FC $E3 $FB $C4 $F7 $CB $EF $97 +; db $B6 $FF $DD $E3 $FF $C5 $F7 $9A +; db $BF $C8 $7B $C5 $ED $B7 $FF $DF +; db $EF $DF $F7 $CF $FB $E7 $FD $F3 +; db $FE $F9 $FD $FF $FE $FF $FF $FF +; db $FF $AF $FF $D7 $FF $EB $FF $F5 +; db $FF $AB $FF $57 $FF $AF $FF $FF + +; 22D170 doesnt seem to execute + ; REP #$30 + ; LDA $EA + ; AND #$00FF + ; CMP #$0018 + ; BNE $22D181 + ; SEP #$30 + ; LDA #$02 + ; RTL + +; 22D181 Also doest seem to execute + ; LDA #$7B80 + ; STA $2116 + ; LDA #$D100 + ; STA $4302 + ; LDA #$1801 + ; STA $4300 + ; SEP #$30 + ; LDA $4212 + ; AND #$80 + ; BEQ $22D195 + ; LDA #$80 + ; STA $2115 + ; LDA #$22 + ; STA $4304 + ; LDA #$20 + ; STA $4305 + ; LDA #$01 + ; STA $420B + ; REP #$30 + ; LDA #$7B90 + ; STA $2116 + ; LDA #$1801 + ; STA $4300 + ; LDA #$D120 + ; STA $4302 + ; SEP #$30 + ; LDA #$80 + ; STA $2115 + ; LDA #$22 + ; STA $4304 + ; LDA #$20 + ; STA $4305 + ; LDA #$01 + ; STA $420B + ; LDA #$02 + ; RTL + +; 22D2A0 doesnt execute +; menu related + ; LDA #$22 + ; STA $0116 + ; LDA $0202 + ; CMP #$0B + ; BNE $22D2AF + ; JMP $D8B0 + ; CMP #$03 + ; BEQ $22D2B4 + ; RTL + +; 22D2B4 + ; LDA $7EF342 + ; CMP #$02 + ; BEQ $22D2BD + ; RTL +; 22D2BD + ; REP #$30 + ; LDA #$2556 + ; STA $16D8 + ; LDA #$255E + ; STA $16DA + ; LDA #$255B + ; STA $16DC + ; LDA #$2553 + ; STA $16DE + ; LDA #$2562 + ; STA $16E0 + ; LDA #$2563 + ; STA $16E2 + ; LDA #$2550 + ; STA $16E4 + ; LDA #$2561 + ; STA $16E6 + ; SEP #$30 + ; RTL + +; 22D310 + ; STA $7EC7BA + ; LDA $0202 + ; AND #$00FF + ; CMP #$000B + ; BNE $22D322 + ; JMP $DED0 + ; CMP #$0004 + ; BNE $22D32A + ; JMP $D390 + ; CMP #$0002 + ; BEQ $22D335 + ; CMP #$0003 + ; BEQ $22D35F + ; RTL + +; 22D35F HUD RELATED NOT NECESSARY + ; LDA $7EF342 + ; AND #$00FF + ; CMP #$0002 + ; BEQ $22D36C + ; RTL +; 22D36C + ; LDA #$20F5 + ; STA $7EC778 + ; LDA #$2971 + ; STA $7EC77A + ; LDA #$2D72 + ; STA $7EC7B8 + ; LDA #$2973 + ; STA $7EC7BA + ; RTL + +pushpc + +org $348000 +TransferGFXinRAM: +{ + PHX ; keep X + PHP ; keep processor byte + REP #$20 ; 16bit is a bit faster + + LDX #$80 + -- + LDA.l morningstargfx, X : STA.l $7EA180, X + DEX : DEX + BPL -- + + PLP + PLX + RTL +} +; TransferGFXinRAM: +; { +; PHX ; keep X +; PHP ; keep processor byte +; REP #$20 ; 16bit is a bit faster + +; LDX #$80 +; -- +; LDA.l morningstargfx, X : STA.l $7E9A00, X +; DEX : DEX +; BPL -- + +; LDX #$80 +; -- +; LDA.l morningstargfx, X : STA.l $7E99C0, X +; DEX : DEX +; BPL -- + +; PLP +; PLX +; RTL +; } +morningstargfx: + incbin morningstar.bin + +org $0085C4 +dw $0040 + +pullpc + +; 22D470 + LDA $7EF342 + CMP #$02 + BNE + ; $A2D47C + LDA #$03 + BRA $A2D47E ++ + JSL $06ED25 + RTL + + +; 22D4A0 +; Hooked into LinkItem_Hookshot @ _07AB5A +CheckForBallChain: +{ + LDA #$13 : STA $5D ; Using hookshot state + ; LDA $7EF342 : CMP #$02 ; Check ball chain srm + JMP LinkItem_BallChain_GfxTransfer ; $D520 + + + RTL +} + +pushpc + +org $08BF2D + JSL BallChain_DrawOrReturn +warnpc $08BF31 + +pullpc + +; 22D4C0 +; Hooked into AncillaDraw_Hookshot @ _08BF2D +BallChain_DrawOrReturn: +{ + ; LDA $7EF342 : CMP #$02 : BEQ $22D4CD + LDA $02B2 : CMP #$01 : BEQ + + LDA #$00 + STA ($92),Y + RTL ++ ; $22D4CD + LDA #$02 + STA ($92),Y + RTL +} + +pushpc + +org $08BF0C + JML BallChain_ExtraCollisionLogic + +pullpc + +;; 22D4E0 +; Hooked into Hookshot_ExtraCollisionLogic @ 08BF0C +BallChain_ExtraCollisionLogic: +{ + TAX + ; LDA $7EF342 : CMP #$02 : BNE $22D4F2 + LDA $02B2 : CMP #$01 : BNE + ; Check if turtle + TXA + CMP #$0A : BNE ++ ; $22D4F3 + LDA #$FF : BRA ++ ; $22D4F3 + + ; $22D4F2 + TXA + ++ ; $22D4F3 + CMP #$FF + BEQ +++ ; $22D4FB + JML $08BF10 ; AncillaDraw_Hookshot - JSR Ancilla_SetOAM_XY, skips hookshot char + ;22D4FB + +++ + JML $08BF32 ; AncillaDraw_Hookshot_skip +} + + +;; 22D520 +LinkItem_BallChain_GfxTransfer: +{ + LDA #$FF : STA $7A ; Ball Chain Timer + PHB + ; Check link direction + LDA $2F : CMP #$04 : BEQ .transfer_gfx_sideways + CMP #$06 : BEQ .transfer_gfx_sideways + REP #$30 + LDA #$0040 + LDX #GFX_D600 ; $D600 + LDY #$9AC0 + MVN $39, $7E + LDA #$0040 + LDX #GFX_D640 ; $D640 + LDY #$9B40 + MVN $39, $7E + PLB + + LDA #GFX_D6A0 : STA $4302 + JMP .transfer_handle_and_links ; D574 + + ; 22D553 + .transfer_gfx_sideways + REP #$30 + LDA #$0040 + LDX #GFX_D600 ; $D600 + LDY #$9B00 + MVN $39, $7E + LDA #$0040 + LDX #GFX_D640 ; $D640 + LDY #$9B80 + MVN $39, $7E + PLB + LDA #GFX_D6C0 ; #$D6C0 + STA $4302 + + ; 22D574 + .transfer_handle_and_links + LDA #$41E0 : STA $2116 + LDA #$1801 : STA $4300 + SEP #$30 + LDA #$80 : STA $2115 + .transfer_loop + LDA $4212 + AND #$80 + BEQ .transfer_loop + LDA #$39 : STA $4304 + LDA #$20 : STA $4305 + LDA #$01 : STA $420B + + REP #$30 + LDA #$40E0 : STA $2116 + LDA #GFX_D680 ; $D680 + STA $4302 + SEP #$30 + + LDA #$20 : STA $4305 + LDA #$39 : STA $4304 + LDA #$01 : STA $420B + RTL +} + +; 22D5C0 ; Unreached + LDA $8580,Y + CMP #$02 + BEQ $22D5CA + JMP $DA80 + + +; These get used in the above routine in the MVN calls +; I think they are related to the +{ + ; 22D600 + GFX_D600: + db $00, $00, $00, $00, $21, $00, $7B, $00 + db $37, $0B, $3F, $14, $1D, $0A, $1F, $0B + db $00, $00, $00, $00, $21, $00, $5B, $00 + db $2F, $0B, $3F, $14, $1E, $0A, $1F, $0B + GFX_D620: + db $00, $00, $80, $00, $40, $80, $F8, $00 + db $EC, $D0, $BC, $E8, $FC, $50, $D8, $60 + db $00, $00, $80, $00, $C0, $80, $F8, $00 + db $F4, $D0, $FC, $E8, $DC, $50, $F8, $60 + ; 22D640 + GFX_D640: + db $1F, $04, $1F, $07, $2F, $19, $2F, $18 + db $7B, $01, $21, $00, $00, $00, $00, $00 + db $1F, $04, $1F, $07, $3F, $19, $3F, $18 + db $5B, $01, $21, $00, $00, $00, $00, $00 + ; 22D660 + GFX_D660: + db $AC, $D0, $72, $DC, $FC, $C0, $F8, $10 + db $E8, $30, $34, $08, $08, $00, $00, $00 + db $FC, $D0, $FE, $DC, $FC, $C0, $F8, $10 + db $F8, $30, $3C, $08, $08, $00, $00, $00 +; 22D680 + GFX_D680: + db $00, $00, $18, $00, $24, $18, $5A, $24 + db $7E, $24, $3C, $18, $18, $00, $00, $00 + db $00, $00, $18, $00, $3C, $18, $7E, $24 + db $7E, $24, $3C, $18, $18, $00, $00, $00 + ; 22D6A0 + GFX_D6A0: + db $18, $00, $3C, $18, $2C, $08, $34, $10 + db $34, $10, $34, $00, $24, $00, $18, $00 + db $18, $18, $24, $3C, $34, $3C, $2C, $18 + db $2C, $18, $2C, $08, $3C, $18, $18, $00 + ; 22D6C0 + GFX_D6C0: + db $00, $00, $00, $00, $7E, $00, $BB, $1A + db $87, $06, $7E, $00, $00, $00, $00, $00 + db $00, $00, $00, $00, $7E, $00, $C5, $5E + db $F9, $7E, $7E, $00, $00, $00, $00, $00 +} + +pushpc + +org $07ABAF + JSL BallChain_ResetTimer + +pullpc + +; 22D700 +; Hooked into LinkState_Hookshotting @ _07ABAF +; Sets Link state to 0x00 and resets the hookshot timer +BallChain_ResetTimer: +{ + LDA $02B2 : CMP #$01 : BNE + + ; LDA #$00 + ; STA $5D + ; STA $7A ; Ball Chain Timer + STZ $7A ++ + STZ $5D + RTL +} + +pushpc + +org $08BFDA + JSL BallChain_DrawChainOrHookshot + NOP #8 + NOP #5 + +pullpc + +; 22D800 +; Hooked into AncillaDraw_HookshotChain @ 08BFDA +; Natively NOPs out the bytes 08BFDA - 08BFEA +BallChain_DrawChainOrHookshot: +{ + ; LDA $7EF342 : CMP #$02 BEQ $22D812 + LDA $02B2 : CMP #$01 : BEQ + + LDA #$19 : STA ($90),Y + JSR BallChainOrHookshot_Modifier ; $D820 + ORA.b #$02 + RTL ++ ; 22D812 + LDA #$0E : STA ($90),Y + JSR BallChainOrHookshot_Modifier ; $D820 + ORA.b #$04 ; 02 is gray color + RTL +} + +; 22D820 +BallChainOrHookshot_Modifier: +{ + INY : LDA.b $1A : AND.b #$02 + ASL #6 ; six times + RTS +} + +pushpc + +org $8BF1B + JSL AncillaDraw_Hookshot_BallChain_Properties + NOP #3 + +pullpc + +; 22D850 +; Hooked into AncillaDraw_HookshotChain @ _08BF1B +; In place of Hookshot_prop +AncillaDraw_Hookshot_BallChain_Properties: +{ + ; LDA $7EF342 : CMP #$02 : BEQ .ball_chain + LDA $02B2 : CMP #$01 : BEQ .ball_chain + LDA $08BD58, X ; 08BD58 + ORA.b #$02 + ORA.b $65 + RTL +; 22D860 +.ball_chain + LDA $08BD58, X ; 08BD58 + ORA.b #$02 ; previously 04 + ORA.b $65 + RTL +} + +; ========================================================= +; Start Zarby +HookMaskCheck: + LDA.w $0202 : AND.w #$00FF : CMP.w #$0008 : BNE .notMask + LDA.w $0109 + AND #$FF00 + ORA.w #$004A ; #$0042 + RTL +.notMask + TYA + AND.w #$00FF + STA.b $0A + LDA.w $0109 + AND.w #$FF00 + ORA.b $0A + RTL + +pushpc + +org $0DABA2 +JSL HookMaskCheck +BRA bralabel + +org $0DABB0 +bralabel: + +; org $008542 +; dw $A180, $A1A0, $A1C0, $A1E0 +org $008542 +dw $A180, $A1A0, $A180, $A1A0 +dw $A1C0, $A1C0, $A1E0, $A1E0 + +; End Zarby +; ========================================================= + +org $0DA6E3 + JSL Link_OAM_Actually + NOP + +pullpc + +; 22D880 +Link_OAM_Actually: +{ + REP #$20 + ; LDA $7EF342 + LDA $02B2 + AND #$00FF + ; CMP #$0002 + CMP #$0001 + BEQ + ; $22D892 + LDA $839B,Y + RTL + + ;22D892 + LDA $839B,Y + CMP #$221A + BEQ ++ ; $22D89B + RTL +++ ;22D89B + LDA $0202 + AND #$00FF + CMP #$0008 + BEQ +++ ; $22D8AA + LDA $839B,Y + RTL + +++ ;22D8AA + LDA #$241E + RTL +} + +pushpc + +; AncillaDraw_HookshotChain_next_object +org $08BFB0 + JML HookshotChain_AncillaDraw + +org $08BD64 + Hookshot_box_size_y: + +pullpc + +; 22D900 +HookshotChain_AncillaDraw: +{ + REP #$20 + ; Ball Chain Timer + LDA $7A : AND #$00FF : CMP #$0001 : BNE + ; $22D914 + LDA Hookshot_box_size_y, X + JML $08BFB5 ; Jumps into AncillaDraw_HookshotChain ++ ; $22D914 + CMP #$0000 : BNE ++ ; $22D921 + LDA Hookshot_box_size_y, X + JML $08BFB5 ; Jumps into AncillaDraw_HookshotChain +++ + JSR Routine_22E5A0 ; $E5A0 CheckAndClearAncillaId has set the timer in A + + SEP #$30 + ; Compare rotation progress + CLC : CMP #$FB : BNE +++ ; $22D930 + LDA #$06 : STA $2143 ++++ ; 22D930 + BCC ++++ ; $22D935 + JMP StartChainRotation ; $D960 +++++ ; 22D935 + ; Compare rotation progress + CLC : CMP #$AB : BNE +++++ ; $22D93F + LDA #$06 + STA $2143 ++++++ ;22D93F + ; Compare rotation progress + CLC : CMP #$5B : BNE ++++++ ; $22D949 + LDA #$06 : STA $2143 +++++++ ;22D949 + CLC : CMP #$E6 : BCC +++++++ ; $22D951 + JMP Routine_22D9A0 ; $D9A0 ++++++++ ; 22D951 + CLC : CMP #$05 : BCC ++++++++ ; $22D959 + JMP Routine_22D9A0 ; $D9A0 +; 22D959 +++++++++ + JMP Routine_22DBD0 ; $DBD0 +} + +; 22D960 +StartChainRotation: +{ + REP #$20 + LDA #$0000 : EOR #$FFFF : INC + CLC + JSR BallChain_CheckLinkYPosition ; $DA30 + STA $7F5810 + JSR BallChain_CheckLinkXPosition ; $DA50 + STA $7F580E + SEP #$30 + JSR Routine_22DAD0 + STA $7F5803 + DEC $7A ; Ball Chain Timer + SEP #$20 + JML $08BFD0 ; Jumps into AncillaDraw_HookshotChain before Hookshot_CheckProximityToLink +} + +; $22D9A0 +Routine_22D9A0: +{ + LDA $7F5803 : CLC : ADC #$02 + AND #$3F : CPY #$04 : BNE + ; $22D9B6 + STA $7F5803 + CLC : ADC #$02 ++ ; 22D9B6 + AND #$3F + PHX : TAX + ; Ancilla radial project variable + LDA $0FFC02,X : STA $4202 + JSR Routine_22DAA0 : STA $4203 + + ; Sign of the projected distance. + LDA $0FFC42,X : STA $02 : STZ $03 + LDA $4216 : ASL + LDA $4217 : ADC #$00 : STA $00 + STZ $01 + LDA $0FFBC2,X : STA $4202 + JSR Routine_22DAA0 ; $DAA0 + STA $4203 + + ; Sign of the projected distance. + LDA $0FFC82,X : STA $06 : STZ $07 + + ; Get X of projected distance + LDA $4216 : ASL + LDA $4217 : ADC #$00 : STA $04 + STZ $05 + + PHY + JSL $08DA17 ; Sparkle_PrepOAMFromRadial + PLY + PLX + CPY #$04 : BNE ++ ; $22DA14 + + JSR Routine_22DA70 ; $DA70 + NOP #7 + JSR BallChain_SpinAncilla ; $22DB90 +++ ;22DA14 + NOP #3 + LDA #$F0 : CPY #$1C : BNE +++ ; $22DA1F + STA $00 ++++ ; 22DA1F + DEC $7A ; Ball Chain Timer + SEP #$20 + JML $08BFD0 ; Jumps into AncillaDraw_HookshotChain before Hookshot_CheckProximityToLink +} + +;; 22DA30 +BallChain_CheckLinkYPosition: +{ + ADC $20 : CLC : ADC #$000C + CPX #$00 : BNE + ; $22DA3F + SEC : SBC #$000C + RTS ++ + CPX #$02 : BNE ++ ; $22DA47 + CLC : ADC #$000C +++ + RTS +} + +; 22DA50 +BallChain_CheckLinkXPosition: +{ + LDA $22 : CLC : ADC #$0008 + CPX #$04 : BNE + ; $22DA5F + SEC : SBC #$000C + RTS ++ ;$22DA5F + CPX #$06 : BNE ++ ; $22DA67 + CLC : ADC #$000C +++ ;$22DA67 + RTS +} + +; 22DA70 +Routine_22DA70: +{ + LDY #$00 : LDA $02 + STA ($90),Y + + LDY #$01 : LDA $00 + STA ($90),Y + + LDY #$04 + RTS +} + +; 22DA80 +Routine_22DA80: +{ + LDA $7EF34A + CMP #$02 + BNE + ; $22DA89 + RTL ++ + CMP #$01 + BEQ ++ ; $22DA93 + LDA $8580,Y + STA [$00] + RTL +++ + LDA #$8F01 + TSC + SBC ($7E,S),Y + RTL +} + + + +; 22DAA0 +Routine_22DAA0: +{ + CPY #$04 : BNE .alpha ; $22DAA7 + JMP Routine_22DB50 ; $DB50 +.alpha ; 22DAA7 + CPY #$08 : BNE + ; $22DAAE + LDA #$00 + RTS ++ ; 22DAAE + CPY #$0C : BNE ++ ; $22DAB5 + LDA #$04 + RTS +++ ; 22DAB5 + CPY #$10 : BNE +++ ; $22DABC + LDA #$08 + RTS ++++ ; 22DABC + CPY #$14 : BNE ++++ ;$22DAC3 + LDA #$0C + RTS +++++ ; 22DAC3 + CPY #$18 : BNE +++++ ; $22DACA + LDA #$10 + RTS ++++++ ; 22DACA + LDA #$02 + RTS +} + +; 22DAD0 +Routine_22DAD0: +{ + CPX #$00 : BNE + ; $22DAD7 + LDA #$2E + RTS ++ ; 22DAD7 + CPX #$02 : BNE ++ ; $22DADE + LDA #$13 + RTS +++ ; 22DADE + CPX #$04 : BNE +++ ; $22DAE5 + LDA #$2B + RTS ++++ ; 22DAE5 + LDA #$09 + RTS +} + +pushpc + +org $08BF94 + JML BallChain_TryAncillaDraw + NOP + +pullpc + +; 22DB00 +; Hooks into AncillaDraw_HookshotChain @ 08BF94 +; Hookshot box size +BallChain_TryAncillaDraw: +{ + ; Ball Chain timer should be $FF here on first run + LDA $7A : AND #$00FF + CMP #$0000 : BEQ + ; $22DB15 + CMP #$0001 : BEQ + ; $22DB15 + SEP #$20 + JML HookshotChain_AncillaDraw ; $22D900 ++ + LDA Hookshot_box_size_y,X : BNE ++ ; $22DB1F + JML $08BF99 ; AncillaDraw_HookshotChain +++ + JML $08BFA1 ; Resume AncillaDraw_HookshotChain +} + +pushpc + +org $08F7DC + JML BallChain_CheckProximityToLink + +pullpc + +; 22DB30 +; Hooks into Hookshot_CheckProximityToLink @ 08F7DC +BallChain_CheckProximityToLink: +{ + REP #$20 + ; Ball Chain Timer + LDA $7A : AND #$00FF : CMP #$0000 : BNE + ; $22DB44 + ; REP #$20 + LDA.b $00 + JML $08F7E0 ; Hookshot_CheckProximityToLink continue ++ ; 22DB44 + JML $08F820 ; Hookshot_CheckProximityToLink too_far +} + +; 22DB50 +Routine_22DB50: +{ + ; Ball Chain Timer + LDA $7A : CLC : CMP #$EA : BCC + ; $22DB5A + LDA #$08 + RTS ++ ; 22DB5A + CLC : CMP #$16 : BCC ++ ; $22DB62 + LDA #$14 + RTS +++ ; 22DB62 + CLC + LDA #$08 + RTS +} + + +; $22DB90 +BallChain_SpinAncilla: +{ + REP #$20 + LDA $00 : CLC : ADC $E8 : CPX #$02 + BNE .alpha + CLC : ADC #$0010 +.alpha + STA $04 + LDA $02 : CLC : ADC $E2 : STA $06 + SEP #$20 + LDA $04 : STA $0BFE + LDA $05 : STA $0C12 + LDA $06 : STA $0C08 + LDA $07 : STA $0C1C + STZ $0C76 + SEP #$30 + RTS +} + +; 22DBD0 +Routine_22DBD0: +{ + STZ $7A ; Ball Chain Timer + JSR ClearAncillaVariables ; $DC70 + LDA $2F : CMP #$00 : BNE + + LDA #$C0 : STA $0C26 ++ + CMP #$02 : BNE ++ + LDA #$40 : STA $0C26 +++ + CMP #$04 : BNE +++ + LDA #$C0 : STA $0C30 ++++ + CMP #$06 : BNE ++++ + LDA #$40 : STA $0C30 +++++ + SEP #$20 + STZ $0C58 + STZ $0C62 + STZ $0C54 + REP #$20 + + LDA $2F : LSR : STA $0C76 + ASL : TAX + LDA $20 : CLC + ADC $099B00,X ; AncillaAdd_Hookshot_offset_y table + STA $00 + STA $04 + LDA $22 : CLC + ADC $099B08,X ; AncillaAdd_Hookshot_offset_x table + STA $02 : STA $06 + SEP #$30 + LDA $00 : STA $0BFE + LDA $01 : STA $0C12 + LDA $02 : STA $0C08 + LDA $03 : STA $0C1C + LDX #$06 : LDA Hookshot_box_size_y,X ; hookshot box size y table + SEP #$20 + JML $08BFD0 ; Jumps into AncillaDraw_HookshotChain before Hookshot_CheckProximityToLink +} + +pushpc + +org $08BDFD + JML HookshotOrBallChain_Extending_ignore_collision + +pullpc + +; 22DC50 +; Hooked into Hookshot_Extending_ignore_collision @ 08BDFD +; P: B0, Index, Memry, Negative, No Carry or Zero +HookshotOrBallChain_Extending_ignore_collision: +{ + ; Ball Chain Timer + LDA $7A : CMP #$00 : BNE + ;$22DC5E + JSL Hookshot_CheckTileCollision ; $07D576 + + JML $08BE01 ; Hookshot_Extending_ignore_collision continue ++ ; 22DC5E + JML $08BEDC ; AncillaDraw_Hookshot +} + +; 22DC70 +ClearAncillaVariables: +{ + REP #$30 + LDA #$0000 + STA $7F580E + STA $7F5810 + STA $7F5803 + SEP #$30 + RTS +} + +pushpc + +org $08BD7F + JSL BallChain_SFX_Control + NOP #1 + +pullpc + +;; 22DC90 +; Hooked into Ancilla1F_Hookshot @ 08BD7F before Ancilla_SFX2_Pan +BallChain_SFX_Control: +{ + STA $0C68,X + ; Ball Chain Timer + LDA $7A : CMP #$00 : BNE + ; $22DC9C + LDA.b #$0A ; SFX2.0A + RTL ++ ;; 22DC9C + LDA.b #$07 ; Clear SFX2 + RTL +} + +; 22DCA0 +Routine_22DCA0: +{ + LDA $7A + CMP #$00 + BNE + ;$A2DCAB + LDA $0DBB5B,X + RTL ++ + LDA #$00 + RTL +} + +;; 22DD90 +CheckAndClearAncillaId: +{ + SEP #$30 + ; Check if hookshot ancillae in this slot + LDA $0C4A : CMP #$1F : BEQ + ; $22DDC9 + LDA $0C4C : CMP #$1F : BEQ ++ ; $22DDB1 + LDA $0C4D : CMP #$1F : BEQ +++ ; $22DDB9 + LDA $0C4B : CMP #$1F : BEQ ++++ ; $22DDC1 + LDA $7A ; Ball Chain Timer + RTS +++ ; 22DDB1 + NOP + NOP + STZ $0C4C + LDA $7A + RTS ++++ ; 22DDB9 + NOP + NOP + STZ $0C4D + LDA $7A + RTS +++++ ; 22DDC1 + NOP + NOP + STZ $0C4B + LDA $7A + RTS ++ ; 22DDC9 + STZ $0C4A + LDA $7A + RTS +} + +; 22E5A0 +; Checks for the Somaria block before moving on +Routine_22E5A0: +{ + SEP #$30 + JMP CheckForSomariaBlast ; $EE80 +.22E5A5 ; 22E5A5 + LDA $0C4C : CMP #$2C : BNE + ; $22E5B2 + INC $0C4C + JMP $E5DB ++ ; 22E5B2 + LDA $0C4D : CMP #$2C : BNE ++ ; $22E5BF + INC $0C4D + JMP $E5DB +++ ; 22E5BF + LDA $0C4E : CMP #$2C : BNE +++ ; $22E5CC + INC $0C4E + JMP $E5DB ++++ ; 22E5CC + LDA $0C4F : CMP #$2C : BNE ++++ ; $22E5D9 + INC $0C4F + JMP $E5DB +++++ ; 22E5D9 + BRA +++++ ; $22E5E0 + ++++++ ; 22E5E0 + JSR CheckAndClearAncillaId ; $DD90 + RTS +} + +; 22E5F0 doesnt execute? +Routine_22E5F0: +{ + LDA $7EF33C + BNE + ;$22E5F7 + RTL ++ ; 22E5F7 + LDA $4D + BEQ ++ ; $22E5FC + RTL +++ ; 22E5FC + JMP $E108 +} + +; 22E700 +; Hooked into NMI_ReadJoypads @ 0083E7 + STA $F6 + STY $FA + REP #$30 + LDA $7EE000 + DEC + BNE $22E721 + LDA $7EF339 + INC + CMP #$1770 + BCC $22E71A + LDA #$0000 + STA $7EF339 + LDA #$0E10 + STA $7EE000 + SEP #$30 + RTL + + +;22EE80 +CheckForSomariaBlast: +{ + LDA $0300 + BEQ + ; $22EE88 + JMP $E5DB +; 22EE88 ++ + LDA $0C4A + CMP #$01 + BNE ++ ; $22EE92 + JMP $EEC0 +; 22EE92 +++ + LDA $0C4B + CMP #$01 + BNE +++ ; $22EE9C + JMP $EEC0 +; 22EE9C ++++ + LDA $0C4C + CMP #$01 + BNE ++++ ; $22EEA6 + JMP $EEC0 +; 22EEA6 +++++ + LDA $0C4D + CMP #$01 + BNE +++++ ; $22EEB0 + JMP $EEC0 +; 22EEB0 ++++++ + LDA $0C4E + CMP #$01 + BNE ++++++ ; $22EEBA + JMP $EEC0 +; 22EEBA +++++++ + JMP Routine_22E5A0_22E5A5 ; $E5A5 +} + + +;; 22EF00 +; Hooked inside LinkItem_Hookshot @ 07AB5E +BallChain_StartAnimationFlag: +{ + LDA #$01 : STA $037B ; Vanilla code + LDA $037A : CMP #$04 ; We are hookshotting + + BNE + + LDA #$01 : STA $0112 ; Animation flag, prevent menu from opening ++ + RTL +} + +pushpc + +org $07AB95 + JSL BallChain_Finish + NOP #2 + +pullpc + +; 22EF12 +; Hooked inside LinkState_Hookshotting @ 07AB95 +BallChain_Finish: +{ + STZ.w $0300 : STZ.w $037B ; Restore vanilla + LDA $037A : CMP #$04 : BNE .not_done ; We are hookshotting + STZ $0112 ; Clear animation flag +.not_done + RTL +} + +; 22EF30 +; Hooked at $07AC98 + + +Hookshot_Init: +{ +; ResetAllAcceleration: + REP #$20 + + STZ.w $032F + STZ.w $0331 + + STZ.w $0326 + STZ.w $0328 + + STZ.w $032B + STZ.w $032D + + STZ.w $033C + STZ.w $033E + + STZ.w $0334 + STZ.w $0336 + + SEP #$20 + + + STZ.w $0300 + + LDA.b #$01 + TSB.b $50 + + LDA.b #$07 + STA.b $3D + + STZ.b $2E + + LDA.b $67 + AND.b #$F0 + STA.b $67 + + LDA.w $037A + AND.b #$00 + ORA.b #$04 + STA.w $037A + +RTL +} diff --git a/masks/morningstar.bin b/masks/morningstar.bin new file mode 100644 index 0000000..b438f67 Binary files /dev/null and b/masks/morningstar.bin differ