summaryrefslogtreecommitdiff
path: root/engine/overworld
diff options
context:
space:
mode:
Diffstat (limited to 'engine/overworld')
-rw-r--r--engine/overworld/advance_player_sprite.asm12
-rw-r--r--engine/overworld/boulders.asm6
-rwxr-xr-xengine/overworld/cable_club_npc.asm20
-rwxr-xr-xengine/overworld/card_key.asm10
-rw-r--r--engine/overworld/check_player_state.asm14
-rwxr-xr-xengine/overworld/cinnabar_lab.asm14
-rw-r--r--engine/overworld/clear_loadmapdata_vars.asm8
-rwxr-xr-xengine/overworld/cut.asm22
-rwxr-xr-xengine/overworld/cut2.asm6
-rw-r--r--engine/overworld/daycare_exp.asm4
-rwxr-xr-xengine/overworld/doors.asm28
-rw-r--r--engine/overworld/dungeon_warps.asm4
-rwxr-xr-xengine/overworld/elevator.asm4
-rwxr-xr-xengine/overworld/emotion_bubbles.asm10
-rw-r--r--engine/overworld/get_coords_tile_in_front_of_player.asm8
-rwxr-xr-xengine/overworld/healing_machine.asm34
-rwxr-xr-xengine/overworld/hidden_items.asm14
-rwxr-xr-xengine/overworld/hidden_objects.asm4
-rw-r--r--engine/overworld/is_player_just_outside_map.asm2
-rw-r--r--engine/overworld/item.asm6
-rwxr-xr-xengine/overworld/ledges.asm12
-rw-r--r--engine/overworld/load_tileset_header.asm4
-rw-r--r--engine/overworld/load_wild_data.asm4
-rw-r--r--engine/overworld/map_sprite_functions1.asm12
-rwxr-xr-xengine/overworld/map_sprites.asm31
-rw-r--r--engine/overworld/missable_objects.asm14
-rw-r--r--engine/overworld/movement.asm68
-rwxr-xr-xengine/overworld/npc_movement.asm38
-rwxr-xr-xengine/overworld/npc_movement_2.asm4
-rw-r--r--engine/overworld/npc_pathfinding.asm12
-rwxr-xr-xengine/overworld/oaks_aide.asm14
-rw-r--r--engine/overworld/oam.asm12
-rwxr-xr-xengine/overworld/pewter_guys.asm8
-rwxr-xr-xengine/overworld/player_animations.asm79
-rwxr-xr-xengine/overworld/pokecenter.asm26
-rwxr-xr-xengine/overworld/pokemart.asm24
-rw-r--r--engine/overworld/print_safari_steps.asm8
-rw-r--r--engine/overworld/replace_tile_block.asm8
-rwxr-xr-xengine/overworld/saffron_guards.asm4
-rw-r--r--engine/overworld/set_blackout_map.asm6
-rw-r--r--engine/overworld/special_warps.asm6
-rwxr-xr-xengine/overworld/ssanne.asm12
-rw-r--r--engine/overworld/step_functions.asm6
-rwxr-xr-xengine/overworld/trainers.asm30
-rw-r--r--engine/overworld/try_pushing_boulder.asm18
45 files changed, 345 insertions, 345 deletions
diff --git a/engine/overworld/advance_player_sprite.asm b/engine/overworld/advance_player_sprite.asm
index 758dd558..6b4a0cbb 100644
--- a/engine/overworld/advance_player_sprite.asm
+++ b/engine/overworld/advance_player_sprite.asm
@@ -1,4 +1,4 @@
-_AdvancePlayerSprite:: ; f010c (3c:410c)
+_AdvancePlayerSprite::
ld a,[wSpriteStateData1 + 3] ; delta Y
ld b,a
ld a,[wSpriteStateData1 + 5] ; delta X
@@ -192,7 +192,7 @@ _AdvancePlayerSprite:: ; f010c (3c:410c)
ld [hSCX],a ; update background scroll X
ret
-MoveTileBlockMapPointerEast:: ; f0248 (3c:4248)
+MoveTileBlockMapPointerEast::
ld a,[de]
add $1
ld [de],a
@@ -203,7 +203,7 @@ MoveTileBlockMapPointerEast:: ; f0248 (3c:4248)
ld [de],a
ret
-MoveTileBlockMapPointerWest:: ; f0252 (3c:4252)
+MoveTileBlockMapPointerWest::
ld a,[de]
sub $1
ld [de],a
@@ -214,7 +214,7 @@ MoveTileBlockMapPointerWest:: ; f0252 (3c:4252)
ld [de],a
ret
-MoveTileBlockMapPointerSouth:: ; f025c (3c:425c)
+MoveTileBlockMapPointerSouth::
add $6
ld b,a
ld a,[de]
@@ -227,7 +227,7 @@ MoveTileBlockMapPointerSouth:: ; f025c (3c:425c)
ld [de],a
ret
-MoveTileBlockMapPointerNorth:: ; f0268 (3c:4268)
+MoveTileBlockMapPointerNorth::
add $6
ld b,a
ld a,[de]
@@ -238,4 +238,4 @@ MoveTileBlockMapPointerNorth:: ; f0268 (3c:4268)
ld a,[de]
dec a
ld [de],a
- ret \ No newline at end of file
+ ret
diff --git a/engine/overworld/boulders.asm b/engine/overworld/boulders.asm
index edfda2d3..669b7b83 100644
--- a/engine/overworld/boulders.asm
+++ b/engine/overworld/boulders.asm
@@ -1,4 +1,4 @@
-CheckForCollisionWhenPushingBoulder: ; c356 (3:4356)
+CheckForCollisionWhenPushingBoulder:
call GetTileTwoStepsInFrontOfPlayer
call IsTilePassable
jr c, .done
@@ -16,7 +16,7 @@ CheckForCollisionWhenPushingBoulder: ; c356 (3:4356)
ret
; sets a to $ff if there is a collision and $00 if there is no collision
-CheckForBoulderCollisionWithSprites: ; c378 (3:4378)
+CheckForBoulderCollisionWithSprites:
ld a, [wBoulderSpriteIndex]
dec a
swap a
@@ -91,4 +91,4 @@ CheckForBoulderCollisionWithSprites: ; c378 (3:4378)
ret
.success
xor a
- ret \ No newline at end of file
+ ret
diff --git a/engine/overworld/cable_club_npc.asm b/engine/overworld/cable_club_npc.asm
index bc1a553a..e3ce8e8d 100755
--- a/engine/overworld/cable_club_npc.asm
+++ b/engine/overworld/cable_club_npc.asm
@@ -1,4 +1,4 @@
-CableClubNPC: ; 7035 (1:7035)
+CableClubNPC:
ld hl, CableClubNPCWelcomeText
call PrintText
call CheckPikachuFollowingPlayer
@@ -118,7 +118,7 @@ CableClubNPC: ; 7035 (1:7035)
ret
; seems to be similar of Serial_SyncAndExchangeNybble
-Serial_SyncAndExchangeNybbleDouble: ; 7131 (1:7131)
+Serial_SyncAndExchangeNybbleDouble:
ld a, $ff
ld [wSerialExchangeNybbleReceiveData], a
.loop
@@ -166,35 +166,35 @@ Serial_SyncAndExchangeNybbleDouble: ; 7131 (1:7131)
ld [wUnknownSerialCounter + 1], a
ret
-CableClubNPCAreaReservedFor2FriendsLinkedByCableText: ; 7188 (1:7188)
+CableClubNPCAreaReservedFor2FriendsLinkedByCableText:
TX_FAR _CableClubNPCAreaReservedFor2FriendsLinkedByCableText
db "@"
-CableClubNPCWelcomeText: ; 718d (1:718d)
+CableClubNPCWelcomeText:
TX_FAR _CableClubNPCWelcomeText
db "@"
-CableClubNPCPleaseApplyHereHaveToSaveText: ; 7192 (1:7192)
+CableClubNPCPleaseApplyHereHaveToSaveText:
TX_FAR _CableClubNPCPleaseApplyHereHaveToSaveText
db "@"
-CableClubNPCPleaseWaitText: ; 7197 (1:7197)
+CableClubNPCPleaseWaitText:
TX_FAR _CableClubNPCPleaseWaitText
db $a, "@"
-CableClubNPCLinkClosedBecauseOfInactivityText: ; 719d (1:719d)
+CableClubNPCLinkClosedBecauseOfInactivityText:
TX_FAR _CableClubNPCLinkClosedBecauseOfInactivityText
db "@"
-CableClubNPCPleaseComeAgainText: ; 71a2 (1:71a2)
+CableClubNPCPleaseComeAgainText:
TX_FAR _CableClubNPCPleaseComeAgainText
db "@"
-CableClubNPCMakingPreparationsText: ; 71a7 (1:71a7)
+CableClubNPCMakingPreparationsText:
TX_FAR _CableClubNPCMakingPreparationsText
db "@"
-CloseLinkConnection: ; 71ac (1:71ac)
+CloseLinkConnection:
call Delay3
ld a, CONNECTION_NOT_ESTABLISHED
ld [hSerialConnectionStatus], a
diff --git a/engine/overworld/card_key.asm b/engine/overworld/card_key.asm
index 3560c8e8..e1fc9160 100755
--- a/engine/overworld/card_key.asm
+++ b/engine/overworld/card_key.asm
@@ -1,4 +1,4 @@
-PrintCardKeyText: ; 525d8 (14:65d8)
+PrintCardKeyText:
ld hl, SilphCoMapList
ld a, [wCurMap]
ld b, a
@@ -59,7 +59,7 @@ PrintCardKeyText: ; 525d8 (14:65d8)
ld [hSpriteIndexOrTextID], a
jp PrintPredefTextID
-SilphCoMapList: ; 52645 (14:6645)
+SilphCoMapList:
db SILPH_CO_2F
db SILPH_CO_3F
db SILPH_CO_4F
@@ -72,19 +72,19 @@ SilphCoMapList: ; 52645 (14:6645)
db SILPH_CO_11F
db $FF
-CardKeySuccessText: ; 52650 (14:6650)
+CardKeySuccessText:
TX_FAR _CardKeySuccessText1
TX_SFX_ITEM
TX_FAR _CardKeySuccessText2
db "@"
-CardKeyFailText: ; 5265a (14:665a)
+CardKeyFailText:
TX_FAR _CardKeyFailText
db "@"
; d = Y
; e = X
-GetCoordsInFrontOfPlayer: ; 5265f (14:665f)
+GetCoordsInFrontOfPlayer:
ld a, [wYCoord]
ld d, a
ld a, [wXCoord]
diff --git a/engine/overworld/check_player_state.asm b/engine/overworld/check_player_state.asm
index 5dd91c4c..5fad4fc5 100644
--- a/engine/overworld/check_player_state.asm
+++ b/engine/overworld/check_player_state.asm
@@ -1,5 +1,5 @@
; only used for setting bit 2 of wd736 upon entering a new map
-IsPlayerStandingOnWarp: ; c0a6 (3:40a6)
+IsPlayerStandingOnWarp:
ld a, [wNumberOfWarps]
and a
ret z
@@ -31,7 +31,7 @@ IsPlayerStandingOnWarp: ; c0a6 (3:40a6)
jr nz, .loop
ret
-CheckForceBikeOrSurf: ; c0d2 (3:40d2)
+CheckForceBikeOrSurf:
ld hl, wd732
bit 5, [hl]
ret nz
@@ -86,7 +86,7 @@ CheckForceBikeOrSurf: ; c0d2 (3:40d2)
INCLUDE "data/force_bike_surf.asm"
-IsPlayerFacingEdgeOfMap: ; c148 (3:4148)
+IsPlayerFacingEdgeOfMap:
push hl
push de
push bc
@@ -152,7 +152,7 @@ IsPlayerFacingEdgeOfMap: ; c148 (3:4148)
scf
ret
-IsWarpTileInFrontOfPlayer: ; c197 (3:4197)
+IsWarpTileInFrontOfPlayer:
push hl
push de
push bc
@@ -178,7 +178,7 @@ IsWarpTileInFrontOfPlayer: ; c197 (3:4197)
pop hl
ret
-.warpTileListPointers: ; c1c0 (3:41c0)
+.warpTileListPointers:
dw .facingDownWarpTiles
dw .facingUpWarpTiles
dw .facingLeftWarpTiles
@@ -206,7 +206,7 @@ IsWarpTileInFrontOfPlayer: ; c197 (3:4197)
and a
jr .done
-IsPlayerStandingOnDoorTileOrWarpTile: ; c1e6 (3:41e6)
+IsPlayerStandingOnDoorTileOrWarpTile:
push hl
push de
push bc
@@ -233,4 +233,4 @@ IsPlayerStandingOnDoorTileOrWarpTile: ; c1e6 (3:41e6)
pop hl
ret
-INCLUDE "data/warp_tile_ids.asm" \ No newline at end of file
+INCLUDE "data/warp_tile_ids.asm"
diff --git a/engine/overworld/cinnabar_lab.asm b/engine/overworld/cinnabar_lab.asm
index f7c5e326..13313746 100755
--- a/engine/overworld/cinnabar_lab.asm
+++ b/engine/overworld/cinnabar_lab.asm
@@ -1,4 +1,4 @@
-GiveFossilToCinnabarLab: ; 61006 (18:5006)
+GiveFossilToCinnabarLab:
ld hl, wd730
set 6, [hl]
xor a
@@ -72,23 +72,23 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006)
call PrintText
ret
-LabFossil_610ae: ; 610ae (18:50ae)
+LabFossil_610ae:
TX_FAR _Lab4Text_610ae
db "@"
-LabFossil_610b3: ; 610b3 (18:50b3)
+LabFossil_610b3:
TX_FAR _Lab4Text_610b3
db "@"
-LabFossil_610b8: ; 610b8 (18:50b8)
+LabFossil_610b8:
TX_FAR _Lab4Text_610b8
db "@"
-LabFossil_610bd: ; 610bd (18:50bd)
+LabFossil_610bd:
TX_FAR _Lab4Text_610bd
db "@"
-PrintFossilsInBag: ; 610c2 (18:50c2)
+PrintFossilsInBag:
; Prints each fossil in the player's bag on a separate line in the menu.
ld hl, wFilteredBagItems
xor a
@@ -112,7 +112,7 @@ PrintFossilsInBag: ; 610c2 (18:50c2)
jr .loop
; loads the names of the fossil item and the resulting mon
-LoadFossilItemAndMonName: ; 610eb (18:50eb)
+LoadFossilItemAndMonName:
ld a, [wFossilMon]
ld [wd11e], a
call GetMonName
diff --git a/engine/overworld/clear_loadmapdata_vars.asm b/engine/overworld/clear_loadmapdata_vars.asm
index 2e7cd165..c5dc21fa 100644
--- a/engine/overworld/clear_loadmapdata_vars.asm
+++ b/engine/overworld/clear_loadmapdata_vars.asm
@@ -1,4 +1,4 @@
-ClearVariablesAfterLoadingMapData: ; c07c (3:407c)
+ClearVariablesAfterLoadingMapData:
ld a, $90
ld [hWY], a
ld [rWY], a
@@ -14,7 +14,7 @@ ClearVariablesAfterLoadingMapData: ; c07c (3:407c)
ld hl, wCardKeyDoorY
ld [hli], a
ld [hl], a
- ld hl, wWhichTrade
- ld bc, $1e
+ ld hl, wUnusedCD3D
+ ld bc, wStandingOnWarpPadOrHole - wUnusedCD3D
call FillMemory
- ret \ No newline at end of file
+ ret
diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm
index 488bc4de..462e3e8e 100755
--- a/engine/overworld/cut.asm
+++ b/engine/overworld/cut.asm
@@ -1,4 +1,4 @@
-UsedCut: ; edd1 (3:6dd1)
+UsedCut:
xor a
ld [wActionResultOrTookBattleTurn], a ; initialise to failure value
ld a, [wCurMapTileset]
@@ -67,11 +67,11 @@ UsedCut: ; edd1 (3:6dd1)
call UpdateSprites
jp RedrawMapView
-UsedCutText: ; ee6f (3:6e6f)
+UsedCutText:
TX_FAR _UsedCutText
db "@"
-InitCutAnimOAM: ; ee74 (3:6e74)
+InitCutAnimOAM:
xor a
ld [wWhichAnimationOffsets], a
ld a, %11100100
@@ -112,22 +112,22 @@ InitCutAnimOAM: ; ee74 (3:6e74)
jr nz, .loop
ret
-LoadCutGrassAnimationTilePattern: ; eecc (3:6ecc)
+LoadCutGrassAnimationTilePattern:
ld de, AnimationTileset2 + $60 ; tile depicting a leaf
lb bc, BANK(AnimationTileset2), $01
jp CopyVideoData
-WriteCutOrBoulderDustAnimationOAMBlock: ; eed5 (3:6ed5)
+WriteCutOrBoulderDustAnimationOAMBlock:
call GetCutOrBoulderDustAnimationOffsets
ld a, $9
ld de, CutOrBoulderDustAnimationTilesAndAttributes
jp WriteOAMBlock
-CutOrBoulderDustAnimationTilesAndAttributes: ; eee0 (3:6ee0)
+CutOrBoulderDustAnimationTilesAndAttributes:
db $FC,$14,$FD,$14
db $FE,$14,$FF,$14
-GetCutOrBoulderDustAnimationOffsets: ; eee8 (3:6ee8)
+GetCutOrBoulderDustAnimationOffsets:
ld hl, wSpriteStateData1 + 4
ld a, [hli] ; player's sprite screen Y position
ld b, a
@@ -158,14 +158,14 @@ GetCutOrBoulderDustAnimationOffsets: ; eee8 (3:6ee8)
ld c, a
ret
-CutAnimationOffsets: ; ef0f (3:6f0f)
+CutAnimationOffsets:
; Each pair represents the x and y pixels offsets from the player of where the cut tree animation should be drawn
db 8, 36 ; player is facing down
db 8, 4 ; player is facing up
db -8, 20 ; player is facing left
db 24, 20 ; player is facing right
-BoulderDustAnimationOffsets: ; ef17 (3:6f17)
+BoulderDustAnimationOffsets:
; Each pair represents the x and y pixels offsets from the player of where the cut tree animation should be drawn
; These offsets represent 2 blocks away from the player
db 8, 52 ; player is facing down
@@ -173,7 +173,7 @@ BoulderDustAnimationOffsets: ; ef17 (3:6f17)
db -24, 20 ; player is facing left
db 40, 20 ; player is facing right
-ReplaceTreeTileBlock: ; ef1f (3:6f1f)
+ReplaceTreeTileBlock:
; Determine the address of the tile block that contains the tile in front of the
; player (i.e. where the tree is) and replace it with the corresponding tile
; block that doesn't have the tree.
@@ -249,7 +249,7 @@ ReplaceTreeTileBlock: ; ef1f (3:6f1f)
ld [hl], a
ret
-CutTreeBlockSwaps: ; ef80 (3:6f80)
+CutTreeBlockSwaps:
; first byte = tileset block containing the cut tree
; second byte = corresponding tileset block after the cut animation happens
db $32, $6D
diff --git a/engine/overworld/cut2.asm b/engine/overworld/cut2.asm
index 9bb4ee2c..37490f95 100755
--- a/engine/overworld/cut2.asm
+++ b/engine/overworld/cut2.asm
@@ -1,4 +1,4 @@
-AnimCut: ; 7a037 (1e:6037)
+AnimCut:
ld a, [wCutTile]
cp $52
jr z, .grass
@@ -44,7 +44,7 @@ AnimCut: ; 7a037 (1e:6037)
jr nz, .cutGrassLoop
ret
-AnimCutGrass_UpdateOAMEntries: ; 7a091 (1e:6091)
+AnimCutGrass_UpdateOAMEntries:
push bc
ld hl, wOAMBuffer + $91
ld a, 1
@@ -76,7 +76,7 @@ AnimCutGrass_UpdateOAMEntries: ; 7a091 (1e:6091)
jr nz, AnimCutGrass_UpdateOAMEntries
ret
-AnimCutGrass_SwapOAMEntries: ; 7a0d7 (1e:60d7)
+AnimCutGrass_SwapOAMEntries:
ld hl, wOAMBuffer + $90
ld de, wBuffer
ld bc, $8
diff --git a/engine/overworld/daycare_exp.asm b/engine/overworld/daycare_exp.asm
index a7c7bd91..dbe4023a 100644
--- a/engine/overworld/daycare_exp.asm
+++ b/engine/overworld/daycare_exp.asm
@@ -1,4 +1,4 @@
-IncrementDayCareMonExp: ; c684 (3:4684)
+IncrementDayCareMonExp:
ld a, [wDayCareInUse]
and a
ret z
@@ -15,4 +15,4 @@ IncrementDayCareMonExp: ; c684 (3:4684)
ret c
ld a, $50
ld [hl], a
- ret \ No newline at end of file
+ ret
diff --git a/engine/overworld/doors.asm b/engine/overworld/doors.asm
index 3f7b5f0f..8bde8600 100755
--- a/engine/overworld/doors.asm
+++ b/engine/overworld/doors.asm
@@ -1,5 +1,5 @@
; returns whether the player is standing on a door tile in carry
-IsPlayerStandingOnDoorTile: ; 1a785 (6:6785)
+IsPlayerStandingOnDoorTile:
push de
ld hl, DoorTileIDPointers
ld a, [wCurMapTileset]
@@ -25,7 +25,7 @@ IsPlayerStandingOnDoorTile: ; 1a785 (6:6785)
and a
ret
-DoorTileIDPointers: ; 1a7a8 (6:67a8)
+DoorTileIDPointers:
dbw OVERWORLD, OverworldDoorTileIDs
dbw FOREST, ForestDoorTileIDs
dbw MART, MartDoorTileIDs
@@ -42,38 +42,38 @@ DoorTileIDPointers: ; 1a7a8 (6:67a8)
dbw INTERIOR, InteriorDoorTileIDs
db $ff
-OverworldDoorTileIDs: ; 1a7d3 (6:67d3)
+OverworldDoorTileIDs:
db $1B,$58,$00
-ForestDoorTileIDs: ; 1a7d6 (6:67d6)
+ForestDoorTileIDs:
db $3a,$00
-MartDoorTileIDs: ; 1a7d8 (6:67d8)
+MartDoorTileIDs:
db $5e,$00
-HouseDoorTileIDs: ; 1a7da (6:67da)
+HouseDoorTileIDs:
db $54,$00
-TilesetMuseumDoorTileIDs: ; 1a7dc (6:67dc)
+TilesetMuseumDoorTileIDs:
db $3b,$00
-ShipDoorTileIDs: ; 1a7de (6:67de)
+ShipDoorTileIDs:
db $1e,$00
-LobbyDoorTileIDs: ; 1a7e0 (6:67e0)
+LobbyDoorTileIDs:
db $1c,$38,$1a,$00
-MansionDoorTileIDs: ; 1a7e4 (6:67e4)
+MansionDoorTileIDs:
db $1a,$1c,$53,$00
-LabDoorTileIDs: ; 1a7e8 (6:67e8)
+LabDoorTileIDs:
db $34,$00
-FacilityDoorTileIDs: ; 1a7ea (6:67ea)
+FacilityDoorTileIDs:
db $43,$58,$1b,$00
-PlateauDoorTileIDs: ; 1a7ee (6:67ee)
+PlateauDoorTileIDs:
db $3b,$1b,$00
-InteriorDoorTileIDs: ; 1a7f1 (6:67f1)
+InteriorDoorTileIDs:
db $04,$15,$00
diff --git a/engine/overworld/dungeon_warps.asm b/engine/overworld/dungeon_warps.asm
index b234c3a1..f47dfb01 100644
--- a/engine/overworld/dungeon_warps.asm
+++ b/engine/overworld/dungeon_warps.asm
@@ -1,4 +1,4 @@
-IsPlayerOnDungeonWarp: ; 46bf3 (11:6bf3)
+IsPlayerOnDungeonWarp:
xor a
ld [wWhichDungeonWarp], a
ld a, [wd72d]
@@ -12,4 +12,4 @@ IsPlayerOnDungeonWarp: ; 46bf3 (11:6bf3)
set 4, [hl]
ld hl, wd732
set 4, [hl]
- ret \ No newline at end of file
+ ret
diff --git a/engine/overworld/elevator.asm b/engine/overworld/elevator.asm
index b355102f..cd7bf5ba 100755
--- a/engine/overworld/elevator.asm
+++ b/engine/overworld/elevator.asm
@@ -1,4 +1,4 @@
-ShakeElevator: ; 75f07 (1d:5f07)
+ShakeElevator:
ld de, -$20
call ShakeElevatorRedrawRow
ld de, SCREEN_HEIGHT * $20
@@ -37,7 +37,7 @@ ShakeElevator: ; 75f07 (1d:5f07)
call UpdateSprites
jp PlayDefaultMusic
-ShakeElevatorRedrawRow: ; 75f52 (1d:5f52)
+ShakeElevatorRedrawRow:
; This function is used to redraw certain portions of the screen, but it does
; not appear to ever result in any visible effect, so this function seems to
; be pointless.
diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm
index f002deed..3b02fd55 100755
--- a/engine/overworld/emotion_bubbles.asm
+++ b/engine/overworld/emotion_bubbles.asm
@@ -1,9 +1,9 @@
-EmotionBubble: ; 4116f (10:516f)
+EmotionBubble:
ld a, [wWhichEmotionBubble]
and $f
swap a
ld c, a
- ld b, $0
+ ld b, 0
ld hl, EmotionBubbles
add hl, bc ; each emotion bubble is 16 bytes, so calculate the offset directly instead of with a pointer table
add hl, bc
@@ -64,11 +64,11 @@ EmotionBubble: ; 4116f (10:516f)
call DelayFrame
call UpdateSprites
ret
- ; jp UpdateSprites
-EmotionBubblesOAM: ; 411dd (5:51dd)
+
+EmotionBubblesOAM:
db $F8,$00,$F9,$00
db $FA,$00,$FB,$00
-EmotionBubbles: ; 411e5 (10:51e5)
+EmotionBubbles:
INCBIN "gfx/emotion_bubbles.2bpp"
diff --git a/engine/overworld/get_coords_tile_in_front_of_player.asm b/engine/overworld/get_coords_tile_in_front_of_player.asm
index 1003570b..e8bbc660 100644
--- a/engine/overworld/get_coords_tile_in_front_of_player.asm
+++ b/engine/overworld/get_coords_tile_in_front_of_player.asm
@@ -1,7 +1,7 @@
-GetTileAndCoordsInFrontOfPlayer: ; c2d4 (3:42d1)
+GetTileAndCoordsInFrontOfPlayer:
call GetPredefRegisters
-_GetTileAndCoordsInFrontOfPlayer: ; c2d4 (3:42d4)
+_GetTileAndCoordsInFrontOfPlayer:
ld a, [wYCoord]
ld d, a
ld a, [wXCoord]
@@ -38,7 +38,7 @@ _GetTileAndCoordsInFrontOfPlayer: ; c2d4 (3:42d4)
ld [wTileInFrontOfPlayer], a
ret
-GetTileTwoStepsInFrontOfPlayer: ; c309 (3:4309)
+GetTileTwoStepsInFrontOfPlayer:
xor a
ld [$ffdb], a
ld hl, wYCoord
@@ -84,4 +84,4 @@ GetTileTwoStepsInFrontOfPlayer: ; c309 (3:4309)
ld c, a
ld [wTileInFrontOfBoulderAndBoulderCollisionResult], a
ld [wTileInFrontOfPlayer], a
- ret \ No newline at end of file
+ ret
diff --git a/engine/overworld/healing_machine.asm b/engine/overworld/healing_machine.asm
index daaf33b2..ed733d7d 100755
--- a/engine/overworld/healing_machine.asm
+++ b/engine/overworld/healing_machine.asm
@@ -1,5 +1,5 @@
-AnimateHealingMachine: ; 7048b (1c:448b)
- ld de, PokeCenterFlashingMonitorAndHealBall ; $44b7
+AnimateHealingMachine:
+ ld de, PokeCenterFlashingMonitorAndHealBall
ld hl, vChars0 + $7c0
lb bc, BANK(PokeCenterFlashingMonitorAndHealBall), $03 ; loads one too many tiles
call CopyVideoData
@@ -11,23 +11,23 @@ AnimateHealingMachine: ; 7048b (1c:448b)
ld a, [rOBP1]
push af
ld a, $e0
- ld [rOBP1], a ; $ff49
+ ld [rOBP1], a
call UpdateGBCPal_OBP1
ld hl, wOAMBuffer + $84
- ld de, PokeCenterOAMData ; $44d7
+ ld de, PokeCenterOAMData
call CopyHealingMachineOAM
ld a, 4
ld [wAudioFadeOutControl], a
call StopAllMusic
.waitLoop
ld a, [wAudioFadeOutControl]
- and a
- jr nz, .waitLoop
- ld a, [wPartyCount] ; wPartyCount
+ and a ; is fade-out finished?
+ jr nz, .waitLoop ; if not, check again
+ ld a, [wPartyCount]
ld b, a
.partyLoop
call CopyHealingMachineOAM
- ld a, $9e ; (SFX_02_4a - SFX_Headers_02) / 3
+ ld a, SFX_HEALING_MACHINE
call PlaySound
ld c, 30
call DelayFrames
@@ -38,32 +38,32 @@ AnimateHealingMachine: ; 7048b (1c:448b)
ld [wAudioSavedROMBank], a
jr nz, .next
call StopAllMusic
- ld a, $2 ; BANK(Music_PkmnHealed)
+ ld a, BANK(Music_PkmnHealed)
ld [wAudioROMBank], a
.next
- ld a, $e8 ; MUSIC_PKMN_HEALED
+ ld a, MUSIC_PKMN_HEALED
ld [wNewSoundID], a
call PlaySound
ld d, $28
call FlashSprite8Times
.waitLoop2
ld a, [wChannelSoundIDs]
- cp $e8 ; MUSIC_PKMN_HEALED
- jr z, .waitLoop2
+ cp MUSIC_PKMN_HEALED ; is the healed music still playing?
+ jr z, .waitLoop2 ; if so, check gain
ld c, 32
call DelayFrames
pop af
- ld [rOBP1], a ; $ff49
+ ld [rOBP1], a
call UpdateGBCPal_OBP1
pop hl
pop af
ld [hl], a
jp UpdateSprites
-PokeCenterFlashingMonitorAndHealBall: ; 7050b (1c:450b)
+PokeCenterFlashingMonitorAndHealBall:
INCBIN "gfx/pokecenter_ball.2bpp"
-PokeCenterOAMData: ; 7042b (1c:442b)
+PokeCenterOAMData:
db $24,$34,$7C,$14 ; heal machine monitor
db $2B,$30,$7D,$14 ; pokeballs 1-6
db $2B,$38,$7D,$34
@@ -73,7 +73,7 @@ PokeCenterOAMData: ; 7042b (1c:442b)
db $35,$38,$7D,$34
; d = value to xor with palette
-FlashSprite8Times: ; 70547 (1c:4547)
+FlashSprite8Times:
ld b, 8
.loop
ld a, [rOBP1]
@@ -86,7 +86,7 @@ FlashSprite8Times: ; 70547 (1c:4547)
jr nz, .loop
ret
-CopyHealingMachineOAM: ; 7055a (1c:455a)
+CopyHealingMachineOAM:
; copy one OAM entry and advance the pointers
ld a, [de]
inc de
diff --git a/engine/overworld/hidden_items.asm b/engine/overworld/hidden_items.asm
index 43a56658..15082847 100755
--- a/engine/overworld/hidden_items.asm
+++ b/engine/overworld/hidden_items.asm
@@ -1,4 +1,4 @@
-HiddenItems: ; 75f74 (1d:5f74)
+HiddenItems:
ld hl, HiddenItemCoords
call FindHiddenItemOrCoinsIndex
ld [wHiddenItemOrCoinsIndex], a
@@ -25,7 +25,7 @@ HiddenItems: ; 75f74 (1d:5f74)
INCLUDE "data/hidden_item_coords.asm"
-FoundHiddenItemText: ; 76050 (1d:6050)
+FoundHiddenItemText:
TX_FAR _FoundHiddenItemText
TX_ASM
ld a, [wHiddenObjectFunctionArgument] ; item ID
@@ -50,11 +50,11 @@ FoundHiddenItemText: ; 76050 (1d:6050)
call PrintText
jp TextScriptEnd
-HiddenItemBagFullText: ; 76089 (1d:6089)
+HiddenItemBagFullText:
TX_FAR _HiddenItemBagFullText
db "@"
-HiddenCoins: ; 7608e (1d:608e)
+HiddenCoins:
ld b, COIN_CASE
predef GetQuantityOfItemInBag
ld a, b
@@ -131,17 +131,17 @@ HiddenCoins: ; 7608e (1d:608e)
INCLUDE "data/hidden_coins.asm"
-FoundHiddenCoinsText: ; 76143 (1d:6143)
+FoundHiddenCoinsText:
TX_FAR _FoundHiddenCoinsText
db $10,"@"
-DroppedHiddenCoinsText: ; 76149 (1d:6149)
+DroppedHiddenCoinsText:
TX_FAR _FoundHiddenCoins2Text
db $10
TX_FAR _DroppedHiddenCoinsText
db "@"
-FindHiddenItemOrCoinsIndex: ; 76153 (1d:6153)
+FindHiddenItemOrCoinsIndex:
ld a, [wHiddenObjectY]
ld d, a
ld a, [wHiddenObjectX]
diff --git a/engine/overworld/hidden_objects.asm b/engine/overworld/hidden_objects.asm
index 6e515b5a..9a81dcfc 100755
--- a/engine/overworld/hidden_objects.asm
+++ b/engine/overworld/hidden_objects.asm
@@ -1,5 +1,5 @@
; if a hidden object was found, stores $00 in [hDidntFindAnyHiddenObject], else stores $ff
-CheckForHiddenObject: ; f25f8 (3c:65f8)
+CheckForHiddenObject:
ld hl, hItemAlreadyFound
xor a
ld [hli], a
@@ -60,7 +60,7 @@ CheckForHiddenObject: ; f25f8 (3c:65f8)
; checks if the coordinates in front of the player's sprite match Y in b and X in c
; [hCoordsInFrontOfPlayerMatch] = $00 if they match, $ff if they don't match
-CheckIfCoordsInFrontOfPlayerMatch: ; 46a01 (11:6a01)
+CheckIfCoordsInFrontOfPlayerMatch:
ld a, [wPlayerFacingDirection] ; player's sprite facing direction
cp SPRITE_FACING_UP
jr z, .facingUp
diff --git a/engine/overworld/is_player_just_outside_map.asm b/engine/overworld/is_player_just_outside_map.asm
index 19823c53..44690db0 100644
--- a/engine/overworld/is_player_just_outside_map.asm
+++ b/engine/overworld/is_player_just_outside_map.asm
@@ -1,5 +1,5 @@
; returns whether the player is one tile outside the map in Z
-IsPlayerJustOutsideMap: ; e876c (3a:476c)
+IsPlayerJustOutsideMap:
ld a, [wYCoord]
ld b, a
ld a, [wCurMapHeight]
diff --git a/engine/overworld/item.asm b/engine/overworld/item.asm
index e421a946..63eecef9 100644
--- a/engine/overworld/item.asm
+++ b/engine/overworld/item.asm
@@ -1,4 +1,4 @@
-PickUpItem: ; 4d55 (1:4d55)
+PickUpItem:
call EnableAutoTextBoxDrawing
ld a, [hSpriteIndexOrTextID]
@@ -44,11 +44,11 @@ PickUpItem: ; 4d55 (1:4d55)
call PrintText
ret
-FoundItemText: ; 4d9a (1:4d9a)
+FoundItemText:
TX_FAR _FoundItemText
db $0B
db "@"
-NoMoreRoomForItemText: ; 4da0 (1:4da0)
+NoMoreRoomForItemText:
TX_FAR _NoMoreRoomForItemText
db "@"
diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm
index 5d95cb18..e7874637 100755
--- a/engine/overworld/ledges.asm
+++ b/engine/overworld/ledges.asm
@@ -1,4 +1,4 @@
-HandleLedges: ; 1a7f4 (6:67f4)
+HandleLedges:
ld a, [wd736]
bit 6, a ; already jumping down ledge
ret nz
@@ -55,7 +55,7 @@ HandleLedges: ; 1a7f4 (6:67f4)
ret
; (player direction) (tile player standing on) (ledge tile) (input required)
-LedgeTiles: ; 1a851 (6:6851)
+LedgeTiles:
db SPRITE_FACING_DOWN, $2C,$37,D_DOWN
db SPRITE_FACING_DOWN, $39,$36,D_DOWN
db SPRITE_FACING_DOWN, $39,$37,D_DOWN
@@ -66,7 +66,7 @@ LedgeTiles: ; 1a851 (6:6851)
db SPRITE_FACING_RIGHT,$39,$0D,D_RIGHT
db $FF
-LoadHoppingShadowOAM: ; 1a872 (6:6872)
+LoadHoppingShadowOAM:
ld hl, vChars1 + $7f0
ld de, LedgeHoppingShadow
lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / $8
@@ -80,11 +80,11 @@ LoadHoppingShadowOAM: ; 1a872 (6:6872)
ld [wOAMBuffer + 39 * 4], a
ret
-LedgeHoppingShadow: ; 1a893 (6:6893)
+LedgeHoppingShadow:
INCBIN "gfx/ledge_hopping_shadow.1bpp"
LedgeHoppingShadowEnd:
-LedgeHoppingShadowOAM: ; 1a89b (6:689b)
+LedgeHoppingShadowOAM:
db $58,$48,$FF,$00
db $58,$50,$FF,$20
-LedgeHoppingShadowOAMEnd: ; 1a8a3 (6:68a3)
+LedgeHoppingShadowOAMEnd:
diff --git a/engine/overworld/load_tileset_header.asm b/engine/overworld/load_tileset_header.asm
index aeab3e24..05061651 100644
--- a/engine/overworld/load_tileset_header.asm
+++ b/engine/overworld/load_tileset_header.asm
@@ -1,4 +1,4 @@
-LoadTilesetHeader: ; c4f4 (3:44f4)
+LoadTilesetHeader:
call GetPredefRegisters
push hl
ld d, 0
@@ -48,4 +48,4 @@ LoadTilesetHeader: ; c4f4 (3:44f4)
INCLUDE "data/dungeon_tilesets.asm"
-INCLUDE "data/tileset_headers.asm" \ No newline at end of file
+INCLUDE "data/tileset_headers.asm"
diff --git a/engine/overworld/load_wild_data.asm b/engine/overworld/load_wild_data.asm
index 71e3fe2a..6444ab7e 100644
--- a/engine/overworld/load_wild_data.asm
+++ b/engine/overworld/load_wild_data.asm
@@ -1,4 +1,4 @@
-LoadWildData: ; cb62 (3:4b62)
+LoadWildData:
ld hl,WildDataPointers
ld a,[wCurMap]
@@ -30,4 +30,4 @@ LoadWildData: ; cb62 (3:4b62)
ld bc,$0014
jp CopyData
-INCLUDE "data/wild_mons.asm" \ No newline at end of file
+INCLUDE "data/wild_mons.asm"
diff --git a/engine/overworld/map_sprite_functions1.asm b/engine/overworld/map_sprite_functions1.asm
index 722fc14e..f0a718bd 100644
--- a/engine/overworld/map_sprite_functions1.asm
+++ b/engine/overworld/map_sprite_functions1.asm
@@ -1,4 +1,4 @@
-_UpdateSprites: ; 4bb7 (1:4bb7)
+_UpdateSprites:
ld h, wSpriteStateData1 / $100
inc h
ld a, $e ; (wSpriteStateData2 + $0e) & $ff
@@ -31,7 +31,7 @@ _UpdateSprites: ; 4bb7 (1:4bb7)
jp z, SpawnPikachu
ld a, [hl]
-UpdateNonPlayerSprite: ; 4be3 (1:4be3)
+UpdateNonPlayerSprite:
dec a
swap a
ld [$ff93], a ; $10 * sprite#
@@ -53,7 +53,7 @@ UpdateNonPlayerSprite: ; 4be3 (1:4be3)
; 9 values when the sprite is aligned with the grid: $fc, $0c, $1c, $2c, ..., $7c.
; The reason that 4 is added below to the coordinate is to make it align with a
; multiple of $10 to make comparisons easier.
-DetectCollisionBetweenSprites: ; 4bf7 (1:4bf7)
+DetectCollisionBetweenSprites:
; nop
ld h, wSpriteStateData1 / $100
@@ -336,7 +336,7 @@ DetectCollisionBetweenSprites: ; 4bf7 (1:4bf7)
; c = 0 if delta X/Y is 0
; c = 7 if delta X/Y is 1
; c = 9 if delta X/Y is -1
-Func_4d0a: ; 4d0a (1:4d0a)
+Func_4d0a:
ld a, [$ff91]
ld b, a
ld a, [$ff90]
@@ -356,7 +356,7 @@ Func_4d0a: ; 4d0a (1:4d0a)
inc l
ret
-SetSpriteCollisionValues: ; 4d22 (1:4d22)
+SetSpriteCollisionValues:
and a
ld b, 0
ld c, 0
@@ -371,7 +371,7 @@ SetSpriteCollisionValues: ; 4d22 (1:4d22)
.done
ret
-SpriteCollisionBitTable: ; 4d35 (1:4d35)
+SpriteCollisionBitTable:
db %00000000,%00000001
db %00000000,%00000010
db %00000000,%00000100
diff --git a/engine/overworld/map_sprites.asm b/engine/overworld/map_sprites.asm
index 10f0362e..32d3d47b 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: ; 1401b (5:401b)
+_InitMapSprites:
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)
@@ -19,7 +19,7 @@ _InitMapSprites: ; 1401b (5:401b)
; Loads sprite set for outside maps (cities and routes) and sets VRAM slots.
; sets carry if the map is a city or route, unsets carry if not
-InitOutsideMapSprites: ; 14029 (5:4029)
+InitOutsideMapSprites:
ld a, [wCurMap]
cp a, REDS_HOUSE_1F ; is the map a city or a route (map ID less than $25)?
ret nc ; if not, return
@@ -50,7 +50,7 @@ InitOutsideMapSprites: ; 14029 (5:4029)
scf
ret
-LoadSpriteSetFromMapHeader: ; 14061 (5:4061)
+LoadSpriteSetFromMapHeader:
; This loop stores the correct VRAM tile pattern slots according the sprite
; data from the map's header. Since the VRAM tile pattern slots are filled in
; the order of the sprite set, in order to find the VRAM tile pattern slot
@@ -93,7 +93,7 @@ LoadSpriteSetFromMapHeader: ; 14061 (5:4061)
jr nz, .storeVRAMSlotsLoop
ret
-CheckIfPictureIDAlreadyLoaded: ; 1409b (5:409b)
+CheckIfPictureIDAlreadyLoaded:
; Check if the current picture ID has already had its tile patterns loaded.
; This done by looping through the previous sprite slots and seeing if any of
; their picture ID's match that of the current sprite slot.
@@ -118,7 +118,7 @@ CheckIfPictureIDAlreadyLoaded: ; 1409b (5:409b)
scf
ret
-CheckForFourTileSprite: ; 140ac (5:40ac)
+CheckForFourTileSprite:
; Checks for a sprite added in yellow
; Returns no carry if the sprite is Pikachu, as its sprite is handled separately
; Else, returns carry if the sprite uses 4 tiles
@@ -135,7 +135,7 @@ CheckForFourTileSprite: ; 140ac (5:40ac)
scf
ret
-LoadMapSpriteTilePatterns: ; 140b7 (5:40b7)
+LoadMapSpriteTilePatterns:
ld a, 0
.loop
ld [hVRAMSlot], a
@@ -154,7 +154,7 @@ LoadMapSpriteTilePatterns: ; 140b7 (5:40b7)
jr nz, .loop
ret
-ReloadWalkingTilePatterns: ; 140d2 (5:40d2)
+ReloadWalkingTilePatterns:
xor a
.loop
ld [hVRAMSlot], a
@@ -168,7 +168,7 @@ ReloadWalkingTilePatterns: ; 140d2 (5:40d2)
jr nz, .loop
ret
-LoadStillTilePattern: ; 140e4 (5:40e4)
+LoadStillTilePattern:
ld a, [wFontLoaded]
bit 0, a ; reloading upper half of tile patterns after displaying text?
ret nz ; if so, skip loading data into the lower half
@@ -178,7 +178,7 @@ LoadStillTilePattern: ; 140e4 (5:40e4)
call CopyVideoDataAlternate ; new yellow function
ret
-LoadWalkingTilePattern: ; 140f5 (5:40f5)
+LoadWalkingTilePattern:
call ReadSpriteSheetData
ret nc
ld hl, $c0
@@ -190,7 +190,7 @@ LoadWalkingTilePattern: ; 140f5 (5:40f5)
call CopyVideoDataAlternate
ret
-GetSpriteVRAMAddress: ; 14018 (5:4108)
+GetSpriteVRAMAddress:
push bc
ld a, [hVRAMSlot]
ld c, a
@@ -204,7 +204,7 @@ GetSpriteVRAMAddress: ; 14018 (5:4108)
pop bc
ret
-SpriteVRAMAddresses: ; 14118 (5:4118)
+SpriteVRAMAddresses:
; Equivalent to multiplying $C0 (number of bytes in 12 tiles) times the VRAM
; slot and adding the result to $8000 (the VRAM base address).
dw vChars0 + $0c0
@@ -219,7 +219,7 @@ SpriteVRAMAddresses: ; 14118 (5:4118)
dw vChars0 + $780 ; 4-tile sprites
dw vChars0 + $7c0 ; 4-tile sprites
-ReadSpriteSheetData: ; 1412e (5:412e)
+ReadSpriteSheetData:
ld a, [hVRAMSlot]
ld e, a
ld d, 0
@@ -249,7 +249,7 @@ ReadSpriteSheetData: ; 1412e (5:412e)
scf
ret
-Func_14150: ; 14150 (5:4150)
+Func_14150:
ld a, $1
ld [wPlayerSpriteImageBaseOffset], a ; vram slot for player
ld a, $2
@@ -275,7 +275,7 @@ Func_14150: ; 14150 (5:4150)
jr nz, .loop
ret
-Func_14179: ; 14179 (5:4179)
+Func_14179:
push de
push bc
ld c, a ; c = picture ID
@@ -298,7 +298,7 @@ Func_14179: ; 14179 (5:4179)
pop de
ret
-GetSplitMapSpriteSetID: ; 14193 (5:4193)
+GetSplitMapSpriteSetID:
ld e, a
ld d, 0
ld hl, MapSpriteSets
@@ -328,7 +328,6 @@ GetSplitMapSpriteSetID: ; 14193 (5:4193)
.northSouthDivide
ld a, [wYCoord]
jr .compareCoord
-
.eastWestDivide
ld a, [wXCoord]
.compareCoord
diff --git a/engine/overworld/missable_objects.asm b/engine/overworld/missable_objects.asm
index 1cc15be5..dd601451 100644
--- a/engine/overworld/missable_objects.asm
+++ b/engine/overworld/missable_objects.asm
@@ -1,4 +1,4 @@
-MarkTownVisitedAndLoadMissableObjects: ; ef93 (3:6f93)
+MarkTownVisitedAndLoadMissableObjects:
ld a, [wCurMap]
cp ROUTE_1
jr nc, .notInTown
@@ -17,7 +17,7 @@ MarkTownVisitedAndLoadMissableObjects: ; ef93 (3:6f93)
ld h, [hl]
; fall through
-; LoadMissableObjects: ; efb2 (3:6fb2)
+; LoadMissableObjects:
; seems to not exist in yellow (predef replaced with something near TryPushingBoulder)
ld l, a
push hl
@@ -64,7 +64,7 @@ MarkTownVisitedAndLoadMissableObjects: ; ef93 (3:6f93)
ld [de], a ; write sentinel
ret
-InitializeMissableObjectsFlags: ; eff1 (3:6ff1)
+InitializeMissableObjectsFlags:
ld hl, wMissableObjectFlags
ld bc, wMissableObjectFlagsEnd - wMissableObjectFlags
xor a
@@ -95,7 +95,7 @@ InitializeMissableObjectsFlags: ; eff1 (3:6ff1)
jr .missableObjectsLoop
; tests if current sprite is a missable object that is hidden/has been removed
-IsObjectHidden: ; f022 (3:7022)
+IsObjectHidden:
ld a, [H_CURRENTSPRITEOFFSET]
swap a
ld b, a
@@ -122,7 +122,7 @@ IsObjectHidden: ; f022 (3:7022)
; adds missable object (items, leg. pokemon, etc.) to the map
; [wMissableObjectIndex]: index of the missable object to be added (global index)
-ShowObject: ; f044 (3:7044)
+ShowObject:
ShowObject2:
ld hl, wMissableObjectFlags
ld a, [wMissableObjectIndex]
@@ -133,7 +133,7 @@ ShowObject2:
; removes missable object (items, leg. pokemon, etc.) from the map
; [wMissableObjectIndex]: index of the missable object to be removed (global index)
-HideObject: ; f053 (3:7053)
+HideObject:
ld hl, wMissableObjectFlags
ld a, [wMissableObjectIndex]
ld c, a
@@ -141,7 +141,7 @@ HideObject: ; f053 (3:7053)
call MissableObjectFlagAction ; set "removed" flag
jp UpdateSprites
-MissableObjectFlagAction: ; f062 (3:7062)
+MissableObjectFlagAction:
; identical to FlagAction
push hl
diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm
index d69e2fbc..ad4515ff 100644
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -1,4 +1,4 @@
-UpdatePlayerSprite: ; 4da5 (1:4da5)
+UpdatePlayerSprite:
ld a, [wSpriteStateData2]
and a
jr z, .checkIfTextBoxInFrontOfSprite
@@ -86,7 +86,7 @@ UpdatePlayerSprite: ; 4da5 (1:4da5)
ld [wSpriteStateData2 + $07], a
ret
-Func_4e32: ; 4e32 (1:4e32)
+Func_4e32:
ld a, [wSpriteStateData1 + 8]
ld b, a
ld a, [wPlayerFacingDirection]
@@ -94,7 +94,7 @@ Func_4e32: ; 4e32 (1:4e32)
ld [wSpriteStateData1 + 2], a
ret
-UpdateNPCSprite: ; 4e3e (1:4e3e)
+UpdateNPCSprite:
ld a, [H_CURRENTSPRITEOFFSET]
swap a
dec a
@@ -242,7 +242,7 @@ UpdateNPCSprite: ; 4e3e (1:4e3e)
jr TryWalking
; changes facing direction by zeroing the movement delta and calling TryWalking
-ChangeFacingDirection: ; 4f43 (1:4f43)
+ChangeFacingDirection:
ld de, $0
; fall through
@@ -252,7 +252,7 @@ ChangeFacingDirection: ; 4f43 (1:4f43)
; e: X movement delta (-1, 0 or 1)
; hl: pointer to tile the sprite would walk onto
; set carry on failure, clears carry on success
-TryWalking: ; 4f46 (1:4f46)
+TryWalking:
push hl
call Func_5337
pop hl
@@ -271,7 +271,7 @@ TryWalking: ; 4f46 (1:4f46)
jp UpdateSpriteImage
; update the walking animation parameters for a sprite that is currently walking
-UpdateSpriteInWalkingAnimation: ; 4f61 (1:4f61)
+UpdateSpriteInWalkingAnimation:
call Func_5274
.noNextAnimationFrame
ld a, [H_CURRENTSPRITEOFFSET]
@@ -330,7 +330,7 @@ UpdateSpriteInWalkingAnimation: ; 4f61 (1:4f61)
ret
; update delay value (c2x8) for sprites in the delayed state (c1x1)
-UpdateSpriteMovementDelay: ; 4fa9 (1:4fa9)
+UpdateSpriteMovementDelay:
ld h, $c2
ld a, [H_CURRENTSPRITEOFFSET]
add $6
@@ -351,7 +351,7 @@ UpdateSpriteMovementDelay: ; 4fa9 (1:4fa9)
inc a
ld l, a
ld [hl], $1 ; c1x1 = 1 (mark as ready to move)
-notYetMoving: ; 4fc5 (1:4fc5)
+notYetMoving:
ld h, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $8
@@ -359,7 +359,7 @@ notYetMoving: ; 4fc5 (1:4fc5)
ld [hl], $0 ; c1x8 = 0 (walk animation frame)
jp UpdateSpriteImage
-MakeNPCFacePlayer: ; 507f (1:507f)
+MakeNPCFacePlayer:
; Make an NPC face the player if the player has spoken to him or her.
; Check if the behaviour of the NPC facing the player when spoken to is
@@ -392,7 +392,7 @@ MakeNPCFacePlayer: ; 507f (1:507f)
ld [hl], c ; c1x9: set facing direction
jr notYetMoving
-InitializeSpriteStatus: ; 4fff (1:4fff)
+InitializeSpriteStatus:
ld [hl], $1 ; $c1x1: set movement status to ready
inc l
ld [hl], $ff ; $c1x2: set sprite image to $ff (invisible/off screen)
@@ -407,7 +407,7 @@ InitializeSpriteStatus: ; 4fff (1:4fff)
ret
; calculates the spprite's scrren position form its map position and the player position
-InitializeSpriteScreenPosition: ; 5012 (1:5012)
+InitializeSpriteScreenPosition:
ld h, wSpriteStateData2 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $4
@@ -430,7 +430,7 @@ InitializeSpriteScreenPosition: ; 5012 (1:5012)
ld [hl], a ; c1x6 (screen X position)
ret
-Func_5033: ; 5033 (1:5033)
+Func_5033:
jr nc, .asm_503c
cpl
inc a
@@ -443,7 +443,7 @@ Func_5033: ; 5033 (1:5033)
ret
; tests if sprite is off screen or otherwise unable to do anything
-CheckSpriteAvailability: ; 503f (1:503f)
+CheckSpriteAvailability:
predef IsObjectHidden
ld a, [$ffe5]
and a
@@ -524,7 +524,7 @@ CheckSpriteAvailability: ; 503f (1:503f)
.done
ret
-UpdateSpriteImage: ; 50ba (1:50ba)
+UpdateSpriteImage:
ld h, $c1
ld a, [H_CURRENTSPRITEOFFSET]
add $8
@@ -549,7 +549,7 @@ UpdateSpriteImage: ; 50ba (1:50ba)
; d: Y movement delta (-1, 0 or 1)
; e: X movement delta (-1, 0 or 1)
; set carry on failure, clears carry on success
-CanWalkOntoTile: ; 50d1 (1:50d1)
+CanWalkOntoTile:
ld h, wSpriteStateData2 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $6
@@ -658,7 +658,7 @@ CanWalkOntoTile: ; 50d1 (1:50d1)
; calculates the tile pointer pointing to the tile the current sprite stancs on
; this is always the lower left tile of the 2x2 tile blocks all sprites are snapped to
; hl: output pointer
-GetTileSpriteStandsOn: ; 516a (1:516a)
+GetTileSpriteStandsOn:
ld h, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $4
@@ -687,7 +687,7 @@ GetTileSpriteStandsOn: ; 516a (1:516a)
ret
; loads [de+a] into a
-LoadDEPlusA: ; 5192 (1:5192)
+LoadDEPlusA:
add e
ld e, a
jr nc, .noCarry
@@ -696,7 +696,7 @@ LoadDEPlusA: ; 5192 (1:5192)
ld a, [de]
ret
-DoScriptedNPCMovement: ; 5199 (1:5199)
+DoScriptedNPCMovement:
; This is an alternative method of scripting an NPC's movement and is only used
; a few times in the game. It is used when the NPC and player must walk together
; in sync, such as when the player is following the NPC somewhere. An NPC can't
@@ -767,23 +767,23 @@ DoScriptedNPCMovement: ; 5199 (1:5199)
inc [hl]
ret
-InitScriptedNPCMovement: ; 5209 (1:5209)
+InitScriptedNPCMovement:
xor a
ld [wNPCMovementDirections2Index], a
ld a, 8
ld [wScriptedNPCWalkCounter], a
jp AnimScriptedNPCMovement
-GetSpriteScreenYPointer: ; 5215 (1:5215)
+GetSpriteScreenYPointer:
ld a, $4
ld b, a
jr GetSpriteScreenXYPointerCommon
-GetSpriteScreenXPointer: ; 521a (1:521a)
+GetSpriteScreenXPointer:
ld a, $6
ld b, a
-GetSpriteScreenXYPointerCommon: ; 521d (1:521d)
+GetSpriteScreenXYPointerCommon:
ld hl, wSpriteStateData1
ld a, [H_CURRENTSPRITEOFFSET]
add l
@@ -791,7 +791,7 @@ GetSpriteScreenXYPointerCommon: ; 521d (1:521d)
ld l, a
ret
-AnimScriptedNPCMovement: ; 5226 (1:5226)
+AnimScriptedNPCMovement:
ld hl, wSpriteStateData2
ld a, [H_CURRENTSPRITEOFFSET]
add $e
@@ -830,7 +830,7 @@ AnimScriptedNPCMovement: ; 5226 (1:5226)
ld [hl], a
ret
-AdvanceScriptedNPCAnimFrameCounter: ; 5264 (1:5264)
+AdvanceScriptedNPCAnimFrameCounter:
call Func_5274
ld h, wSpriteStateData1 / $100
ld a, [H_CURRENTSPRITEOFFSET]
@@ -841,7 +841,7 @@ AdvanceScriptedNPCAnimFrameCounter: ; 5264 (1:5264)
ld [hSpriteAnimFrameCounter], a
ret
-Func_5274: ; 5274 (1:5274)
+Func_5274:
ld a, [H_CURRENTSPRITEOFFSET]
add $7
ld l, a
@@ -858,7 +858,7 @@ Func_5274: ; 5274 (1:5274)
ld [hl], a ; advance to next animation frame every 4 ticks (16 ticks total for one step)
ret
-Func_5288: ; 5288 (1:5288)
+Func_5288:
; nice lookup table
; a is supposedly [wNPCMovementDirections + $fe]
cp $5
@@ -957,27 +957,27 @@ Func_5288: ; 5288 (1:5288)
scf
ret
-Func_531f: ; 531f (1:531f)
+Func_531f:
lb de, 1, 0
ld c, SPRITE_FACING_DOWN
ret
-Func_5325: ; 5325 (1:5325)
+Func_5325:
lb de, -1, 0
ld c, SPRITE_FACING_UP
ret
-Func_532b: ; 532b (1:532b)
+Func_532b:
lb de, 0, 1
ld c, SPRITE_FACING_RIGHT
ret
-Func_5331: ; 5331 (1:5331)
+Func_5331:
lb de, 0, -1
ld c, SPRITE_FACING_LEFT
ret
-Func_5337: ; 5337 (1:5337)
+Func_5337:
ld a, [H_CURRENTSPRITEOFFSET]
add $9
ld l, a
@@ -992,7 +992,7 @@ Func_5337: ; 5337 (1:5337)
ld [hl], e ; c1x5 (update X movement delta)
ret
-Func_5349: ; 5349 (1:5349)
+Func_5349:
ld h, wSpriteStateData2 / $100
ld a, [H_CURRENTSPRITEOFFSET]
add $4
@@ -1005,7 +1005,7 @@ Func_5349: ; 5349 (1:5349)
ld [hl], a ; update X position
ret
-Func_5357: ; 5357 (1:5357)
+Func_5357:
call Func_5274
ld a, [H_CURRENTSPRITEOFFSET]
add $3
@@ -1062,4 +1062,4 @@ Func_5357: ; 5357 (1:5357)
inc l
ld c, [hl]
ld [hl], a
- ret \ No newline at end of file
+ ret
diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm
index 07abd44f..333779fa 100755
--- a/engine/overworld/npc_movement.asm
+++ b/engine/overworld/npc_movement.asm
@@ -1,4 +1,4 @@
-PlayerStepOutFromDoor: ; 1a4ea (6:64ea)
+PlayerStepOutFromDoor:
ld hl, wd730
res 1, [hl]
call IsPlayerStandingOnDoorTile
@@ -27,7 +27,7 @@ PlayerStepOutFromDoor: ; 1a4ea (6:64ea)
res 7, [hl]
ret
-_EndNPCMovementScript: ; 1a527 (6:6527)
+_EndNPCMovementScript:
ld hl, wd730
res 7, [hl]
ld hl, wd72e
@@ -44,14 +44,14 @@ _EndNPCMovementScript: ; 1a527 (6:6527)
ld [wSimulatedJoypadStatesEnd], a
ret
-PalletMovementScriptPointerTable: ; 1a54c (6:654c)
+PalletMovementScriptPointerTable:
dw PalletMovementScript_OakMoveLeft
dw PalletMovementScript_PlayerMoveLeft
dw PalletMovementScript_WaitAndWalkToLab
dw PalletMovementScript_WalkToLab
dw PalletMovementScript_Done
-PalletMovementScript_OakMoveLeft: ; 1a556 (6:6556)
+PalletMovementScript_OakMoveLeft:
ld a, [wXCoord]
sub $a
ld [wNumStepsToTake], a
@@ -89,7 +89,7 @@ PalletMovementScript_OakMoveLeft: ; 1a556 (6:6556)
ld [wJoyIgnore], a
ret
-PalletMovementScript_PlayerMoveLeft: ; 1a597 (6:6597)
+PalletMovementScript_PlayerMoveLeft:
ld a, [wd730]
bit 0, a ; is an NPC being moved by a script?
ret nz ; return if Oak is still moving
@@ -102,12 +102,12 @@ PalletMovementScript_PlayerMoveLeft: ; 1a597 (6:6597)
ld [wNPCMovementScriptFunctionNum], a
ret
-PalletMovementScript_WaitAndWalkToLab: ; 1a5b3 (6:65b3)
+PalletMovementScript_WaitAndWalkToLab:
ld a, [wSimulatedJoypadStatesIndex]
and a ; is the player done moving left yet?
ret nz
-PalletMovementScript_WalkToLab: ; 1a5b8 (6:65b8)
+PalletMovementScript_WalkToLab:
xor a
ld [wOverrideSimulatedJoypadStatesMask], a
ld a, [wSpriteIndex]
@@ -132,7 +132,7 @@ PalletMovementScript_WalkToLab: ; 1a5b8 (6:65b8)
ret
-RLEList_ProfOakWalkToLab: ; 1a5ee (6:65ee)
+RLEList_ProfOakWalkToLab:
db NPC_MOVEMENT_DOWN, $06 ; differs from red
db NPC_MOVEMENT_LEFT, $01
db NPC_MOVEMENT_DOWN, $05
@@ -141,7 +141,7 @@ RLEList_ProfOakWalkToLab: ; 1a5ee (6:65ee)
db $E0, $01 ; stand still
db $FF
-RLEList_PlayerWalkToLab: ; 1a5fb (6:65fb)
+RLEList_PlayerWalkToLab:
db D_UP, $02
db D_RIGHT, $03
db D_DOWN, $05
@@ -149,7 +149,7 @@ RLEList_PlayerWalkToLab: ; 1a5fb (6:65fb)
db D_DOWN, $07 ; differs from red
db $FF
-PalletMovementScript_Done: ; 1a606 (6:6606)
+PalletMovementScript_Done:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
@@ -162,11 +162,11 @@ PalletMovementScript_Done: ; 1a606 (6:6606)
res 7, [hl]
jp EndNPCMovementScript
-PewterMuseumGuyMovementScriptPointerTable: ; 1a622 (6:6622)
+PewterMuseumGuyMovementScriptPointerTable:
dw PewterMovementScript_WalkToMuseum
dw PewterMovementScript_Done
-PewterMovementScript_WalkToMuseum: ; 1a626 (6:6626)
+PewterMovementScript_WalkToMuseum:
ld a, BANK(Music_MuseumGuy)
ld c, a
ld a, MUSIC_MUSEUM_GUY
@@ -192,21 +192,21 @@ PewterMovementScript_WalkToMuseum: ; 1a626 (6:6626)
ld [wNPCMovementScriptFunctionNum], a
ret
-RLEList_PewterMuseumPlayer: ; 1a661 (6:6661)
+RLEList_PewterMuseumPlayer:
db 0, $01
db D_UP, $03
db D_LEFT, $0D
db D_UP, $06
db $FF
-RLEList_PewterMuseumGuy: ; 1a66a (6:666a)
+RLEList_PewterMuseumGuy:
db NPC_MOVEMENT_UP, $06
db NPC_MOVEMENT_LEFT, $0D
db NPC_MOVEMENT_UP, $03
db NPC_MOVEMENT_LEFT, $01
db $FF
-PewterMovementScript_Done: ; 1a673 (6:6673)
+PewterMovementScript_Done:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
@@ -216,11 +216,11 @@ PewterMovementScript_Done: ; 1a673 (6:6673)
res 7, [hl]
jp EndNPCMovementScript
-PewterGymGuyMovementScriptPointerTable: ; 1a685 (6:6685)
+PewterGymGuyMovementScriptPointerTable:
dw PewterMovementScript_WalkToGym
dw PewterMovementScript_Done
-PewterMovementScript_WalkToGym: ; 1a689 (6:6689)
+PewterMovementScript_WalkToGym:
ld a, BANK(Music_MuseumGuy)
ld c, a
ld a, MUSIC_MUSEUM_GUY
@@ -249,7 +249,7 @@ PewterMovementScript_WalkToGym: ; 1a689 (6:6689)
ld [wNPCMovementScriptFunctionNum], a
ret
-RLEList_PewterGymPlayer: ; 1a6cb (6:66cb)
+RLEList_PewterGymPlayer:
db 0, $01
db D_RIGHT, $02
db D_DOWN, $05
@@ -258,7 +258,7 @@ RLEList_PewterGymPlayer: ; 1a6cb (6:66cb)
db D_LEFT, $0F
db $FF
-RLEList_PewterGymGuy: ; 1a6cd8 (6:66d8)
+RLEList_PewterGymGuy:
db NPC_MOVEMENT_DOWN, $02
db NPC_MOVEMENT_LEFT, $0F
db NPC_MOVEMENT_UP, $05
diff --git a/engine/overworld/npc_movement_2.asm b/engine/overworld/npc_movement_2.asm
index c5e11aa0..06ee9319 100755
--- a/engine/overworld/npc_movement_2.asm
+++ b/engine/overworld/npc_movement_2.asm
@@ -1,4 +1,4 @@
-FreezeEnemyTrainerSprite: ; eaa02 (3a:6a02)
+FreezeEnemyTrainerSprite:
ld a, [wCurMap]
cp POKEMONTOWER_7
ret z ; the Rockets on Pokemon Tower 7F leave after battling, so don't freeze them
@@ -17,7 +17,7 @@ FreezeEnemyTrainerSprite: ; eaa02 (3a:6a02)
ld [H_SPRITEINDEX], a
jp SetSpriteMovementBytesToFF
-RivalIDs: ; eaa20 (3a:6a20)
+RivalIDs:
db OPP_SONY1
db OPP_SONY2
db OPP_SONY3
diff --git a/engine/overworld/npc_pathfinding.asm b/engine/overworld/npc_pathfinding.asm
index ed7db530..f3d23b7c 100644
--- a/engine/overworld/npc_pathfinding.asm
+++ b/engine/overworld/npc_pathfinding.asm
@@ -1,4 +1,4 @@
-FindPathToPlayer: ; f74a (3:774a)
+FindPathToPlayer:
xor a
ld hl, hFindPathNumSteps
ld [hli], a ; hFindPathNumSteps
@@ -74,7 +74,7 @@ FindPathToPlayer: ; f74a (3:774a)
ld [hl], $ff
ret
-CalcPositionOfPlayerRelativeToNPC: ; f7b9 (3:77b9)
+CalcPositionOfPlayerRelativeToNPC:
xor a
ld [hNPCPlayerRelativePosFlags], a
ld a, [wSpriteStateData1 + 4] ; player's sprite screen Y position in pixels
@@ -151,7 +151,7 @@ CalcPositionOfPlayerRelativeToNPC: ; f7b9 (3:77b9)
ld [hNPCPlayerRelativePosFlags], a
ret
-ConvertNPCMovementDirectionsToJoypadMasks: ; f830 (3:7830)
+ConvertNPCMovementDirectionsToJoypadMasks:
ld a, [hNPCMovementDirections2Index]
ld [wNPCMovementDirections2Index], a
dec a
@@ -172,7 +172,7 @@ ConvertNPCMovementDirectionsToJoypadMasks: ; f830 (3:7830)
jr nz, .loop
ret
-ConvertNPCMovementDirectionToJoypadMask: ; f84f (3:784f)
+ConvertNPCMovementDirectionToJoypadMask:
push hl
ld b, a
ld hl, NPCMovementDirectionsToJoypadMasksTable
@@ -190,7 +190,7 @@ ConvertNPCMovementDirectionToJoypadMask: ; f84f (3:784f)
pop hl
ret
-NPCMovementDirectionsToJoypadMasksTable: ; f862 (3:7862)
+NPCMovementDirectionsToJoypadMasksTable:
db NPC_MOVEMENT_UP, D_UP
db NPC_MOVEMENT_DOWN, D_DOWN
db NPC_MOVEMENT_LEFT, D_LEFT
@@ -198,4 +198,4 @@ NPCMovementDirectionsToJoypadMasksTable: ; f862 (3:7862)
db $ff
; unreferenced
- ret \ No newline at end of file
+ ret
diff --git a/engine/overworld/oaks_aide.asm b/engine/overworld/oaks_aide.asm
index d412d8ec..54ba6b7a 100755
--- a/engine/overworld/oaks_aide.asm
+++ b/engine/overworld/oaks_aide.asm
@@ -1,4 +1,4 @@
-OaksAideScript: ; 58ecc (16:4ecc)
+OaksAideScript:
ld hl, OaksAideHiText
call PrintText
call YesNoChoice
@@ -45,27 +45,27 @@ OaksAideScript: ; 58ecc (16:4ecc)
ld [hOaksAideResult], a
ret
-OaksAideHiText: ; 58f28 (16:4f28)
+OaksAideHiText:
TX_FAR _OaksAideHiText
db "@"
-OaksAideUhOhText: ; 58f2d (16:4f2d)
+OaksAideUhOhText:
TX_FAR _OaksAideUhOhText
db "@"
-OaksAideComeBackText: ; 58f32 (16:4f32)
+OaksAideComeBackText:
TX_FAR _OaksAideComeBackText
db "@"
-OaksAideHereYouGoText: ; 58f37 (16:4f37)
+OaksAideHereYouGoText:
TX_FAR _OaksAideHereYouGoText
db "@"
-OaksAideGotItemText: ; 58f3c (16:4f3c)
+OaksAideGotItemText:
TX_FAR _OaksAideGotItemText
db $0b
db "@"
-OaksAideNoRoomText: ; 58f41 (16:4f41)
+OaksAideNoRoomText:
TX_FAR _OaksAideNoRoomText
db "@"
diff --git a/engine/overworld/oam.asm b/engine/overworld/oam.asm
index ede025cd..5a831327 100644
--- a/engine/overworld/oam.asm
+++ b/engine/overworld/oam.asm
@@ -1,4 +1,4 @@
-PrepareOAMData: ; 499b (1:499b)
+PrepareOAMData:
; Determine OAM data for currently visible
; sprites and write it to wOAMBuffer.
; Yellow code has been changed to use registers more efficiently
@@ -8,7 +8,7 @@ PrepareOAMData: ; 499b (1:499b)
dec a
jr z, .updateEnabled
- cp $ff
+ cp -1
ret nz
ld [wUpdateSpritesEnabled], a
jp HideSprites
@@ -164,7 +164,7 @@ PrepareOAMData: ; 499b (1:499b)
jr nz, .clearLoop
ret
-GetSpriteScreenXY: ; 4a5f (1:4a5f)
+GetSpriteScreenXY:
inc e
inc e
ld a, [de] ; c1x4
@@ -186,7 +186,7 @@ GetSpriteScreenXY: ; 4a5f (1:4a5f)
ld [de], a ; c1xb (x)
ret
-Func_4a7b: ; 4a7b (1:4a7b)
+Func_4a7b:
push bc
ld a, [wd5cd] ; temp copy of c1x2
swap a ; high nybble determines sprite used (0 is always player sprite, next are some npcs)
@@ -212,7 +212,7 @@ Func_4a7b: ; 4a7b (1:4a7b)
INCLUDE "engine/oam_dma.asm"
-_IsTilePassable:: ; 4aaa (1:4aaa)
+_IsTilePassable::
ld hl,wTilesetCollisionPtr ; pointer to list of passable tiles
ld a,[hli]
ld h,[hl]
@@ -229,4 +229,4 @@ _IsTilePassable:: ; 4aaa (1:4aaa)
scf
ret
-INCLUDE "data/collision.asm" ; probably \ No newline at end of file
+INCLUDE "data/collision.asm" ; probably
diff --git a/engine/overworld/pewter_guys.asm b/engine/overworld/pewter_guys.asm
index ff3c6152..532fa4bf 100755
--- a/engine/overworld/pewter_guys.asm
+++ b/engine/overworld/pewter_guys.asm
@@ -1,4 +1,4 @@
-PewterGuys: ; 1a6e5 (6:66e5)
+PewterGuys:
ld hl, wSimulatedJoypadStatesEnd
ld a, [wSimulatedJoypadStatesIndex]
dec a ; this decrement causes it to overwrite the last byte before $FF in the list
@@ -48,14 +48,14 @@ PewterGuys: ; 1a6e5 (6:66e5)
inc hl
jr .findMatchingCoordsLoop
-PointerTable_37ce6: ; 1a72a (6:672a)
+PointerTable_37ce6:
dw PewterMuseumGuyCoords
dw PewterGymGuyCoords
; these are the four coordinates of the spaces below, above, to the left and
; to the right of the museum guy, and pointers to different movements for
; the player to make to get positioned before the main movement.
-PewterMuseumGuyCoords: ; 1a72e (6:672e)
+PewterMuseumGuyCoords:
db 18, 27
dw .down
db 16, 27
@@ -78,7 +78,7 @@ PewterMuseumGuyCoords: ; 1a72e (6:672e)
; different movements for the player to make to get positioned before the
; main movement
; $00 is a pause
-PewterGymGuyCoords: ; 1a74a (6:674a)
+PewterGymGuyCoords:
db 16, 34
dw .one
db 17, 35
diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm
index bea43308..d4ecec53 100755
--- a/engine/overworld/player_animations.asm
+++ b/engine/overworld/player_animations.asm
@@ -1,4 +1,4 @@
-EnterMapAnim: ; 70567 (1c:4567)
+EnterMapAnim:
call InitFacingDirectionList
ld a, $ec
ld [wSpriteStateData1 + 4], a ; player's sprite Y screen position
@@ -9,7 +9,7 @@ EnterMapAnim: ; 70567 (1c:4567)
bit 7, [hl] ; used fly out of battle?
res 7, [hl]
jr nz, .flyAnimation
- ld a, $a0 ; (SFX_02_4c - SFX_Headers_02) / 3
+ ld a, SFX_TELEPORT_ENTER_1
call PlaySound
ld hl, wd732
bit 4, [hl] ; used dungeon warp?
@@ -17,7 +17,7 @@ EnterMapAnim: ; 70567 (1c:4567)
;res 4, [hl]
jr nz, .dungeonWarpAnimation
call PlayerSpinWhileMovingDown
- ld a, $a3 ; (SFX_02_4f - SFX_Headers_02) / 3
+ ld a, SFX_TELEPORT_ENTER_2
call PlaySound
call IsPlayerStandingOnWarpPadOrHole
ld a, b
@@ -51,7 +51,7 @@ EnterMapAnim: ; 70567 (1c:4567)
.flyAnimation
pop hl
call LoadBirdSpriteGraphics
- ld a, $a4 ; SFX_BIRD_FLY
+ ld a, SFX_FLY
call PlaySound
ld hl, wFlyAnimUsingCoordList
xor a ; is using coord list
@@ -66,7 +66,7 @@ EnterMapAnim: ; 70567 (1c:4567)
ld [wPikachuSpawnState], a
jr .restoreDefaultMusic
-FlyAnimationEnterScreenCoords: ; 705ed (1c:45ed)
+FlyAnimationEnterScreenCoords:
; y, x pairs
; This is the sequence of screen coordinates used by the overworld
; Fly animation when the player is entering a map.
@@ -83,7 +83,7 @@ FlyAnimationEnterScreenCoords: ; 705ed (1c:45ed)
db $3C, $48
db $3C, $40
-PlayerSpinWhileMovingDown: ; 70605 (1c:4605)
+PlayerSpinWhileMovingDown:
ld hl, wPlayerSpinWhileMovingUpOrDownAnimDeltaY
ld a, $10
ld [hli], a ; wPlayerSpinWhileMovingUpOrDownAnimDeltaY
@@ -94,7 +94,7 @@ PlayerSpinWhileMovingDown: ; 70605 (1c:4605)
jp PlayerSpinWhileMovingUpOrDown
-_LeaveMapAnim: ; 70615 (1c:4615)
+_LeaveMapAnim:
call Func_1510
call InitFacingDirectionList
call IsPlayerStandingOnWarpPadOrHole
@@ -104,7 +104,7 @@ _LeaveMapAnim: ; 70615 (1c:4615)
dec a
jp nz, LeaveMapThroughHoleAnim
.spinWhileMovingUp
- ld a, $9f ; (SFX_02_4b - SFX_Headers_02) / 3
+ ld a, SFX_TELEPORT_EXIT_1
call PlaySound
ld hl, wPlayerSpinWhileMovingUpOrDownAnimDeltaY
ld a, -$10
@@ -138,7 +138,7 @@ _LeaveMapAnim: ; 70615 (1c:4615)
ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelayDelta
xor a
ld [hli], a ; wPlayerSpinInPlaceAnimFrameDelayEndValue
- ld [hl], $a1 ; SFX_TELEPORT_EXIT_2
+ ld [hl], SFX_TELEPORT_EXIT_2 ; wPlayerSpinInPlaceAnimSoundID
ld hl, wFacingDirectionList
call PlayerSpinInPlace
jr .spinWhileMovingUp
@@ -151,7 +151,7 @@ _LeaveMapAnim: ; 70615 (1c:4615)
ld [hli], a ; wFlyAnimCounter
ld [hl], $c ; wFlyAnimBirdSpriteImageIndex
call DoFlyAnimation
- ld a, $a4 ; SFX_FLY
+ ld a, SFX_FLY
call PlaySound
ld hl, wFlyAnimUsingCoordList
xor a ; is using coord list
@@ -172,7 +172,7 @@ _LeaveMapAnim: ; 70615 (1c:4615)
call GBFadeOutToWhite
jp RestoreFacingDirectionAndYScreenPos
-FlyAnimationScreenCoords1: ; 706ad (1c:46ad)
+FlyAnimationScreenCoords1:
; y, x pairs
; This is the sequence of screen coordinates used by the first part
; of the Fly overworld animation.
@@ -189,7 +189,7 @@ FlyAnimationScreenCoords1: ; 706ad (1c:46ad)
db $2A, $98
db $27, $A0
-FlyAnimationScreenCoords2: ; 706c5 (1c:46c5)
+FlyAnimationScreenCoords2:
; y, x pairs
; This is the sequence of screen coordinates used by the second part
; of the Fly overworld animation.
@@ -206,7 +206,7 @@ FlyAnimationScreenCoords2: ; 706c5 (1c:46c5)
db $F0, $00
-LeaveMapThroughHoleAnim: ; 706db (1c:46db)
+LeaveMapThroughHoleAnim:
ld a, $ff
ld [wUpdateSpritesEnabled], a ; disable UpdateSprites
; shift upper half of player's sprite down 8 pixels and hide lower half
@@ -228,7 +228,7 @@ LeaveMapThroughHoleAnim: ; 706db (1c:46db)
ld [wUpdateSpritesEnabled], a ; enable UpdateSprites
jp RestoreFacingDirectionAndYScreenPos
-DoFlyAnimation: ; 7070c (1c:470c)
+DoFlyAnimation:
ld a, [wFlyAnimBirdSpriteImageIndex]
xor $1 ; make the bird flap its wings
ld [wFlyAnimBirdSpriteImageIndex], a
@@ -252,19 +252,19 @@ DoFlyAnimation: ; 7070c (1c:470c)
jr nz, DoFlyAnimation
ret
-LoadBirdSpriteGraphics: ; 70735 (1c:4735)
- ld de, BirdSprite ; $4d80
+LoadBirdSpriteGraphics:
+ ld de, BirdSprite
ld b, BANK(BirdSprite)
ld c, $c
ld hl, vNPCSprites
call CopyVideoData
- ld de, BirdSprite + $c0 ; $4e40 ; moving amination sprite
+ ld de, BirdSprite + $c0 ; moving animation sprite
ld b, BANK(BirdSprite)
ld c, $0c
ld hl, vNPCSprites2
jp CopyVideoData
-InitFacingDirectionList: ; 7074f (1c:474f)
+InitFacingDirectionList:
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
@@ -283,12 +283,12 @@ InitFacingDirectionList: ; 7074f (1c:474f)
dec hl
ret
-PlayerSpinningFacingOrder: ; 70773 (1c:4773)
+PlayerSpinningFacingOrder:
; 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: ; 70777 (1c:4777)
+SpinPlayerSprite:
; 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)
@@ -302,7 +302,7 @@ SpinPlayerSprite: ; 70777 (1c:4777)
pop hl
ret
-PlayerSpinInPlace: ; 70790 (1c:4790)
+PlayerSpinInPlace:
call SpinPlayerSprite
ld a, [wPlayerSpinInPlaceAnimFrameDelay]
ld c, a
@@ -323,7 +323,7 @@ PlayerSpinInPlace: ; 70790 (1c:4790)
call DelayFrames
jr PlayerSpinInPlace
-PlayerSpinWhileMovingUpOrDown: ; 707b5 (1c:47b5)
+PlayerSpinWhileMovingUpOrDown:
call SpinPlayerSprite
ld a, [wPlayerSpinWhileMovingUpOrDownAnimDeltaY]
ld c, a
@@ -339,7 +339,7 @@ PlayerSpinWhileMovingUpOrDown: ; 707b5 (1c:47b5)
call DelayFrames
jr PlayerSpinWhileMovingUpOrDown
-RestoreFacingDirectionAndYScreenPos: ; 707d2 (1c:47d2)
+RestoreFacingDirectionAndYScreenPos:
ld a, [wSavedPlayerScreenY]
ld [wSpriteStateData1 + 4], a
ld a, [wSavedPlayerFacingDirection]
@@ -347,14 +347,14 @@ RestoreFacingDirectionAndYScreenPos: ; 707d2 (1c:47d2)
ret
; if SGB, 2 frames, else 3 frames
-GetPlayerTeleportAnimFrameDelay: ; 707df (1c:47df)
+GetPlayerTeleportAnimFrameDelay:
ld a, [wOnSGB]
xor $1
inc a
inc a
ret
-IsPlayerStandingOnWarpPadOrHole: ; 707e7 (1c:47e7)
+IsPlayerStandingOnWarpPadOrHole:
ld b, 0
ld hl, .warpPadAndHoleData
ld a, [wCurMapTileset]
@@ -381,20 +381,20 @@ IsPlayerStandingOnWarpPadOrHole: ; 707e7 (1c:47e7)
ret
; format: db tileset id, tile id, value to be put in [wStandingOnWarpPadOrHole]
-.warpPadAndHoleData: ; 70809 (1c:4809)
+.warpPadAndHoleData:
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: ; 70816 (1c:4816)
+FishingAnim:
ld c, 10
call DelayFrames
ld hl, wd736
- set 6, [hl]
+ set 6, [hl] ; reserve the last 4 OAM entries
ld hl, vNPCSprites
- ld de, RedSprite ; $4180
+ ld de, RedSprite
ld b, BANK(RedSprite)
ld c, $c
call CopyVideoData
@@ -422,7 +422,6 @@ FishingAnim: ; 70816 (1c:4816)
; there was a bite
; shake the player's sprite vertically
-
ld b, 10
.loop
ld hl, wSpriteStateData1 + 4 ; player's sprite Y screen position
@@ -435,17 +434,19 @@ FishingAnim: ; 70816 (1c:4816)
; 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]
+ ld a, [wSpriteStateData1 + 2] ; player's sprite facing direction
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
@@ -463,25 +464,25 @@ FishingAnim: ; 70816 (1c:4816)
call LoadFontTilePatterns
ret
-.ShakePlayerSprite ; 708a3 (1c:48a3)
+.ShakePlayerSprite
ld a, [hl]
xor $1
ld [hl], a
ret
-NoNibbleText: ; 708a8 (1c:48a8)
+NoNibbleText:
TX_FAR _NoNibbleText
db "@"
-NothingHereText: ; 708ad (1c:48ad)
+NothingHereText:
TX_FAR _NothingHereText
db "@"
-ItsABiteText: ; 708b2 (1c:48b2)
+ItsABiteText:
TX_FAR _ItsABiteText
db "@"
-FishingRodOAM: ; 708b7 (1c:48b7)
+FishingRodOAM:
; specifies how the fishing rod should be drawn on the screen
; first byte = screen y coordinate
; second byte = screen x coordinate
@@ -492,7 +493,7 @@ FishingRodOAM: ; 708b7 (1c:48b7)
db $50, $40, $FE, $00 ; player facing left
db $50, $58, $FE, $20 ; player facing right ($20 means "horizontally flip the tile")
-RedFishingTiles: ; 708c7 (1c:48c7)
+RedFishingTiles:
dw RedFishingTilesFront
db 2, BANK(RedFishingTilesFront)
dw vNPCSprites + $20
@@ -509,7 +510,7 @@ RedFishingTiles: ; 708c7 (1c:48c7)
db 3, BANK(RedFishingRodTiles)
dw vNPCSprites2 + $7d0
-_HandleMidJump: ; 708df (1c:48df)
+_HandleMidJump:
ld a, [wPlayerJumpingYScreenCoordsIndex]
ld c, a
inc a
@@ -541,6 +542,6 @@ _HandleMidJump: ; 708df (1c:48df)
ld [wJoyIgnore], a
ret
-PlayerJumpingYScreenCoords: ; 7091b (1c:491b)
+PlayerJumpingYScreenCoords:
; 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
diff --git a/engine/overworld/pokecenter.asm b/engine/overworld/pokecenter.asm
index 65dfcd87..1801d9e9 100755
--- a/engine/overworld/pokecenter.asm
+++ b/engine/overworld/pokecenter.asm
@@ -1,4 +1,4 @@
-DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97)
+DisplayPokemonCenterDialogue_:
ld a, [wCurMap]
cp PEWTER_POKECENTER
jr nz, .regularCenter
@@ -32,7 +32,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97)
call LoadCurrentMapView
call Delay3
call UpdateSprites
- callab Func_fd252 ; todo
+ callab PikachuWalksToNurseJoy ; todo
.notHealingPlayerPikachu
ld hl, NeedYourPokemonText
call PrintText
@@ -40,7 +40,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97)
call DelayFrames
call CheckPikachuFollowingPlayer
jr nz, .playerPikachuNotOnScreen
- call Func_152d
+ call DisablePikachuOverworldSpriteDrawing
callab IsStarterPikachuInOurParty
call c, Func_6eaa
.playerPikachuNotOnScreen
@@ -64,7 +64,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97)
call c, Func_6eaa
ld a, $5
ld [wPikachuSpawnState], a
- call Func_1525
+ call EnablePikachuOverworldSpriteDrawing
.doNotReturnPikachu
lb bc, 1, 0
call Func_6ebb
@@ -97,7 +97,7 @@ DisplayPokemonCenterDialogue_: ; 6d97 (1:6d97)
call UpdateSprites
ret
-Func_6eaa: ; 6eaa (1:6eaa)
+Func_6eaa:
ld a, $1
ld [H_SPRITEINDEX], a
ld a, $4
@@ -107,7 +107,7 @@ Func_6eaa: ; 6eaa (1:6eaa)
call DelayFrames
ret
-Func_6ebb: ; 6ebb (1:6ebb)
+Func_6ebb:
ld a, b
ld [H_SPRITEINDEX], a
ld a, c
@@ -122,28 +122,28 @@ Func_6ebb: ; 6ebb (1:6ebb)
call SpriteFunc_34a1
ret
-PokemonCenterWelcomeText: ; 6de0 (1:6de0)
+PokemonCenterWelcomeText:
TX_FAR _PokemonCenterWelcomeText
db "@"
-ShallWeHealYourPokemonText: ; 6de5 (1:6de5)
+ShallWeHealYourPokemonText:
db $a
TX_FAR _ShallWeHealYourPokemonText
db "@"
-NeedYourPokemonText: ; 6deb (1:6deb)
+NeedYourPokemonText:
TX_FAR _NeedYourPokemonText
db "@"
-PokemonFightingFitText: ; 6ee0 (1:6ee0)
+PokemonFightingFitText:
TX_FAR _PokemonFightingFitText
db "@"
-PokemonCenterFarewellText: ; 6ee5 (1:6ee5)
+PokemonCenterFarewellText:
db $a
TX_FAR _PokemonCenterFarewellText
db "@"
-LooksContentText: ; 6eeb (1:6eeb)
+LooksContentText:
TX_FAR _LooksContentText
- db "@" \ No newline at end of file
+ db "@"
diff --git a/engine/overworld/pokemart.asm b/engine/overworld/pokemart.asm
index ca3f8991..823939b1 100755
--- a/engine/overworld/pokemart.asm
+++ b/engine/overworld/pokemart.asm
@@ -1,4 +1,4 @@
-DisplayPokemartDialogue_: ; 69a5 (1:69a5)
+DisplayPokemartDialogue_:
ld a,[wListScrollOffset]
ld [wSavedListScrollOffset],a
call UpdateSprites
@@ -227,46 +227,46 @@ DisplayPokemartDialogue_: ; 69a5 (1:69a5)
ld [wListScrollOffset],a
ret
-PokemartBuyingGreetingText: ; 6b91 (1:6b91)
+PokemartBuyingGreetingText:
TX_FAR _PokemartBuyingGreetingText
db "@"
-PokemartTellBuyPriceText: ; 6b96 (1:6b96)
+PokemartTellBuyPriceText:
TX_FAR _PokemartTellBuyPriceText
db "@"
-PokemartBoughtItemText: ; 6b9b (1:6b9b)
+PokemartBoughtItemText:
TX_FAR _PokemartBoughtItemText
db "@"
-PokemartNotEnoughMoneyText: ; 6ba0 (1:6ba0)
+PokemartNotEnoughMoneyText:
TX_FAR _PokemartNotEnoughMoneyText
db "@"
-PokemartItemBagFullText: ; 6ba5 (1:6ba5)
+PokemartItemBagFullText:
TX_FAR _PokemartItemBagFullText
db "@"
-PokemonSellingGreetingText: ; 6baa (1:6baa)
+PokemonSellingGreetingText:
TX_FAR _PokemonSellingGreetingText
db "@"
-PokemartTellSellPriceText: ; 6baf (1:6baf)
+PokemartTellSellPriceText:
TX_FAR _PokemartTellSellPriceText
db "@"
-PokemartItemBagEmptyText: ; 6bb4 (1:6bb4)
+PokemartItemBagEmptyText:
TX_FAR _PokemartItemBagEmptyText
db "@"
-PokemartUnsellableItemText: ; 6bb9 (1:6bb9)
+PokemartUnsellableItemText:
TX_FAR _PokemartUnsellableItemText
db "@"
-PokemartThankYouText: ; 6bbe (1:6bbe)
+PokemartThankYouText:
TX_FAR _PokemartThankYouText
db "@"
-PokemartAnythingElseText: ; 6bc3 (1:6bc3)
+PokemartAnythingElseText:
TX_FAR _PokemartAnythingElseText
db "@"
diff --git a/engine/overworld/print_safari_steps.asm b/engine/overworld/print_safari_steps.asm
index 3f2ada03..01dd34e0 100644
--- a/engine/overworld/print_safari_steps.asm
+++ b/engine/overworld/print_safari_steps.asm
@@ -1,4 +1,4 @@
-PrintSafariZoneSteps: ; c27b (3:427b)
+PrintSafariZoneSteps:
ld a, [wCurMap]
cp SAFARI_ZONE_EAST
ret c
@@ -29,8 +29,8 @@ PrintSafariZoneSteps: ; c27b (3:427b)
lb bc, 1, 2
jp PrintNumber
-SafariSteps: ; c2c4 (3:42c4)
+SafariSteps:
db "/500@"
-SafariBallText: ; c5c9 (3:42c9)
- db "BALL×× @" \ No newline at end of file
+SafariBallText:
+ db "BALL×× @"
diff --git a/engine/overworld/replace_tile_block.asm b/engine/overworld/replace_tile_block.asm
index 32c652ea..8577b9e7 100644
--- a/engine/overworld/replace_tile_block.asm
+++ b/engine/overworld/replace_tile_block.asm
@@ -2,7 +2,7 @@
; and redraws the map view if necessary
; b = Y
; c = X
-ReplaceTileBlock: ; ed1b (3:6d1b)
+ReplaceTileBlock:
call GetPredefRegisters
ld hl, wOverworldMap
ld a, [wCurMapWidth]
@@ -46,7 +46,7 @@ ReplaceTileBlock: ; ed1b (3:6d1b)
call CompareHLWithBC
ret c ; return if the replaced tile block is above the map view in memory
-RedrawMapView: ; ed59 (3:6d59)
+RedrawMapView:
ld a, [wIsInBattle]
inc a
ret z
@@ -117,10 +117,10 @@ RedrawMapView: ; ed59 (3:6d59)
ld [H_AUTOBGTRANSFERENABLED], a
ret
-CompareHLWithBC: ; edcb (3:6dcb)
+CompareHLWithBC:
ld a, h
sub b
ret nz
ld a, l
sub c
- ret \ No newline at end of file
+ ret
diff --git a/engine/overworld/saffron_guards.asm b/engine/overworld/saffron_guards.asm
index 83d73d02..3b26b6f8 100755
--- a/engine/overworld/saffron_guards.asm
+++ b/engine/overworld/saffron_guards.asm
@@ -1,4 +1,4 @@
-RemoveGuardDrink: ; 5a53a (16:653a)
+RemoveGuardDrink:
ld hl, GuardDrinksList
.drinkLoop
ld a, [hli]
@@ -12,5 +12,5 @@ RemoveGuardDrink: ; 5a53a (16:653a)
jr z, .drinkLoop
jpba RemoveItemByID
-GuardDrinksList: ; 5a552 (16:6552)
+GuardDrinksList:
db FRESH_WATER, SODA_POP, LEMONADE, $00
diff --git a/engine/overworld/set_blackout_map.asm b/engine/overworld/set_blackout_map.asm
index 5faef173..9bfe82bd 100644
--- a/engine/overworld/set_blackout_map.asm
+++ b/engine/overworld/set_blackout_map.asm
@@ -1,4 +1,4 @@
-SetLastBlackoutMap: ; 6ef0 (1:6ef0)
+SetLastBlackoutMap:
; Set the map to return to when
; blacking out or using Teleport or Dig.
; Safari rest houses don't count.
@@ -22,8 +22,8 @@ SetLastBlackoutMap: ; 6ef0 (1:6ef0)
pop hl
ret
-SafariZoneRestHouses: ; 6f0a (1:6f0a)
+SafariZoneRestHouses:
db SAFARI_ZONE_REST_HOUSE_2
db SAFARI_ZONE_REST_HOUSE_3
db SAFARI_ZONE_REST_HOUSE_4
- db -1 \ No newline at end of file
+ db -1
diff --git a/engine/overworld/special_warps.asm b/engine/overworld/special_warps.asm
index 8c1b4159..4814e668 100644
--- a/engine/overworld/special_warps.asm
+++ b/engine/overworld/special_warps.asm
@@ -1,4 +1,4 @@
-SpecialWarpIn: ; 6042 (1:6042)
+SpecialWarpIn:
call LoadSpecialWarpData
predef LoadTilesetHeader
ld hl,wd732
@@ -29,7 +29,7 @@ SpecialWarpIn: ; 6042 (1:6042)
ret
; gets the map ID, tile block map view pointer, tileset, and coordinates
-LoadSpecialWarpData: ; 6073 (1:6073)
+LoadSpecialWarpData:
ld a, [wd72d]
cp TRADE_CENTER
jr nz, .notTradeCenter
@@ -144,4 +144,4 @@ LoadSpecialWarpData: ; 6073 (1:6073)
ld [wXOffsetSinceLastSpecialWarp], a
ld a, $ff ; the player's coordinates have already been updated using a special warp, so don't use any of the normal warps
ld [wDestinationWarpID], a
- ret \ No newline at end of file
+ ret
diff --git a/engine/overworld/ssanne.asm b/engine/overworld/ssanne.asm
index d0d957be..347dc459 100755
--- a/engine/overworld/ssanne.asm
+++ b/engine/overworld/ssanne.asm
@@ -1,4 +1,4 @@
-AnimateBoulderDust: ; 7a0fb (1e:60fb)
+AnimateBoulderDust:
ld a, $1
ld [wWhichAnimationOffsets], a ; select the boulder dust offsets
ld a, [wUpdateSpritesEnabled]
@@ -31,7 +31,7 @@ AnimateBoulderDust: ; 7a0fb (1e:60fb)
ld [wUpdateSpritesEnabled], a
jp LoadPlayerSpriteGraphics
-GetMoveBoulderDustFunctionPointer: ; 7913f (1e:613f)
+GetMoveBoulderDustFunctionPointer:
ld a, [wPlayerFacingDirection] ; player's sprite facing direction
ld hl, MoveBoulderDustFunctionPointerTable
ld c, a
@@ -53,7 +53,7 @@ GetMoveBoulderDustFunctionPointer: ; 7913f (1e:613f)
pop hl
ret
-MoveBoulderDustFunctionPointerTable: ; 7a15d (1e:615d)
+MoveBoulderDustFunctionPointerTable:
; facing down
db $FF,$00
dw AdjustOAMBlockYPos
@@ -70,7 +70,7 @@ MoveBoulderDustFunctionPointerTable: ; 7a15d (1e:615d)
db $FF,$01
dw AdjustOAMBlockXPos
-LoadSmokeTileFourTimes: ; 7916d (1e:616d)
+LoadSmokeTileFourTimes:
ld hl, vChars1 + $7c0
ld c, $4
.loop
@@ -85,11 +85,11 @@ LoadSmokeTileFourTimes: ; 7916d (1e:616d)
jr nz, .loop
ret
-LoadSmokeTile: ; 7a181 (1e:6181)
+LoadSmokeTile:
ld de, SSAnneSmokePuffTile
lb bc, BANK(SSAnneSmokePuffTile), (SSAnneSmokePuffTileEnd - SSAnneSmokePuffTile) / $10
jp CopyVideoData
-SSAnneSmokePuffTile: ; 7a18a (1e:618a)
+SSAnneSmokePuffTile:
INCBIN "gfx/ss_anne_smoke_puff.2bpp"
SSAnneSmokePuffTileEnd:
diff --git a/engine/overworld/step_functions.asm b/engine/overworld/step_functions.asm
index bc1a74aa..84b09291 100644
--- a/engine/overworld/step_functions.asm
+++ b/engine/overworld/step_functions.asm
@@ -1,4 +1,4 @@
-ApplyOutOfBattlePoisonDamage: ; c3de (3:43de)
+ApplyOutOfBattlePoisonDamage:
ld a, [wd730]
add a
jp c, .noBlackOut ; no black out if joypad states are being simulated
@@ -124,7 +124,7 @@ ApplyOutOfBattlePoisonDamage: ; c3de (3:43de)
ld [wOutOfBattleBlackout], a
ret
-Func_c4c7: ; c4c7 (3:44c7)
+Func_c4c7:
ld a, [wStepCounter]
and a
jr nz, .asm_c4de
@@ -148,4 +148,4 @@ Func_c4c7: ; c4c7 (3:44c7)
.asm_c4ef
xor a
ld [wd49c], a
- ret \ No newline at end of file
+ ret
diff --git a/engine/overworld/trainers.asm b/engine/overworld/trainers.asm
index 9dee81bd..655c6b2a 100755
--- a/engine/overworld/trainers.asm
+++ b/engine/overworld/trainers.asm
@@ -1,4 +1,4 @@
-_GetSpritePosition1: ; 56745 (15:6745)
+_GetSpritePosition1:
ld hl, wSpriteStateData1
ld de, $4
ld a, [wSpriteIndex]
@@ -17,7 +17,7 @@ _GetSpritePosition1: ; 56745 (15:6745)
ld [$ffee], a
ret
-_GetSpritePosition2: ; 56765 (15:6765)
+_GetSpritePosition2:
ld hl, wSpriteStateData1
ld de, $4
ld a, [wSpriteIndex]
@@ -36,7 +36,7 @@ _GetSpritePosition2: ; 56765 (15:6765)
ld [wSavedSpriteMapX], a
ret
-_SetSpritePosition1: ; 56789 (15:6789)
+_SetSpritePosition1:
ld hl, wSpriteStateData1
ld de, $4
ld a, [wSpriteIndex]
@@ -55,9 +55,9 @@ _SetSpritePosition1: ; 56789 (15:6789)
ld [hl], a
ret
-_SetSpritePosition2: ; 567a9 (15:67a9)
+_SetSpritePosition2:
ld hl, wSpriteStateData1
- ld de, $4
+ ld de, 4
ld a, [wSpriteIndex]
ld [H_SPRITEINDEX], a
call GetSpriteDataPointer
@@ -74,7 +74,7 @@ _SetSpritePosition2: ; 567a9 (15:67a9)
ld [hl], a ; c2x5 (map X pos)
ret
-TrainerWalkUpToPlayer: ; 567cd (15:67cd)
+TrainerWalkUpToPlayer:
ld a, [wSpriteIndex]
swap a
ld [wTrainerSpriteOffset], a
@@ -149,7 +149,7 @@ TrainerWalkUpToPlayer: ; 567cd (15:67cd)
; input: de = offset within sprite entry
; output: hl = pointer to sprite data
-GetSpriteDataPointer: ; 5684f (15:684f)
+GetSpriteDataPointer:
push de
add hl, de
ld a, [H_SPRITEINDEX]
@@ -161,7 +161,7 @@ GetSpriteDataPointer: ; 5684f (15:684f)
ret
; tests if this trainer is in the right position to engage the player and do so if she is.
-TrainerEngage: ; 5685b (15:685b)
+TrainerEngage:
push hl
push de
ld a, [wTrainerSpriteOffset]
@@ -232,7 +232,7 @@ TrainerEngage: ; 5685b (15:685b)
ret
; reads trainer's Y position to wTrainerScreenY and X position to wTrainerScreenX
-ReadTrainerScreenPosition: ; 568da (15:68da)
+ReadTrainerScreenPosition:
ld a, [wTrainerSpriteOffset]
add $4
ld d, $0
@@ -254,7 +254,7 @@ ReadTrainerScreenPosition: ; 568da (15:68da)
; checks if the sprite is properly lined up with the player with respect to the direction it's looking. Also checks the distance between player and sprite
; note that this does not necessarily mean the sprite is seeing the player, he could be behind it's back
; a: distance player to sprite
-CheckSpriteCanSeePlayer: ; 569af (15:69af)
+CheckSpriteCanSeePlayer:
ld b, a
ld a, [wTrainerEngageDistance] ; how far the trainer can see
cp b
@@ -262,13 +262,13 @@ CheckSpriteCanSeePlayer: ; 569af (15:69af)
jr .notInLine ; player too far away
.checkIfLinedUp
ld a, [wTrainerFacingDirection] ; sprite facing direction
- cp SPRITE_FACING_DOWN ; down
+ cp SPRITE_FACING_DOWN
jr z, .checkXCoord
- cp SPRITE_FACING_UP ; up
+ cp SPRITE_FACING_UP
jr z, .checkXCoord
- cp SPRITE_FACING_LEFT ; left
+ cp SPRITE_FACING_LEFT
jr z, .checkYCoord
- cp SPRITE_FACING_RIGHT ; right
+ cp SPRITE_FACING_RIGHT
jr z, .checkYCoord
jr .notInLine
.checkXCoord
@@ -290,7 +290,7 @@ CheckSpriteCanSeePlayer: ; 569af (15:69af)
ret
; tests if the player is in front of the sprite (rather than behind it)
-CheckPlayerIsInFrontOfSprite: ; 5692f (15:692f)
+CheckPlayerIsInFrontOfSprite:
ld a, [wCurMap]
cp POWER_PLANT
jp z, .engage ; bypass this for power plant to get voltorb fake items to work
diff --git a/engine/overworld/try_pushing_boulder.asm b/engine/overworld/try_pushing_boulder.asm
index b7e04092..a00790b9 100644
--- a/engine/overworld/try_pushing_boulder.asm
+++ b/engine/overworld/try_pushing_boulder.asm
@@ -1,8 +1,8 @@
-TryPushingBoulder: ; f0a1 (3:70a1)
+TryPushingBoulder:
ld a, [wd728]
bit 0, a ; using Strength?
ret z
-Func_f0a7: ; f0a7 (3:70a7)
+Func_f0a7:
; where LoadMissableObjects predef points to now
ld a, [wFlags_0xcd60]
bit 1, a ; has boulder dust animation from previous push played yet?
@@ -72,19 +72,19 @@ Func_f0a7: ; f0a7 (3:70a7)
set 1, [hl]
ret
-PushBoulderUpMovementData: ; f129 (3:7129)
+PushBoulderUpMovementData:
db NPC_MOVEMENT_UP,$FF
-PushBoulderDownMovementData: ; f12b (3:712b)
+PushBoulderDownMovementData:
db NPC_MOVEMENT_DOWN,$FF
-PushBoulderLeftMovementData: ; f12d (3:712d)
+PushBoulderLeftMovementData:
db NPC_MOVEMENT_LEFT,$FF
-PushBoulderRightMovementData: ; f12f (3:712f)
+PushBoulderRightMovementData:
db NPC_MOVEMENT_RIGHT,$FF
-DoBoulderDustAnimation: ; f131 (3:7131)
+DoBoulderDustAnimation:
ld a, [wd730]
bit 0, a
ret nz
@@ -100,8 +100,8 @@ DoBoulderDustAnimation: ; f131 (3:7131)
ld a, SFX_CUT
jp PlaySound
-ResetBoulderPushFlags: ; f159 (3:7159)
+ResetBoulderPushFlags:
ld hl, wFlags_0xcd60
res 1, [hl]
res 6, [hl]
- ret \ No newline at end of file
+ ret