diff options
Diffstat (limited to 'engine/overworld/player_animations.asm')
-rwxr-xr-x | engine/overworld/player_animations.asm | 111 |
1 files changed, 61 insertions, 50 deletions
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 |