summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--constants/engine_flags.asm12
-rw-r--r--constants/wram_constants.asm30
-rw-r--r--data/engine_flags.asm38
-rw-r--r--engine/events.asm2
-rwxr-xr-xengine/events/field_moves.asm2
-rwxr-xr-xengine/events/halloffame.asm2
-rw-r--r--engine/events/pokerus/pokerus.asm15
-rw-r--r--engine/events/std_scripts.asm4
-rwxr-xr-xengine/events/sweet_scent.asm2
-rw-r--r--engine/events_2.asm12
-rwxr-xr-xengine/intro_menu.asm4
-rwxr-xr-xengine/main_menu.asm6
-rwxr-xr-xengine/mart.asm2
-rw-r--r--engine/pokedex/pokedex.asm2
-rwxr-xr-xengine/pokegear.asm8
-rw-r--r--engine/radio.asm4
-rw-r--r--engine/scripting.asm4
-rwxr-xr-xengine/start_menu.asm14
-rw-r--r--engine/timeofdaypals.asm2
-rwxr-xr-xengine/trainer_card.asm2
-rwxr-xr-xengine/wildmons.asm4
-rw-r--r--home/audio.asm2
-rw-r--r--home/flag.asm12
-rw-r--r--home/map.asm4
-rw-r--r--maps/GoldenrodCity.asm2
-rw-r--r--mobile/mobile_40.asm12
-rwxr-xr-xmobile/mobile_46.asm10
-rw-r--r--wram.asm10
28 files changed, 129 insertions, 94 deletions
diff --git a/constants/engine_flags.asm b/constants/engine_flags.asm
index 0b5695dd3..40ba221d4 100644
--- a/constants/engine_flags.asm
+++ b/constants/engine_flags.asm
@@ -19,7 +19,7 @@
; wStatusFlags
const ENGINE_POKEDEX
const ENGINE_UNOWN_DEX
- const ENGINE_POKERUS
+ const ENGINE_CAUGHT_POKERUS
const ENGINE_ROCKET_SIGNAL_ON_CH20
const ENGINE_CREDITS_SKIP
const ENGINE_BUG_CONTEST_ON ; 10
@@ -28,8 +28,8 @@
const ENGINE_SAFARI_ZONE
const ENGINE_ROCKETS_IN_RADIO_TOWER
const ENGINE_BIKE_SHOP_CALL_ENABLED
- const ENGINE_GIVE_POKERUS
- const ENGINE_FLORIA
+ const ENGINE_CAN_USE_SWEET_SCENT
+ const ENGINE_REACHED_GOLDENROD
const ENGINE_ROCKETS_IN_MAHOGANY
; wBikeFlags
const ENGINE_STRENGTH_ACTIVE
@@ -58,10 +58,10 @@
const ENGINE_UNLOCKED_UNOWNS_L_TO_R
const ENGINE_UNLOCKED_UNOWNS_S_TO_W
const ENGINE_UNLOCKED_UNOWNS_X_TO_Z
- const ENGINE_UNLOCKED_UNOWNS_UNUSED_5
- const ENGINE_UNLOCKED_UNOWNS_UNUSED_6 ; 30
+ const ENGINE_UNLOCKED_UNOWNS_UNUSED_4
+ const ENGINE_UNLOCKED_UNOWNS_UNUSED_5 ; 30
+ const ENGINE_UNLOCKED_UNOWNS_UNUSED_6
const ENGINE_UNLOCKED_UNOWNS_UNUSED_7
- const ENGINE_UNLOCKED_UNOWNS_UNUSED_8
; wVisitedSpawns
const ENGINE_FLYPOINT_KRISS_HOUSE
const ENGINE_FLYPOINT_VIRIDIAN_POKECENTER
diff --git a/constants/wram_constants.asm b/constants/wram_constants.asm
index dce4ab551..59ca28c36 100644
--- a/constants/wram_constants.asm
+++ b/constants/wram_constants.asm
@@ -142,6 +142,28 @@ SPAWN_RED EQU 2
PLAYER_OBJECT EQU 0
NUM_OBJECTS EQU $10
+; wStatusFlags:: ; d84c
+ const_def
+ const STATUSFLAGS_POKEDEX_F ; 0
+ const STATUSFLAGS_UNOWN_DEX_F ; 1
+ const STATUSFLAGS_FLASH_F ; 2
+ const STATUSFLAGS_CAUGHT_POKERUS_F ; 3
+ const STATUSFLAGS_ROCKET_SIGNAL_F ; 4
+ const STATUSFLAGS_NO_WILD_ENCOUNTERS_F ; 5
+ const STATUSFLAGS_HALL_OF_FAME_F ; 6
+ const STATUSFLAGS_BUG_CONTEST_ON_F ; 7
+
+; wStatusFlags2:: ; d84d
+ const_def
+ const STATUSFLAGS2_ROCKETS_IN_RADIO_TOWER_F ; 0
+ const STATUSFLAGS2_SAFARI_GAME_F ; 1
+ const STATUSFLAGS2_BUG_CONTEST_TIMER_F ; 2
+ const STATUSFLAGS2_UNUSED_F ; 3
+ const STATUSFLAGS2_BIKE_SHOP_CALL_F ; 4
+ const STATUSFLAGS2_CAN_USE_SWEET_SCENT_F ; 5
+ const STATUSFLAGS2_REACHED_GOLDENROD_F ; 6
+ const STATUSFLAGS2_ROCKETS_IN_MAHOGANY_F ; 7
+
; wMomSavingMoney:: ; d854
MOM_SAVING_SOME_MONEY_F EQU 0
MOM_SAVING_HALF_MONEY_F EQU 1
@@ -204,6 +226,14 @@ CELEBIEVENT_FOREST_IS_RESTLESS_F EQU 2
const BIKEFLAGS_ALWAYS_ON_BIKE_F ; 1
const BIKEFLAGS_DOWNHILL_F ; 2
+; wSwarmFlags:: ; dc20
+ const_def
+ const SWARMFLAGS_BUENAS_PASSWORD_F ; 0
+ const SWARMFLAGS_GOLDENROD_DEPT_STORE_SALE_F ; 1
+ const SWARMFLAGS_DUNSPARCE_SWARM_F ; 2
+ const SWARMFLAGS_YANMA_SWARM_F ; 3
+ const SWARMFLAGS_MOBILE_4_F ; 4
+
; wLuckyNumberShowFlag:: ; dc9d
LUCKYNUMBERSHOW_GAME_OVER_F EQU 0
diff --git a/data/engine_flags.asm b/data/engine_flags.asm
index 064f08de3..74f4535a0 100644
--- a/data/engine_flags.asm
+++ b/data/engine_flags.asm
@@ -24,19 +24,20 @@ EngineFlags: ; 80462
engine_flag wUnusedTwoDayTimerOn, 0 ; unused, possibly related to a 2-day timer
- engine_flag wStatusFlags, 0 ; pokedex
- engine_flag wStatusFlags, 1 ; unown dex
- engine_flag wStatusFlags, 3 ; pokerus
- engine_flag wStatusFlags, 4 ; rocket signal on ch20
- engine_flag wStatusFlags, 6 ; credits skip
- engine_flag wStatusFlags, 7 ; bug contest on ; $10
- engine_flag wStatusFlags2, 2 ; bug contest timer
- engine_flag wStatusFlags2, 1 ; safari zone?
- engine_flag wStatusFlags2, 0 ; rockets in radio tower
- engine_flag wStatusFlags2, 4 ; bike shop call enabled (1024 bike steps reqd)
- engine_flag wStatusFlags2, 5 ; give pokerus
- engine_flag wStatusFlags2, 6 ; berry -> berry juice when trading?
- engine_flag wStatusFlags2, 7 ; rockets in mahogany
+ engine_flag wStatusFlags, STATUSFLAGS_POKEDEX_F
+ engine_flag wStatusFlags, STATUSFLAGS_UNOWN_DEX_F
+ engine_flag wStatusFlags, STATUSFLAGS_CAUGHT_POKERUS_F
+ engine_flag wStatusFlags, STATUSFLAGS_ROCKET_SIGNAL_F
+ engine_flag wStatusFlags, STATUSFLAGS_HALL_OF_FAME_F
+ engine_flag wStatusFlags, STATUSFLAGS_BUG_CONTEST_ON_F
+
+ engine_flag wStatusFlags2, STATUSFLAGS2_BUG_CONTEST_TIMER_F
+ engine_flag wStatusFlags2, STATUSFLAGS2_SAFARI_GAME_F
+ engine_flag wStatusFlags2, STATUSFLAGS2_ROCKETS_IN_RADIO_TOWER_F
+ engine_flag wStatusFlags2, STATUSFLAGS2_BIKE_SHOP_CALL_F
+ engine_flag wStatusFlags2, STATUSFLAGS2_CAN_USE_SWEET_SCENT_F
+ engine_flag wStatusFlags2, STATUSFLAGS2_REACHED_GOLDENROD_F
+ engine_flag wStatusFlags2, STATUSFLAGS2_ROCKETS_IN_MAHOGANY_F
engine_flag wBikeFlags, BIKEFLAGS_STRENGTH_ACTIVE_F ; $18
engine_flag wBikeFlags, BIKEFLAGS_ALWAYS_ON_BIKE_F
@@ -100,7 +101,8 @@ EngineFlags: ; 80462
engine_flag wVisitedSpawns, NUM_SPAWNS ; unused
engine_flag wLuckyNumberShowFlag, LUCKYNUMBERSHOW_GAME_OVER_F
- engine_flag wStatusFlags2, 3 ; ????
+
+ engine_flag wStatusFlags2, STATUSFLAGS2_UNUSED_F
engine_flag wDailyFlags, 0 ; kurt making balls ; $50
engine_flag wDailyFlags, 1 ; ????
@@ -120,8 +122,8 @@ EngineFlags: ; 80462
engine_flag wWeeklyFlags, 6 ; move tutor
engine_flag wWeeklyFlags, 7 ; buenas password
- engine_flag wSwarmFlags, 0 ; buenas password 2
- engine_flag wSwarmFlags, 1 ; goldenrod dept store sale is on
+ engine_flag wSwarmFlags, SWARMFLAGS_BUENAS_PASSWORD_F
+ engine_flag wSwarmFlags, SWARMFLAGS_GOLDENROD_DEPT_STORE_SALE_F
engine_flag wGameTimerPause, 7 ; $62
@@ -193,7 +195,7 @@ EngineFlags: ; 80462
engine_flag wPlayerSpriteSetupFlags, PLAYERSPRITESETUP_FEMALE_TO_MALE_F
- engine_flag wSwarmFlags, 2 ; dunsparce swarm ; $a0
- engine_flag wSwarmFlags, 3 ; yanma swarm
+ engine_flag wSwarmFlags, SWARMFLAGS_DUNSPARCE_SWARM_F ; $a0
+ engine_flag wSwarmFlags, SWARMFLAGS_YANMA_SWARM_F
; 80648
diff --git a/engine/events.asm b/engine/events.asm
index 96108730a..fd355744a 100644
--- a/engine/events.asm
+++ b/engine/events.asm
@@ -493,7 +493,7 @@ CheckTimeEvents: ; 9693a
jr nz, .nothing
ld hl, wStatusFlags2
- bit 2, [hl] ; bug contest
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
jr z, .do_daily
farcall CheckBugContestTimer
diff --git a/engine/events/field_moves.asm b/engine/events/field_moves.asm
index 3fb1fe9e6..e6c0629de 100755
--- a/engine/events/field_moves.asm
+++ b/engine/events/field_moves.asm
@@ -9,7 +9,7 @@ PlayWhirlpoolSound: ; 8c7d4
BlindingFlash: ; 8c7e1
farcall Special_FadeOutPalettes
ld hl, wStatusFlags
- set 2, [hl] ; Flash
+ set STATUSFLAGS_FLASH_F, [hl]
farcall ReplaceTimeOfDayPals
farcall UpdateTimeOfDayPal
ld b, SCGB_MAPPALS
diff --git a/engine/events/halloffame.asm b/engine/events/halloffame.asm
index dbd3a2d5a..3de91fa5c 100755
--- a/engine/events/halloffame.asm
+++ b/engine/events/halloffame.asm
@@ -12,7 +12,7 @@ HallOfFame:: ; 0x8640e
; Enable the Pokégear map to cycle through all of Kanto
ld hl, wStatusFlags
- set 6, [hl] ; hall of fame
+ set STATUSFLAGS_HALL_OF_FAME_F, [hl]
farcall HallOfFame_InitSaveIfNeeded
diff --git a/engine/events/pokerus/pokerus.asm b/engine/events/pokerus/pokerus.asm
index d47bcb6c1..ab717407a 100644
--- a/engine/events/pokerus/pokerus.asm
+++ b/engine/events/pokerus/pokerus.asm
@@ -19,7 +19,7 @@ GivePokerusAndConvertBerries: ; 2ed44
; If we haven't been to Goldenrod City at least once,
; prevent the contraction of Pokerus.
ld hl, wStatusFlags2
- bit 6, [hl]
+ bit STATUSFLAGS2_REACHED_GOLDENROD_F, [hl]
ret z
call Random
ld a, [hRandomAdd]
@@ -61,7 +61,7 @@ GivePokerusAndConvertBerries: ; 2ed44
.TrySpreadPokerus:
call Random
- cp 1 + 33 percent
+ cp 33 percent + 1
ret nc ; 1/3 chance
ld a, [PartyCount]
@@ -74,7 +74,7 @@ GivePokerusAndConvertBerries: ; 2ed44
jr c, .checkPreviousMonsLoop ; no more mons after this one, go backwards
call Random
- cp 1 + 50 percent
+ cp 50 percent + 1
jr c, .checkPreviousMonsLoop ; 1/2 chance, go backwards
.checkFollowingMonsLoop
add hl, de
@@ -121,14 +121,15 @@ GivePokerusAndConvertBerries: ; 2ed44
ld [hl], a
ret
-; any berry held by a Shuckle may be converted to berry juice
ConvertBerriesToBerryJuice: ; 2ede6
+; If we haven't been to Goldenrod City at least once,
+; prevent Shuckle from turning held Berry into Berry Juice.
ld hl, wStatusFlags2
- bit 6, [hl]
+ bit STATUSFLAGS2_REACHED_GOLDENROD_F, [hl]
ret z
call Random
- cp $10
- ret nc ; 1/16 chance
+ cp 6 percent + 1 ; 1/16 chance
+ ret nc
ld hl, PartyMons
ld a, [PartyCount]
.partyMonLoop
diff --git a/engine/events/std_scripts.asm b/engine/events/std_scripts.asm
index 216ce0058..e4dd586b0 100644
--- a/engine/events/std_scripts.asm
+++ b/engine/events/std_scripts.asm
@@ -122,7 +122,7 @@ PokecenterNurseScript:
checkphonecall ; elm already called about pokerus
iftrue .no
- checkflag ENGINE_POKERUS ; nurse already talked about pokerus
+ checkflag ENGINE_CAUGHT_POKERUS
iftrue .no
special Special_CheckPokerus
iftrue .pokerus
@@ -158,7 +158,7 @@ PokecenterNurseScript:
closetext
.pokerus_done
- setflag ENGINE_POKERUS
+ setflag ENGINE_CAUGHT_POKERUS
specialphonecall SPECIALCALL_POKERUS
end
diff --git a/engine/events/sweet_scent.asm b/engine/events/sweet_scent.asm
index 9b75eb9b8..e936369c8 100755
--- a/engine/events/sweet_scent.asm
+++ b/engine/events/sweet_scent.asm
@@ -37,7 +37,7 @@ SweetScentEncounter: ; 506ef
farcall CanUseSweetScent
jr nc, .no_battle
ld hl, wStatusFlags2
- bit 2, [hl]
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
jr nz, .not_in_bug_contest
farcall GetMapEncounterRate
ld a, b
diff --git a/engine/events_2.asm b/engine/events_2.asm
index 1149c2431..93044a23b 100644
--- a/engine/events_2.asm
+++ b/engine/events_2.asm
@@ -3,8 +3,8 @@
Special_WarpToSpawnPoint:: ; 97c28
ld hl, wStatusFlags2
- res 1, [hl] ; safari zone?
- res 2, [hl] ; bug contest
+ res STATUSFLAGS2_SAFARI_GAME_F, [hl]
+ res STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
ret
; 97c30
@@ -109,7 +109,7 @@ RandomEncounter:: ; 97cc0
call CanUseSweetScent
jr nc, .nope
ld hl, wStatusFlags2
- bit 2, [hl] ; bug contest
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
jr nz, .bug_contest
farcall TryWildEncounter
jr nz, .nope
@@ -150,7 +150,7 @@ WildBattleScript: ; 97cf9
CanUseSweetScent:: ; 97cfd
ld hl, wStatusFlags
- bit 5, [hl]
+ bit STATUSFLAGS2_CAN_USE_SWEET_SCENT_F, [hl]
jr nz, .no
ld a, [wEnvironment]
cp CAVE
@@ -264,7 +264,7 @@ DoBikeStep:: ; 97db3
; if we've already gotten the call, we don't have to
; be here.
ld hl, wStatusFlags2
- bit 4, [hl] ; bike shop call
+ bit STATUSFLAGS2_BIKE_SHOP_CALL_F, [hl]
jr z, .NoCall
; If we're not on the bike, we don't have to be here.
@@ -315,7 +315,7 @@ DoBikeStep:: ; 97db3
xor a
ld [wSpecialPhoneCallID + 1], a
ld hl, wStatusFlags2
- res 4, [hl] ; bike shop call
+ res STATUSFLAGS2_BIKE_SHOP_CALL_F, [hl]
scf
ret
diff --git a/engine/intro_menu.asm b/engine/intro_menu.asm
index c825a6216..a99303cf0 100755
--- a/engine/intro_menu.asm
+++ b/engine/intro_menu.asm
@@ -541,7 +541,7 @@ Continue_LoadMenuHeader: ; 5ebf
ld [hBGMapMode], a
ld hl, .MenuDataHeader_Dex
ld a, [wStatusFlags]
- bit 0, a ; pokedex
+ bit STATUSFLAGS_POKEDEX_F, a
jr nz, .show_menu
ld hl, .MenuDataHeader_NoDex
@@ -640,7 +640,7 @@ Continue_DisplayBadgeCount: ; 5f58
Continue_DisplayPokedexNumCaught: ; 5f6b
ld a, [wStatusFlags]
- bit 0, a ; Pokedex
+ bit STATUSFLAGS_POKEDEX_F, a
ret z
push hl
ld hl, PokedexCaught
diff --git a/engine/main_menu.asm b/engine/main_menu.asm
index f82c6072a..3bb3a6293 100755
--- a/engine/main_menu.asm
+++ b/engine/main_menu.asm
@@ -166,8 +166,9 @@ MainMenu_GetWhichMenu: ; 49da4
cp -1
call CloseSRAM
jr nz, .mystery_gift
+ ; This check makes no difference.
ld a, [wStatusFlags]
- bit 7, a
+ bit STATUSFLAGS_BUG_CONTEST_ON_F, a
ld a, $1 ; Continue
jr z, .ok
jr .ok
@@ -180,8 +181,9 @@ MainMenu_GetWhichMenu: ; 49da4
ret
.mystery_gift
+ ; This check makes no difference.
ld a, [wStatusFlags]
- bit 7, a
+ bit STATUSFLAGS_BUG_CONTEST_ON_F, a
jr z, .ok3
jr .ok3
diff --git a/engine/mart.asm b/engine/mart.asm
index b427037c1..ed93cbb81 100755
--- a/engine/mart.asm
+++ b/engine/mart.asm
@@ -82,7 +82,7 @@ RooftopSale: ; 15ac4
ld b, BANK(RooftopSaleData1)
ld de, RooftopSaleData1
ld hl, wStatusFlags
- bit 6, [hl] ; hall of fame
+ bit STATUSFLAGS_HALL_OF_FAME_F, [hl]
jr z, .ok
ld b, BANK(RooftopSaleData2)
ld de, RooftopSaleData2
diff --git a/engine/pokedex/pokedex.asm b/engine/pokedex/pokedex.asm
index e96d0a7d7..00321d07a 100644
--- a/engine/pokedex/pokedex.asm
+++ b/engine/pokedex/pokedex.asm
@@ -108,7 +108,7 @@ InitPokedex: ; 40063
Pokedex_CheckUnlockedUnownMode: ; 400a2
ld a, [wStatusFlags]
- bit 1, a
+ bit STATUSFLAGS_UNOWN_DEX_F, a
jr nz, .unlocked
xor a
diff --git a/engine/pokegear.asm b/engine/pokegear.asm
index 86c538253..2bb819bf5 100755
--- a/engine/pokegear.asm
+++ b/engine/pokegear.asm
@@ -764,7 +764,7 @@ PokegearMap_UpdateCursorPosition: ; 910d4
TownMap_GetKantoLandmarkLimits: ; 910e8
ld a, [wStatusFlags]
- bit 6, a ; ENGINE_CREDITS_SKIP
+ bit STATUSFLAGS_HALL_OF_FAME_F, a
jr z, .not_hof
ld d, ROUTE_28
ld e, PALLET_TOWN
@@ -1613,7 +1613,7 @@ RadioChannels:
.EvolutionRadio:
; This station airs in the Lake of Rage area when Rocket are still in Mahogany.
ld a, [wStatusFlags]
- bit 4, a ; ENGINE_ROCKET_SIGNAL_ON_CH20
+ bit STATUSFLAGS_ROCKET_SIGNAL_F, a
jr z, .NoSignal
ld a, [wPokegearMapPlayerIconLandmark]
cp MAHOGANY_TOWN
@@ -1699,7 +1699,7 @@ LoadStation_BuenasPassword: ; 917a5 (24:57a5)
call Radio_BackUpFarCallParams
ld de, NotBuenasPasswordName
ld a, [wStatusFlags2]
- bit 0, a ; ENGINE_ROCKETS_IN_RADIO_TOWER
+ bit STATUSFLAGS2_ROCKETS_IN_RADIO_TOWER_F, a
ret z
ld de, BuenasPasswordName
ret
@@ -2561,7 +2561,7 @@ Pokedex_GetArea: ; 91d11
.right
ld a, [wStatusFlags]
- bit 6, a ; ENGINE_CREDITS_SKIP
+ bit STATUSFLAGS_HALL_OF_FAME_F, a
ret z
ld a, [hWY]
and a
diff --git a/engine/radio.asm b/engine/radio.asm
index 67485dc03..9e9646505 100644
--- a/engine/radio.asm
+++ b/engine/radio.asm
@@ -5,7 +5,7 @@ PlayRadioShow:
jr nc, .ok
; If Team Rocket is not occupying the radio tower, we don't need to be here.
ld a, [wStatusFlags2]
- bit 0, a ; checkflag ENGINE_ROCKETS_IN_RADIO_TOWER
+ bit STATUSFLAGS2_ROCKETS_IN_RADIO_TOWER_F, a
jr z, .ok
; If we're in Kanto, we don't need to be here.
call IsInJohto
@@ -1171,7 +1171,7 @@ PeoplePlaces4: ; People
push af
ld hl, PnP_HiddenPeople
ld a, [wStatusFlags]
- bit 6, a ; ENGINE_CREDITS_SKIP
+ bit STATUSFLAGS_HALL_OF_FAME_F, a
jr z, .ok
ld hl, PnP_HiddenPeople_BeatE4
ld a, [wKantoBadges]
diff --git a/engine/scripting.asm b/engine/scripting.asm
index eebebb752..1ecdc016c 100644
--- a/engine/scripting.asm
+++ b/engine/scripting.asm
@@ -2449,14 +2449,14 @@ Script_wildoff:
; script command 0x38
ld hl, wStatusFlags
- set 5, [hl]
+ set STATUSFLAGS_NO_WILD_ENCOUNTERS_F, [hl]
ret
Script_wildon:
; script command 0x37
ld hl, wStatusFlags
- res 5, [hl]
+ res STATUSFLAGS_NO_WILD_ENCOUNTERS_F, [hl]
ret
Script_xycompare:
diff --git a/engine/start_menu.asm b/engine/start_menu.asm
index 20ab75ff4..a60a8b3ce 100755
--- a/engine/start_menu.asm
+++ b/engine/start_menu.asm
@@ -21,7 +21,7 @@ StartMenu:: ; 125cd
farcall ReanchorBGMap_NoOAMUpdate
ld hl, wStatusFlags2
- bit 2, [hl] ; bug catching contest
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
ld hl, .MenuDataHeader
jr z, .GotMenuData
ld hl, .ContestMenuDataHeader
@@ -306,7 +306,7 @@ endr
call .FillMenuList
ld hl, wStatusFlags
- bit 0, [hl]
+ bit STATUSFLAGS_POKEDEX_F, [hl]
jr z, .no_pokedex
ld a, STARTMENUITEM_POKEDEX
call .AppendMenuList
@@ -323,7 +323,7 @@ endr
and a
jr nz, .no_pack
ld hl, wStatusFlags2
- bit 2, [hl] ; bug catching contest
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
jr nz, .no_pack
ld a, STARTMENUITEM_PACK
call .AppendMenuList
@@ -336,14 +336,14 @@ endr
call .AppendMenuList
.no_pokegear
- ld a, 3 ; status
+ ld a, STARTMENUITEM_STATUS
call .AppendMenuList
ld a, [wLinkMode]
and a
jr nz, .no_save
ld hl, wStatusFlags2
- bit 2, [hl] ; bug catching contest
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
ld a, STARTMENUITEM_QUIT
jr nz, .write
ld a, STARTMENUITEM_SAVE
@@ -412,7 +412,7 @@ endr
.DrawBugContestStatusBox: ; 128d1
ld hl, wStatusFlags2
- bit 2, [hl] ; bug catching contest
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
ret z
farcall StartMenu_DrawBugContestStatusBox
ret
@@ -420,7 +420,7 @@ endr
.DrawBugContestStatus: ; 128de
ld hl, wStatusFlags2
- bit 2, [hl] ; bug catching contest
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
jr nz, .contest
ret
.contest
diff --git a/engine/timeofdaypals.asm b/engine/timeofdaypals.asm
index 6dfa5657a..2e4d4eec0 100644
--- a/engine/timeofdaypals.asm
+++ b/engine/timeofdaypals.asm
@@ -216,7 +216,7 @@ ReplaceTimeOfDayPals: ; 8c0e5
.DarkCave:
ld a, [wStatusFlags]
- bit 2, a ; Flash
+ bit STATUSFLAGS_FLASH_F, a
jr nz, .UsedFlash
ld a, %11111111 ; 3, 3, 3, 3
ld [wTimeOfDayPalset], a
diff --git a/engine/trainer_card.asm b/engine/trainer_card.asm
index 6d59660f7..29c4b202f 100755
--- a/engine/trainer_card.asm
+++ b/engine/trainer_card.asm
@@ -290,7 +290,7 @@ TrainerCard_Page1_PrintDexCaught_GameTime: ; 2530a (9:530a)
ld de, .StatusTilemap
call TrainerCardSetup_PlaceTilemapString
ld a, [wStatusFlags]
- bit 0, a ; ENGINE_POKEDEX
+ bit STATUSFLAGS_POKEDEX_F, a
ret nz
hlcoord 1, 9
lb bc, 2, 17
diff --git a/engine/wildmons.asm b/engine/wildmons.asm
index 50d4ea250..d2da42611 100755
--- a/engine/wildmons.asm
+++ b/engine/wildmons.asm
@@ -429,7 +429,7 @@ _SwarmWildmonCheck
call CopyCurrMapDE
push hl
ld hl, wSwarmFlags
- bit 2, [hl]
+ bit SWARMFLAGS_DUNSPARCE_SWARM_F, [hl]
pop hl
jr z, .CheckYanma
ld a, [wDunsparceMapGroup]
@@ -446,7 +446,7 @@ _SwarmWildmonCheck
.CheckYanma:
push hl
ld hl, wSwarmFlags
- bit 3, [hl]
+ bit SWARMFLAGS_YANMA_SWARM_F, [hl]
pop hl
jr z, _NoSwarmWildmon
ld a, [wYanmaMapGroup]
diff --git a/home/audio.asm b/home/audio.asm
index 44786ee29..7508d569c 100644
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -462,7 +462,7 @@ SpecialMapMusic:: ; 3d62
jr z, .surf
ld a, [wStatusFlags2]
- bit 2, a
+ bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, a
jr nz, .contest
.no
diff --git a/home/flag.asm b/home/flag.asm
index 5f1d783af..040333a5f 100644
--- a/home/flag.asm
+++ b/home/flag.asm
@@ -15,15 +15,15 @@ ResetBikeFlags:: ; 2e56
ResetFlashIfOutOfCave:: ; 2e5d
ld a, [wEnvironment]
- cp $2
- jr z, .asm_2e69
- cp $1
- jr z, .asm_2e69
+ cp ROUTE
+ jr z, .outdoors
+ cp TOWN
+ jr z, .outdoors
ret
-.asm_2e69
+.outdoors
ld hl, wStatusFlags
- res 2, [hl]
+ res STATUSFLAGS_FLASH_F, [hl]
ret
; 2e6f
diff --git a/home/map.asm b/home/map.asm
index a66391896..1ed0e5ca8 100644
--- a/home/map.asm
+++ b/home/map.asm
@@ -2306,7 +2306,7 @@ GetMapMusic:: ; 2cbd
.radiotower
ld a, [wStatusFlags2]
- bit 0, a
+ bit STATUSFLAGS2_ROCKETS_IN_RADIO_TOWER_F, a
jr z, .clearedradiotower
ld de, MUSIC_ROCKET_OVERTURE
jr .done
@@ -2321,7 +2321,7 @@ GetMapMusic:: ; 2cbd
.mahoganymart
ld a, [wStatusFlags2]
- bit 7, a
+ bit STATUSFLAGS2_ROCKETS_IN_MAHOGANY_F, a
jr z, .clearedmahogany
ld de, MUSIC_ROCKET_HIDEOUT
jr .done
diff --git a/maps/GoldenrodCity.asm b/maps/GoldenrodCity.asm
index 89ca2bb0d..f9f506fdd 100644
--- a/maps/GoldenrodCity.asm
+++ b/maps/GoldenrodCity.asm
@@ -26,7 +26,7 @@ GoldenrodCity_MapScripts:
.FlyPointAndFloria:
setflag ENGINE_FLYPOINT_GOLDENROD
- setflag ENGINE_FLORIA
+ setflag ENGINE_REACHED_GOLDENROD
checkevent EVENT_MET_FLORIA
iftrue .FloriaDone
clearevent EVENT_FLORIA_AT_SUDOWOODO
diff --git a/mobile/mobile_40.asm b/mobile/mobile_40.asm
index 48751e4fa..0a04453a0 100644
--- a/mobile/mobile_40.asm
+++ b/mobile/mobile_40.asm
@@ -7894,7 +7894,7 @@ Function1036f9: ; 1036f9
Function103700: ; 103700
ld c, $0a
ld hl, wSwarmFlags
- bit 4, [hl]
+ bit SWARMFLAGS_MOBILE_4_F, [hl]
jr z, .asm_10370f
farcall Function1008a6
@@ -7991,18 +7991,18 @@ Special_Function103780: ; 103780
Function10378c: ; 10378c
ld c, 0
ld hl, wSwarmFlags
- bit 4, [hl]
+ bit SWARMFLAGS_MOBILE_4_F, [hl]
jr nz, .already_set
- ld c, $01
+ ld c, 1
ld hl, wSwarmFlags
- set 4, [hl]
+ set SWARMFLAGS_MOBILE_4_F, [hl]
.already_set
push bc
farcall Link_SaveGame
pop bc
jr c, .failed_to_save
- ld a, $01
+ ld a, 1
ld [ScriptVar], a
ld a, c
and a
@@ -8017,7 +8017,7 @@ Function10378c: ; 10378c
and a
ret z
ld hl, wSwarmFlags
- res 4, [hl]
+ res SWARMFLAGS_MOBILE_4_F, [hl]
ret
; 1037c2
diff --git a/mobile/mobile_46.asm b/mobile/mobile_46.asm
index 98e896789..51ae92703 100755
--- a/mobile/mobile_46.asm
+++ b/mobile/mobile_46.asm
@@ -1199,15 +1199,15 @@ BattleTowerRoomMenu_PlacePickLevelMenu:
ld a, $1
ld [rSVBK], a
ld a, [wStatusFlags]
- bit 6, a ; Hall Of Fame
+ bit STATUSFLAGS_HALL_OF_FAME_F, a
jr nz, .asm_11896b
- ld hl, Strings_Ll0ToL40 ; Address to list of strings with the choosable levels
- ld a, 5 ; 4 levels to choose from, including 'Cancel'-option
+ ld hl, Strings_Ll0ToL40 ; Address to list of strings with the choosable levels
+ ld a, 5 ; 4 levels to choose from, including 'Cancel'-option
jr .asm_118970
.asm_11896b
- ld hl, Strings_L10ToL100 ; Address to list of strings with the choosable levels
- ld a, 11 ; 10 levels to choose from, including 'Cancel'-option
+ ld hl, Strings_L10ToL100 ; Address to list of strings with the choosable levels
+ ld a, 11 ; 10 levels to choose from, including 'Cancel'-option
.asm_118970
ld [wcd4a], a
diff --git a/wram.asm b/wram.asm
index 8eb667c58..362dc5699 100644
--- a/wram.asm
+++ b/wram.asm
@@ -2420,8 +2420,8 @@ wSecretID:: dw
wStatusFlags:: ; d84c
; bit 0: pokedex
; bit 1: unown dex
-; bit 2: unused
-; bit 3: pokerus
+; bit 2: flash
+; bit 3: caught pokerus
; bit 4: rocket signal
; bit 5: wild encounters on/off
; bit 6: hall of fame
@@ -2430,12 +2430,12 @@ wStatusFlags:: ; d84c
wStatusFlags2:: ; d84d
; bit 0: rockets
-; bit 1: unused
+; bit 1: safari game (unused)
; bit 2: bug contest timer
; bit 3: unused
; bit 4: bike shop call
-; bit 5: pokerus
-; bit 6: berry juice
+; bit 5: can use sweet scent
+; bit 6: reached goldenrod
; bit 7: rockets in mahogany
db