diff options
author | luckytyphlosion <alan.rj.huang@gmail.com> | 2015-07-12 15:59:37 -0400 |
---|---|---|
committer | luckytyphlosion <alan.rj.huang@gmail.com> | 2015-07-12 15:59:37 -0400 |
commit | 888860a5eeec547348c6a049fdf2595c0aa1c522 (patch) | |
tree | 48d7049f3cd3805f647edc0fc3fa9eb0c829affa | |
parent | 9d56570f8295ba2d37e176ac104fa10424af00eb (diff) |
More bank1c documentation.
-rw-r--r-- | engine/battle/battle_transitions.asm | 94 | ||||
-rw-r--r-- | engine/battle/ghost_marowak_anim.asm | 11 | ||||
-rwxr-xr-x | engine/overworld/healing_machine.asm | 50 | ||||
-rwxr-xr-x | engine/overworld/player_animations.asm | 111 |
4 files changed, 143 insertions, 123 deletions
diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index f1aa4161..4a9ea782 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -1,4 +1,4 @@ -BattleTransition: ; 7096d (1c:496d) +BattleTransition: ; 709d7 (1c:49d7) ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a call Delay3 @@ -64,7 +64,7 @@ BattleTransition: ; 7096d (1c:496d) ; bit 0: set if trainer battle ; bit 1: set if enemy is at least 3 levels higher than player ; bit 2: set if dungeon map -BattleTransitions: ; 709d2 (1c:49d2) +BattleTransitions: ; 70a3c (1c:4a3c) dw BattleTransition_DoubleCircle ; %000 dw BattleTransition_Spiral ; %001 dw BattleTransition_Circle ; %010 @@ -74,7 +74,7 @@ BattleTransitions: ; 709d2 (1c:49d2) dw BattleTransition_VerticalStripes ; %110 dw BattleTransition_Split ; %111 -GetBattleTransitionID_WildOrTrainer: ; 709e2 (1c:49e2) +GetBattleTransitionID_WildOrTrainer: ; 70a4c (1c:4a4c) ld a, [W_CUROPPONENT] cp $c8 jr nc, .trainer @@ -84,7 +84,7 @@ GetBattleTransitionID_WildOrTrainer: ; 709e2 (1c:49e2) set 0, c ret -GetBattleTransitionID_CompareLevels: ; 709ef (1c:49ef) +GetBattleTransitionID_CompareLevels: ; 70a59 (1c:4a59) ld hl, wPartyMon1HP .faintedLoop ld a, [hli] @@ -115,7 +115,7 @@ GetBattleTransitionID_CompareLevels: ; 709ef (1c:49ef) ; fails to recognize VICTORY_ROAD_2, VICTORY_ROAD_3, all ROCKET_HIDEOUT maps, ; MANSION_1, SEAFOAM_ISLANDS_[2-5], POWER_PLANT, DIGLETTS_CAVE ; and SILPH_CO_[9-11]F as dungeon maps -GetBattleTransitionID_IsDungeonMap: ; 70a19 (1c:4a19) +GetBattleTransitionID_IsDungeonMap: ; 70a83 (1c:4a83) ld a, [W_CURMAP] ld e, a ld hl, DungeonMaps1 @@ -147,7 +147,7 @@ GetBattleTransitionID_IsDungeonMap: ; 70a19 (1c:4a19) ; GetBattleTransitionID_IsDungeonMap checks if W_CURMAP ; is equal to one of these maps -DungeonMaps1: ; 70a3f (1c:4a3f) +DungeonMaps1: ; 70aa9 (1c:4aa9) db VIRIDIAN_FOREST db ROCK_TUNNEL_1 db SEAFOAM_ISLANDS_1 @@ -156,7 +156,7 @@ DungeonMaps1: ; 70a3f (1c:4a3f) ; GetBattleTransitionID_IsDungeonMap checks if W_CURMAP ; is in between or equal to each pair of maps -DungeonMaps2: ; 70a44 (1c:4a44) +DungeonMaps2: ; 70aac (1c:4aac) ; all MT_MOON maps db MT_MOON_1 db MT_MOON_3 @@ -175,27 +175,30 @@ DungeonMaps2: ; 70a44 (1c:4a44) db UNKNOWN_DUNGEON_1 db $FF -LoadBattleTransitionTile: ; 70a4d (1c:4a4d) +LoadBattleTransitionTile: ; 70ab7 (1c:4ab7) ld hl, vChars1 + $7f0 ld de, BattleTransitionTile ld bc, (BANK(BattleTransitionTile) << 8) + $01 jp CopyVideoData -BattleTransitionTile: ; 70a59 (1c:4a59) +BattleTransitionTile: ; 70ac3 (1c:4ac3) INCBIN "gfx/battle_transition.2bpp" -BattleTransition_BlackScreen: ; 70a69 (1c:4a69) +BattleTransition_BlackScreen: ; 70ad3 (1c:4ad3) ld a, $ff ld [rBGP], a ld [rOBP0], a ld [rOBP1], a + call Func_3021 + call Func_3040 + call Func_3061 ret ; for non-dungeon trainer battles ; called regardless of mon levels, but does an ; outward spiral if enemy is at least 3 levels ; higher than player and does an inward spiral otherwise -BattleTransition_Spiral: ; 70a72 (1c:4a72) +BattleTransition_Spiral: ; 70ae5 (1c:4ae5) ld a, [wcd47] and a jr z, .outwardSpiral @@ -228,7 +231,7 @@ BattleTransition_Spiral: ; 70a72 (1c:4a72) ld [wd09a], a ret -BattleTransition_InwardSpiral: ; 70aaa (1c:4aaa) +BattleTransition_InwardSpiral: ; 70b1d (1c:4b1d) ld a, $7 ld [wWhichTrade], a ld hl, wTileMap @@ -246,10 +249,10 @@ BattleTransition_InwardSpiral: ; 70aaa (1c:4aaa) call BattleTransition_InwardSpiral_ dec c dec c - ld de, $ffec + ld de, -$14 call BattleTransition_InwardSpiral_ inc c - ld de, rIE + ld de, -1 call BattleTransition_InwardSpiral_ dec c dec c @@ -258,7 +261,7 @@ BattleTransition_InwardSpiral: ; 70aaa (1c:4aaa) jr nz, .loop ret -BattleTransition_InwardSpiral_: ; 70ae0 (1c:4ae0) +BattleTransition_InwardSpiral_: ; 70b53 (1c:4b53) push bc .loop ld [hl], $ff @@ -277,8 +280,8 @@ BattleTransition_InwardSpiral_: ; 70ae0 (1c:4ae0) pop bc ret -BattleTransition_OutwardSpiral_: ; 70af9 (1c:4af9) - ld bc, $ffec +BattleTransition_OutwardSpiral_: ; 70b6c (1c:4b6c) + ld bc, -$14 ld de, $14 ld a, [wd09b] ld l, a @@ -345,13 +348,14 @@ BattleTransition_OutwardSpiral_: ; 70af9 (1c:4af9) jr .done2_ FlashScreen: -BattleTransition_FlashScreen_: ; 70b5d (1c:4b5d) +BattleTransition_FlashScreen_: ; 70be8 (1c:4be8s) ld hl, BattleTransition_FlashScreenPalettes .loop ld a, [hli] cp $1 jr z, .done ld [rBGP], a + call Func_3021 ld c, $2 call DelayFrames jr .loop @@ -360,12 +364,12 @@ BattleTransition_FlashScreen_: ; 70b5d (1c:4b5d) jr nz, BattleTransition_FlashScreen_ ret -BattleTransition_FlashScreenPalettes: ; 70b72 (1c:4b72) +BattleTransition_FlashScreenPalettes: ; 70be8 (1c:4be8) db $F9,$FE,$FF,$FE,$F9,$E4,$90,$40,$00,$40,$90,$E4 db $01 ; terminator ; used for low level trainer dungeon battles -BattleTransition_Shrink: ; 70b7f (1c:4b7f) +BattleTransition_Shrink: ; 70bf4 (1c:4bf4) ld c, $9 .loop push bc @@ -373,7 +377,7 @@ BattleTransition_Shrink: ; 70b7f (1c:4b7f) ld [H_AUTOBGTRANSFERENABLED], a hlCoord 0, 7 deCoord 0, 8 - ld bc, $ffd8 + ld bc, -$28 call BattleTransition_CopyTiles1 hlCoord 0, 10 deCoord 0, 9 @@ -381,7 +385,7 @@ BattleTransition_Shrink: ; 70b7f (1c:4b7f) call BattleTransition_CopyTiles1 hlCoord 8, 0 deCoord 9, 0 - ld bc, $fffe + ld bc, -$2 call BattleTransition_CopyTiles2 hlCoord 11, 0 deCoord 10, 0 @@ -399,7 +403,7 @@ BattleTransition_Shrink: ; 70b7f (1c:4b7f) jp DelayFrames ; used for high level trainer dungeon battles -BattleTransition_Split: ; 70bca (1c:4bca) +BattleTransition_Split: ; 70c40 (1c:4c40) ld c, $9 xor a ld [H_AUTOBGTRANSFERENABLED], a @@ -407,7 +411,7 @@ BattleTransition_Split: ; 70bca (1c:4bca) push bc hlCoord 0, 16 deCoord 0, 17 - ld bc, $ffd8 + ld bc, -$28 call BattleTransition_CopyTiles1 hlCoord 0, 1 ld de, wTileMap @@ -415,7 +419,7 @@ BattleTransition_Split: ; 70bca (1c:4bca) call BattleTransition_CopyTiles1 hlCoord 18, 0 deCoord 19, 0 - ld bc, $fffe + ld bc, -$2 call BattleTransition_CopyTiles2 hlCoord 1, 0 ld de, wTileMap @@ -430,7 +434,7 @@ BattleTransition_Split: ; 70bca (1c:4bca) ld c, $a jp DelayFrames -BattleTransition_CopyTiles1: ; 70c12 (1c:4c12) +BattleTransition_CopyTiles1: ; 70c88 (1c:4c88) ld a, c ld [wWhichTrade], a ld a, b @@ -462,7 +466,7 @@ BattleTransition_CopyTiles1: ; 70c12 (1c:4c12) jr nz, .loop2 ret -BattleTransition_CopyTiles2: ; 70c3f (1c:4c3f) +BattleTransition_CopyTiles2: ; 70cb5 (1c:4c3f) ld a, c ld [wWhichTrade], a ld a, b @@ -512,7 +516,7 @@ BattleTransition_CopyTiles2: ; 70c3f (1c:4c3f) ret ; used for high level wild dungeon battles -BattleTransition_VerticalStripes: ; 70c7e (1c:4c7e) +BattleTransition_VerticalStripes: ; 70cf4 (1c:4cf4) ld c, $12 ld hl, wTileMap deCoord 1, 17 @@ -540,7 +544,7 @@ BattleTransition_VerticalStripes: ; 70c7e (1c:4c7e) jr nz, .loop jp BattleTransition_BlackScreen -BattleTransition_VerticalStripes_: ; 70caa (1c:4caa) +BattleTransition_VerticalStripes_: ; 70d20 (1c:4d20) ld c, $a .loop ld [hl], $ff @@ -551,7 +555,7 @@ BattleTransition_VerticalStripes_: ; 70caa (1c:4caa) ret ; used for low level wild dungeon battles -BattleTransition_HorizontalStripes: ; 70cb4 (1c:4cb4) +BattleTransition_HorizontalStripes: ; 70d2a (1c:4d2a) ld c, $14 ld hl, wTileMap deCoord 19, 1 @@ -575,7 +579,7 @@ BattleTransition_HorizontalStripes: ; 70cb4 (1c:4cb4) jr nz, .loop jp BattleTransition_BlackScreen -BattleTransition_HorizontalStripes_: ; 70cd8 (1c:4cd8) +BattleTransition_HorizontalStripes_: ; 70d4e (1c:4d4e) ld c, $9 ld de, $28 .loop @@ -588,7 +592,7 @@ BattleTransition_HorizontalStripes_: ; 70cd8 (1c:4cd8) ; used for high level wild non-dungeon battles ; makes one full circle around the screen ; by animating each half circle one at a time -BattleTransition_Circle: ; 70ce4 (1c:4ce4) +BattleTransition_Circle: ; 70d5a (1c:4d5a) call BattleTransition_FlashScreen ld bc, $000a ld hl, BattleTransition_HalfCircle1 @@ -599,14 +603,14 @@ BattleTransition_Circle: ; 70ce4 (1c:4ce4) call BattleTransition_Circle_Sub1 jp BattleTransition_BlackScreen -BattleTransition_FlashScreen: ; 70cfd (1c:4cfd) +BattleTransition_FlashScreen: ; 70d73 (1c:4d73) ld b, $3 call BattleTransition_FlashScreen_ xor a ld [H_AUTOBGTRANSFERENABLED], a ret -BattleTransition_Circle_Sub1: ; 70d06 (1c:4d06) +BattleTransition_Circle_Sub1: ; 70d7c (1c:4d7c) push bc push hl ld a, b @@ -620,7 +624,7 @@ BattleTransition_Circle_Sub1: ; 70d06 (1c:4d06) jr nz, BattleTransition_Circle_Sub1 ret -BattleTransition_TransferDelay3: ; 70d19 (1c:4d19) +BattleTransition_TransferDelay3: ; 70d8f (1c:4d8f) ld a, $1 ld [H_AUTOBGTRANSFERENABLED], a call Delay3 @@ -631,7 +635,7 @@ BattleTransition_TransferDelay3: ; 70d19 (1c:4d19) ; used for low level wild non-dungeon battles ; makes two half circles around the screen ; by animating both half circles at the same time -BattleTransition_DoubleCircle: ; 70d24 (1c:4d24) +BattleTransition_DoubleCircle: ; 70d9a (1c:4d9a) call BattleTransition_FlashScreen ld c, $a ld hl, BattleTransition_HalfCircle1 @@ -659,7 +663,7 @@ BattleTransition_DoubleCircle: ; 70d24 (1c:4d24) jr nz, .loop jp BattleTransition_BlackScreen -BattleTransition_Circle_Sub2: ; 70d50 (1c:4d50) +BattleTransition_Circle_Sub2: ; 70dc6 (1c:4dc6) ld [wWhichTrade], a ld a, [hli] ld [wTrainerEngageDistance], a @@ -672,7 +676,7 @@ BattleTransition_Circle_Sub2: ; 70d50 (1c:4d50) ld l, a jp BattleTransition_Circle_Sub3 -BattleTransition_HalfCircle1: ; 70d61 (1c:4d61) +BattleTransition_HalfCircle1: ; 70dd7 (1c:4dd7) db $01 dw BattleTransition_CircleData1 dwCoord 18, 6 @@ -713,7 +717,7 @@ BattleTransition_HalfCircle1: ; 70d61 (1c:4d61) dw BattleTransition_CircleData1 dwCoord 1, 6 -BattleTransition_HalfCircle2: ; 70d93 (1c:4d93) +BattleTransition_HalfCircle2: ; 70d93 (1c:4e09) db $00 dw BattleTransition_CircleData1 dwCoord 1, 11 @@ -754,7 +758,7 @@ BattleTransition_HalfCircle2: ; 70d93 (1c:4d93) dw BattleTransition_CircleData1 dwCoord 18, 11 -BattleTransition_Circle_Sub3: ; 70dc5 (1c:4dc5) +BattleTransition_Circle_Sub3: ; 70e3b (1c:4e3b) push hl ld a, [de] ld c, a @@ -799,17 +803,17 @@ BattleTransition_Circle_Sub3: ; 70dc5 (1c:4dc5) jr nz, .loop2 jr BattleTransition_Circle_Sub3 -BattleTransition_CircleData1: ; 70dfe (1c:4dfe) +BattleTransition_CircleData1: ; 70e74 (1c:4e74) db $02,$03,$05,$04,$09,$FF -BattleTransition_CircleData2: ; 70e04 (1c:4e04) +BattleTransition_CircleData2: ; 70e7a (1c:4e7a) db $01,$01,$02,$02,$04,$02,$04,$02,$03,$FF -BattleTransition_CircleData3: ; 70e0e (1c:4e0e) +BattleTransition_CircleData3: ; 70e84 (1c:4e84) db $02,$01,$03,$01,$04,$01,$04,$01,$04,$01,$03,$01,$02,$01,$01,$01,$01,$FF -BattleTransition_CircleData4: ; 70e20 (1c:4e20) +BattleTransition_CircleData4: ; 70e97 (1c:4e97) db $04,$01,$04,$00,$03,$01,$03,$00,$02,$01,$02,$00,$01,$FF -BattleTransition_CircleData5: ; 70e2e (1c:4e2e) +BattleTransition_CircleData5: ; 70ea3 (1c:4ea3) db $04,$00,$03,$00,$03,$00,$02,$00,$02,$00,$01,$00,$01,$00,$01,$FF diff --git a/engine/battle/ghost_marowak_anim.asm b/engine/battle/ghost_marowak_anim.asm index 73d3bcc2..5c9e6f1a 100644 --- a/engine/battle/ghost_marowak_anim.asm +++ b/engine/battle/ghost_marowak_anim.asm @@ -1,7 +1,8 @@ -MarowakAnim: ; 708ca (1c:48ca) +MarowakAnim: ; 7092b (1c:492b) ; animate the ghost being unveiled as a Marowak ld a, $e4 ld [rOBP1], a + call Func_3061 call CopyMonPicFromBGToSpriteVRAM ; cover the BG ghost pic with a sprite ghost pic that looks the same ; now that the ghost pic is being displayed using sprites, clear the ghost pic from the BG tilemap hlCoord 12, 0 @@ -15,7 +16,7 @@ MarowakAnim: ; 708ca (1c:48ca) ld [wHPBarMaxHP], a ld a, $1 ld [H_WHOSETURN], a - callab Func_79793 + callab Func_798d4 ; alternate between black and light grey 8 times. ; this makes the ghost's body appear to flash ld d, $80 @@ -27,6 +28,7 @@ MarowakAnim: ; 708ca (1c:48ca) sla a sla a ld [rOBP1], a + call Func_3061 jr nz, .fadeOutGhostLoop call ClearSprites call CopyMonPicFromBGToSpriteVRAM ; copy Marowak pic from BG to sprite VRAM @@ -40,6 +42,7 @@ MarowakAnim: ; 708ca (1c:48ca) srl b rra ld [rOBP1], a + call Func_3061 ld a, b and a jr nz, .fadeInMarowakLoop @@ -49,7 +52,7 @@ MarowakAnim: ; 708ca (1c:48ca) jp ClearSprites ; copies a mon pic's from background VRAM to sprite VRAM and sets up OAM -CopyMonPicFromBGToSpriteVRAM: ; 7092a (1c:492a) +CopyMonPicFromBGToSpriteVRAM: ; 70994 (1c:4994) ld de, vFrontPic ld hl, vSprites ld bc, 7 * 7 @@ -74,7 +77,7 @@ CopyMonPicFromBGToSpriteVRAM: ; 7092a (1c:492a) ld [hli], a ld a, d ld [hli], a - ld a, $10 ; use OBP1 + ld a, $14 ; use OBP1 ld [hli], a inc d dec c diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm index 90d306c3..09abf779 100755 --- a/engine/overworld/healing_machine.asm +++ b/engine/overworld/healing_machine.asm @@ -1,4 +1,4 @@ -AnimateHealingMachine: ; 70433 (1c:4433) +AnimateHealingMachine: ; 7048b (1c:448b) ld de, PokeCenterFlashingMonitorAndHealBall ; $44b7 ld hl, vChars0 + $7c0 ld bc, (BANK(PokeCenterFlashingMonitorAndHealBall) << 8) + $03 @@ -12,82 +12,84 @@ AnimateHealingMachine: ; 70433 (1c:4433) push af ld a, $e0 ld [rOBP1], a ; $ff49 + call Func_3061 ld hl, wOAMBuffer + $84 ld de, PokeCenterOAMData ; $44d7 - call Func_70503 + call Func_7055a ld a, $4 ld [wMusicHeaderPointer], a ld a, $ff ld [wc0ee], a call PlaySound -.asm_70464 +.asm_704ba ld a, [wMusicHeaderPointer] and a - jr nz, .asm_70464 + jr nz, .asm_704ba ld a, [wPartyCount] ; wPartyCount ld b, a -.asm_7046e - call Func_70503 +.asm_704c4 + call Func_7055a ld a, (SFX_02_4a - SFX_Headers_02) / 3 call PlaySound ld c, $1e call DelayFrames dec b - jr nz, .asm_7046e + jr nz, .asm_704c4 ld a, [wc0ef] cp $1f ld [wc0f0], a - jr nz, .asm_70495 - ld a, $ff - ld [wc0ee], a + jr nz, .asm_704e6 + call StopAllMusic call PlaySound ld a, BANK(Music_PkmnHealed) ld [wc0ef], a -.asm_70495 +.asm_704e6 ld a, MUSIC_PKMN_HEALED ld [wc0ee], a call PlaySound ld d, $28 call FlashSprite8Times -.asm_704a2 +.asm_704f3 ld a, [wc026] cp MUSIC_PKMN_HEALED - jr z, .asm_704a2 + jr z, .asm_704f3 ld c, $20 call DelayFrames pop af ld [rOBP1], a ; $ff49 + call Func_3061 pop hl pop af ld [hl], a jp UpdateSprites -PokeCenterFlashingMonitorAndHealBall: ; 704b7 (1c:44b7) +PokeCenterFlashingMonitorAndHealBall: ; 7050b (1c:450b) INCBIN "gfx/pokecenter_ball.2bpp" -PokeCenterOAMData: ; 704d7 (1c:44d7) - db $24,$34,$7C,$10 ; heal machine monitor - db $2B,$30,$7D,$10 ; pokeballs 1-6 - db $2B,$38,$7D,$30 - db $30,$30,$7D,$10 - db $30,$38,$7D,$30 - db $35,$30,$7D,$10 - db $35,$38,$7D,$30 +PokeCenterOAMData: ; 7042b (1c:442b) + db $24,$34,$7C,$14 ; heal machine monitor + db $2B,$30,$7D,$14 ; pokeballs 1-6 + db $2B,$38,$7D,$34 + db $30,$30,$7D,$14 + db $30,$38,$7D,$34 + db $35,$30,$7D,$14 + db $35,$38,$7D,$34 ; d = value to xor with palette -FlashSprite8Times: ; 704f3 (1c:44f3) +FlashSprite8Times: ; 70547 (1c:4547) ld b, 8 .loop ld a, [rOBP1] xor d ld [rOBP1], a + call Func_3061 ld c, 10 call DelayFrames dec b jr nz, .loop ret -Func_70503: ; 70503 (1c:4503) +Func_7055a: ; 7055a (1c:455a) ld a, [de] inc de ld [hli], a diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index 6602cedd..b2c8d94d 100755 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -1,4 +1,4 @@ -EnterMapAnim: ; 70510 (1c:4510) +EnterMapAnim: ; 70567 (1c:4567) call InitFacingDirectionBuffer ld a, $ec ld [wSpriteStateData1 + 4], a ; player's sprite Y screen position @@ -13,8 +13,8 @@ EnterMapAnim: ; 70510 (1c:4510) call PlaySound ld hl, wd732 bit 4, [hl] ; used dungeon warp? - res 4, [hl] pop hl + ;res 4, [hl] jr nz, .dungeonWarpAnimation call PlayerSpinWhileMovingDown ld a, (SFX_02_4f - SFX_Headers_02) / 3 @@ -34,21 +34,26 @@ EnterMapAnim: ; 70510 (1c:4510) ld [hl], $ff ; wPlayerSpinInPlaceAnimSoundID ld hl, wcd48 call PlayerSpinInPlace + ld a, $1 + ld [wd431], a .restoreDefaultMusic call PlayDefaultMusic + call Func_151d .done jp RestoreFacingDirectionAndYScreenPos .dungeonWarpAnimation ld c, 50 call DelayFrames call PlayerSpinWhileMovingDown + ld a, $0 + ld [wd431], a jr .done .flyAnimation pop hl - ld de, BirdSprite - ld hl, vNPCSprites - ld bc, (BANK(BirdSprite) << 8) + $0c - call CopyVideoData + ;ld de, BirdSprite + ;ld hl, vNPCSprites + ;ld bc, (BANK(BirdSprite) << 8) + $0c + ;call CopyVideoData call LoadBirdSpriteGraphics ld a, (SFX_02_50 - SFX_Headers_02) / 3 call PlaySound @@ -61,9 +66,11 @@ EnterMapAnim: ; 70510 (1c:4510) ld de, FlyAnimationEnterScreenCoords ; $4592 call DoFlyAnimation call LoadPlayerSpriteGraphics + ld a, $1 + ld [wd431], a jr .restoreDefaultMusic -FlyAnimationEnterScreenCoords: ; 70592 (1c:4592) +FlyAnimationEnterScreenCoords: ; 705ed (1c:45ed) ; y, x pairs ; This is the sequence of screen coordinates used by the overworld ; Fly animation when the player is entering a map. @@ -80,7 +87,7 @@ FlyAnimationEnterScreenCoords: ; 70592 (1c:4592) db $3C, $48 db $3C, $40 -PlayerSpinWhileMovingDown: ; 705aa (1c:45aa) +PlayerSpinWhileMovingDown: ; 70605 (1c:4605) ld hl, wPlayerSpinWhileMovingUpOrDownAnimDeltaY ld a, $10 ld [hli], a ; wPlayerSpinWhileMovingUpOrDownAnimDeltaY @@ -90,7 +97,8 @@ PlayerSpinWhileMovingDown: ; 705aa (1c:45aa) ld [hl], a ; wPlayerSpinWhileMovingUpOrDownAnimFrameDelay jp PlayerSpinWhileMovingUpOrDown -_LeaveMapAnim: ; 705ba (1c:45ba) +_LeaveMapAnim: ; 70615 (1c:4615) + call Func_1510 call InitFacingDirectionBuffer call IsPlayerStandingOnWarpPadOrHole ld a, b @@ -167,7 +175,7 @@ _LeaveMapAnim: ; 705ba (1c:45ba) call GBFadeOutToWhite jp RestoreFacingDirectionAndYScreenPos -FlyAnimationScreenCoords1: ; 7064f (1c:464f) +FlyAnimationScreenCoords1: ; 706ad (1c:46ad) ; y, x pairs ; This is the sequence of screen coordinates used by the first part ; of the Fly overworld animation. @@ -184,7 +192,7 @@ FlyAnimationScreenCoords1: ; 7064f (1c:464f) db $2A, $98 db $27, $A0 -FlyAnimationScreenCoords2: ; 70667 (1c:4667) +FlyAnimationScreenCoords2: ; 706c5 (1c:46c5) ; y, x pairs ; This is the sequence of screen coordinates used by the second part ; of the Fly overworld animation. @@ -201,7 +209,7 @@ FlyAnimationScreenCoords2: ; 70667 (1c:4667) db $F0, $00 -LeaveMapThroughHoleAnim: ; 7067d (1c:467d) +LeaveMapThroughHoleAnim: ; 706db (1c:46db) ld a, $ff ld [wUpdateSpritesEnabled], a ; disable UpdateSprites ; shift upper half of player's sprite down 8 pixels and hide lower half @@ -223,7 +231,7 @@ LeaveMapThroughHoleAnim: ; 7067d (1c:467d) ld [wUpdateSpritesEnabled], a ; enable UpdateSprites jp RestoreFacingDirectionAndYScreenPos -DoFlyAnimation: ; 706ae (1c:46ae) +DoFlyAnimation: ; 7070c (1c:470c) ld a, [wFlyAnimBirdSpriteImageIndex] xor $1 ; make the bird flap its wings ld [wFlyAnimBirdSpriteImageIndex], a @@ -231,7 +239,7 @@ DoFlyAnimation: ; 706ae (1c:46ae) call Delay3 ld a, [wFlyAnimUsingCoordList] cp $ff - jr z, .asm_706cd + jr z, .asm_7072b ld hl, wSpriteStateData1 + 4 ld a, [de] inc de @@ -240,24 +248,26 @@ DoFlyAnimation: ; 706ae (1c:46ae) ld a, [de] inc de ld [hl], a -.asm_706cd +.asm_7072b ld a, [wFlyAnimCounter] dec a ld [wFlyAnimCounter], a jr nz, DoFlyAnimation ret -LoadBirdSpriteGraphics: ; 706d7 (1c:46d7) +LoadBirdSpriteGraphics: ; 70735 (1c:4735) ld de, BirdSprite ; $4d80 + ld b, BANK(BirdSprite) + ld c,$c ld hl, vNPCSprites - ld bc, (BANK(BirdSprite) << 8) + $0c call CopyVideoData ld de, BirdSprite + $c0 ; $4e40 ; moving amination sprite + ld b, BANK(BirdSprite) + ld c, $0c ld hl, vNPCSprites2 - ld bc, (BANK(BirdSprite) << 8) + $0c jp CopyVideoData -InitFacingDirectionBuffer: ; 706ef (1c:46ef) +InitFacingDirectionBuffer: ; 7074f (1c:474f) ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction (image index is locked to standing images) ld [wcd50], a ld a, [wSpriteStateData1 + 4] ; player's sprite Y screen position @@ -275,12 +285,12 @@ InitFacingDirectionBuffer: ; 706ef (1c:46ef) dec hl ret -PlayerSpinningFacingOrder: ; 70713 (1c:4713) +PlayerSpinningFacingOrder: ; 70773 (1c:4773) ; The order of the direction the player's sprite is facing when teleporting ; away. Creates a spinning effect. db SPRITE_FACING_DOWN, SPRITE_FACING_LEFT, SPRITE_FACING_UP, SPRITE_FACING_RIGHT -SpinPlayerSprite: ; 70717 (1c:4717) +SpinPlayerSprite: ; 70777 (1c:4777) ld a, [hl] ld [wSpriteStateData1 + 2], a ; player's sprite facing direction (image index is locked to standing images) push hl @@ -293,16 +303,16 @@ SpinPlayerSprite: ; 70717 (1c:4717) pop hl ret -PlayerSpinInPlace: ; 70730 (1c:4730) +PlayerSpinInPlace: ; 70790 (1c:4790) call SpinPlayerSprite ld a, [wPlayerSpinInPlaceAnimFrameDelay] ld c, a and $3 - jr nz, .asm_70743 + jr nz, .asm_707a3 ld a, [wPlayerSpinInPlaceAnimSoundID] cp $ff call nz, PlaySound -.asm_70743 +.asm_707a3 ld a, [wPlayerSpinInPlaceAnimFrameDelayDelta] add c ld [wPlayerSpinInPlaceAnimFrameDelay], a @@ -313,7 +323,7 @@ PlayerSpinInPlace: ; 70730 (1c:4730) call DelayFrames jr PlayerSpinInPlace -PlayerSpinWhileMovingUpOrDown: ; 70755 (1c:4755) +PlayerSpinWhileMovingUpOrDown: ; 707b5 (1c:47b5) call SpinPlayerSprite ld a, [wPlayerSpinWhileMovingUpOrDownAnimDeltaY] ld c, a @@ -329,7 +339,7 @@ PlayerSpinWhileMovingUpOrDown: ; 70755 (1c:4755) call DelayFrames jr PlayerSpinWhileMovingUpOrDown -RestoreFacingDirectionAndYScreenPos: ; 70772 (1c:4772) +RestoreFacingDirectionAndYScreenPos: ; 707d2 (1c:47d2) ld a, [wcd4f] ld [wSpriteStateData1 + 4], a ld a, [wcd50] @@ -337,14 +347,14 @@ RestoreFacingDirectionAndYScreenPos: ; 70772 (1c:4772) ret ; if SGB, 2 frames, else 3 frames -GetPlayerTeleportAnimFrameDelay: ; 7077f (1c:477f) +GetPlayerTeleportAnimFrameDelay: ; 707df (1c:47df) ld a, [wOnSGB] xor $1 inc a inc a ret -IsPlayerStandingOnWarpPadOrHole: ; 70787 (1c:4787) +IsPlayerStandingOnWarpPadOrHole: ; 707e7 (1c:47e7) ld b, 0 ld hl, .warpPadAndHoleData ld a, [W_CURMAPTILESET] @@ -371,21 +381,22 @@ IsPlayerStandingOnWarpPadOrHole: ; 70787 (1c:4787) ret ; format: db tileset id, tile id, value to be put in wcd5b -.warpPadAndHoleData: ; 707a9 (1c:47a9) +.warpPadAndHoleData: ; 70809 (1c:4809) db FACILITY, $20, 1 ; warp pad db FACILITY, $11, 2 ; hole db CAVERN, $22, 2 ; hole db INTERIOR, $55, 1 ; warp pad db $FF -Func_707b6: ; 707b6 (1c:47b6) +Func_707b6: ; 70716 (1c:4716) ld c, $a call DelayFrames ld hl, wd736 set 6, [hl] ld de, RedSprite ; $4180 ld hl, vNPCSprites - ld bc, (BANK(RedSprite) << 8) + $0c + ld b, BANK(RedSprite) + ld c, $c call CopyVideoData ld a, $4 ld hl, RedFishingTiles ; $4866 @@ -398,30 +409,30 @@ Func_707b6: ; 707b6 (1c:47b6) ld de, wOAMBuffer + $9c ld bc, $4 call CopyData - ld c, $64 + ld c, 100 call DelayFrames ld a, [wWhichTrade] ; wWhichTrade and a ld hl, NoNibbleText - jr z, .asm_70836 + jr z, .asm_708a8 cp $2 ld hl, NothingHereText - jr z, .asm_70836 + jr z, .asm_70897 ld b, $a -.asm_707fe +.asm_7085f ld hl, wSpriteStateData1 + 4 - call Func_70842 + call Func_708a3 ld hl, wOAMBuffer + $9c - call Func_70842 + call Func_708a3 call Delay3 dec b - jr nz, .asm_707fe + jr nz, .asm_7085f ld a, [wSpriteStateData1 + 2] cp $4 - jr nz, .asm_7081c + jr nz, .asm_7087d ld a, $a0 ld [wOAMBuffer + $9c], a -.asm_7081c +.asm_7087d ld hl, wcd4f xor a ld [hli], a @@ -429,10 +440,10 @@ Func_707b6: ; 707b6 (1c:47b6) predef EmotionBubble ld a, [wSpriteStateData1 + 2] cp $4 - jr nz, .asm_70833 + jr nz, .asm_70894 ld a, $44 ld [wOAMBuffer + $9c], a -.asm_70833 +.asm_70894 ld hl, ItsABiteText .asm_70836 call PrintText @@ -441,25 +452,25 @@ Func_707b6: ; 707b6 (1c:47b6) call LoadFontTilePatterns ret -Func_70842: ; 70842 (1c:4842) +Func_70842: ; 708a3 (1c:48a3) ld a, [hl] xor $1 ld [hl], a ret -NoNibbleText: ; 70847 (1c:4847) +NoNibbleText: ; 708a8 (1c:48a8) TX_FAR _NoNibbleText db "@" -NothingHereText: ; 7084c (1c:484c) +NothingHereText: ; 708ad (1c:48ad) TX_FAR _NothingHereText db "@" -ItsABiteText: ; 70851 (1c:4851) +ItsABiteText: ; 708b2 (1c:48b2) TX_FAR _ItsABiteText db "@" -FishingRodGfxProperties: ; 70856 (1c:4856) +FishingRodGfxProperties: ; 708b7 (1c:48b7) ; specifies how the fishing rod should be drawn on the screen ; first byte = screen y coordinate ; second byte = screen x coordinate @@ -470,7 +481,7 @@ FishingRodGfxProperties: ; 70856 (1c:4856) db $50, $40, $FE, $00 ; player facing left db $50, $58, $FE, $20 ; player facing right ($20 means "horizontally flip the tile") -RedFishingTiles: ; 70866 (1c:4866) +RedFishingTiles: ; 708c7 (1c:48c7) dw RedFishingTilesFront db 2, BANK(RedFishingTilesFront) dw vNPCSprites + $20 @@ -487,7 +498,7 @@ RedFishingTiles: ; 70866 (1c:4866) db 3, BANK(RedFishingRodTiles) dw vNPCSprites2 + $7d0 -_HandleMidJump: ; 7087e (1c:487e) +_HandleMidJump: ; 708df (1c:48df) ld a, [wPlayerJumpingYScreenCoordsIndex] ld c, a inc a @@ -519,6 +530,6 @@ _HandleMidJump: ; 7087e (1c:487e) ld [wJoyIgnore], a ret -PlayerJumpingYScreenCoords: ; 708ba (1c:48ba) +PlayerJumpingYScreenCoords: ; 7091b (1c:491b) ; Sequence of y screen coordinates for player's sprite when jumping over a ledge. db $38, $36, $34, $32, $31, $30, $30, $30, $31, $32, $33, $34, $36, $38, $3C, $3C |