summaryrefslogtreecommitdiff
path: root/engine/overworld
diff options
context:
space:
mode:
authorluckytyphlosion <alan.rj.huang@gmail.com>2015-07-12 15:59:37 -0400
committerluckytyphlosion <alan.rj.huang@gmail.com>2015-07-12 15:59:37 -0400
commit888860a5eeec547348c6a049fdf2595c0aa1c522 (patch)
tree48d7049f3cd3805f647edc0fc3fa9eb0c829affa /engine/overworld
parent9d56570f8295ba2d37e176ac104fa10424af00eb (diff)
More bank1c documentation.
Diffstat (limited to 'engine/overworld')
-rwxr-xr-xengine/overworld/healing_machine.asm50
-rwxr-xr-xengine/overworld/player_animations.asm111
2 files changed, 87 insertions, 74 deletions
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