summaryrefslogtreecommitdiff
path: root/engine/overworld
diff options
context:
space:
mode:
Diffstat (limited to 'engine/overworld')
-rw-r--r--engine/overworld/cmd_queue.asm4
-rw-r--r--engine/overworld/decorations.asm31
-rw-r--r--engine/overworld/events.asm60
-rw-r--r--engine/overworld/load_map_part.asm1
-rw-r--r--engine/overworld/map_object_action.asm3
-rw-r--r--engine/overworld/map_objects.asm13
-rw-r--r--engine/overworld/map_setup.asm2
-rw-r--r--engine/overworld/overworld.asm2
-rw-r--r--engine/overworld/player_movement.asm2
-rw-r--r--engine/overworld/scripting.asm24
-rw-r--r--engine/overworld/time.asm16
11 files changed, 79 insertions, 79 deletions
diff --git a/engine/overworld/cmd_queue.asm b/engine/overworld/cmd_queue.asm
index 6a598438..1994220e 100644
--- a/engine/overworld/cmd_queue.asm
+++ b/engine/overworld/cmd_queue.asm
@@ -148,7 +148,7 @@ CmdQueues_IncAnonJumptableIndex:
inc [hl]
ret
-CmdQueues_DecAnonJumptableIndex:
+CmdQueues_DecAnonJumptableIndex: ; unreferenced
ld hl, CMDQUEUE_05
add hl, bc
dec [hl]
@@ -163,7 +163,7 @@ CmdQueue_Type1:
CmdQueue_Type4:
call CmdQueues_AnonJumptable
- ; anonymous dw
+.anon_dw
dw .zero
dw .one
diff --git a/engine/overworld/decorations.asm b/engine/overworld/decorations.asm
index e7a882ae..059f915a 100644
--- a/engine/overworld/decorations.asm
+++ b/engine/overworld/decorations.asm
@@ -44,7 +44,7 @@ _PlayerDecorationMenu:
.MenuData:
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
db 0 ; items
- dw wceed
+ dw wNumOwnedDecoCategories
dw PlaceNthMenuStrings
dw .pointers
@@ -75,7 +75,7 @@ _PlayerDecorationMenu:
ld a, 7
call .AppendToStringBuffer2
ld hl, wStringBuffer2
- ld de, wceed
+ ld de, wDecoNameBuffer
ld bc, ITEM_NAME_LENGTH
call CopyBytes
ret
@@ -133,10 +133,11 @@ _PlayerDecorationMenu:
Deco_FillTempWithMinusOne:
xor a
- ld hl, wceed
+ ld hl, wNumOwnedDecoCategories
ld [hli], a
+ assert wNumOwnedDecoCategories + 1 == wOwnedDecoCategories
ld a, -1
- ld bc, $10
+ ld bc, 16
call ByteFill
ret
@@ -161,10 +162,11 @@ CheckAllDecorationFlags:
ret
AppendDecoIndex:
- ld hl, wceed
+ ld hl, wNumOwnedDecoCategories
inc [hl]
+ assert wNumOwnedDecoCategories + 1 == wOwnedDecoCategories
ld e, [hl]
- ld d, $0
+ ld d, 0
add hl, de
ld [hl], a
ret
@@ -176,7 +178,7 @@ FindOwnedDecosInCategory:
pop hl
call CheckAllDecorationFlags
pop bc
- ld a, [wceed]
+ ld a, [wNumOwnedDecoCategories]
and a
ret z
@@ -335,7 +337,7 @@ DecoExitMenu:
ret
PopulateDecoCategoryMenu:
- ld a, [wceed]
+ ld a, [wNumOwnedDecoCategories]
and a
jr z, .empty
cp 8
@@ -353,9 +355,10 @@ PopulateDecoCategoryMenu:
ret
.beyond_eight
- ld hl, wceed
+ ld hl, wNumOwnedDecoCategories
ld e, [hl]
dec [hl]
+ assert wNumOwnedDecoCategories + 1 == wOwnedDecoCategories
ld d, 0
add hl, de
ld [hl], -1
@@ -395,7 +398,7 @@ PopulateDecoCategoryMenu:
.NonscrollingMenuData:
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
db 0 ; items
- dw wceed
+ dw wDecoNameBuffer
dw DecorationMenuFunction
dw DecorationAttributes
@@ -409,10 +412,10 @@ PopulateDecoCategoryMenu:
db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 8, 0 ; rows, columns
db SCROLLINGMENU_ITEMS_NORMAL ; item format
- dbw 0, wceed ; text pointer
+ dbw 0, wDecoNameBuffer ; text pointer
dba DecorationMenuFunction
- dbw 0, 0
- dbw 0, 0
+ dbw 0, NULL
+ dbw 0, NULL
GetDecorationData:
ld hl, DecorationAttributes
@@ -932,7 +935,7 @@ GetDecorationID:
pop hl
ret
-SetAllDecorationFlags:
+SetAllDecorationFlags: ; unreferenced
ld hl, DecorationIDs
.loop
ld a, [hli]
diff --git a/engine/overworld/events.asm b/engine/overworld/events.asm
index f21ea17b..ee2facbe 100644
--- a/engine/overworld/events.asm
+++ b/engine/overworld/events.asm
@@ -25,76 +25,76 @@ OverworldLoop::
DisableEvents:
xor a
- ld [wScriptFlags3], a
+ ld [wScriptFlags2], a
ret
EnableEvents::
ld a, $ff
- ld [wScriptFlags3], a
+ ld [wScriptFlags2], a
ret
-CheckBit5_ScriptFlags3:
- ld hl, wScriptFlags3
+CheckBit5_ScriptFlags2:
+ ld hl, wScriptFlags2
bit 5, [hl]
ret
-DisableWarpsConnxns:
- ld hl, wScriptFlags3
+DisableWarpsConnxns: ; unreferenced
+ ld hl, wScriptFlags2
res 2, [hl]
ret
-DisableCoordEvents:
- ld hl, wScriptFlags3
+DisableCoordEvents: ; unreferenced
+ ld hl, wScriptFlags2
res 1, [hl]
ret
-DisableStepCount:
- ld hl, wScriptFlags3
+DisableStepCount: ; unreferenced
+ ld hl, wScriptFlags2
res 0, [hl]
ret
-DisableWildEncounters:
- ld hl, wScriptFlags3
+DisableWildEncounters: ; unreferenced
+ ld hl, wScriptFlags2
res 4, [hl]
ret
-EnableWarpsConnxns:
- ld hl, wScriptFlags3
+EnableWarpsConnxns: ; unreferenced
+ ld hl, wScriptFlags2
set 2, [hl]
ret
-EnableCoordEvents:
- ld hl, wScriptFlags3
+EnableCoordEvents: ; unreferenced
+ ld hl, wScriptFlags2
set 1, [hl]
ret
-EnableStepCount:
- ld hl, wScriptFlags3
+EnableStepCount: ; unreferenced
+ ld hl, wScriptFlags2
set 0, [hl]
ret
EnableWildEncounters:
- ld hl, wScriptFlags3
+ ld hl, wScriptFlags2
set 4, [hl]
ret
CheckWarpConnxnScriptFlag:
- ld hl, wScriptFlags3
+ ld hl, wScriptFlags2
bit 2, [hl]
ret
CheckCoordEventScriptFlag:
- ld hl, wScriptFlags3
+ ld hl, wScriptFlags2
bit 1, [hl]
ret
CheckStepCountScriptFlag:
- ld hl, wScriptFlags3
+ ld hl, wScriptFlags2
bit 0, [hl]
ret
CheckWildEncountersScriptFlag:
- ld hl, wScriptFlags3
+ ld hl, wScriptFlags2
bit 4, [hl]
ret
@@ -133,7 +133,7 @@ EnterMap:
ld [wMapStatus], a
ret
-UnusedWait30Frames:
+UnusedWait30Frames: ; unreferenced
ld c, 30
call DelayFrames
ret
@@ -245,7 +245,7 @@ PlayerEvents:
and a
ret nz
- call Dummy_CheckScriptFlags3Bit5 ; This is a waste of time
+ call Dummy_CheckScriptFlags2Bit5 ; This is a waste of time
call CheckTrainerBattle_GetPlayerEvent
jr c, .ok
@@ -382,8 +382,8 @@ SetMinTwoStepWildEncounterCooldown:
ld [wWildEncounterCooldown], a
ret
-Dummy_CheckScriptFlags3Bit5:
- call CheckBit5_ScriptFlags3
+Dummy_CheckScriptFlags2Bit5:
+ call CheckBit5_ScriptFlags2
ret z
call SetXYCompareFlags
ret
@@ -468,8 +468,8 @@ CheckTimeEvents:
scf
ret
-.unused
- ld a, 8
+.unused ; unreferenced
+ ld a, $8 ; ???
scf
ret
@@ -800,7 +800,7 @@ PlayerMovement:
CheckMenuOW:
xor a
ldh [hMenuReturn], a
- ldh [hUnusedFFA3], a
+ ldh [hUnusedByte], a
ldh a, [hJoyPressed]
bit SELECT_F, a
diff --git a/engine/overworld/load_map_part.asm b/engine/overworld/load_map_part.asm
index 4e8e228b..c91d8c98 100644
--- a/engine/overworld/load_map_part.asm
+++ b/engine/overworld/load_map_part.asm
@@ -136,7 +136,6 @@ ForceApplyFlashlight4: ; unreferenced
decoord 8, 8
ld bc, (SURROUNDING_WIDTH + 1) * 8
add hl, bc
-.loop
ld a, [hli]
ld [de], a
inc de
diff --git a/engine/overworld/map_object_action.asm b/engine/overworld/map_object_action.asm
index 4913386c..8a153f59 100644
--- a/engine/overworld/map_object_action.asm
+++ b/engine/overworld/map_object_action.asm
@@ -246,7 +246,8 @@ SetFacingBoulderDust:
and 2
ld a, FACING_BOULDER_DUST_1
jr z, .ok
- inc a ; FACING_BOULDER_DUST_2
+ inc a
+ assert FACING_BOULDER_DUST_1 + 1 == FACING_BOULDER_DUST_2
.ok
ld [hl], a
ret
diff --git a/engine/overworld/map_objects.asm b/engine/overworld/map_objects.asm
index db82248e..3d3b1cab 100644
--- a/engine/overworld/map_objects.asm
+++ b/engine/overworld/map_objects.asm
@@ -2823,18 +2823,17 @@ InitSprites:
.InitSprite:
xor a
-.skip1
ld hl, OBJECT_FLAGS2
add hl, bc
ld e, [hl]
bit OBJ_FLAGS2_7, e
- jr z, .skip2
+ jr z, .not_priority
or PRIORITY
-.skip2
+.not_priority
bit USE_OBP1_F, e
- jr z, .skip3
+ jr z, .not_obp_num
or OBP_NUM
-.skip3
+.not_obp_num
ld hl, OBJECT_PALETTE
add hl, bc
ld d, a
@@ -2844,9 +2843,9 @@ InitSprites:
ld d, a
xor a
bit OVERHEAD_F, e
- jr z, .skip4
+ jr z, .not_overhead
or PRIORITY
-.skip4
+.not_overhead
ldh [hCurSpriteOAMFlags], a
ld hl, OBJECT_SPRITE_TILE
add hl, bc
diff --git a/engine/overworld/map_setup.asm b/engine/overworld/map_setup.asm
index e1a7ebec..e13c2216 100644
--- a/engine/overworld/map_setup.asm
+++ b/engine/overworld/map_setup.asm
@@ -82,7 +82,7 @@ LoadMapObjects:
farcall InitializeVisibleSprites
ret
-; unused
+MapSetup_DummyFunction: ; unreferenced
ret
ResetPlayerObjectAction:
diff --git a/engine/overworld/overworld.asm b/engine/overworld/overworld.asm
index 0d285d2a..40157524 100644
--- a/engine/overworld/overworld.asm
+++ b/engine/overworld/overworld.asm
@@ -119,7 +119,7 @@ AddOutdoorSprites:
dec c
jr nz, .loop
- ld a, [wUnusedD05A]
+ ld a, [wUnusedAddOutdoorSpritesReturnValue]
ld c, a
ret
diff --git a/engine/overworld/player_movement.asm b/engine/overworld/player_movement.asm
index a958429c..c18d3b46 100644
--- a/engine/overworld/player_movement.asm
+++ b/engine/overworld/player_movement.asm
@@ -311,7 +311,7 @@ DoPlayerMovement::
scf
ret
-; unused
+.unused ; unreferenced
xor a
ret
diff --git a/engine/overworld/scripting.asm b/engine/overworld/scripting.asm
index 19fd15db..ffb878a9 100644
--- a/engine/overworld/scripting.asm
+++ b/engine/overworld/scripting.asm
@@ -432,11 +432,11 @@ Script_verbosegiveitem:
ld de, GiveItemScript
jp ScriptCall
-ret_96e71:
+GiveItemScript_DummyFunction:
ret
GiveItemScript:
- callasm ret_96e71
+ callasm GiveItemScript_DummyFunction
writetext .ReceivedItemText
iffalse .Full
waitsfx
@@ -1518,8 +1518,6 @@ Script_getcurlandmarkname:
ld a, [wMapNumber]
ld c, a
call GetWorldMapLocation
-
-ConvertLandmarkToText:
ld e, a
farcall GetLandmarkName
ld de, wStringBuffer1
@@ -1589,7 +1587,7 @@ Script_givepokemail:
push bc
inc hl
ld bc, MAIL_MSG_LENGTH
- ld de, wceed
+ ld de, wMonMailMessageBuffer
ld a, [wScriptBank]
call FarCopyBytes
pop bc
@@ -2059,8 +2057,7 @@ Script_warpcheck:
farcall EnableEvents
ret
-Script_enableevents:
-; unused
+Script_enableevents: ; unreferenced
farcall EnableEvents
ret
@@ -2090,7 +2087,8 @@ Script_writeunusedbytebuffer:
ld [wUnusedScriptByteBuffer], a
ret
- db closetext_command ; unused
+UnusedClosetextScript: ; unreferenced
+ closetext
Script_closetext:
ldh a, [hOAMUpdate]
@@ -2208,11 +2206,11 @@ Script_endall:
ret
Script_halloffame:
- ld hl, wGameTimerPause
- res GAMETIMERPAUSE_TIMER_PAUSED_F, [hl]
+ ld hl, wGameTimerPaused
+ res GAME_TIMER_PAUSED_F, [hl]
farcall HallOfFame
- ld hl, wGameTimerPause
- set GAMETIMERPAUSE_TIMER_PAUSED_F, [hl]
+ ld hl, wGameTimerPaused
+ set GAME_TIMER_PAUSED_F, [hl]
jr ReturnFromCredits
Script_credits:
@@ -2224,7 +2222,7 @@ ReturnFromCredits:
call StopScript
ret
-; unused
+Script_checkver_duplicate: ; unreferenced
ld a, [.gs_version]
ld [wScriptVar], a
ret
diff --git a/engine/overworld/time.asm b/engine/overworld/time.asm
index a829cd4f..a109a417 100644
--- a/engine/overworld/time.asm
+++ b/engine/overworld/time.asm
@@ -158,7 +158,7 @@ CheckPokerusTick::
xor a
ret
-SetUnusedTwoDayTimer:
+SetUnusedTwoDayTimer: ; unreferenced
ld a, 2
ld hl, wUnusedTwoDayTimer
ld [hl], a
@@ -175,12 +175,12 @@ CheckUnusedTwoDayTimer:
call UpdateTimeRemaining
ret
-; unused
+UnusedSetSwarmFlag: ; unreferenced
ld hl, wDailyFlags1
set DAILYFLAGS1_SWARM_F, [hl]
ret
-; unused
+UnusedCheckSwarmFlag: ; unreferenced
and a
ld hl, wDailyFlags1
bit DAILYFLAGS1_SWARM_F, [hl]
@@ -227,7 +227,7 @@ DoMysteryGiftIfDayHasPassed:
ld hl, wBuffer1
call InitOneDayCountdown
call CloseSRAM
- farcall Function2a4f6
+ farcall ResetDailyMysteryGiftLimitIfUnlocked
.not_timed_out
ld a, BANK(sMysteryGiftTimer)
@@ -263,7 +263,7 @@ UpdateTimeRemaining:
scf
ret
-GetSecondsSinceIfLessThan60:
+GetSecondsSinceIfLessThan60: ; unreferenced
ld a, [wDaysSince]
and a
jr nz, GetTimeElapsed_ExceedsUnitLimit
@@ -285,7 +285,7 @@ GetMinutesSinceIfLessThan60:
ld a, [wMinutesSince]
ret
-GetHoursSinceIfLessThan24:
+GetHoursSinceIfLessThan24: ; unreferenced
ld a, [wDaysSince]
and a
jr nz, GetTimeElapsed_ExceedsUnitLimit
@@ -304,7 +304,7 @@ CalcDaysSince:
xor a
jr _CalcDaysSince
-CalcHoursDaysSince:
+CalcHoursDaysSince: ; unreferenced
inc hl
xor a
jr _CalcHoursDaysSince
@@ -378,7 +378,7 @@ CopyDayToHL:
ld [hl], a
ret
-CopyDayHourToHL:
+CopyDayHourToHL: ; unreferenced
ld a, [wCurDay]
ld [hli], a
ldh a, [hHours]