summaryrefslogtreecommitdiff
path: root/engine/overworld
diff options
context:
space:
mode:
Diffstat (limited to 'engine/overworld')
-rwxr-xr-xengine/overworld/cable_club_npc.asm23
-rwxr-xr-xengine/overworld/card_key.asm6
-rwxr-xr-xengine/overworld/cinnabar_lab.asm35
-rwxr-xr-xengine/overworld/cut.asm125
-rwxr-xr-xengine/overworld/cut2.asm76
-rwxr-xr-xengine/overworld/hidden_items.asm4
-rw-r--r--engine/overworld/item.asm2
-rwxr-xr-xengine/overworld/npc_movement.asm8
-rwxr-xr-xengine/overworld/pewter_guys.asm18
-rwxr-xr-xengine/overworld/player_animations.asm4
-rwxr-xr-xengine/overworld/ssanne.asm6
-rwxr-xr-xengine/overworld/trainers.asm18
12 files changed, 164 insertions, 161 deletions
diff --git a/engine/overworld/cable_club_npc.asm b/engine/overworld/cable_club_npc.asm
index 65837150..a2feba06 100755
--- a/engine/overworld/cable_club_npc.asm
+++ b/engine/overworld/cable_club_npc.asm
@@ -8,7 +8,7 @@ CableClubNPC: ; 71c5 (1:71c5)
call DelayFrames
ld hl, CableClubNPCMakingPreparationsText
call PrintText
- jp Func_7298
+ jp .didNotConnect
.receivedPokedex
ld a, $1
ld [wMenuJoypadPollCount], a
@@ -71,31 +71,29 @@ CableClubNPC: ; 71c5 (1:71c5)
ld hl, wUnknownSerialCounter
ld a, [hli]
inc a
- jr nz, Func_72a8
+ jr nz, .connected
ld a, [hl]
inc a
- jr nz, Func_72a8
- ld b, $a
-.asm_7273
+ jr nz, .connected
+ ld b, 10
+.syncLoop
call DelayFrame
call Serial_SendZeroByte
dec b
- jr nz, .asm_7273
+ jr nz, .syncLoop
call CloseLinkConnection
ld hl, CableClubNPCLinkClosedBecauseOfInactivityText
call PrintText
- jr Func_7298
+ jr .didNotConnect
.failedToEstablishConnection
ld hl, CableClubNPCAreaReservedFor2FriendsLinkedByCableText
call PrintText
- jr Func_7298
+ jr .didNotConnect
.choseNo
call CloseLinkConnection
ld hl, CableClubNPCPleaseComeAgainText
call PrintText
- ; fall through
-
-Func_7298: ; 7298 (1:7298)
+.didNotConnect
xor a
ld hl, wUnknownSerialCounter
ld [hli], a
@@ -105,8 +103,7 @@ Func_7298: ; 7298 (1:7298)
xor a
ld [wMenuJoypadPollCount], a
ret
-
-Func_72a8: ; 72a8 (1:72a8)
+.connected
xor a
ld [hld], a
ld [hl], a
diff --git a/engine/overworld/card_key.asm b/engine/overworld/card_key.asm
index 746ea326..cc9fe3a7 100755
--- a/engine/overworld/card_key.asm
+++ b/engine/overworld/card_key.asm
@@ -28,7 +28,7 @@ PrintCardKeyText: ; 52673 (14:6673)
call GetCoordsInFrontOfPlayer
push de
tx_pre_id CardKeySuccessText
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
call PrintPredefTextID
pop de
srl d
@@ -47,7 +47,7 @@ PrintCardKeyText: ; 52673 (14:6673)
.notSilphCo11F
ld a, $e
.replaceCardKeyDoorTileBlock
- ld [wd09f], a
+ ld [wNewTileBlockID], a
predef ReplaceTileBlock
ld hl, wd126
set 5, [hl]
@@ -55,7 +55,7 @@ PrintCardKeyText: ; 52673 (14:6673)
jp PlaySound
.noCardKey
tx_pre_id CardKeyFailText
- ld [H_DOWNARROWBLINKCNT2], a
+ ld [hSpriteIndexOrTextID], a
jp PrintPredefTextID
SilphCoMapList: ; 526e3 (14:66e3)
diff --git a/engine/overworld/cinnabar_lab.asm b/engine/overworld/cinnabar_lab.asm
index 1b96b4c6..5337255c 100755
--- a/engine/overworld/cinnabar_lab.asm
+++ b/engine/overworld/cinnabar_lab.asm
@@ -3,19 +3,19 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006)
set 6, [hl]
xor a
ld [wCurrentMenuItem], a
- ld a, $3
+ ld a, A_BUTTON | B_BUTTON
ld [wMenuWatchedKeys], a
ld a, [wcd37]
dec a
ld [wMaxMenuItem], a
- ld a, $2
+ ld a, 2
ld [wTopMenuItemY], a
- ld a, $1
+ ld a, 1
ld [wTopMenuItemX], a
ld a, [wcd37]
dec a
- ld bc, $2
- ld hl, $3
+ ld bc, 2
+ ld hl, 3
call AddNTimes
dec l
ld b, l
@@ -23,12 +23,12 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006)
coord hl, 0, 0
call TextBoxBorder
call UpdateSprites
- call Func_610c2
+ call PrintFossilsInBag
ld hl, wd730
res 6, [hl]
call HandleMenuInput
- bit 1, a
- jr nz, .asm_610a7
+ bit 1, a ; pressed B?
+ jr nz, .cancelledGivingFossil
ld hl, wcc5b
ld a, [wCurrentMenuItem]
ld d, $0
@@ -57,17 +57,17 @@ GiveFossilToCinnabarLab: ; 61006 (18:5006)
call YesNoChoice
ld a, [wCurrentMenuItem]
and a
- jr nz, .asm_610a7
+ jr nz, .cancelledGivingFossil
ld hl, LabFossil_610b3
call PrintText
ld a, [W_FOSSILITEM]
- ld [$ffdb], a
+ ld [hItemToRemoveID], a
callba RemoveItemByID
ld hl, LabFossil_610b8
call PrintText
SetEvents EVENT_GAVE_FOSSIL_TO_LAB, EVENT_LAB_STILL_REVIVING_FOSSIL
ret
-.asm_610a7
+.cancelledGivingFossil
ld hl, LabFossil_610bd
call PrintText
ret
@@ -88,11 +88,12 @@ LabFossil_610bd: ; 610bd (18:50bd)
TX_FAR _Lab4Text_610bd
db "@"
-Func_610c2: ; 610c2 (18:50c2)
+PrintFossilsInBag: ; 610c2 (18:50c2)
+; Prints each fossil in the player's bag on a separate line in the menu.
ld hl, wcc5b
xor a
- ld [$ffdb], a
-.asm_610c8
+ ld [hFossilCounter], a
+.loop
ld a, [hli]
cp $ff
ret z
@@ -100,15 +101,15 @@ Func_610c2: ; 610c2 (18:50c2)
ld [wd11e], a
call GetItemName
coord hl, 2, 2
- ld a, [$ffdb]
+ ld a, [hFossilCounter]
ld bc, SCREEN_WIDTH * 2
call AddNTimes
ld de, wcd6d
call PlaceString
- ld hl, $ffdb
+ ld hl, hFossilCounter
inc [hl]
pop hl
- jr .asm_610c8
+ jr .loop
; loads the names of the fossil item and the resulting mon
LoadFossilItemAndMonName: ; 610eb (18:50eb)
diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm
index 293daee7..2056bbb0 100755
--- a/engine/overworld/cut.asm
+++ b/engine/overworld/cut.asm
@@ -3,21 +3,21 @@ UsedCut: ; ef54 (3:6f54)
ld [wActionResultOrTookBattleTurn], a ; initialise to failure value
ld a, [W_CURMAPTILESET]
and a ; OVERWORLD
- jr z, .asm_ef6b
+ jr z, .overworld
cp GYM
- jr nz, .asm_ef77
+ jr nz, .nothingToCut
ld a, [wTileInFrontOfPlayer]
cp $50 ; gym cut tree
- jr nz, .asm_ef77
- jr .asm_ef82
-.asm_ef6b
+ jr nz, .nothingToCut
+ jr .canCut
+.overworld
dec a
ld a, [wTileInFrontOfPlayer]
cp $3d ; cut tree
- jr z, .asm_ef82
+ jr z, .canCut
cp $52 ; grass
- jr z, .asm_ef82
-.asm_ef77
+ jr z, .canCut
+.nothingToCut
ld hl, .NothingToCutText
jp PrintText
@@ -25,9 +25,9 @@ UsedCut: ; ef54 (3:6f54)
TX_FAR _NothingToCutText
db "@"
-.asm_ef82
+.canCut
ld [wCutTile], a
- ld a, $1
+ ld a, 1
ld [wActionResultOrTookBattleTurn], a ; used cut
ld a, [wWhichPokemon]
ld hl, wPartyMonNicks
@@ -37,7 +37,7 @@ UsedCut: ; ef54 (3:6f54)
call GBPalWhiteOutWithDelay3
call ClearSprites
call RestoreScreenTilesAndReloadTilePatterns
- ld a, $90
+ ld a, SCREEN_HEIGHT_PIXELS
ld [hWY], a
call Delay3
call LoadGBPal
@@ -53,11 +53,11 @@ UsedCut: ; ef54 (3:6f54)
res 6, [hl]
ld a, $ff
ld [wUpdateSpritesEnabled], a
- call AnimateCutTree
+ call InitCutAnimOAM
ld de, CutTreeBlockSwaps
- call Func_f09f
+ call ReplaceTreeTileBlock
call RedrawMapView
- callba Func_79e96
+ callba AnimCut
ld a, $1
ld [wUpdateSpritesEnabled], a
ld a, SFX_CUT
@@ -71,14 +71,15 @@ UsedCutText: ; eff2 (3:6ff2)
TX_FAR _UsedCutText
db "@"
-AnimateCutTree: ; eff7 (3:6ff7)
+InitCutAnimOAM: ; eff7 (3:6ff7)
xor a
ld [wWhichAnimationOffsets], a
ld a, $e4
ld [rOBP1], a
ld a, [wCutTile]
cp $52
- jr z, .asm_f020
+ jr z, .grass
+; tree
ld de, Overworld_GFX + $2d0 ; cuttable tree sprite top row
ld hl, vChars1 + $7c0
ld bc, (BANK(Overworld_GFX) << 8) + $02
@@ -87,45 +88,45 @@ AnimateCutTree: ; eff7 (3:6ff7)
ld hl, vChars1 + $7e0
ld bc, (BANK(Overworld_GFX) << 8) + $02
call CopyVideoData
- jr WriteCutTreeBoulderDustAnimationOAMBlock
-.asm_f020
+ jr WriteCutOrBoulderDustAnimationOAMBlock
+.grass
ld hl, vChars1 + $7c0
- call LoadCutTreeAnimationTilePattern
+ call LoadCutGrassAnimationTilePattern
ld hl, vChars1 + $7d0
- call LoadCutTreeAnimationTilePattern
+ call LoadCutGrassAnimationTilePattern
ld hl, vChars1 + $7e0
- call LoadCutTreeAnimationTilePattern
+ call LoadCutGrassAnimationTilePattern
ld hl, vChars1 + $7f0
- call LoadCutTreeAnimationTilePattern
- call WriteCutTreeBoulderDustAnimationOAMBlock
+ call LoadCutGrassAnimationTilePattern
+ call WriteCutOrBoulderDustAnimationOAMBlock
ld hl, wOAMBuffer + $93
- ld de, $4
+ ld de, 4
ld a, $30
ld c, e
-.asm_f044
+.loop
ld [hl], a
add hl, de
xor $60
dec c
- jr nz, .asm_f044
+ jr nz, .loop
ret
-LoadCutTreeAnimationTilePattern: ; f04c (3:704c)
+LoadCutGrassAnimationTilePattern: ; f04c (3:704c)
ld de, AnimationTileset2 + $60 ; tile depicting a leaf
ld bc, (BANK(AnimationTileset2) << 8) + $01
jp CopyVideoData
-WriteCutTreeBoulderDustAnimationOAMBlock: ; f055 (3:7055)
- call GetCutTreeBoulderDustAnimationOffsets
+WriteCutOrBoulderDustAnimationOAMBlock: ; f055 (3:7055)
+ call GetCutOrBoulderDustAnimationOffsets
ld a, $9
- ld de, CutTreeBoulderDustAnimationTilesAndAttributes
+ ld de, CutOrBoulderDustAnimationTilesAndAttributes
jp WriteOAMBlock
-CutTreeBoulderDustAnimationTilesAndAttributes: ; f060 (3:7060)
+CutOrBoulderDustAnimationTilesAndAttributes: ; f060 (3:7060)
db $FC,$10,$FD,$10
db $FE,$10,$FF,$10
-GetCutTreeBoulderDustAnimationOffsets: ; f068 (3:7068)
+GetCutOrBoulderDustAnimationOffsets: ; f068 (3:7068)
ld hl, wSpriteStateData1 + 4
ld a, [hli] ; player's sprite screen Y position
ld b, a
@@ -140,10 +141,10 @@ GetCutTreeBoulderDustAnimationOffsets: ; f068 (3:7068)
ld d, $0 ; de holds direction (00: down, 02: up, 04: left, 06: right)
ld a, [wWhichAnimationOffsets]
and a
- ld hl, CutTreeAnimationOffsets
- jr z, .asm_f084
+ ld hl, CutAnimationOffsets
+ jr z, .next
ld hl, BoulderDustAnimationOffsets
-.asm_f084
+.next
add hl, de
ld e, [hl]
inc hl
@@ -156,7 +157,7 @@ GetCutTreeBoulderDustAnimationOffsets: ; f068 (3:7068)
ld c, a
ret
-CutTreeAnimationOffsets: ; f08f (3:708f)
+CutAnimationOffsets: ; f08f (3:708f)
; 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
@@ -171,75 +172,79 @@ BoulderDustAnimationOffsets: ; f097 (3:7097)
db -24, 20 ; player is facing left
db 40, 20 ; player is facing right
-Func_f09f: ; f09f (3:709f)
+ReplaceTreeTileBlock: ; f09f (3:709f)
+; 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.
push de
ld a, [W_CURMAPWIDTH]
- add $6
+ add 6
ld c, a
- ld b, $0
- ld d, $0
+ ld b, 0
+ ld d, 0
ld hl, wCurrentTileBlockMapViewPointer
ld a, [hli]
ld h, [hl]
ld l, a
add hl, bc
- ld a, [wSpriteStateData1 + 9]
+ ld a, [wSpriteStateData1 + 9] ; player sprite's facing direction
and a
jr z, .down
cp SPRITE_FACING_UP
jr z, .up
cp SPRITE_FACING_LEFT
jr z, .left
+; right
ld a, [W_XBLOCKCOORD]
and a
- jr z, .asm_f0e0
- jr .asm_f0ec
+ jr z, .centerTileBlock
+ jr .rightOfCenter
.down
ld a, [W_YBLOCKCOORD]
and a
- jr z, .asm_f0e0
- jr .asm_f0df
+ jr z, .centerTileBlock
+ jr .belowCenter
.up
ld a, [W_YBLOCKCOORD]
and a
- jr z, .asm_f0e1
- jr .asm_f0e0
+ jr z, .aboveCenter
+ jr .centerTileBlock
.left
ld a, [W_XBLOCKCOORD]
and a
- jr z, .asm_f0e6
- jr .asm_f0e0
-.asm_f0df
+ jr z, .leftOfCenter
+ jr .centerTileBlock
+.belowCenter
add hl, bc
-.asm_f0e0
+.centerTileBlock
add hl, bc
-.asm_f0e1
+.aboveCenter
ld e, $2
add hl, de
- jr .asm_f0f0
-.asm_f0e6
+ jr .next
+.leftOfCenter
ld e, $1
add hl, bc
add hl, de
- jr .asm_f0f0
-.asm_f0ec
+ jr .next
+.rightOfCenter
ld e, $3
add hl, bc
add hl, de
-.asm_f0f0
+.next
pop de
ld a, [hl]
ld c, a
-.asm_f0f3
+.loop ; find the matching tile block in the array
ld a, [de]
inc de
inc de
cp $ff
ret z
cp c
- jr nz, .asm_f0f3
+ jr nz, .loop
dec de
- ld a, [de]
+ ld a, [de] ; replacement tile block from matching array entry
ld [hl], a
ret
diff --git a/engine/overworld/cut2.asm b/engine/overworld/cut2.asm
index 3194b39b..1cf832b5 100755
--- a/engine/overworld/cut2.asm
+++ b/engine/overworld/cut2.asm
@@ -1,19 +1,19 @@
-Func_79e96: ; 79e96 (1e:5e96)
+AnimCut: ; 79e96 (1e:5e96)
ld a, [wCutTile]
cp $52
- jr z, .asm_79ec8
+ jr z, .grass
ld c, $8
-.asm_79e9f
+.cutTreeLoop
push bc
ld hl, wOAMBuffer + $91
- ld a, $1
- ld [wd08a], a
- ld c, $2
+ ld a, 1
+ ld [wCoordAdjustmentAmount], a
+ ld c, 2
call AdjustOAMBlockXPos2
ld hl, wOAMBuffer + $99
- ld a, $ff
- ld [wd08a], a
- ld c, $2
+ ld a, -1
+ ld [wCoordAdjustmentAmount], a
+ ld c, 2
call AdjustOAMBlockXPos2
ld a, [rOBP1]
xor $64
@@ -21,49 +21,49 @@ Func_79e96: ; 79e96 (1e:5e96)
call DelayFrame
pop bc
dec c
- jr nz, .asm_79e9f
+ jr nz, .cutTreeLoop
ret
-.asm_79ec8
- ld c, $2
-.asm_79eca
+.grass
+ ld c, 2
+.cutGrassLoop
push bc
ld c, $8
- call Func_79eed
- call Func_79f30
+ call AnimCutGrass_UpdateOAMEntries
+ call AnimCutGrass_SwapOAMEntries
ld c, $8
- call Func_79eed
- call Func_79f30
+ call AnimCutGrass_UpdateOAMEntries
+ call AnimCutGrass_SwapOAMEntries
ld hl, wOAMBuffer + $90
- ld a, $2
- ld [wd08a], a
- ld c, $4
+ ld a, 2
+ ld [wCoordAdjustmentAmount], a
+ ld c, 4
call AdjustOAMBlockYPos2
pop bc
dec c
- jr nz, .asm_79eca
+ jr nz, .cutGrassLoop
ret
-Func_79eed: ; 79eed (1e:5eed)
+AnimCutGrass_UpdateOAMEntries: ; 79eed (1e:5eed)
push bc
ld hl, wOAMBuffer + $91
- ld a, $1
- ld [wd08a], a
- ld c, $1
+ ld a, 1
+ ld [wCoordAdjustmentAmount], a
+ ld c, 1
call AdjustOAMBlockXPos2
ld hl, wOAMBuffer + $95
- ld a, $2
- ld [wd08a], a
- ld c, $1
+ ld a, 2
+ ld [wCoordAdjustmentAmount], a
+ ld c, 1
call AdjustOAMBlockXPos2
ld hl, wOAMBuffer + $99
- ld a, $fe
- ld [wd08a], a
- ld c, $1
+ ld a, -2
+ ld [wCoordAdjustmentAmount], a
+ ld c, 1
call AdjustOAMBlockXPos2
ld hl, wOAMBuffer + $9d
- ld a, $ff
- ld [wd08a], a
- ld c, $1
+ ld a, -1
+ ld [wCoordAdjustmentAmount], a
+ ld c, 1
call AdjustOAMBlockXPos2
ld a, [rOBP1]
xor $64
@@ -71,19 +71,19 @@ Func_79eed: ; 79eed (1e:5eed)
call DelayFrame
pop bc
dec c
- jr nz, Func_79eed
+ jr nz, AnimCutGrass_UpdateOAMEntries
ret
-Func_79f30: ; 79f30 (1e:5f30)
+AnimCutGrass_SwapOAMEntries: ; 79f30 (1e:5f30)
ld hl, wOAMBuffer + $90
- ld de, wHPBarMaxHP
+ ld de, wBuffer
ld bc, $8
call CopyData
ld hl, wOAMBuffer + $98
ld de, wOAMBuffer + $90
ld bc, $8
call CopyData
- ld hl, wHPBarMaxHP
+ ld hl, wBuffer
ld de, wOAMBuffer + $98
ld bc, $8
jp CopyData
diff --git a/engine/overworld/hidden_items.asm b/engine/overworld/hidden_items.asm
index fc69afc1..1203dd2a 100755
--- a/engine/overworld/hidden_items.asm
+++ b/engine/overworld/hidden_items.asm
@@ -29,7 +29,7 @@ FoundHiddenItemText: ; 7675b (1d:675b)
call GiveItem
jr nc, .BagFull
ld hl, wObtainedHiddenItemsFlags
- ld a, [wTrainerScreenX]
+ ld a, [wHiddenItemOrCoinsIndex]
ld c, a
ld b, FLAG_SET
predef FlagActionPredef
@@ -100,7 +100,7 @@ HiddenCoins: ; 76799 (1d:6799)
ld c, $2
predef AddBCDPredef
ld hl, wObtainedHiddenCoinsFlags
- ld a, [wTrainerScreenX]
+ ld a, [wHiddenItemOrCoinsIndex]
ld c, a
ld b, FLAG_SET
predef FlagActionPredef
diff --git a/engine/overworld/item.asm b/engine/overworld/item.asm
index eb6d743a..6fbe823d 100644
--- a/engine/overworld/item.asm
+++ b/engine/overworld/item.asm
@@ -31,7 +31,7 @@ PickUpItem:
jr nc, .BagFull
ld a, [$ffdb]
- ld [wcc4d], a
+ ld [wMissableObjectIndex], a
predef HideObject
ld a, 1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
diff --git a/engine/overworld/npc_movement.asm b/engine/overworld/npc_movement.asm
index fcef55e0..0c01e38c 100755
--- a/engine/overworld/npc_movement.asm
+++ b/engine/overworld/npc_movement.asm
@@ -149,7 +149,7 @@ PalletMovementScript_Done: ; 1a4f4 (6:64f4)
and a
ret nz
ld a, $0
- ld [wcc4d], a
+ ld [wMissableObjectIndex], a
predef HideObject
ld hl, wd730
res 7, [hl]
@@ -178,7 +178,7 @@ PewterMovementScript_WalkToMuseum: ; 1a514 (6:6514)
dec a
ld [wSimulatedJoypadStatesIndex], a
xor a
- ld [wd12f], a
+ ld [wWhichPewterGuy], a
predef PewterGuys
ld hl, wNPCMovementDirections2
ld de, RLEList_PewterMuseumGuy
@@ -234,8 +234,8 @@ PewterMovementScript_WalkToGym: ; 1a581 (6:6581)
call DecodeRLEList
dec a
ld [wSimulatedJoypadStatesIndex], a
- ld a, $1
- ld [wd12f], a
+ ld a, 1
+ ld [wWhichPewterGuy], a
predef PewterGuys
ld hl, wNPCMovementDirections2
ld de, RLEList_PewterGymGuy
diff --git a/engine/overworld/pewter_guys.asm b/engine/overworld/pewter_guys.asm
index fa0dd4a7..4ac60e00 100755
--- a/engine/overworld/pewter_guys.asm
+++ b/engine/overworld/pewter_guys.asm
@@ -9,7 +9,7 @@ PewterGuys: ; 37ca1 (d:7ca1)
ld d, h
ld e, l
ld hl, PointerTable_37ce6
- ld a, [wd12f]
+ ld a, [wWhichPewterGuy]
add a
ld b, 0
ld c, a
@@ -21,17 +21,17 @@ PewterGuys: ; 37ca1 (d:7ca1)
ld b, a
ld a, [W_XCOORD]
ld c, a
-.asm_37cc7
+.findMatchingCoordsLoop
ld a, [hli]
cp b
- jr nz, .asm_37ce1
+ jr nz, .nextEntry1
ld a, [hli]
cp c
- jr nz, .asm_37ce2
+ jr nz, .nextEntry2
ld a, [hli]
ld h, [hl]
ld l, a
-.asm_37cd2
+.copyMovementDataLoop
ld a, [hli]
cp $ff
ret z
@@ -40,13 +40,13 @@ PewterGuys: ; 37ca1 (d:7ca1)
ld a, [wSimulatedJoypadStatesIndex]
inc a
ld [wSimulatedJoypadStatesIndex], a
- jr .asm_37cd2
-.asm_37ce1
+ jr .copyMovementDataLoop
+.nextEntry1
inc hl
-.asm_37ce2
+.nextEntry2
inc hl
inc hl
- jr .asm_37cc7
+ jr .findMatchingCoordsLoop
PointerTable_37ce6: ; 37ce6 (d:7ce6)
dw PewterMuseumGuyCoords
diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm
index a9aa2cf2..1a3d374f 100755
--- a/engine/overworld/player_animations.asm
+++ b/engine/overworld/player_animations.asm
@@ -370,10 +370,10 @@ IsPlayerStandingOnWarpPadOrHole: ; 70787 (1c:4787)
ld b, [hl]
.done
ld a, b
- ld [wcd5b], a
+ ld [wStandingOnWarpPadOrHole], a
ret
-; format: db tileset id, tile id, value to be put in wcd5b
+; format: db tileset id, tile id, value to be put in [wStandingOnWarpPadOrHole]
.warpPadAndHoleData: ; 707a9 (1c:47a9)
db FACILITY, $20, 1 ; warp pad
db FACILITY, $11, 2 ; hole
diff --git a/engine/overworld/ssanne.asm b/engine/overworld/ssanne.asm
index a59ae794..8c5485e2 100755
--- a/engine/overworld/ssanne.asm
+++ b/engine/overworld/ssanne.asm
@@ -8,14 +8,14 @@ AnimateBoulderDust: ; 79f54 (1e:5f54)
ld a, %11100100
ld [rOBP1], a
call LoadSmokeTileFourTimes
- callba WriteCutTreeBoulderDustAnimationOAMBlock
+ callba WriteCutOrBoulderDustAnimationOAMBlock
ld c, 8 ; number of steps in animation
.loop
push bc
call GetMoveBoulderDustFunctionPointer
ld bc, .returnAddress
push bc
- ld c, $4
+ ld c, 4
jp [hl]
.returnAddress
ld a, [rOBP1]
@@ -36,7 +36,7 @@ GetMoveBoulderDustFunctionPointer: ; 79f92 (1e:5f92)
ld b, $0
add hl, bc
ld a, [hli]
- ld [wd08a], a
+ ld [wCoordAdjustmentAmount], a
ld a, [hli]
ld e, a
ld a, [hli]
diff --git a/engine/overworld/trainers.asm b/engine/overworld/trainers.asm
index 2b08997b..7d2ec0dd 100755
--- a/engine/overworld/trainers.asm
+++ b/engine/overworld/trainers.asm
@@ -24,16 +24,16 @@ _GetSpritePosition2: ; 56819 (15:6819)
ld [H_SPRITEINDEX], a
call GetSpriteDataPointer
ld a, [hli] ; c1x4 (screen Y pos)
- ld [wd130], a
+ ld [wSavedSpriteScreenY], a
inc hl
ld a, [hl] ; c1x6 (screen X pos)
- ld [wd131], a
+ ld [wSavedSpriteScreenX], a
ld de, $104 - $6
add hl, de
ld a, [hli] ; c2x4 (map Y pos)
- ld [wd132], a
+ ld [wSavedSpriteMapY], a
ld a, [hl] ; c2x5 (map X pos)
- ld [wd133], a
+ ld [wSavedSpriteMapX], a
ret
_SetSpritePosition1: ; 5683d (15:683d)
@@ -61,16 +61,16 @@ _SetSpritePosition2: ; 5685d (15:685d)
ld a, [wSpriteIndex]
ld [H_SPRITEINDEX], a
call GetSpriteDataPointer
- ld a, [wd130]
+ ld a, [wSavedSpriteScreenY]
ld [hli], a
inc hl
- ld a, [wd131]
+ ld a, [wSavedSpriteScreenX]
ld [hl], a
ld de, $00fe
add hl, de
- ld a, [wd132]
+ ld a, [wSavedSpriteMapY]
ld [hli], a
- ld a, [wd133]
+ ld a, [wSavedSpriteMapX]
ld [hl], a
ret
@@ -256,7 +256,7 @@ ReadTrainerScreenPosition: ; 5698e (15:698e)
; a: distance player to sprite
CheckSpriteCanSeePlayer: ; 569af (15:69af)
ld b, a
- ld a, [wTrainerEngageDistance] ; sprite line of sight (engage distance)
+ ld a, [wTrainerEngageDistance] ; how far the trainer can see
cp b
jr nc, .checkIfLinedUp
jr .notInLine ; player too far away