aboutsummaryrefslogtreecommitdiffstats
path: root/engine
diff options
context:
space:
mode:
Diffstat (limited to 'engine')
-rw-r--r--engine/battle/battle_transitions.asm2
-rw-r--r--engine/battle/core.asm36
-rw-r--r--engine/battle/effects.asm4
-rw-r--r--engine/battle/end_of_battle.asm4
-rw-r--r--engine/battle/experience.asm6
-rw-r--r--engine/battle/read_trainer_party.asm8
-rw-r--r--engine/battle/wild_encounters.asm8
-rw-r--r--engine/debug/debug_menu.asm6
-rw-r--r--engine/debug/debug_party.asm2
-rw-r--r--engine/events/black_out.asm12
-rw-r--r--engine/events/cinnabar_lab.asm8
-rw-r--r--engine/events/diploma.asm8
-rw-r--r--engine/events/display_pokedex.asm8
-rw-r--r--engine/events/hidden_objects/bills_house_pc.asm8
-rw-r--r--engine/events/hidden_objects/school_blackboard.asm24
-rw-r--r--engine/events/hidden_objects/town_map.asm8
-rw-r--r--engine/events/in_game_trades.asm6
-rw-r--r--engine/events/poison.asm9
-rw-r--r--engine/events/pokecenter.asm8
-rw-r--r--engine/events/prize_menu.asm10
-rw-r--r--engine/events/vending_machine.asm8
-rw-r--r--engine/gfx/sprite_oam.asm4
-rw-r--r--engine/items/item_effects.asm32
-rw-r--r--engine/items/town_map.asm7
-rw-r--r--engine/joypad.asm4
-rw-r--r--engine/link/cable_club.asm4
-rw-r--r--engine/link/cable_club_npc.asm4
-rw-r--r--engine/menus/display_text_id_init.asm6
-rw-r--r--engine/menus/draw_start_menu.asm12
-rw-r--r--engine/menus/league_pc.asm4
-rw-r--r--engine/menus/main_menu.asm86
-rw-r--r--engine/menus/naming_screen.asm8
-rw-r--r--engine/menus/party_menu.asm4
-rw-r--r--engine/menus/pc.asm20
-rw-r--r--engine/menus/players_pc.asm24
-rw-r--r--engine/menus/pokedex.asm8
-rw-r--r--engine/menus/save.asm9
-rw-r--r--engine/menus/start_sub_menus.asm36
-rw-r--r--engine/menus/text_box.asm50
-rw-r--r--engine/movie/oak_speech/oak_speech.asm10
-rw-r--r--engine/movie/title.asm6
-rw-r--r--engine/movie/trade.asm8
-rw-r--r--engine/overworld/auto_movement.asm76
-rw-r--r--engine/overworld/cut.asm8
-rw-r--r--engine/overworld/emotion_bubbles.asm4
-rw-r--r--engine/overworld/field_move_messages.asm24
-rw-r--r--engine/overworld/hidden_objects.asm12
-rw-r--r--engine/overworld/ledges.asm8
-rw-r--r--engine/overworld/movement.asm22
-rw-r--r--engine/overworld/player_animations.asm32
-rw-r--r--engine/overworld/player_state.asm27
-rw-r--r--engine/overworld/push_boulder.asm38
-rw-r--r--engine/overworld/special_warps.asm30
-rw-r--r--engine/overworld/trainer_sight.asm4
-rw-r--r--engine/play_time.asm16
-rw-r--r--engine/pokemon/add_mon.asm6
-rw-r--r--engine/pokemon/bills_pc.asm20
-rw-r--r--engine/pokemon/evos_moves.asm8
-rw-r--r--engine/pokemon/status_screen.asm10
-rw-r--r--engine/slots/slot_machine.asm8
60 files changed, 449 insertions, 443 deletions
diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm
index 363533ce..16311f48 100644
--- a/engine/battle/battle_transitions.asm
+++ b/engine/battle/battle_transitions.asm
@@ -105,7 +105,7 @@ GetBattleTransitionID_CompareLevels:
ld a, [hl]
add $3
ld e, a
- ld a, [wCurEnemyLVL]
+ ld a, [wCurEnemyLevel]
sub e
jr nc, .highLevelEnemy
res 1, c
diff --git a/engine/battle/core.asm b/engine/battle/core.asm
index ca3294b8..ab4d1c56 100644
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -844,7 +844,7 @@ FaintEnemyPokemon:
; the player has exp all
; now, set the gain exp flag for every party member
; half of the total stat exp and normal exp will divided evenly amongst every party member
- ld a, $1
+ ld a, TRUE
ld [wBoostExpByExpAll], a
ld a, [wPartyCount]
ld b, 0
@@ -924,8 +924,8 @@ TrainerBattleVictory:
cp RIVAL3 ; final battle against rival
jr nz, .notrival
ld b, MUSIC_DEFEATED_GYM_LEADER
- ld hl, wFlags_D733
- set 1, [hl]
+ ld hl, wStatusFlags7
+ set BIT_NO_MAP_MUSIC, [hl]
.notrival
ld a, [wLinkState]
cp LINK_STATE_BATTLING
@@ -1157,9 +1157,9 @@ HandlePlayerBlackOut:
ld hl, LinkBattleLostText
.noLinkBattle
call PrintText
- ld a, [wd732]
- res 5, a
- ld [wd732], a
+ ld a, [wStatusFlags6]
+ res BIT_ALWAYS_ON_BIKE, a
+ ld [wStatusFlags6], a
call ClearScreen
scf
ret
@@ -1179,10 +1179,10 @@ LinkBattleLostText:
; slides pic of fainted mon downwards until it disappears
; bug: when this is called, [hAutoBGTransferEnabled] is non-zero, so there is screen tearing
SlideDownFaintedMonPic:
- ld a, [wd730]
+ ld a, [wStatusFlags5]
push af
- set 6, a
- ld [wd730], a
+ set BIT_NO_TEXT_DELAY, a
+ ld [wStatusFlags5], a
ld b, 7 ; number of times to slide
.slideStepLoop ; each iteration, the mon is slid down one row
push bc
@@ -1221,7 +1221,7 @@ SlideDownFaintedMonPic:
dec b
jr nz, .slideStepLoop
pop af
- ld [wd730], a
+ ld [wStatusFlags5], a
ret
SevenSpacesText:
@@ -1344,7 +1344,7 @@ EnemySendOutFirstMon:
ld bc, wEnemyMon2 - wEnemyMon1
call AddNTimes
ld a, [hl]
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
ld a, [wWhichPokemon]
inc a
ld hl, wEnemyPartyCount
@@ -2558,7 +2558,7 @@ MoveSelectionMenu:
cp LINK_STATE_BATTLING
jr z, .matchedkeyspicked
; Disable left, right, and START buttons in regular battles.
- ld a, [wFlags_D733]
+ ld a, [wStatusFlags7]
bit BIT_TEST_BATTLE, a
ld b, D_UP | D_DOWN | A_BUTTON | B_BUTTON | SELECT
jr z, .matchedkeyspicked
@@ -2587,7 +2587,7 @@ SelectMenuItem:
jr .select
.battleselect
; Hide move swap cursor in TestBattle.
- ld a, [wFlags_D733]
+ ld a, [wStatusFlags7]
bit BIT_TEST_BATTLE, a
; This causes PrintMenuItem to not run in TestBattle.
; MoveSelectionMenu still draws part of its window, an issue
@@ -4404,7 +4404,7 @@ GetEnemyMonStat:
ret
.notLinkBattle
ld a, [wEnemyMonLevel]
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
ld a, [wEnemyMonSpecies]
ld [wd0b5], a
call GetMonHeader
@@ -6092,7 +6092,7 @@ GetCurrentMove:
.player
ld de, wPlayerMoveNum
; Apply InitBattleVariables to TestBattle.
- ld a, [wFlags_D733]
+ ld a, [wStatusFlags7]
bit BIT_TEST_BATTLE, a
ld a, [wTestBattlePlayerSelectedMove]
jr nz, .selected
@@ -6143,7 +6143,7 @@ LoadEnemyMonData:
ld [hli], a
ld [hl], b
ld de, wEnemyMonLevel
- ld a, [wCurEnemyLVL]
+ ld a, [wCurEnemyLevel]
ld [de], a
inc de
ld b, $0
@@ -6776,7 +6776,7 @@ InitOpponent:
jr InitBattleCommon
DetermineWildOpponent:
- ld a, [wd732]
+ ld a, [wStatusFlags6]
bit BIT_DEBUG_MODE, a
jr z, .notDebugMode
ldh a, [hJoyHeld]
@@ -6794,7 +6794,7 @@ InitBattleCommon:
ld hl, wLetterPrintingDelayFlags
ld a, [hl]
push af
- res 1, [hl]
+ res BIT_TEXT_DELAY, [hl] ; no delay
callfar InitBattleVariables
ld a, [wEnemyMonSpecies2]
sub OPP_ID_OFFSET
diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm
index b94b12d2..643afeb2 100644
--- a/engine/battle/effects.asm
+++ b/engine/battle/effects.asm
@@ -812,7 +812,7 @@ SwitchAndTeleportEffect:
ld a, [wIsInBattle]
dec a
jr nz, .notWildBattle1
- ld a, [wCurEnemyLVL]
+ ld a, [wCurEnemyLevel]
ld b, a
ld a, [wBattleMonLevel]
cp b ; is the player's level greater than the enemy's level?
@@ -856,7 +856,7 @@ SwitchAndTeleportEffect:
jr nz, .notWildBattle2
ld a, [wBattleMonLevel]
ld b, a
- ld a, [wCurEnemyLVL]
+ ld a, [wCurEnemyLevel]
cp b
jr nc, .enemyMoveWasSuccessful
add b
diff --git a/engine/battle/end_of_battle.asm b/engine/battle/end_of_battle.asm
index b9f9d537..80fdf002 100644
--- a/engine/battle/end_of_battle.asm
+++ b/engine/battle/end_of_battle.asm
@@ -66,8 +66,8 @@ EndOfBattle:
ld [hli], a
dec b
jr nz, .loop
- ld hl, wd72c
- set 0, [hl]
+ ld hl, wStatusFlags2
+ set BIT_WILD_ENCOUNTER_COOLDOWN, [hl]
call WaitForSoundToFinish
call GBPalWhiteOut
ld a, $ff
diff --git a/engine/battle/experience.asm b/engine/battle/experience.asm
index 0eab6e08..798d7ce1 100644
--- a/engine/battle/experience.asm
+++ b/engine/battle/experience.asm
@@ -160,11 +160,11 @@ GainExperience:
ld a, [hl] ; current level
cp d
jp z, .nextMon ; if level didn't change, go to next mon
- ld a, [wCurEnemyLVL]
+ ld a, [wCurEnemyLevel]
push af
push hl
ld a, d
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
ld [hl], a
ld bc, wPartyMon1Species - wPartyMon1Level
add hl, bc
@@ -261,7 +261,7 @@ GainExperience:
predef FlagActionPredef
pop hl
pop af
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
.nextMon
ld a, [wPartyCount]
diff --git a/engine/battle/read_trainer_party.asm b/engine/battle/read_trainer_party.asm
index a9e09a30..a88b0dfc 100644
--- a/engine/battle/read_trainer_party.asm
+++ b/engine/battle/read_trainer_party.asm
@@ -49,7 +49,7 @@ ReadTrainer:
ld a, [hli]
cp $FF ; is the trainer special?
jr z, .SpecialTrainer ; if so, check for special moves
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
.LoopTrainerData
ld a, [hli]
and a ; have we reached the end of the trainer data?
@@ -69,7 +69,7 @@ ReadTrainer:
ld a, [hli]
and a ; have we reached the end of the trainer data?
jr z, .AddLoneMove
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
ld a, [hli]
ld [wcf91], a
ld a, ENEMY_PARTY_DATA
@@ -150,7 +150,7 @@ ReadTrainer:
ld [de], a
inc de
ld [de], a
- ld a, [wCurEnemyLVL]
+ ld a, [wCurEnemyLevel]
ld b, a
.LastLoop
; update wAmountMoneyWon addresses (money to win) based on enemy's level
@@ -162,5 +162,5 @@ ReadTrainer:
inc de
inc de
dec b
- jr nz, .LastLoop ; repeat wCurEnemyLVL times
+ jr nz, .LastLoop ; repeat wCurEnemyLevel times
ret
diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm
index 8c9c1529..eede46ed 100644
--- a/engine/battle/wild_encounters.asm
+++ b/engine/battle/wild_encounters.asm
@@ -4,8 +4,8 @@ TryDoWildEncounter:
ld a, [wNPCMovementScriptPointerTableNum]
and a
ret nz
- ld a, [wd736]
- and a
+ ld a, [wMovementFlags]
+ and a ; is player exiting a door, jumping over a ledge, or fishing?
ret nz
callfar IsPlayerStandingOnDoorTileOrWarpTile
jr nc, .notStandingOnDoorOrWarpTile
@@ -74,7 +74,7 @@ TryDoWildEncounter:
ld b, 0
add hl, bc
ld a, [hli]
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
ld a, [hl]
ld [wcf91], a
ld [wEnemyMonSpecies2], a
@@ -83,7 +83,7 @@ TryDoWildEncounter:
jr z, .willEncounter
ld a, [wPartyMon1Level]
ld b, a
- ld a, [wCurEnemyLVL]
+ ld a, [wCurEnemyLevel]
cp b
jr c, .CantEncounter2 ; repel prevents encounters if the leading party mon's level is higher than the wild mon
jr .willEncounter
diff --git a/engine/debug/debug_menu.asm b/engine/debug/debug_menu.asm
index fbf136fe..06c2ace1 100644
--- a/engine/debug/debug_menu.asm
+++ b/engine/debug/debug_menu.asm
@@ -55,7 +55,7 @@ IF DEF(_DEBUG)
jp z, TestBattle
; DEBUG
- ld hl, wd732
+ ld hl, wStatusFlags6
set BIT_DEBUG_MODE, [hl]
jp StartNewGameDebug
@@ -80,7 +80,7 @@ TestBattle: ; unreferenced except in _DEBUG
ld a, 1 << BIT_EARTHBADGE
ld [wObtainedBadges], a
- ld hl, wFlags_D733
+ ld hl, wStatusFlags7
set BIT_TEST_BATTLE, [hl]
; wNumBagItems and wBagItems are not initialized here,
@@ -100,7 +100,7 @@ TestBattle: ; unreferenced except in _DEBUG
ld a, RHYDON
ld [wcf91], a
ld a, 20
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
xor a
ld [wMonDataLocation], a
ld [wCurMap], a
diff --git a/engine/debug/debug_party.asm b/engine/debug/debug_party.asm
index 0c76bde1..17d0f793 100644
--- a/engine/debug/debug_party.asm
+++ b/engine/debug/debug_party.asm
@@ -7,7 +7,7 @@ SetDebugNewGameParty: ; unreferenced except in _DEBUG
ld [wcf91], a
inc de
ld a, [de]
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
inc de
call AddPartyMon
jr .loop
diff --git a/engine/events/black_out.asm b/engine/events/black_out.asm
index 16d2081f..5b0459e2 100644
--- a/engine/events/black_out.asm
+++ b/engine/events/black_out.asm
@@ -8,7 +8,7 @@ ResetStatusAndHalveMoneyOnBlackout::
ld [wNPCMovementScriptFunctionNum], a
ldh [hJoyHeld], a
ld [wNPCMovementScriptPointerTableNum], a
- ld [wFlags_0xcd60], a
+ ld [wMiscFlags], a
ldh [hMoney], a
ldh [hMoney + 1], a
@@ -37,10 +37,10 @@ ResetStatusAndHalveMoneyOnBlackout::
ld [wPlayerMoney + 2], a
.lostmoney
- ld hl, wd732
- set 2, [hl]
- res 3, [hl]
- set 6, [hl]
- ld a, %11111111
+ ld hl, wStatusFlags6
+ set BIT_FLY_OR_DUNGEON_WARP, [hl]
+ res BIT_FLY_WARP, [hl]
+ set BIT_ESCAPE_WARP, [hl]
+ ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
predef_jump HealParty
diff --git a/engine/events/cinnabar_lab.asm b/engine/events/cinnabar_lab.asm
index 545baf13..eb82a5b1 100644
--- a/engine/events/cinnabar_lab.asm
+++ b/engine/events/cinnabar_lab.asm
@@ -1,6 +1,6 @@
GiveFossilToCinnabarLab::
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
xor a
ld [wCurrentMenuItem], a
ld a, A_BUTTON | B_BUTTON
@@ -24,8 +24,8 @@ GiveFossilToCinnabarLab::
call TextBoxBorder
call UpdateSprites
call PrintFossilsInBag
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
call HandleMenuInput
bit BIT_B_BUTTON, a
jr nz, .cancelledGivingFossil
diff --git a/engine/events/diploma.asm b/engine/events/diploma.asm
index e08b1f24..900e3782 100644
--- a/engine/events/diploma.asm
+++ b/engine/events/diploma.asm
@@ -6,8 +6,8 @@ DisplayDiploma::
call ClearScreen
xor a
ld [wUpdateSpritesEnabled], a
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
call DisableLCD
ld hl, CircleTile
ld de, vChars2 tile CIRCLE_TILE_ID
@@ -65,8 +65,8 @@ DisplayDiploma::
ld a, $90
ldh [rOBP0], a
call WaitForTextScrollButtonPress
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
call GBPalWhiteOutWithDelay3
call RestoreScreenTilesAndReloadTilePatterns
call Delay3
diff --git a/engine/events/display_pokedex.asm b/engine/events/display_pokedex.asm
index d657ea85..68d48bb3 100644
--- a/engine/events/display_pokedex.asm
+++ b/engine/events/display_pokedex.asm
@@ -1,9 +1,9 @@
_DisplayPokedex::
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
predef ShowPokedexData
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
call ReloadMapData
ld c, 10
call DelayFrames
diff --git a/engine/events/hidden_objects/bills_house_pc.asm b/engine/events/hidden_objects/bills_house_pc.asm
index 6147387a..b4c0256d 100644
--- a/engine/events/hidden_objects/bills_house_pc.asm
+++ b/engine/events/hidden_objects/bills_house_pc.asm
@@ -82,8 +82,8 @@ BillsHousePokemonList::
ld a, 1
ld [wTopMenuItemX], a
.billsPokemonLoop
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
hlcoord 0, 0
ld b, 10
ld c, 9
@@ -113,8 +113,8 @@ BillsHousePokemonList::
call LoadScreenTilesFromBuffer2
jr .billsPokemonLoop
.cancel
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
call LoadScreenTilesFromBuffer2
jp TextScriptEnd
diff --git a/engine/events/hidden_objects/school_blackboard.asm b/engine/events/hidden_objects/school_blackboard.asm
index fd3c0b8f..4839af37 100644
--- a/engine/events/hidden_objects/school_blackboard.asm
+++ b/engine/events/hidden_objects/school_blackboard.asm
@@ -24,8 +24,8 @@ LinkCableHelp::
ld a, 1
ld [wTopMenuItemX], a
.linkHelpLoop
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
hlcoord 0, 0
ld b, 8
ld c, 13
@@ -41,8 +41,8 @@ LinkCableHelp::
ld a, [wCurrentMenuItem]
cp 3 ; pressed a on "STOP READING"
jr z, .exit
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
ld hl, LinkCableInfoTexts
add a
ld d, 0
@@ -54,8 +54,8 @@ LinkCableHelp::
call PrintText
jp .linkHelpLoop
.exit
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
call LoadScreenTilesFromBuffer1
jp TextScriptEnd
@@ -108,8 +108,8 @@ ViridianSchoolBlackboard::
ld a, 1
ld [wTopMenuItemX], a
.blackboardLoop
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
hlcoord 0, 0
lb bc, 6, 10
call TextBoxBorder
@@ -158,8 +158,8 @@ ViridianSchoolBlackboard::
jr z, .exitBlackboard
; we must have pressed a on a status condition
; so print the text
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
ld hl, ViridianBlackboardStatusPointers
add a
ld d, 0
@@ -171,8 +171,8 @@ ViridianSchoolBlackboard::
call PrintText
jp .blackboardLoop
.exitBlackboard
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
call LoadScreenTilesFromBuffer1
jp TextScriptEnd
diff --git a/engine/events/hidden_objects/town_map.asm b/engine/events/hidden_objects/town_map.asm
index 4284214f..11f7cbc7 100644
--- a/engine/events/hidden_objects/town_map.asm
+++ b/engine/events/hidden_objects/town_map.asm
@@ -4,8 +4,8 @@ TownMapText::
text_asm
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
call GBPalWhiteOutWithDelay3
xor a
ldh [hWY], a
@@ -13,8 +13,8 @@ TownMapText::
ldh [hAutoBGTransferEnabled], a
call LoadFontTilePatterns
farcall DisplayTownMap
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
ld de, TextScriptEnd
push de
ldh a, [hLoadedROMBank]
diff --git a/engine/events/in_game_trades.asm b/engine/events/in_game_trades.asm
index c6951615..54588e7d 100644
--- a/engine/events/in_game_trades.asm
+++ b/engine/events/in_game_trades.asm
@@ -108,7 +108,7 @@ InGameTrade_DoTrade:
ld bc, wPartyMon2 - wPartyMon1
call AddNTimes
ld a, [hl]
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
ld hl, wCompletedInGameTradeFlags
ld a, [wWhichTrade]
ld c, a
@@ -118,13 +118,13 @@ InGameTrade_DoTrade:
call PrintText
ld a, [wWhichPokemon]
push af
- ld a, [wCurEnemyLVL]
+ ld a, [wCurEnemyLevel]
push af
call LoadHpBarAndStatusTilePatterns
call InGameTrade_PrepareTradeData
predef InternalClockTradeAnim
pop af
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
pop af
ld [wWhichPokemon], a
ld a, [wInGameTradeReceiveMonSpecies]
diff --git a/engine/events/poison.asm b/engine/events/poison.asm
index 8bb756b5..513d08a7 100644
--- a/engine/events/poison.asm
+++ b/engine/events/poison.asm
@@ -1,6 +1,7 @@
ApplyOutOfBattlePoisonDamage:
- ld a, [wd730]
- add a
+ ld a, [wStatusFlags5]
+ assert BIT_SCRIPTED_MOVEMENT_STATE == 7
+ add a ; overflows bit 7 into carry flag
jp c, .noBlackOut ; no black out if joypad states are being simulated
ld a, [wPartyCount]
and a
@@ -101,8 +102,8 @@ ApplyOutOfBattlePoisonDamage:
ld a, TEXT_BLACKED_OUT
ldh [hSpriteIndexOrTextID], a
call DisplayTextID
- ld hl, wd72e
- set 5, [hl]
+ ld hl, wStatusFlags4
+ set BIT_BATTLE_OVER_OR_BLACKOUT, [hl]
ld a, $ff
jr .done
.noBlackOut
diff --git a/engine/events/pokecenter.asm b/engine/events/pokecenter.asm
index 97dbcd53..e52c8f5e 100644
--- a/engine/events/pokecenter.asm
+++ b/engine/events/pokecenter.asm
@@ -2,10 +2,10 @@ DisplayPokemonCenterDialogue_::
call SaveScreenTilesToBuffer1 ; save screen
ld hl, PokemonCenterWelcomeText
call PrintText
- ld hl, wd72e
- bit 2, [hl]
- set 1, [hl]
- set 2, [hl]
+ ld hl, wStatusFlags4
+ bit BIT_USED_POKECENTER, [hl]
+ set BIT_UNKNOWN_4_1, [hl]
+ set BIT_USED_POKECENTER, [hl]
jr nz, .skipShallWeHealYourPokemon
ld hl, ShallWeHealYourPokemonText
call PrintText
diff --git a/engine/events/prize_menu.asm b/engine/events/prize_menu.asm
index bc3aab9a..c1e93c36 100644
--- a/engine/events/prize_menu.asm
+++ b/engine/events/prize_menu.asm
@@ -5,8 +5,8 @@ CeladonPrizeMenu::
ld hl, RequireCoinCaseTextPtr
jp PrintText
.havingCoinCase
- ld hl, wd730
- set 6, [hl] ; disable letter-printing delay
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
ld hl, ExchangeCoinsForPrizesTextPtr
call PrintText
; the following are the menu settings
@@ -38,8 +38,8 @@ CeladonPrizeMenu::
jr z, .noChoice
call HandlePrizeChoice
.noChoice
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
ret
RequireCoinCaseTextPtr:
@@ -298,7 +298,7 @@ GetPrizeMonLevel:
jr .loop
.matchFound
ld a, [hl]
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
ret
INCLUDE "data/events/prize_mon_levels.asm"
diff --git a/engine/events/vending_machine.asm b/engine/events/vending_machine.asm
index 980a45c5..1530b994 100644
--- a/engine/events/vending_machine.asm
+++ b/engine/events/vending_machine.asm
@@ -15,8 +15,8 @@ VendingMachineMenu::
ld [wTopMenuItemY], a
ld a, 1
ld [wTopMenuItemX], a
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
hlcoord 0, 3
ld b, 8
ld c, 12
@@ -28,8 +28,8 @@ VendingMachineMenu::
hlcoord 9, 6
ld de, DrinkPriceText
call PlaceString
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
call HandleMenuInput
bit BIT_B_BUTTON, a
jr nz, .notThirsty
diff --git a/engine/gfx/sprite_oam.asm b/engine/gfx/sprite_oam.asm
index 8704814f..3916c0db 100644
--- a/engine/gfx/sprite_oam.asm
+++ b/engine/gfx/sprite_oam.asm
@@ -150,8 +150,8 @@ PrepareOAMData::
ld h, HIGH(wShadowOAM)
ld de, $4
ld b, $a0
- ld a, [wd736]
- bit 6, a ; jumping down ledge or fishing animation?
+ ld a, [wMovementFlags]
+ bit BIT_LEDGE_OR_FISHING, a
ld a, $a0
jr z, .clear
diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm
index 8d21b964..e771504d 100644
--- a/engine/items/item_effects.asm
+++ b/engine/items/item_effects.asm
@@ -495,7 +495,7 @@ ItemUseBall:
ld a, [wEnemyMonSpecies2]
ld [wcf91], a
ld a, [wEnemyMonLevel]
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
callfar LoadEnemyMonData
pop af
ld [wcf91], a
@@ -679,8 +679,8 @@ ItemUseSurfboard:
jp c, SurfingAttemptFailed
.surf
call .makePlayerMoveForward
- ld hl, wd730
- set 7, [hl]
+ ld hl, wStatusFlags5
+ set BIT_SCRIPTED_MOVEMENT_STATE, [hl]
ld a, 2
ld [wWalkBikeSurfState], a ; change player state to surfing
call PlayDefaultMusic ; play surfing music
@@ -715,8 +715,8 @@ ItemUseSurfboard:
jp PrintText
.stopSurfing
call .makePlayerMoveForward
- ld hl, wd730
- set 7, [hl]
+ ld hl, wStatusFlags5
+ set BIT_SCRIPTED_MOVEMENT_STATE, [hl]
xor a
ld [wWalkBikeSurfState], a ; change player state to walking
dec a
@@ -1259,7 +1259,7 @@ ItemUseMedicine:
ld bc, wPartyMon1Level - wPartyMon1
add hl, bc ; hl now points to level
ld a, [hl] ; a = level
- ld [wCurEnemyLVL], a ; store level
+ ld [wCurEnemyLevel], a ; store level
call GetMonHeader
push de
ld a, d
@@ -1338,7 +1338,7 @@ ItemUseMedicine:
jr z, .vitaminNoEffect ; can't raise level above 100
inc a
ld [hl], a ; store incremented level
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
push hl
push de
ld d, a
@@ -1505,11 +1505,11 @@ ItemUseEscapeRope:
jr z, .notUsable
cp b
jr nz, .loop
- ld hl, wd732
- set 3, [hl]
- set 6, [hl]
- ld hl, wd72e
- res 4, [hl]
+ ld hl, wStatusFlags6
+ set BIT_FLY_WARP, [hl]
+ set BIT_ESCAPE_WARP, [hl]
+ ld hl, wStatusFlags4
+ res BIT_NO_BATTLES, [hl]
ResetEvent EVENT_IN_SAFARI_ZONE
xor a
ld [wNumSafariBalls], a
@@ -1597,8 +1597,8 @@ ItemUseCardKey:
.done
ld hl, ItemUseText00
call PrintText
- ld hl, wd728
- set 7, [hl]
+ ld hl, wStatusFlags1
+ set BIT_UNUSED_CARD_KEY, [hl] ; never checked
ret
INCLUDE "data/events/card_key_coords.asm"
@@ -1872,7 +1872,7 @@ RodResponse:
ld a, 1
ld [wMoveMissed], a
ld a, b ; level
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
ld a, c ; species
ld [wCurOpponent], a
@@ -2774,7 +2774,7 @@ SendNewMonToBox:
ld [de], a
inc de
push de
- ld a, [wCurEnemyLVL]
+ ld a, [wCurEnemyLevel]
ld d, a
callfar CalcExperience
pop de
diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm
index d278d034..ccbe0225 100644
--- a/engine/items/town_map.asm
+++ b/engine/items/town_map.asm
@@ -208,10 +208,11 @@ LoadTownMap_Fly::
call PlaySound
ld a, [hl]
ld [wDestinationMap], a
- ld hl, wd732
- set 3, [hl]
+ ld hl, wStatusFlags6
+ set BIT_FLY_WARP, [hl]
+ assert wStatusFlags6 + 1 == wStatusFlags7
inc hl
- set 7, [hl]
+ set BIT_USED_FLY, [hl]
.pressedB
xor a
ld [wTownMapSpriteBlinkingEnabled], a
diff --git a/engine/joypad.asm b/engine/joypad.asm
index 87f92635..63b09a87 100644
--- a/engine/joypad.asm
+++ b/engine/joypad.asm
@@ -19,8 +19,8 @@ _Joypad::
ld a, b
ldh [hJoyLast], a
- ld a, [wd730]
- bit 5, a
+ ld a, [wStatusFlags5]
+ bit BIT_DISABLE_JOYPAD, a
jr nz, DiscardButtonPresses
ldh a, [hJoyLast]
diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm
index f10e1ada..e5796e53 100644
--- a/engine/link/cable_club.asm
+++ b/engine/link/cable_club.asm
@@ -587,7 +587,7 @@ ReturnToCableClubRoom:
push hl
res 0, [hl]
xor a
- ld [wd72d], a
+ ld [wStatusFlags3], a ; clears BIT_INIT_TRADE_CENTER_FACING
dec a
ld [wDestinationWarpID], a
call LoadMapData
@@ -839,7 +839,7 @@ TradeCenter_Trade:
call ClearScreen
call LoadHpBarAndStatusTilePatterns
xor a
- ld [wUnusedCC5B], a
+ ld [wUnusedFlag], a
ldh a, [hSerialConnectionStatus]
cp USING_EXTERNAL_CLOCK
jr z, .usingExternalClock
diff --git a/engine/link/cable_club_npc.asm b/engine/link/cable_club_npc.asm
index 41f56a21..d88538b0 100644
--- a/engine/link/cable_club_npc.asm
+++ b/engine/link/cable_club_npc.asm
@@ -110,8 +110,8 @@ CableClubNPC::
ld hl, wUnknownSerialCounter
ld [hli], a
ld [hl], a
- ld hl, wd72e
- res 6, [hl]
+ ld hl, wStatusFlags4
+ res BIT_LINK_CONNECTED, [hl]
xor a
ld [wMenuJoypadPollCount], a
ret
diff --git a/engine/menus/display_text_id_init.asm b/engine/menus/display_text_id_init.asm
index 6ce76e7f..7f2c1a59 100644
--- a/engine/menus/display_text_id_init.asm
+++ b/engine/menus/display_text_id_init.asm
@@ -32,9 +32,9 @@ DisplayTextIDInit::
.skipDrawingTextBoxBorder
ld hl, wFontLoaded
set 0, [hl]
- ld hl, wFlags_0xcd60
- bit 4, [hl]
- res 4, [hl]
+ ld hl, wMiscFlags
+ bit BIT_NO_SPRITE_UPDATES, [hl]
+ res BIT_NO_SPRITE_UPDATES, [hl]
jr nz, .skipMovingSprites
call UpdateSprites
.skipMovingSprites
diff --git a/engine/menus/draw_start_menu.asm b/engine/menus/draw_start_menu.asm
index 00d385bc..c5b85952 100644
--- a/engine/menus/draw_start_menu.asm
+++ b/engine/menus/draw_start_menu.asm
@@ -23,8 +23,8 @@ DrawStartMenu::
ld [wLastMenuItem], a
xor a
ld [wMenuWatchMovingOutOfBounds], a
- ld hl, wd730
- set 6, [hl] ; no pauses between printing each letter
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
hlcoord 12, 2
CheckEvent EVENT_GOT_POKEDEX
; case for not having pokedex
@@ -42,8 +42,8 @@ DrawStartMenu::
call PrintStartMenuItem
ld de, wPlayerName ; player's name
call PrintStartMenuItem
- ld a, [wd72e]
- bit 6, a ; is the player using the link feature?
+ ld a, [wStatusFlags4]
+ bit BIT_LINK_CONNECTED, a
; case for not using link feature
ld de, StartMenuSaveText
jr z, .printSaveOrResetText
@@ -55,8 +55,8 @@ DrawStartMenu::
call PrintStartMenuItem
ld de, StartMenuExitText
call PlaceString
- ld hl, wd730
- res 6, [hl] ; turn pauses between printing letters back on
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
ret
StartMenuPokedexText:
diff --git a/engine/menus/league_pc.asm b/engine/menus/league_pc.asm
index 533454ad..08ff22e4 100644
--- a/engine/menus/league_pc.asm
+++ b/engine/menus/league_pc.asm
@@ -1,8 +1,8 @@
PKMNLeaguePC:
ld hl, AccessedHoFPCText
call PrintText
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
push hl
ld a, [wUpdateSpritesEnabled]
push af
diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm
index e638b169..df9f523f 100644
--- a/engine/menus/main_menu.asm
+++ b/engine/menus/main_menu.asm
@@ -21,14 +21,14 @@ MainMenu:
ld [hli], a
ld [hl], a
ld [wDefaultMap], a
- ld hl, wd72e
- res 6, [hl]
+ ld hl, wStatusFlags4
+ res BIT_LINK_CONNECTED, [hl]
call ClearScreen
call RunDefaultPaletteCommand
call LoadTextBoxTilePatterns
call LoadFontTilePatterns
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
ld a, [wSaveFileStatus]
cp 1
jr z, .noSaveFile
@@ -50,8 +50,8 @@ MainMenu:
ld de, NewGameText
call PlaceString
.next2
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
call UpdateSprites
xor a
ld [wCurrentMenuItem], a
@@ -85,7 +85,7 @@ MainMenu:
cp 1
jp z, StartNewGame
call DisplayOptionMenu
- ld a, 1
+ ld a, TRUE
ld [wOptionsInitialized], a
jp .mainMenuLoop
.choseContinue
@@ -99,10 +99,10 @@ MainMenu:
ldh [hJoyHeld], a
call Joypad
ldh a, [hJoyHeld]
- bit 0, a
+ bit BIT_A_BUTTON, a
jr nz, .pressedA
- bit 1, a
- jp nz, .mainMenuLoop ; pressed B
+ bit BIT_B_BUTTON, a
+ jp nz, .mainMenuLoop
jr .inputLoop
.pressedA
call GBPalWhiteOutWithDelay3
@@ -114,18 +114,18 @@ MainMenu:
ld a, [wNumHoFTeams]
and a
jp z, SpecialEnterMap
- ld a, [wCurMap] ; map ID
+ ld a, [wCurMap]
cp HALL_OF_FAME
jp nz, SpecialEnterMap
xor a
ld [wDestinationMap], a
- ld hl, wd732
- set 2, [hl] ; fly warp or dungeon warp
+ ld hl, wStatusFlags6
+ set BIT_FLY_OR_DUNGEON_WARP, [hl]
call PrepareForSpecialWarp
jp SpecialEnterMap
InitOptions:
- ld a, TEXT_DELAY_FAST
+ ld a, 1 << BIT_FAST_TEXT_DELAY
ld [wLetterPrintingDelayFlags], a
ld a, TEXT_DELAY_MEDIUM
ld [wOptions], a
@@ -134,8 +134,8 @@ InitOptions:
LinkMenu:
xor a
ld [wLetterPrintingDelayFlags], a
- ld hl, wd72e
- set 6, [hl]
+ ld hl, wStatusFlags4
+ set BIT_LINK_CONNECTED, [hl]
ld hl, LinkMenuEmptyText
call PrintText
call SaveScreenTilesToBuffer1
@@ -151,20 +151,25 @@ LinkMenu:
call PlaceString
xor a
ld [wUnusedLinkMenuByte], a
- ld [wd72d], a
+ ld [wCableClubDestinationMap], a
ld hl, wTopMenuItemY
- ld a, $7
+ ld a, 7
ld [hli], a
- ld a, $6
+ assert wTopMenuItemY + 1 == wTopMenuItemX
+ ld a, 6
ld [hli], a
+ assert wTopMenuItemX + 1 == wCurrentMenuItem
xor a
ld [hli], a
inc hl
- ld a, $2
+ assert wCurrentMenuItem + 2 == wMaxMenuItem
+ ld a, 2
ld [hli], a
+ assert wMaxMenuItem + 1 == wMenuWatchedKeys
+ assert 2 + 1 == A_BUTTON | B_BUTTON
inc a
- ; ld a, A_BUTTON | B_BUTTON
- ld [hli], a ; wMenuWatchedKeys
+ ld [hli], a
+ assert wMenuWatchedKeys + 1 == wLastMenuItem
xor a
ld [hl], a
.waitForInputLoop
@@ -262,12 +267,12 @@ LinkMenu:
jr nz, .next
ld a, TRADE_CENTER
.next
- ld [wd72d], a
+ ld [wCableClubDestinationMap], a
ld hl, PleaseWaitText
call PrintText
ld c, 50
call DelayFrames
- ld hl, wd732
+ ld hl, wStatusFlags6
res BIT_DEBUG_MODE, [hl]
ld a, [wDefaultMap]
ld [wDestinationMap], a
@@ -290,8 +295,8 @@ LinkMenu:
ld hl, LinkCanceledText
vc_hook Wireless_net_end
call PrintText
- ld hl, wd72e
- res 6, [hl]
+ ld hl, wStatusFlags4
+ res BIT_LINK_CONNECTED, [hl]
ret
WhereWouldYouLikeText:
@@ -307,11 +312,9 @@ LinkCanceledText:
text_end
StartNewGame:
- ld hl, wd732
- ; Ensure debug mode is not used when
- ; starting a regular new game.
- ; Debug mode persists in saved games for
- ; both debug and non-debug builds, and is
+ ld hl, wStatusFlags6
+ ; Ensure debug mode is not used when starting a regular new game.
+ ; Debug mode persists in saved games for both debug and non-debug builds, and is
; only reset here by the main menu.
res BIT_DEBUG_MODE, [hl]
; fallthrough
@@ -326,9 +329,9 @@ SpecialEnterMap::
ldh [hJoyPressed], a
ldh [hJoyHeld], a
ldh [hJoy5], a
- ld [wd72d], a
- ld hl, wd732
- set 0, [hl] ; count play time
+ ld [wCableClubDestinationMap], a
+ ld hl, wStatusFlags6
+ set BIT_GAME_TIMER_COUNTING, [hl]
call ResetPlayerSpriteData
ld c, 20
call DelayFrames
@@ -465,7 +468,8 @@ DisplayOptionMenu:
xor a
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
- inc a
+ assert BIT_FAST_TEXT_DELAY == 0
+ inc a ; 1 << BIT_FAST_TEXT_DELAY
ld [wLetterPrintingDelayFlags], a
ld [wOptionsCancelCursorX], a
ld a, 3 ; text speed cursor Y coordinate
@@ -556,12 +560,12 @@ DisplayOptionMenu:
jp .loop
.cursorInBattleAnimation
ld a, [wOptionsBattleAnimCursorX] ; battle animation cursor X coordinate
- xor $0b ; toggle between 1 and 10
+ xor 1 ^ 10 ; toggle between 1 and 10
ld [wOptionsBattleAnimCursorX], a
jp .eraseOldMenuCursor
.cursorInBattleStyle
ld a, [wOptionsBattleStyleCursorX] ; battle style cursor X coordinate
- xor $0b ; toggle between 1 and 10
+ xor 1 ^ 10 ; toggle between 1 and 10
ld [wOptionsBattleStyleCursorX], a
jp .eraseOldMenuCursor
.pressedLeftInTextSpeed
@@ -622,19 +626,19 @@ SetOptionsFromCursorPositions:
dec a
jr z, .battleAnimationOn
.battleAnimationOff
- set 7, d
+ set BIT_BATTLE_ANIMATION, d
jr .checkBattleStyle
.battleAnimationOn
- res 7, d
+ res BIT_BATTLE_ANIMATION, d
.checkBattleStyle
ld a, [wOptionsBattleStyleCursorX] ; battle style cursor X coordinate
dec a
jr z, .battleStyleShift
.battleStyleSet
- set 6, d
+ set BIT_BATTLE_SHIFT, d
jr .storeOptions
.battleStyleShift
- res 6, d
+ res BIT_BATTLE_SHIFT, d
.storeOptions
ld a, d
ld [wOptions], a
diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm
index c2e63aef..f5120518 100644
--- a/engine/menus/naming_screen.asm
+++ b/engine/menus/naming_screen.asm
@@ -83,8 +83,8 @@ DisplayNameRaterScreen::
DisplayNamingScreen:
push hl
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
call GBPalWhiteOutWithDelay3
call ClearScreen
call UpdateSprites
@@ -167,8 +167,8 @@ DisplayNamingScreen:
call GBPalNormal
xor a
ld [wAnimCounter], a
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
ld a, [wIsInBattle]
and a
jp z, LoadTextBoxTilePatterns
diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm
index 46b828eb..50a9838c 100644
--- a/engine/menus/party_menu.asm
+++ b/engine/menus/party_menu.asm
@@ -172,11 +172,11 @@ RedrawPartyMenu_::
ld b, SET_PAL_PARTY_MENU
call RunPaletteCommand
.printMessage
- ld hl, wd730
+ ld hl, wStatusFlags5
ld a, [hl]
push af
push hl
- set 6, [hl] ; turn off letter printing delay
+ set BIT_NO_TEXT_DELAY, [hl]
ld a, [wPartyMenuTypeOrMessageID] ; message ID
cp FIRST_PARTY_MENU_TEXT_ID
jr nc, .printItemUseMessage
diff --git a/engine/menus/pc.asm b/engine/menus/pc.asm
index 6a15eaa5..33dd3c2c 100644
--- a/engine/menus/pc.asm
+++ b/engine/menus/pc.asm
@@ -5,14 +5,14 @@ ActivatePC::
ld hl, TurnedOnPC1Text
call PrintText
call WaitForSoundToFinish
- ld hl, wFlags_0xcd60
- set 3, [hl]
+ ld hl, wMiscFlags
+ set BIT_USING_GENERIC_PC, [hl]
call LoadScreenTilesFromBuffer2
call Delay3
PCMainMenu:
farcall DisplayPCMainMenu
- ld hl, wFlags_0xcd60
- set 5, [hl]
+ ld hl, wMiscFlags
+ set BIT_NO_MENU_BUTTON_SOUND, [hl]
call HandleMenuInput
bit BIT_B_BUTTON, a
jp nz, LogOff
@@ -48,9 +48,9 @@ PCMainMenu:
jp z, PKMNLeague ;if current menu item id is 3, it's pkmnleague
jp LogOff ;otherwise, it's 4, and you're logging off
.playersPC
- ld hl, wFlags_0xcd60
- res 5, [hl]
- set 3, [hl]
+ ld hl, wMiscFlags
+ res BIT_NO_MENU_BUTTON_SOUND, [hl]
+ set BIT_USING_GENERIC_PC, [hl]
ld a, SFX_ENTER_PC
call PlaySound
call WaitForSoundToFinish
@@ -93,9 +93,9 @@ LogOff:
ld a, SFX_TURN_OFF_PC
call PlaySound
call WaitForSoundToFinish
- ld hl, wFlags_0xcd60
- res 3, [hl]
- res 5, [hl]
+ ld hl, wMiscFlags
+ res BIT_USING_GENERIC_PC, [hl]
+ res BIT_NO_MENU_BUTTON_SOUND, [hl]
ret
TurnedOnPC1Text:
diff --git a/engine/menus/players_pc.asm b/engine/menus/players_pc.asm
index 5461be51..e0a3a007 100644
--- a/engine/menus/players_pc.asm
+++ b/engine/menus/players_pc.asm
@@ -1,14 +1,14 @@
PlayerPC::
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
ld a, ITEM_NAME
ld [wNameListType], a
call SaveScreenTilesToBuffer1
xor a
ld [wBagSavedMenuItem], a
ld [wParentMenuItem], a
- ld a, [wFlags_0xcd60]
- bit 3, a ; accessing player's PC through another PC?
+ ld a, [wMiscFlags]
+ bit BIT_USING_GENERIC_PC, a
jr nz, PlayerPCMenu
; accessing it directly
ld a, SFX_TURN_ON_PC
@@ -19,8 +19,8 @@ PlayerPC::
PlayerPCMenu:
ld a, [wParentMenuItem]
ld [wCurrentMenuItem], a
- ld hl, wFlags_0xcd60
- set 5, [hl]
+ ld hl, wMiscFlags
+ set BIT_NO_MENU_BUTTON_SOUND, [hl]
call LoadScreenTilesFromBuffer2
hlcoord 0, 0
ld b, $8
@@ -63,22 +63,22 @@ PlayerPCMenu:
jp z, PlayerPCToss
ExitPlayerPC:
- ld a, [wFlags_0xcd60]
- bit 3, a ; accessing player's PC through another PC?
+ ld a, [wMiscFlags]
+ bit BIT_USING_GENERIC_PC, a
jr nz, .next
; accessing it directly
ld a, SFX_TURN_OFF_PC
call PlaySound
call WaitForSoundToFinish
.next
- ld hl, wFlags_0xcd60
- res 5, [hl]
+ ld hl, wMiscFlags
+ res BIT_NO_MENU_BUTTON_SOUND, [hl]
call LoadScreenTilesFromBuffer2
xor a
ld [wListScrollOffset], a
ld [wBagSavedMenuItem], a
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
xor a
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ret
diff --git a/engine/menus/pokedex.asm b/engine/menus/pokedex.asm
index df5d643e..c6fe37a0 100644
--- a/engine/menus/pokedex.asm
+++ b/engine/menus/pokedex.asm
@@ -397,8 +397,8 @@ ShowPokedexData:
; function to display pokedex data from inside the pokedex
ShowPokedexDataInternal:
- ld hl, wd72c
- set 1, [hl]
+ ld hl, wStatusFlags2
+ set BIT_NO_AUDIO_FADE_OUT, [hl]
ld a, $33 ; 3/7 volume
ldh [rNR50], a
call GBPalWhiteOut ; zero all palettes
@@ -583,8 +583,8 @@ ShowPokedexDataInternal:
call RunDefaultPaletteCommand
call LoadTextBoxTilePatterns
call GBPalNormal
- ld hl, wd72c
- res 1, [hl]
+ ld hl, wStatusFlags2
+ res BIT_NO_AUDIO_FADE_OUT, [hl]
ld a, $77 ; max volume
ldh [rNR50], a
ret
diff --git a/engine/menus/save.asm b/engine/menus/save.asm
index 3269e7f2..2f61b678 100644
--- a/engine/menus/save.asm
+++ b/engine/menus/save.asm
@@ -1,6 +1,5 @@
LoadSAV:
-;(if carry -> write
-;"the file data is destroyed")
+; if carry, write "the file data is destroyed"
call ClearScreen
call LoadFontTilePatterns
call LoadTextBoxTilePatterns
@@ -13,15 +12,15 @@ LoadSAV:
ld a, $2 ; good checksum
jr .goodsum
.badsum
- ld hl, wd730
+ ld hl, wStatusFlags5
push hl
- set 6, [hl]
+ set BIT_NO_TEXT_DELAY, [hl]
ld hl, FileDataDestroyedText
call PrintText
ld c, 100
call DelayFrames
pop hl
- res 6, [hl]
+ res BIT_NO_TEXT_DELAY, [hl]
ld a, $1 ; bad checksum
.goodsum
ld [wSaveFileStatus], a
diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm
index 7dfb7dc3..5f742e38 100644
--- a/engine/menus/start_sub_menus.asm
+++ b/engine/menus/start_sub_menus.asm
@@ -142,12 +142,12 @@ StartMenu_Pokemon::
jp .loop
.canFly
call ChooseFlyDestination
- ld a, [wd732]
- bit 3, a ; did the player decide to fly?
+ ld a, [wStatusFlags6]
+ bit BIT_FLY_WARP, a
jp nz, .goBackToMap
call LoadFontTilePatterns
- ld hl, wd72e
- set 1, [hl]
+ ld hl, wStatusFlags4
+ set BIT_UNKNOWN_4_1, [hl]
jp StartMenu_Pokemon
.cut
bit BIT_CASCADEBADGE, a
@@ -161,9 +161,9 @@ StartMenu_Pokemon::
bit BIT_SOULBADGE, a
jp z, .newBadgeRequired
farcall IsSurfingAllowed
- ld hl, wd728
- bit 1, [hl]
- res 1, [hl]
+ ld hl, wStatusFlags1
+ bit BIT_SURF_ALLOWED, [hl]
+ res BIT_SURF_ALLOWED, [hl]
jp z, .loop
ld a, SURFBOARD
ld [wcf91], a
@@ -177,7 +177,7 @@ StartMenu_Pokemon::
.strength
bit BIT_RAINBOWBADGE, a
jp z, .newBadgeRequired
- predef PrintStrengthTxt
+ predef PrintStrengthText
call GBPalWhiteOutWithDelay3
jp .goBackToMap
.flash
@@ -214,12 +214,12 @@ StartMenu_Pokemon::
.canTeleport
ld hl, .warpToLastPokemonCenterText
call PrintText
- ld hl, wd732
- set 3, [hl]
- set 6, [hl]
- ld hl, wd72e
- set 1, [hl]
- res 4, [hl]
+ ld hl, wStatusFlags6
+ set BIT_FLY_WARP, [hl]
+ set BIT_ESCAPE_WARP, [hl]
+ ld hl, wStatusFlags4
+ set BIT_UNKNOWN_4_1, [hl]
+ res BIT_NO_BATTLES, [hl]
ld c, 60
call DelayFrames
call GBPalWhiteOutWithDelay3
@@ -371,8 +371,8 @@ StartMenu_Item::
ld a, [wcf91]
cp BICYCLE
jr nz, .notBicycle2
- ld a, [wd732]
- bit 5, a
+ ld a, [wStatusFlags6]
+ bit BIT_ALWAYS_ON_BIKE, a
jr z, .useItem_closeMenu
ld hl, CannotGetOffHereText
call PrintText
@@ -639,8 +639,8 @@ TrainerInfo_DrawVerticalLine:
ret
StartMenu_SaveReset::
- ld a, [wd72e]
- bit 6, a ; is the player using the link feature?
+ ld a, [wStatusFlags4]
+ bit BIT_LINK_CONNECTED, a
jp nz, Init
predef SaveSAV ; save the game
call LoadScreenTilesFromBuffer2 ; restore saved screen
diff --git a/engine/menus/text_box.asm b/engine/menus/text_box.asm
index cdb8841d..3c1b5233 100644
--- a/engine/menus/text_box.asm
+++ b/engine/menus/text_box.asm
@@ -37,14 +37,14 @@ DisplayTextBoxID_::
call TextBoxBorder
pop hl
call GetTextBoxIDText
- ld a, [wd730]
+ ld a, [wStatusFlags5]
push af
- ld a, [wd730]
- set 6, a ; no pauses between printing each letter
- ld [wd730], a
+ ld a, [wStatusFlags5]
+ set BIT_NO_TEXT_DELAY, a
+ ld [wStatusFlags5], a
call PlaceString
pop af
- ld [wd730], a
+ ld [wStatusFlags5], a
call UpdateSprites
ret
@@ -128,8 +128,8 @@ GetAddressOfScreenCoords:
INCLUDE "data/text_boxes.asm"
DisplayMoneyBox:
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
ld a, MONEY_BOX_TEMPLATE
ld [wTextBoxID], a
call DisplayTextBoxID
@@ -141,17 +141,17 @@ DisplayMoneyBox:
ld de, wPlayerMoney
ld c, $a3
call PrintBCDNumber
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
ret
CurrencyString:
db " ¥@"
DoBuySellQuitMenu:
- ld a, [wd730]
- set 6, a ; no printing delay
- ld [wd730], a
+ ld a, [wStatusFlags5]
+ set BIT_NO_TEXT_DELAY, a
+ ld [wStatusFlags5], a
xor a
ld [wChosenMenuItem], a
ld a, BUY_SELL_QUIT_MENU_TEMPLATE
@@ -169,9 +169,9 @@ DoBuySellQuitMenu:
ld [wCurrentMenuItem], a
ld [wLastMenuItem], a
ld [wMenuWatchMovingOutOfBounds], a
- ld a, [wd730]
- res 6, a ; turn on the printing delay
- ld [wd730], a
+ ld a, [wStatusFlags5]
+ res BIT_NO_TEXT_DELAY, a
+ ld [wStatusFlags5], a
call HandleMenuInput
call PlaceUnfilledArrowMenuCursor
bit BIT_A_BUTTON, a
@@ -205,9 +205,9 @@ DoBuySellQuitMenu:
; hl = address where the text box border should be drawn
DisplayTwoOptionMenu:
push hl
- ld a, [wd730]
- set 6, a ; no printing delay
- ld [wd730], a
+ ld a, [wStatusFlags5]
+ set BIT_NO_TEXT_DELAY, a
+ ld [wStatusFlags5], a
; pointless because both values are overwritten before they are read
xor a
@@ -277,8 +277,8 @@ DisplayTwoOptionMenu:
pop hl
add hl, bc
call PlaceString
- ld hl, wd730
- res 6, [hl] ; turn on the printing delay
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
ld a, [wTwoOptionMenuID]
cp NO_YES_MENU
jr nz, .notNoYesMenu
@@ -287,12 +287,12 @@ DisplayTwoOptionMenu:
; it only seems to be used when confirming the deletion of a save file
xor a
ld [wTwoOptionMenuID], a
- ld a, [wFlags_0xcd60]
+ ld a, [wMiscFlags]
push af
push hl
- ld hl, wFlags_0xcd60
- bit 5, [hl]
- set 5, [hl] ; don't play sound when A or B is pressed in menu
+ ld hl, wMiscFlags
+ bit BIT_NO_MENU_BUTTON_SOUND, [hl]
+ set BIT_NO_MENU_BUTTON_SOUND, [hl]
pop hl
.noYesMenuInputLoop
call HandleMenuInput
@@ -300,7 +300,7 @@ DisplayTwoOptionMenu:
jr nz, .noYesMenuInputLoop ; try again if B was not pressed
pop af
pop hl
- ld [wFlags_0xcd60], a
+ ld [wMiscFlags], a
ld a, SFX_PRESS_AB
call PlaySound
jr .pressedAButton
diff --git a/engine/movie/oak_speech/oak_speech.asm b/engine/movie/oak_speech/oak_speech.asm
index 3e339619..d0fc4ad8 100644
--- a/engine/movie/oak_speech/oak_speech.asm
+++ b/engine/movie/oak_speech/oak_speech.asm
@@ -8,7 +8,7 @@ PrepareOakSpeech:
; which causes CheckForceBikeOrSurf to not return.
; To fix this in debug builds, reset bit 5 here or in StartNewGame.
; In non-debug builds, the instructions can be removed.
- ld a, [wd732]
+ ld a, [wStatusFlags6]
push af
ld hl, wPlayerName
ld bc, wBoxDataEnd - wPlayerName
@@ -19,7 +19,7 @@ PrepareOakSpeech:
xor a
call FillMemory
pop af
- ld [wd732], a
+ ld [wStatusFlags6], a
pop af
ld [wOptions], a
pop af
@@ -61,7 +61,7 @@ OakSpeech:
call PrepareForSpecialWarp
xor a
ldh [hTileAnimations], a
- ld a, [wd732]
+ ld a, [wStatusFlags6]
bit BIT_DEBUG_MODE, a
jp nz, .skipSpeech
ld de, ProfOakPic
@@ -106,8 +106,8 @@ OakSpeech:
lb bc, BANK(RedPicFront), $00
call IntroDisplayPicCenteredOrUpperRight
call GBFadeInFromWhite
- ld a, [wd72d]
- and a
+ ld a, [wStatusFlags3]
+ and a ; ???
jr nz, .next
ld hl, OakSpeechText3
call PrintText
diff --git a/engine/movie/title.asm b/engine/movie/title.asm
index 36a28b0d..7edbbedf 100644
--- a/engine/movie/title.asm
+++ b/engine/movie/title.asm
@@ -15,9 +15,11 @@ PrepareTitleScreen::
xor a
ldh [hWY], a
ld [wLetterPrintingDelayFlags], a
- ld hl, wd732
+ ld hl, wStatusFlags6
ld [hli], a
+ assert wStatusFlags6 + 1 == wStatusFlags7
ld [hli], a
+ assert wStatusFlags7 + 1 == wElite4Flags
ld [hl], a
ld a, BANK(Music_TitleScreen)
ld [wAudioROMBank], a
@@ -218,7 +220,7 @@ ENDC
ld [wNewSoundID], a
call PlaySound
xor a
- ld [wUnusedCC5B], a
+ ld [wUnusedFlag], a
; Keep scrolling in new mons indefinitely until the user performs input.
.awaitUserInterruptionLoop
diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm
index def901ba..9d168cc7 100644
--- a/engine/movie/trade.asm
+++ b/engine/movie/trade.asm
@@ -173,8 +173,8 @@ LoadTradingGFXAndMonNames:
call ClearSprites
ld a, $ff
ld [wUpdateSpritesEnabled], a
- ld hl, wd730
- set 6, [hl] ; turn on instant text printing
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
ld a, [wOnSGB]
and a
ld a, $e4 ; non-SGB OBP0
@@ -218,8 +218,8 @@ Trade_SwapNames:
Trade_Cleanup:
xor a
call LoadGBPal
- ld hl, wd730
- res 6, [hl] ; turn off instant text printing
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
ret
Trade_ShowPlayerMon:
diff --git a/engine/overworld/auto_movement.asm b/engine/overworld/auto_movement.asm
index 53898371..8a45735f 100644
--- a/engine/overworld/auto_movement.asm
+++ b/engine/overworld/auto_movement.asm
@@ -1,12 +1,12 @@
PlayerStepOutFromDoor::
- ld hl, wd730
- res 1, [hl]
+ ld hl, wStatusFlags5 ; should this be wMovementFlags?
+ res BIT_EXITING_DOOR, [hl]
call IsPlayerStandingOnDoorTile
jr nc, .notStandingOnDoor
ld a, SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
- ld hl, wd736
- set 1, [hl]
+ ld hl, wMovementFlags
+ set BIT_EXITING_DOOR, [hl]
ld a, $1
ld [wSimulatedJoypadStatesIndex], a
ld a, D_DOWN
@@ -20,21 +20,21 @@ PlayerStepOutFromDoor::
ld [wUnusedOverrideSimulatedJoypadStatesIndex], a
ld [wSimulatedJoypadStatesIndex], a
ld [wSimulatedJoypadStatesEnd], a
- ld hl, wd736
- res 0, [hl]
- res 1, [hl]
- ld hl, wd730
- res 7, [hl]
+ ld hl, wMovementFlags
+ res BIT_STANDING_ON_DOOR, [hl]
+ res BIT_EXITING_DOOR, [hl]
+ ld hl, wStatusFlags5
+ res BIT_SCRIPTED_MOVEMENT_STATE, [hl]
ret
_EndNPCMovementScript::
- ld hl, wd730
- res 7, [hl]
- ld hl, wd72e
- res 7, [hl]
- ld hl, wd736
- res 0, [hl]
- res 1, [hl]
+ ld hl, wStatusFlags5
+ res BIT_SCRIPTED_MOVEMENT_STATE, [hl]
+ ld hl, wStatusFlags4
+ res BIT_INIT_SCRIPTED_MOVEMENT, [hl]
+ ld hl, wMovementFlags
+ res BIT_STANDING_ON_DOOR, [hl]
+ res BIT_EXITING_DOOR, [hl]
xor a
ld [wNPCMovementScriptSpriteOffset], a
ld [wNPCMovementScriptPointerTableNum], a
@@ -79,15 +79,15 @@ PalletMovementScript_OakMoveLeft:
ld a, $3
ld [wNPCMovementScriptFunctionNum], a
.done
- ld hl, wFlags_D733
- set 1, [hl]
+ ld hl, wStatusFlags7
+ set BIT_NO_MAP_MUSIC, [hl]
ld a, SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
ret
PalletMovementScript_PlayerMoveLeft:
- ld a, [wd730]
- bit 0, a ; is an NPC being moved by a script?
+ ld a, [wStatusFlags5]
+ bit BIT_SCRIPTED_NPC_MOVEMENT, a
ret nz ; return if Oak is still moving
ld a, [wNumStepsToTake]
ld [wSimulatedJoypadStatesIndex], a
@@ -119,10 +119,10 @@ PalletMovementScript_WalkToLab:
ld hl, wNPCMovementDirections2
ld de, RLEList_ProfOakWalkToLab
call DecodeRLEList
- ld hl, wd72e
- res 7, [hl]
- ld hl, wd730
- set 7, [hl]
+ ld hl, wStatusFlags4
+ res BIT_INIT_SCRIPTED_MOVEMENT, [hl]
+ ld hl, wStatusFlags5
+ set BIT_SCRIPTED_MOVEMENT_STATE, [hl]
ld a, $4
ld [wNPCMovementScriptFunctionNum], a
ret
@@ -151,10 +151,10 @@ PalletMovementScript_Done:
ld a, HS_PALLET_TOWN_OAK
ld [wMissableObjectIndex], a
predef HideObject
- ld hl, wd730
- res 7, [hl]
- ld hl, wd72e
- res 7, [hl]
+ ld hl, wStatusFlags5
+ res BIT_SCRIPTED_MOVEMENT_STATE, [hl]
+ ld hl, wStatusFlags4
+ res BIT_INIT_SCRIPTED_MOVEMENT, [hl]
jp EndNPCMovementScript
PewterMuseumGuyMovementScriptPointerTable::
@@ -183,8 +183,8 @@ PewterMovementScript_WalkToMuseum:
ld hl, wNPCMovementDirections2
ld de, RLEList_PewterMuseumGuy
call DecodeRLEList
- ld hl, wd72e
- res 7, [hl]
+ ld hl, wStatusFlags4
+ res BIT_INIT_SCRIPTED_MOVEMENT, [hl]
ld a, $1
ld [wNPCMovementScriptFunctionNum], a
ret
@@ -207,10 +207,10 @@ PewterMovementScript_Done:
ld a, [wSimulatedJoypadStatesIndex]
and a
ret nz
- ld hl, wd730
- res 7, [hl]
- ld hl, wd72e
- res 7, [hl]
+ ld hl, wStatusFlags5
+ res BIT_SCRIPTED_MOVEMENT_STATE, [hl]
+ ld hl, wStatusFlags4
+ res BIT_INIT_SCRIPTED_MOVEMENT, [hl]
jp EndNPCMovementScript
PewterGymGuyMovementScriptPointerTable::
@@ -240,10 +240,10 @@ PewterMovementScript_WalkToGym:
ld hl, wNPCMovementDirections2
ld de, RLEList_PewterGymGuy
call DecodeRLEList
- ld hl, wd72e
- res 7, [hl]
- ld hl, wd730
- set 7, [hl]
+ ld hl, wStatusFlags4
+ res BIT_INIT_SCRIPTED_MOVEMENT, [hl]
+ ld hl, wStatusFlags5
+ set BIT_SCRIPTED_MOVEMENT_STATE, [hl]
ld a, $1
ld [wNPCMovementScriptFunctionNum], a
ret
diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm
index 8ae9ed65..3e514672 100644
--- a/engine/overworld/cut.asm
+++ b/engine/overworld/cut.asm
@@ -32,8 +32,8 @@ UsedCut:
ld a, [wWhichPokemon]
ld hl, wPartyMonNicks
call GetPartyMonName
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
call GBPalWhiteOutWithDelay3
call ClearSprites
call RestoreScreenTilesAndReloadTilePatterns
@@ -49,8 +49,8 @@ UsedCut:
ld hl, UsedCutText
call PrintText
call LoadScreenTilesFromBuffer2
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
ld a, $ff
ld [wUpdateSpritesEnabled], a
call InitCutAnimOAM
diff --git a/engine/overworld/emotion_bubbles.asm b/engine/overworld/emotion_bubbles.asm
index 84b13f17..d25d5ff1 100644
--- a/engine/overworld/emotion_bubbles.asm
+++ b/engine/overworld/emotion_bubbles.asm
@@ -15,8 +15,8 @@ EmotionBubble:
push af
ld a, $ff
ld [wUpdateSpritesEnabled], a
- ld a, [wd736]
- bit 6, a ; are the last 4 OAM entries reserved for a shadow or fishing rod?
+ ld a, [wMovementFlags]
+ bit BIT_LEDGE_OR_FISHING, a ; are the last 4 OAM entries reserved for a shadow or fishing rod?
ld hl, wShadowOAMSprite35Attributes
ld de, wShadowOAMSprite39Attributes
jr z, .next
diff --git a/engine/overworld/field_move_messages.asm b/engine/overworld/field_move_messages.asm
index d75ffc21..a9e29b63 100644
--- a/engine/overworld/field_move_messages.asm
+++ b/engine/overworld/field_move_messages.asm
@@ -1,6 +1,6 @@
-PrintStrengthTxt:
- ld hl, wd728
- set 0, [hl]
+PrintStrengthText:
+ ld hl, wStatusFlags1
+ set BIT_STRENGTH_ACTIVE, [hl]
ld hl, UsedStrengthText
call PrintText
ld hl, CanMoveBouldersText
@@ -19,13 +19,13 @@ CanMoveBouldersText:
text_end
IsSurfingAllowed:
-; Returns whether surfing is allowed in bit 1 of wd728.
+; Returns whether surfing is allowed in BIT_SURF_ALLOWED of wStatusFlags1.
; Surfing isn't allowed on the Cycling Road or in the lowest level of the
; Seafoam Islands before the current has been slowed with boulders.
- ld hl, wd728
- set 1, [hl]
- ld a, [wd732]
- bit 5, a
+ ld hl, wStatusFlags1
+ set BIT_SURF_ALLOWED, [hl]
+ ld a, [wStatusFlags6]
+ bit BIT_ALWAYS_ON_BIKE, a
jr nz, .forcedToRideBike
ld a, [wCurMap]
cp SEAFOAM_ISLANDS_B4F
@@ -35,13 +35,13 @@ IsSurfingAllowed:
ld hl, SeafoamIslandsB4FStairsCoords
call ArePlayerCoordsInArray
ret nc
- ld hl, wd728
- res 1, [hl]
+ ld hl, wStatusFlags1
+ res BIT_SURF_ALLOWED, [hl]
ld hl, CurrentTooFastText
jp PrintText
.forcedToRideBike
- ld hl, wd728
- res 1, [hl]
+ ld hl, wStatusFlags1
+ res BIT_SURF_ALLOWED, [hl]
ld hl, CyclingIsFunText
jp PrintText
diff --git a/engine/overworld/hidden_objects.asm b/engine/overworld/hidden_objects.asm
index 855328e7..2798864a 100644
--- a/engine/overworld/hidden_objects.asm
+++ b/engine/overworld/hidden_objects.asm
@@ -1,17 +1,17 @@
IsPlayerOnDungeonWarp::
xor a
ld [wWhichDungeonWarp], a
- ld a, [wd72d]
- bit 4, a
+ ld a, [wStatusFlags3]
+ bit BIT_ON_DUNGEON_WARP, a
ret nz
call ArePlayerCoordsInArray
ret nc
ld a, [wCoordIndex]
ld [wWhichDungeonWarp], a
- ld hl, wd72d
- set 4, [hl]
- ld hl, wd732
- set 4, [hl]
+ ld hl, wStatusFlags3
+ set BIT_ON_DUNGEON_WARP, [hl]
+ ld hl, wStatusFlags6
+ set BIT_DUNGEON_WARP, [hl]
ret
; if a hidden object was found, stores $00 in [hDidntFindAnyHiddenObject], else stores $ff
diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm
index 89e4ef57..73733e15 100644
--- a/engine/overworld/ledges.asm
+++ b/engine/overworld/ledges.asm
@@ -1,6 +1,6 @@
HandleLedges::
- ld a, [wd736]
- bit 6, a ; already jumping down ledge
+ ld a, [wMovementFlags]
+ bit BIT_LEDGE_OR_FISHING, a
ret nz
ld a, [wCurMapTileset]
and a ; OVERWORLD
@@ -41,8 +41,8 @@ HandleLedges::
ret z
ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN
ld [wJoyIgnore], a
- ld hl, wd736
- set 6, [hl] ; jumping down ledge
+ ld hl, wMovementFlags
+ set BIT_LEDGE_OR_FISHING, [hl]
call StartSimulatingJoypadStates
ld a, e
ld [wSimulatedJoypadStatesEnd], a
diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm
index afcb5907..1ca24f6a 100644
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -60,8 +60,8 @@ UpdatePlayerSprite:
bit 0, a
jr nz, .notMoving
.moving
- ld a, [wd736]
- bit 7, a ; is the player sprite spinning due to a spin tile?
+ ld a, [wMovementFlags]
+ bit BIT_SPINNING, a
jr nz, .skipSpriteAnim
ldh a, [hCurrentSpriteOffset]
add $7
@@ -175,8 +175,8 @@ UpdateNPCSprite:
jr nz, .next
; reached end of wNPCMovementDirections list
ld [hl], a ; store $ff in movement byte 1, disabling scripted movement
- ld hl, wd730
- res 0, [hl]
+ ld hl, wStatusFlags5
+ res BIT_SCRIPTED_NPC_MOVEMENT, [hl]
xor a
ld [wSimulatedJoypadStatesIndex], a
ld [wUnusedOverrideSimulatedJoypadStatesIndex], a
@@ -409,8 +409,8 @@ MakeNPCFacePlayer:
; Check if the behaviour of the NPC facing the player when spoken to is
; disabled. This is only done when rubbing the S.S. Anne captain's back.
- ld a, [wd72d]
- bit 5, a
+ ld a, [wStatusFlags3]
+ bit BIT_NO_NPC_FACE_PLAYER, a
jr nz, notYetMoving
res 7, [hl]
ld a, [wPlayerDirection]
@@ -740,12 +740,12 @@ DoScriptedNPCMovement:
; 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
; be moved in sync with the player using the other method.
- ld a, [wd730]
- bit 7, a
+ ld a, [wStatusFlags5]
+ bit BIT_SCRIPTED_MOVEMENT_STATE, a
ret z
- ld hl, wd72e
- bit 7, [hl]
- set 7, [hl]
+ ld hl, wStatusFlags4
+ bit BIT_INIT_SCRIPTED_MOVEMENT, [hl]
+ set BIT_INIT_SCRIPTED_MOVEMENT, [hl]
jp z, InitScriptedNPCMovement
ld hl, wNPCMovementDirections2
ld a, [wNPCMovementDirections2Index]
diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm
index bec59369..210599da 100644
--- a/engine/overworld/player_animations.asm
+++ b/engine/overworld/player_animations.asm
@@ -5,15 +5,15 @@ EnterMapAnim::
call Delay3
push hl
call GBFadeInFromWhite
- ld hl, wFlags_D733
- bit 7, [hl] ; used fly out of battle?
- res 7, [hl]
+ ld hl, wStatusFlags7
+ bit BIT_USED_FLY, [hl]
+ res BIT_USED_FLY, [hl]
jr nz, .flyAnimation
ld a, SFX_TELEPORT_ENTER_1
call PlaySound
- ld hl, wd732
- bit 4, [hl] ; used dungeon warp?
- res 4, [hl]
+ ld hl, wStatusFlags6
+ bit BIT_DUNGEON_WARP, [hl]
+ res BIT_DUNGEON_WARP, [hl]
pop hl
jr nz, .dungeonWarpAnimation
call PlayerSpinWhileMovingDown
@@ -122,8 +122,8 @@ _LeaveMapAnim::
.playerNotStandingOnWarpPadOrHole
ld a, $4
call StopMusic
- ld a, [wd732]
- bit 6, a ; is the last used pokemon center the destination?
+ ld a, [wStatusFlags6]
+ bit BIT_ESCAPE_WARP, a
jr z, .flyAnimation
; if going to the last used pokemon center
ld hl, wPlayerSpinInPlaceAnimFrameDelay
@@ -378,8 +378,8 @@ INCLUDE "data/tilesets/warp_pad_hole_tile_ids.asm"
FishingAnim:
ld c, 10
call DelayFrames
- ld hl, wd736
- set 6, [hl] ; reserve the last 4 OAM entries
+ ld hl, wMovementFlags
+ set BIT_LEDGE_OR_FISHING, [hl]
ld de, RedSprite
ld hl, vNPCSprites tile $00
lb bc, BANK(RedSprite), 12
@@ -445,8 +445,8 @@ FishingAnim:
.done
call PrintText
- ld hl, wd736
- res 6, [hl] ; unreserve the last 4 OAM entries
+ ld hl, wMovementFlags
+ res BIT_LEDGE_OR_FISHING, [hl]
call LoadFontTilePatterns
ret
@@ -512,10 +512,10 @@ _HandleMidJump::
ldh [hJoyPressed], a
ldh [hJoyReleased], a
ld [wPlayerJumpingYScreenCoordsIndex], a
- ld hl, wd736
- res 6, [hl] ; not jumping down a ledge any more
- ld hl, wd730
- res 7, [hl] ; not simulating joypad states any more
+ ld hl, wMovementFlags
+ res BIT_LEDGE_OR_FISHING, [hl]
+ ld hl, wStatusFlags5
+ res BIT_SCRIPTED_MOVEMENT_STATE, [hl]
xor a
ld [wJoyIgnore], a
ret
diff --git a/engine/overworld/player_state.asm b/engine/overworld/player_state.asm
index 80b132ac..4711bb5c 100644
--- a/engine/overworld/player_state.asm
+++ b/engine/overworld/player_state.asm
@@ -1,4 +1,4 @@
-; only used for setting bit 2 of wd736 upon entering a new map
+; only used for setting BIT_STANDING_ON_WARP of wMovementFlags upon entering a new map
IsPlayerStandingOnWarp::
ld a, [wNumberOfWarps]
and a
@@ -18,8 +18,8 @@ IsPlayerStandingOnWarp::
ld [wDestinationWarpID], a
ld a, [hl] ; target map
ldh [hWarpDestinationMap], a
- ld hl, wd736
- set 2, [hl] ; standing on warp flag
+ ld hl, wMovementFlags
+ set BIT_STANDING_ON_WARP, [hl]
ret
.nextWarp1
inc hl
@@ -32,8 +32,8 @@ IsPlayerStandingOnWarp::
ret
CheckForceBikeOrSurf::
- ld hl, wd732
- bit 5, [hl]
+ ld hl, wStatusFlags6
+ bit BIT_ALWAYS_ON_BIKE, [hl]
ret nz
ld hl, ForcedBikeOrSurfMaps
ld a, [wYCoord]
@@ -45,14 +45,14 @@ CheckForceBikeOrSurf::
.loop
ld a, [hli]
cp $ff
- ret z ;if we reach FF then it's not part of the list
- cp d ;compare to current map
+ ret z ; if we reach FF then it's not part of the list
+ cp d ; compare to current map
jr nz, .incorrectMap
ld a, [hli]
- cp b ;compare y-coord
+ cp b ; compare y-coord
jr nz, .incorrectY
ld a, [hli]
- cp c ;compare x-coord
+ cp c ; compare x-coord
jr nz, .loop ; incorrect x-coord, check next item
ld a, [wCurMap]
cp SEAFOAM_ISLANDS_B3F
@@ -64,9 +64,8 @@ CheckForceBikeOrSurf::
ld a, SCRIPT_SEAFOAMISLANDSB4F_MOVE_OBJECT
ld [wSeafoamIslandsB4FCurScript], a
jr z, .forceSurfing
- ;force bike riding
- ld hl, wd732
- set 5, [hl]
+ ld hl, wStatusFlags6
+ set BIT_ALWAYS_ON_BIKE, [hl]
ld a, $1
ld [wWalkBikeSurfState], a
ld [wWalkBikeSurfStateCopy], a
@@ -207,8 +206,8 @@ IsPlayerStandingOnDoorTileOrWarpTile::
lda_coord 8, 9
call IsInArray
jr nc, .done
- ld hl, wd736
- res 2, [hl]
+ ld hl, wMovementFlags
+ res BIT_STANDING_ON_WARP, [hl]
.done
pop bc
pop de
diff --git a/engine/overworld/push_boulder.asm b/engine/overworld/push_boulder.asm
index 96c506c0..7eee844c 100644
--- a/engine/overworld/push_boulder.asm
+++ b/engine/overworld/push_boulder.asm
@@ -1,9 +1,9 @@
TryPushingBoulder::
- ld a, [wd728]
- bit 0, a ; using Strength?
+ ld a, [wStatusFlags1]
+ bit BIT_STRENGTH_ACTIVE, a
ret z
- ld a, [wFlags_0xcd60]
- bit 1, a ; has boulder dust animation from previous push played yet?
+ ld a, [wMiscFlags]
+ bit BIT_BOULDER_DUST, a
ret nz
xor a
ldh [hSpriteIndexOrTextID], a
@@ -23,9 +23,9 @@ TryPushingBoulder::
ld a, [hl]
cp BOULDER_MOVEMENT_BYTE_2
jp nz, ResetBoulderPushFlags
- ld hl, wFlags_0xcd60
- bit 6, [hl]
- set 6, [hl] ; indicate that the player has tried pushing
+ ld hl, wMiscFlags
+ bit BIT_TRIED_PUSH_BOULDER, [hl]
+ set BIT_TRIED_PUSH_BOULDER, [hl]
ret z ; the player must try pushing twice before the boulder will move
ldh a, [hJoyHeld]
and D_RIGHT | D_LEFT | D_UP | D_DOWN
@@ -44,30 +44,30 @@ TryPushingBoulder::
cp SPRITE_FACING_RIGHT
jr z, .pushBoulderRight
.pushBoulderDown
- bit 7, b
+ bit BIT_D_DOWN, b
ret z
ld de, PushBoulderDownMovementData
jr .done
.pushBoulderUp
- bit 6, b
+ bit BIT_D_UP, b
ret z
ld de, PushBoulderUpMovementData
jr .done
.pushBoulderLeft
- bit 5, b
+ bit BIT_D_LEFT, b
ret z
ld de, PushBoulderLeftMovementData
jr .done
.pushBoulderRight
- bit 4, b
+ bit BIT_D_RIGHT, b
ret z
ld de, PushBoulderRightMovementData
.done
call MoveSprite
ld a, SFX_PUSH_BOULDER
call PlaySound
- ld hl, wFlags_0xcd60
- set 1, [hl]
+ ld hl, wMiscFlags
+ set BIT_BOULDER_DUST, [hl]
ret
PushBoulderUpMovementData:
@@ -87,14 +87,14 @@ PushBoulderRightMovementData:
db -1 ; end
DoBoulderDustAnimation::
- ld a, [wd730]
- bit 0, a
+ ld a, [wStatusFlags5]
+ bit BIT_SCRIPTED_NPC_MOVEMENT, a
ret nz
callfar AnimateBoulderDust
call DiscardButtonPresses
ld [wJoyIgnore], a
call ResetBoulderPushFlags
- set 7, [hl] ; [wFlags_0xcd60]
+ set BIT_PUSHED_BOULDER, [hl]
ld a, [wBoulderSpriteIndex]
ldh [hSpriteIndex], a
call GetSpriteMovementByte2Pointer
@@ -103,7 +103,7 @@ DoBoulderDustAnimation::
jp PlaySound
ResetBoulderPushFlags:
- ld hl, wFlags_0xcd60
- res 1, [hl]
- res 6, [hl]
+ ld hl, wMiscFlags
+ res BIT_BOULDER_DUST, [hl]
+ res BIT_TRIED_PUSH_BOULDER, [hl]
ret
diff --git a/engine/overworld/special_warps.asm b/engine/overworld/special_warps.asm
index 0cc2a474..303415c1 100644
--- a/engine/overworld/special_warps.asm
+++ b/engine/overworld/special_warps.asm
@@ -1,9 +1,9 @@
PrepareForSpecialWarp::
call LoadSpecialWarpData
predef LoadTilesetHeader
- ld hl, wd732
- bit 2, [hl] ; dungeon warp or fly warp?
- res 2, [hl]
+ ld hl, wStatusFlags6
+ bit BIT_FLY_OR_DUNGEON_WARP, [hl]
+ res BIT_FLY_OR_DUNGEON_WARP, [hl]
jr z, .debugNewGameWarp
ld a, [wDestinationMap]
jr .next
@@ -17,19 +17,19 @@ PrepareForSpecialWarp::
ld a, PALLET_TOWN
.next
ld b, a
- ld a, [wd72d]
- and a
+ ld a, [wStatusFlags3]
+ and a ; ???
jr nz, .next2
ld a, b
.next2
- ld hl, wd732
- bit 4, [hl] ; dungeon warp
+ ld hl, wStatusFlags6
+ bit BIT_DUNGEON_WARP, [hl]
ret nz
ld [wLastMap], a
ret
LoadSpecialWarpData:
- ld a, [wd72d]
+ ld a, [wCableClubDestinationMap]
cp TRADE_CENTER
jr nz, .notTradeCenter
ld hl, TradeCenterPlayerWarp
@@ -48,7 +48,7 @@ LoadSpecialWarpData:
ld hl, ColosseumFriendWarp
jr .copyWarpData
.notColosseum
- ld a, [wd732]
+ ld a, [wStatusFlags6]
bit BIT_DEBUG_MODE, a
; warp to wLastMap (PALLET_TOWN) for StartNewGameDebug
jr nz, .notNewGameWarp
@@ -70,17 +70,17 @@ LoadSpecialWarpData:
jr .done
.notNewGameWarp
ld a, [wLastMap] ; this value is overwritten before it's ever read
- ld hl, wd732
- bit 4, [hl] ; dungeon warp
+ ld hl, wStatusFlags6
+ bit BIT_DUNGEON_WARP, [hl]
jr nz, .usedDungeonWarp
- bit 6, [hl] ; blacked out
- res 6, [hl]
+ bit BIT_ESCAPE_WARP, [hl]
+ res BIT_ESCAPE_WARP, [hl]
jr z, .otherDestination
ld a, [wLastBlackoutMap]
jr .usedFlyWarp
.usedDungeonWarp
- ld hl, wd72d
- res 4, [hl]
+ ld hl, wStatusFlags3
+ res BIT_ON_DUNGEON_WARP, [hl]
ld a, [wDungeonWarpDestinationMap]
ld b, a
ld [wCurMap], a
diff --git a/engine/overworld/trainer_sight.asm b/engine/overworld/trainer_sight.asm
index 816dea7f..f32b558a 100644
--- a/engine/overworld/trainer_sight.asm
+++ b/engine/overworld/trainer_sight.asm
@@ -221,8 +221,8 @@ TrainerEngage:
ld a, [wTrainerSpriteOffset]
and a
jr z, .noEngage
- ld hl, wFlags_0xcd60
- set 0, [hl]
+ ld hl, wMiscFlags
+ set BIT_SEEN_BY_TRAINER, [hl]
call EngageMapTrainer
ld a, $ff
.noEngage
diff --git a/engine/play_time.asm b/engine/play_time.asm
index dcba88c2..9b4491de 100644
--- a/engine/play_time.asm
+++ b/engine/play_time.asm
@@ -1,7 +1,7 @@
TrackPlayTime::
call CountDownIgnoreInputBitReset
- ld a, [wd732]
- bit 0, a
+ ld a, [wStatusFlags6]
+ bit BIT_GAME_TIMER_COUNTING, a
ret z
ld a, [wPlayTimeMaxed]
and a
@@ -48,12 +48,12 @@ CountDownIgnoreInputBitReset:
ld [wIgnoreInputCounter], a
and a
ret nz
- ld a, [wd730]
- res 1, a
- res 2, a
- bit 5, a
- res 5, a
- ld [wd730], a
+ ld a, [wStatusFlags5]
+ res BIT_UNKNOWN_5_1, a
+ res BIT_UNKNOWN_5_2, a
+ bit BIT_DISABLE_JOYPAD, a
+ res BIT_DISABLE_JOYPAD, a
+ ld [wStatusFlags5], a
ret z
xor a
ldh [hJoyPressed], a
diff --git a/engine/pokemon/add_mon.asm b/engine/pokemon/add_mon.asm
index 6fb074ac..0b7fb96c 100644
--- a/engine/pokemon/add_mon.asm
+++ b/engine/pokemon/add_mon.asm
@@ -199,7 +199,7 @@ _AddPartyMon::
inc de
ld [de], a
push de
- ld a, [wCurEnemyLVL]
+ ld a, [wCurEnemyLevel]
ld d, a
callfar CalcExperience
pop de
@@ -224,7 +224,7 @@ _AddPartyMon::
pop hl
call AddPartyMon_WriteMovePP
inc de
- ld a, [wCurEnemyLVL]
+ ld a, [wCurEnemyLevel]
ld [de], a
inc de
ld a, [wIsInBattle]
@@ -500,7 +500,7 @@ _MoveMon::
call LoadMonData
farcall CalcLevelFromExperience
ld a, d
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
pop hl
ld bc, wBoxMon2 - wBoxMon1
add hl, bc
diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm
index 8684b761..59933762 100644
--- a/engine/pokemon/bills_pc.asm
+++ b/engine/pokemon/bills_pc.asm
@@ -93,8 +93,8 @@ PKMNLeaguePCText: db "<PKMN>LEAGUE@"
LogOffPCText: db "LOG OFF@"
BillsPC_::
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
xor a
ld [wParentMenuItem], a
inc a ; MONSTER_NAME
@@ -102,8 +102,8 @@ BillsPC_::
call LoadHpBarAndStatusTilePatterns
ld a, [wListScrollOffset]
push af
- ld a, [wFlags_0xcd60]
- bit 3, a ; accessing Bill's PC through another PC?
+ ld a, [wMiscFlags]
+ bit BIT_USING_GENERIC_PC, a
jr nz, BillsPCMenu
; accessing it directly
ld a, SFX_TURN_ON_PC
@@ -186,8 +186,8 @@ BillsPCMenu:
jp z, BillsPCChangeBox ; change box
ExitBillsPC:
- ld a, [wFlags_0xcd60]
- bit 3, a ; accessing Bill's PC through another PC?
+ ld a, [wMiscFlags]
+ bit BIT_USING_GENERIC_PC, a
jr nz, .next
; accessing it directly
call LoadTextBoxTilePatterns
@@ -195,13 +195,13 @@ ExitBillsPC:
call PlaySound
call WaitForSoundToFinish
.next
- ld hl, wFlags_0xcd60
- res 5, [hl]
+ ld hl, wMiscFlags
+ res BIT_NO_MENU_BUTTON_SOUND, [hl]
call LoadScreenTilesFromBuffer2
pop af
ld [wListScrollOffset], a
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
ret
BillsPCDeposit:
diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm
index d6b51ee5..fa6930c1 100644
--- a/engine/pokemon/evos_moves.asm
+++ b/engine/pokemon/evos_moves.asm
@@ -105,7 +105,7 @@ Evolution_PartyMonLoop: ; loop over party mons
cp b ; is the mon's level greater than the evolution requirement?
jp c, .nextEvoEntry2 ; if so, go the next evolution entry
.doEvolution
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
ld a, 1
ld [wEvolutionOccurred], a
push hl
@@ -340,7 +340,7 @@ LearnMoveFromLevelUp:
and a ; have we reached the end of the learn set?
jr z, .done ; if we've reached the end of the learn set, jump
ld b, a ; level the move is learnt at
- ld a, [wCurEnemyLVL]
+ ld a, [wCurEnemyLevel]
cp b ; is the move learnt at the mon's current level?
ld a, [hli] ; move ID
jr nz, .learnSetLoop
@@ -375,7 +375,7 @@ LearnMoveFromLevelUp:
ld [wd11e], a
ret
-; writes the moves a mon has at level [wCurEnemyLVL] to [de]
+; writes the moves a mon has at level [wCurEnemyLevel] to [de]
; move slots are being filled up sequentially and shifted if all slots are full
WriteMonMoves:
call GetPredefRegisters
@@ -407,7 +407,7 @@ WriteMonMoves:
and a
jp z, .done ; end of list
ld b, a
- ld a, [wCurEnemyLVL]
+ ld a, [wCurEnemyLevel]
cp b
jp c, .done ; mon level < move level (assumption: learnset is sorted by level)
ld a, [wLearningMovesFromDayCare]
diff --git a/engine/pokemon/status_screen.asm b/engine/pokemon/status_screen.asm
index ac03514a..d29c23fe 100644
--- a/engine/pokemon/status_screen.asm
+++ b/engine/pokemon/status_screen.asm
@@ -71,14 +71,14 @@ StatusScreen:
; mon is in a box or daycare
ld a, [wLoadedMonBoxLevel]
ld [wLoadedMonLevel], a
- ld [wCurEnemyLVL], a
+ ld [wCurEnemyLevel], a
ld hl, wLoadedMonHPExp - 1
ld de, wLoadedMonStats
ld b, $1
call CalcStats ; Recalculate stats
.DontRecalculate
- ld hl, wd72c
- set 1, [hl]
+ ld hl, wStatusFlags2
+ set BIT_NO_AUDIO_FADE_OUT, [hl]
ld a, $33
ldh [rNR50], a ; Reduce the volume
call GBPalWhiteOutWithDelay3
@@ -430,8 +430,8 @@ StatusScreen2:
call WaitForTextScrollButtonPress ; wait for button
pop af
ldh [hTileAnimations], a
- ld hl, wd72c
- res 1, [hl]
+ ld hl, wStatusFlags2
+ res BIT_NO_AUDIO_FADE_OUT, [hl]
ld a, $77
ldh [rNR50], a
call GBPalWhiteOut
diff --git a/engine/slots/slot_machine.asm b/engine/slots/slot_machine.asm
index 6dd3b42d..649f634c 100644
--- a/engine/slots/slot_machine.asm
+++ b/engine/slots/slot_machine.asm
@@ -26,16 +26,16 @@ PromptUserToPlaySlots:
call GBPalNormal
ld a, $e4
ldh [rOBP0], a
- ld hl, wd730
- set 6, [hl]
+ ld hl, wStatusFlags5
+ set BIT_NO_TEXT_DELAY, [hl]
xor a
ld [wSlotMachineAllowMatchesCounter], a
ld hl, wStoppingWhichSlotMachineWheel
ld bc, $14
call FillMemory
call MainSlotMachineLoop
- ld hl, wd730
- res 6, [hl]
+ ld hl, wStatusFlags5
+ res BIT_NO_TEXT_DELAY, [hl]
xor a
ld [wSlotMachineAllowMatchesCounter], a
call GBPalWhiteOutWithDelay3