summaryrefslogtreecommitdiff
path: root/engine/overworld
diff options
context:
space:
mode:
Diffstat (limited to 'engine/overworld')
-rwxr-xr-xengine/overworld/healing_machine.asm65
-rwxr-xr-xengine/overworld/map_sprites.asm2
-rw-r--r--engine/overworld/oam.asm16
-rwxr-xr-xengine/overworld/player_animations.asm108
4 files changed, 108 insertions, 83 deletions
diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm
index bf7130cb..e9310925 100755
--- a/engine/overworld/healing_machine.asm
+++ b/engine/overworld/healing_machine.asm
@@ -1,5 +1,5 @@
-AnimateHealingMachine: ; 70433 (1c:4433)
- ld de, PokeCenterFlashingMonitorAndHealBall
+AnimateHealingMachine: ; 7048b (1c:448b)
+ ld de, PokeCenterFlashingMonitorAndHealBall ; $44b7
ld hl, vChars0 + $7c0
lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), $03 ; loads one too many tiles
call CopyVideoData
@@ -11,83 +11,84 @@ AnimateHealingMachine: ; 70433 (1c:4433)
ld a, [rOBP1]
push af
ld a, $e0
- ld [rOBP1], a
+<<<<<<< HEAD
+ ld [rOBP1], a ; $ff49
+ call Func_3061
ld hl, wOAMBuffer + $84
- ld de, PokeCenterOAMData
+ ld de, PokeCenterOAMData ; $44d7
call CopyHealingMachineOAM
ld a, 4
ld [wAudioFadeOutControl], a
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
+ call StopAllMusic
.waitLoop
ld a, [wAudioFadeOutControl]
- and a ; is fade-out finished?
- jr nz, .waitLoop ; if not, check again
- ld a, [wPartyCount]
+ and a
+ jr nz, .waitLoop
+ ld a, [wPartyCount] ; wPartyCount
ld b, a
.partyLoop
call CopyHealingMachineOAM
- ld a, SFX_HEALING_MACHINE
+ ld a, $9e ; (SFX_02_4a - SFX_Headers_02) / 3
call PlaySound
ld c, 30
call DelayFrames
dec b
+<<<<<<< HEAD
jr nz, .partyLoop
ld a, [wAudioROMBank]
- cp BANK(Audio3_UpdateMusic)
+ cp $1f
ld [wAudioSavedROMBank], a
jr nz, .next
- ld a, $ff
- ld [wNewSoundID], a
- call PlaySound
- ld a, BANK(Music_PkmnHealed)
+ call StopAllMusic
+ ld a, $2 ; BANK(Music_PkmnHealed)
ld [wAudioROMBank], a
.next
- ld a, MUSIC_PKMN_HEALED
+ ld a, $e8 ; MUSIC_PKMN_HEALED
ld [wNewSoundID], a
call PlaySound
ld d, $28
call FlashSprite8Times
.waitLoop2
- ld a, [wChannelSoundIDs]
- cp MUSIC_PKMN_HEALED ; is the healed music still playing?
- jr z, .waitLoop2 ; if so, check gain
+ ld a, [wc026]
+ cp $e8 ; MUSIC_PKMN_HEALED
+ jr z, .waitLoop2
ld c, 32
call DelayFrames
pop af
- ld [rOBP1], a
+ 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
-CopyHealingMachineOAM: ; 70503 (1c:4503)
+CopyHealingMachineOAM: ; 7055a (1c:455a)
; copy one OAM entry and advance the pointers
ld a, [de]
inc de
diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm
index 33411dfc..84d67b36 100755
--- a/engine/overworld/map_sprites.asm
+++ b/engine/overworld/map_sprites.asm
@@ -8,7 +8,7 @@
; fields, respectively, within loops. The X is the loop index.
; If there is an inner loop, Y is the inner loop index, i.e. $C1Y* and $C2Y*
; denote fields of the sprite slots interated over in the inner loop.
-InitMapSprites: ; 1785b (5:785b)
+_InitMapSprites: ; 1785b (5:785b)
call InitOutsideMapSprites
ret c ; return if the map is an outside map (already handled by above call)
; if the map is an inside map (i.e. mapID >= $25)
diff --git a/engine/overworld/oam.asm b/engine/overworld/oam.asm
index 41360965..ff85eb3e 100644
--- a/engine/overworld/oam.asm
+++ b/engine/overworld/oam.asm
@@ -187,3 +187,19 @@ GetSpriteScreenXY: ; 4bd1 (1:4bd1)
and $f0
ld [de], a ; c1xb (x)
ret
+
+_IsTilePassable:: ; 4aaa (1:4aaa)
+ ld hl,W_TILESETCOLLISIONPTR ; pointer to list of passable tiles
+ ld a,[hli]
+ ld h,[hl]
+ ld l,a ; hl now points to passable tiles
+.loop
+ ld a,[hli]
+ cp a,$ff
+ jr z,.tileNotPassable
+ cp c
+ ret z
+ jr .loop
+.tileNotPassable
+ scf
+ ret \ No newline at end of file
diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm
index 74762b00..05be3d1d 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 InitFacingDirectionList
ld a, $ec
ld [wSpriteStateData1 + 4], a ; player's sprite Y screen position
@@ -9,15 +9,15 @@ EnterMapAnim: ; 70510 (1c:4510)
bit 7, [hl] ; used fly out of battle?
res 7, [hl]
jr nz, .flyAnimation
- ld a, SFX_TELEPORT_ENTER_1
+ ld a, $a0 ; (SFX_02_4c - SFX_Headers_02) / 3
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_TELEPORT_ENTER_2
+ ld a, $a3 ; (SFX_02_4f - SFX_Headers_02) / 3
call PlaySound
call IsPlayerStandingOnWarpPadOrHole
ld a, b
@@ -34,23 +34,24 @@ EnterMapAnim: ; 70510 (1c:4510)
ld [hl], $ff ; wPlayerSpinInPlaceAnimSoundID
ld hl, wFacingDirectionList
call PlayerSpinInPlace
+ ld a, $1
+ ld [wd431], a
.restoreDefaultMusic
call PlayDefaultMusic
.done
+ call Func_151d
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
- lb bc, BANK(BirdSprite), $0c
- call CopyVideoData
call LoadBirdSpriteGraphics
- ld a, SFX_FLY
+ ld a, $a4 ; SFX_BIRD_FLY
call PlaySound
ld hl, wFlyAnimUsingCoordList
xor a ; is using coord list
@@ -61,9 +62,11 @@ EnterMapAnim: ; 70510 (1c:4510)
ld de, FlyAnimationEnterScreenCoords
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 +83,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 +93,9 @@ PlayerSpinWhileMovingDown: ; 705aa (1c:45aa)
ld [hl], a ; wPlayerSpinWhileMovingUpOrDownAnimFrameDelay
jp PlayerSpinWhileMovingUpOrDown
-_LeaveMapAnim: ; 705ba (1c:45ba)
+
+_LeaveMapAnim: ; 70615 (1c:4615)
+ call Func_1510
call InitFacingDirectionList
call IsPlayerStandingOnWarpPadOrHole
ld a, b
@@ -99,7 +104,7 @@ _LeaveMapAnim: ; 705ba (1c:45ba)
dec a
jp nz, LeaveMapThroughHoleAnim
.spinWhileMovingUp
- ld a, SFX_TELEPORT_EXIT_1
+ ld a, $9f ; (SFX_02_4b - SFX_Headers_02) / 3
call PlaySound
ld hl, wPlayerSpinWhileMovingUpOrDownAnimDeltaY
ld a, -$10
@@ -133,7 +138,7 @@ _LeaveMapAnim: ; 705ba (1c:45ba)
ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelayDelta
xor a
ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelayEndValue
- ld [hl], SFX_TELEPORT_EXIT_2 ; wPlayerSpinInPlaceAnimSoundID
+ ld [hl], $a1 ; SFX_TELEPORT_EXIT_2
ld hl, wFacingDirectionList
call PlayerSpinInPlace
jr .spinWhileMovingUp
@@ -146,7 +151,7 @@ _LeaveMapAnim: ; 705ba (1c:45ba)
ld [hli], a ; wFlyAnimCounter
ld [hl], $c ; wFlyAnimBirdSpriteImageIndex
call DoFlyAnimation
- ld a, SFX_FLY
+ ld a, $a4 ; SFX_FLY
call PlaySound
ld hl, wFlyAnimUsingCoordList
xor a ; is using coord list
@@ -167,7 +172,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 +189,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 +206,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 +228,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
@@ -247,17 +252,19 @@ DoFlyAnimation: ; 706ae (1c:46ae)
jr nz, DoFlyAnimation
ret
-LoadBirdSpriteGraphics: ; 706d7 (1c:46d7)
- ld de, BirdSprite
+LoadBirdSpriteGraphics: ; 70735 (1c:4735)
+ ld de, BirdSprite ; $4d80
+ ld b, BANK(BirdSprite)
+ ld c, $c
ld hl, vNPCSprites
- lb bc, BANK(BirdSprite), $0c
call CopyVideoData
- ld de, BirdSprite + $c0 ; moving animation sprite
+ ld de, BirdSprite + $c0 ; $4e40 ; moving amination sprite
+ ld b, BANK(BirdSprite)
+ ld c, $0c
ld hl, vNPCSprites2
- lb bc, BANK(BirdSprite), $0c
jp CopyVideoData
-InitFacingDirectionList: ; 706ef (1c:46ef)
+InitFacingDirectionList: ; 7074f (1c:474f)
ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction (image index is locked to standing images)
ld [wSavedPlayerFacingDirection], a
ld a, [wSpriteStateData1 + 4] ; player's sprite Y screen position
@@ -276,12 +283,12 @@ InitFacingDirectionList: ; 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)
; copy the current value from the list into the sprite data and rotate the list
ld a, [hl]
ld [wSpriteStateData1 + 2], a ; player's sprite facing direction (image index is locked to standing images)
@@ -295,7 +302,7 @@ SpinPlayerSprite: ; 70717 (1c:4717)
pop hl
ret
-PlayerSpinInPlace: ; 70730 (1c:4730)
+PlayerSpinInPlace: ; 70790 (1c:4790)
call SpinPlayerSprite
ld a, [wPlayerSpinInPlaceAnimFrameDelay]
ld c, a
@@ -316,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
@@ -332,7 +339,7 @@ PlayerSpinWhileMovingUpOrDown: ; 70755 (1c:4755)
call DelayFrames
jr PlayerSpinWhileMovingUpOrDown
-RestoreFacingDirectionAndYScreenPos: ; 70772 (1c:4772)
+RestoreFacingDirectionAndYScreenPos: ; 707d2 (1c:47d2)
ld a, [wSavedPlayerScreenY]
ld [wSpriteStateData1 + 4], a
ld a, [wSavedPlayerFacingDirection]
@@ -340,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]
@@ -374,21 +381,22 @@ IsPlayerStandingOnWarpPadOrHole: ; 70787 (1c:4787)
ret
; format: db tileset id, tile id, value to be put in [wStandingOnWarpPadOrHole]
-.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
-FishingAnim: ; 707b6 (1c:47b6)
+FishingAnim: ; 70816 (1c:4816)
ld c, 10
call DelayFrames
ld hl, wd736
- set 6, [hl] ; reserve the last 4 OAM entries
- ld de, RedSprite
+ set 6, [hl]
ld hl, vNPCSprites
- lb bc, BANK(RedSprite), $0c
+ ld de, RedSprite ; $4180
+ ld b, BANK(RedSprite)
+ ld c, $c
call CopyVideoData
ld a, $4
ld hl, RedFishingTiles
@@ -406,14 +414,16 @@ FishingAnim: ; 707b6 (1c:47b6)
ld a, [wRodResponse]
and a
ld hl, NoNibbleText
+<<<<<<< HEAD
jr z, .done
cp $2
ld hl, NothingHereText
jr z, .done
-
+
; there was a bite
; shake the player's sprite vertically
+
ld b, 10
.loop
ld hl, wSpriteStateData1 + 4 ; player's sprite Y screen position
@@ -423,22 +433,20 @@ FishingAnim: ; 707b6 (1c:47b6)
call Delay3
dec b
jr nz, .loop
-
+
; If the player is facing up, hide the fishing rod so it doesn't overlap with
; the exclamation bubble that will be shown next.
- ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction
+ ld a, [wSpriteStateData1 + 2]
cp SPRITE_FACING_UP
jr nz, .skipHidingFishingRod
ld a, $a0
ld [wOAMBuffer + $9c], a
-
.skipHidingFishingRod
ld hl, wEmotionBubbleSpriteIndex
xor a
ld [hli], a ; player's sprite
ld [hl], a ; EXCLAMATION_BUBBLE
predef EmotionBubble
-
; If the player is facing up, unhide the fishing rod.
ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction
cp SPRITE_FACING_UP
@@ -456,25 +464,25 @@ FishingAnim: ; 707b6 (1c:47b6)
call LoadFontTilePatterns
ret
-.ShakePlayerSprite
+.ShakePlayerSprite ; 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 "@"
-FishingRodOAM: ; 70856 (1c:4856)
+FishingRodOAM: ; 708b7 (1c:48b7)
; specifies how the fishing rod should be drawn on the screen
; first byte = screen y coordinate
; second byte = screen x coordinate
@@ -485,7 +493,7 @@ FishingRodOAM: ; 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
@@ -502,7 +510,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
@@ -534,6 +542,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