aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvie <35663410+Rangi42@users.noreply.github.com>2024-09-24 11:39:44 -0400
committerGitHub <noreply@github.com>2024-09-24 11:39:44 -0400
commit635b9c4cab523100a797b17b28788281159371c0 (patch)
treee2363703bfa658bd230f0822e8a1389837adb0dd
parentIdentify hardware register bits (#469) (diff)
downloadpokeyellow-635b9c4cab523100a797b17b28788281159371c0.tar.gz
pokeyellow-635b9c4cab523100a797b17b28788281159371c0.tar.xz
pokeyellow-635b9c4cab523100a797b17b28788281159371c0.zip
Identify `wCurrentMapScriptFlags` bits (#467)
-rw-r--r--constants/ram_constants.asm6
-rw-r--r--engine/events/card_key.asm2
-rw-r--r--engine/events/elevator.asm2
-rw-r--r--engine/events/hidden_objects/cinnabar_gym_quiz.asm2
-rw-r--r--engine/events/hidden_objects/vermilion_gym_trash.asm2
-rw-r--r--engine/menus/main_menu.asm2
-rw-r--r--home/overworld.asm8
-rw-r--r--home/trainers.asm4
-rw-r--r--ram/wram.asm5
-rw-r--r--scripts/AgathasRoom.asm4
-rw-r--r--scripts/BrunosRoom.asm4
-rw-r--r--scripts/CeladonGym.asm4
-rw-r--r--scripts/CeladonMartElevator.asm8
-rw-r--r--scripts/CeruleanGym.asm4
-rw-r--r--scripts/CinnabarGym.asm10
-rw-r--r--scripts/CinnabarIsland.asm2
-rw-r--r--scripts/FuchsiaGym.asm4
-rw-r--r--scripts/GameCorner.asm12
-rw-r--r--scripts/IndigoPlateauLobby.asm4
-rw-r--r--scripts/LancesRoom.asm6
-rw-r--r--scripts/LoreleisRoom.asm4
-rw-r--r--scripts/PewterGym.asm4
-rw-r--r--scripts/PokemonMansion1F.asm6
-rw-r--r--scripts/PokemonMansion2F.asm6
-rw-r--r--scripts/PokemonMansion3F.asm4
-rw-r--r--scripts/PokemonMansionB1F.asm4
-rw-r--r--scripts/RocketHideoutB1F.asm4
-rw-r--r--scripts/RocketHideoutB4F.asm6
-rw-r--r--scripts/RocketHideoutElevator.asm8
-rw-r--r--scripts/Route23.asm4
-rw-r--r--scripts/Route25.asm4
-rw-r--r--scripts/SaffronGym.asm4
-rw-r--r--scripts/SilphCo10F.asm4
-rw-r--r--scripts/SilphCo11F.asm4
-rw-r--r--scripts/SilphCo2F.asm4
-rw-r--r--scripts/SilphCo3F.asm4
-rw-r--r--scripts/SilphCo4F.asm4
-rw-r--r--scripts/SilphCo5F.asm4
-rw-r--r--scripts/SilphCo6F.asm4
-rw-r--r--scripts/SilphCo7F.asm4
-rw-r--r--scripts/SilphCo8F.asm4
-rw-r--r--scripts/SilphCo9F.asm4
-rw-r--r--scripts/SilphCoElevator.asm8
-rw-r--r--scripts/VermilionCity.asm8
-rw-r--r--scripts/VermilionGym.asm8
-rw-r--r--scripts/VictoryRoad1F.asm6
-rw-r--r--scripts/VictoryRoad2F.asm10
-rw-r--r--scripts/VictoryRoad3F.asm6
48 files changed, 124 insertions, 115 deletions
diff --git a/constants/ram_constants.asm b/constants/ram_constants.asm
index 8102cc7e..756aaa68 100644
--- a/constants/ram_constants.asm
+++ b/constants/ram_constants.asm
@@ -23,6 +23,12 @@ DEF BIT_TEXT_PREDEF EQU 0
; wFontLoaded
DEF BIT_FONT_LOADED EQU 0
+; wCurrentMapScriptFlags
+ const_def 5
+ const BIT_CUR_MAP_LOADED_1 ; 5
+ const BIT_CUR_MAP_LOADED_2 ; 6
+ const BIT_CUR_MAP_USED_ELEVATOR ; 7
+
; wOptions
DEF TEXT_DELAY_MASK EQU %111
const_def 6
diff --git a/engine/events/card_key.asm b/engine/events/card_key.asm
index 1597e12b..f3fa17fe 100644
--- a/engine/events/card_key.asm
+++ b/engine/events/card_key.asm
@@ -50,7 +50,7 @@ PrintCardKeyText:
ld [wNewTileBlockID], a
predef ReplaceTileBlock
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
ld a, SFX_GO_INSIDE
jp PlaySound
.noCardKey
diff --git a/engine/events/elevator.asm b/engine/events/elevator.asm
index 8e871456..9d9b712a 100644
--- a/engine/events/elevator.asm
+++ b/engine/events/elevator.asm
@@ -20,7 +20,7 @@ DisplayElevatorFloorMenu:
ld [wListScrollOffset], a
ret c
ld hl, wCurrentMapScriptFlags
- set 7, [hl]
+ set BIT_CUR_MAP_USED_ELEVATOR, [hl]
ld hl, wElevatorWarpMaps
ld a, [wWhichPokemon]
add a
diff --git a/engine/events/hidden_objects/cinnabar_gym_quiz.asm b/engine/events/hidden_objects/cinnabar_gym_quiz.asm
index 69f03f2c..a14bd198 100644
--- a/engine/events/hidden_objects/cinnabar_gym_quiz.asm
+++ b/engine/events/hidden_objects/cinnabar_gym_quiz.asm
@@ -83,7 +83,7 @@ CinnabarGymQuiz_AskQuestion:
cp c
jr nz, .wrongAnswer
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
ldh a, [hGymGateIndex]
ldh [hBackupGymGateIndex], a
ld hl, CinnabarGymQuizCorrectText
diff --git a/engine/events/hidden_objects/vermilion_gym_trash.asm b/engine/events/hidden_objects/vermilion_gym_trash.asm
index c2bfed06..92fb1406 100644
--- a/engine/events/hidden_objects/vermilion_gym_trash.asm
+++ b/engine/events/hidden_objects/vermilion_gym_trash.asm
@@ -97,7 +97,7 @@ GymTrashScript:
; Completed the trash can puzzle.
SetEvent EVENT_2ND_LOCK_OPENED
ld hl, wCurrentMapScriptFlags
- set 6, [hl]
+ set BIT_CUR_MAP_LOADED_2, [hl]
tx_pre_id VermilionGymTrashSuccessText3
diff --git a/engine/menus/main_menu.asm b/engine/menus/main_menu.asm
index df9f523f..8bd6f05e 100644
--- a/engine/menus/main_menu.asm
+++ b/engine/menus/main_menu.asm
@@ -91,7 +91,7 @@ MainMenu:
.choseContinue
call DisplayContinueGameInfo
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
.inputLoop
xor a
ldh [hJoyPressed], a
diff --git a/home/overworld.asm b/home/overworld.asm
index 85969e46..80638815 100644
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -33,8 +33,8 @@ EnterMap::
res BIT_NO_NPC_FACE_PLAYER, [hl]
call UpdateSprites
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
- set 6, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
+ set BIT_CUR_MAP_LOADED_2, [hl]
xor a
ld [wJoyIgnore], a
@@ -329,8 +329,8 @@ OverworldLoopLessDelay::
ld hl, wStatusFlags7
res BIT_TRAINER_BATTLE, [hl]
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
- set 6, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
+ set BIT_CUR_MAP_LOADED_2, [hl]
xor a
ldh [hJoyHeld], a
ld a, [wCurMap]
diff --git a/home/trainers.asm b/home/trainers.asm
index 0a466cc1..bcd15850 100644
--- a/home/trainers.asm
+++ b/home/trainers.asm
@@ -184,8 +184,8 @@ StartTrainerBattle::
EndTrainerBattle::
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
- set 6, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
+ set BIT_CUR_MAP_LOADED_2, [hl]
ld hl, wStatusFlags3
res BIT_PRINT_END_BATTLE_TEXT, [hl]
ld hl, wMiscFlags
diff --git a/ram/wram.asm b/ram/wram.asm
index 48616226..c94c682f 100644
--- a/ram/wram.asm
+++ b/ram/wram.asm
@@ -1593,7 +1593,10 @@ wIsKeyItem:: db
wTextBoxID:: db
-wCurrentMapScriptFlags:: db ; not exactly sure what this is used for, but it seems to be used as a multipurpose temp flag value
+; bit 5: set when maps first load; can be reset to re-run a script
+; bit 6: set when maps first load; can be reset to re-run a script (used less often than bit 5)
+; bit 7: set when using an elevator map's menu; triggers the shaking animation
+wCurrentMapScriptFlags:: db
wCurEnemyLevel:: db
diff --git a/scripts/AgathasRoom.asm b/scripts/AgathasRoom.asm
index 0f3acc18..2d0dca08 100644
--- a/scripts/AgathasRoom.asm
+++ b/scripts/AgathasRoom.asm
@@ -11,8 +11,8 @@ AgathasRoom_Script:
AgathaShowOrHideExitBlock:
; Blocks or clears the exit to the next room.
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
CheckEvent EVENT_BEAT_AGATHAS_ROOM_TRAINER_0
jr z, .blockExitToNextRoom
diff --git a/scripts/BrunosRoom.asm b/scripts/BrunosRoom.asm
index 94ec7d17..6d7fde6e 100644
--- a/scripts/BrunosRoom.asm
+++ b/scripts/BrunosRoom.asm
@@ -11,8 +11,8 @@ BrunosRoom_Script:
BrunoShowOrHideExitBlock:
; Blocks or clears the exit to the next room.
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
CheckEvent EVENT_BEAT_BRUNOS_ROOM_TRAINER_0
jr z, .blockExitToNextRoom
diff --git a/scripts/CeladonGym.asm b/scripts/CeladonGym.asm
index ca7da4e5..f95d129a 100644
--- a/scripts/CeladonGym.asm
+++ b/scripts/CeladonGym.asm
@@ -1,7 +1,7 @@
CeladonGym_Script:
ld hl, wCurrentMapScriptFlags
- bit 6, [hl]
- res 6, [hl]
+ bit BIT_CUR_MAP_LOADED_2, [hl]
+ res BIT_CUR_MAP_LOADED_2, [hl]
call nz, .LoadNames
call EnableAutoTextBoxDrawing
ld hl, CeladonGymTrainerHeaders
diff --git a/scripts/CeladonMartElevator.asm b/scripts/CeladonMartElevator.asm
index 9a2842f3..69686fa8 100644
--- a/scripts/CeladonMartElevator.asm
+++ b/scripts/CeladonMartElevator.asm
@@ -1,12 +1,12 @@
CeladonMartElevator_Script:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
push hl
call nz, CeladonMartElevatorStoreWarpEntriesScript
pop hl
- bit 7, [hl]
- res 7, [hl]
+ bit BIT_CUR_MAP_USED_ELEVATOR, [hl]
+ res BIT_CUR_MAP_USED_ELEVATOR, [hl]
call nz, CeladonMartElevatorShakeScript
xor a
ld [wAutoTextBoxDrawingControl], a
diff --git a/scripts/CeruleanGym.asm b/scripts/CeruleanGym.asm
index 37d5e405..e924907a 100644
--- a/scripts/CeruleanGym.asm
+++ b/scripts/CeruleanGym.asm
@@ -1,7 +1,7 @@
CeruleanGym_Script:
ld hl, wCurrentMapScriptFlags
- bit 6, [hl]
- res 6, [hl]
+ bit BIT_CUR_MAP_LOADED_2, [hl]
+ res BIT_CUR_MAP_LOADED_2, [hl]
call nz, .LoadNames
call EnableAutoTextBoxDrawing
ld hl, CeruleanGymTrainerHeaders
diff --git a/scripts/CinnabarGym.asm b/scripts/CinnabarGym.asm
index b7c9e1ba..efda64a5 100644
--- a/scripts/CinnabarGym.asm
+++ b/scripts/CinnabarGym.asm
@@ -7,13 +7,13 @@ CinnabarGym_Script:
CinnabarGymSetMapAndTiles:
ld hl, wCurrentMapScriptFlags
- bit 6, [hl]
- res 6, [hl]
+ bit BIT_CUR_MAP_LOADED_2, [hl]
+ res BIT_CUR_MAP_LOADED_2, [hl]
push hl
call nz, .LoadNames
pop hl
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
call nz, UpdateCinnabarGymGateTileBlocks
ResetEvent EVENT_2A7
ret
@@ -170,7 +170,7 @@ CinnabarGymReceiveTM38:
SetEventRange EVENT_BEAT_CINNABAR_GYM_TRAINER_0, EVENT_BEAT_CINNABAR_GYM_TRAINER_6
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
jp CinnabarGymResetScripts
diff --git a/scripts/CinnabarIsland.asm b/scripts/CinnabarIsland.asm
index ed38f690..f2a36afb 100644
--- a/scripts/CinnabarIsland.asm
+++ b/scripts/CinnabarIsland.asm
@@ -1,7 +1,7 @@
CinnabarIsland_Script:
call EnableAutoTextBoxDrawing
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
ResetEvent EVENT_MANSION_SWITCH_ON
ResetEvent EVENT_LAB_STILL_REVIVING_FOSSIL
ld hl, CinnabarIsland_ScriptPointers
diff --git a/scripts/FuchsiaGym.asm b/scripts/FuchsiaGym.asm
index 8ccebe40..c983c896 100644
--- a/scripts/FuchsiaGym.asm
+++ b/scripts/FuchsiaGym.asm
@@ -10,8 +10,8 @@ FuchsiaGym_Script:
.LoadNames:
ld hl, wCurrentMapScriptFlags
- bit 6, [hl]
- res 6, [hl]
+ bit BIT_CUR_MAP_LOADED_2, [hl]
+ res BIT_CUR_MAP_LOADED_2, [hl]
ret z
ld hl, .CityName
ld de, .LeaderName
diff --git a/scripts/GameCorner.asm b/scripts/GameCorner.asm
index 5d5236c5..cac3170c 100644
--- a/scripts/GameCorner.asm
+++ b/scripts/GameCorner.asm
@@ -8,8 +8,8 @@ GameCorner_Script:
GameCornerSelectLuckySlotMachine:
ld hl, wCurrentMapScriptFlags
- bit 6, [hl]
- res 6, [hl]
+ bit BIT_CUR_MAP_LOADED_2, [hl]
+ res BIT_CUR_MAP_LOADED_2, [hl]
ret z
call Random
ldh a, [hRandomAdd]
@@ -25,8 +25,8 @@ GameCornerSelectLuckySlotMachine:
GameCornerSetRocketHideoutDoorTile:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
CheckEvent EVENT_FOUND_ROCKET_HIDEOUT
ret nz
@@ -111,8 +111,8 @@ GameCornerRocketExitScript:
ld [wMissableObjectIndex], a
predef HideObject
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
- set 6, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
+ set BIT_CUR_MAP_LOADED_2, [hl]
ld a, SCRIPT_GAMECORNER_DEFAULT
ld [wGameCornerCurScript], a
ret
diff --git a/scripts/IndigoPlateauLobby.asm b/scripts/IndigoPlateauLobby.asm
index fd8ecf3c..8ac87030 100644
--- a/scripts/IndigoPlateauLobby.asm
+++ b/scripts/IndigoPlateauLobby.asm
@@ -2,8 +2,8 @@ IndigoPlateauLobby_Script:
call Serial_TryEstablishingExternallyClockedConnection
call EnableAutoTextBoxDrawing
ld hl, wCurrentMapScriptFlags
- bit 6, [hl]
- res 6, [hl]
+ bit BIT_CUR_MAP_LOADED_2, [hl]
+ res BIT_CUR_MAP_LOADED_2, [hl]
ret z
ResetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH
; Reset Elite Four events if the player started challenging them before
diff --git a/scripts/LancesRoom.asm b/scripts/LancesRoom.asm
index 31b0f240..235deac1 100644
--- a/scripts/LancesRoom.asm
+++ b/scripts/LancesRoom.asm
@@ -10,8 +10,8 @@ LancesRoom_Script:
LanceShowOrHideEntranceBlocks:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
CheckEvent EVENT_LANCES_ROOM_LOCK_DOOR
jr nz, .closeEntrance
@@ -71,7 +71,7 @@ LancesRoomDefaultScript:
CheckAndSetEvent EVENT_LANCES_ROOM_LOCK_DOOR
ret nz
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
ld a, SFX_GO_INSIDE
call PlaySound
jp LanceShowOrHideEntranceBlocks
diff --git a/scripts/LoreleisRoom.asm b/scripts/LoreleisRoom.asm
index ec88f73e..455561b8 100644
--- a/scripts/LoreleisRoom.asm
+++ b/scripts/LoreleisRoom.asm
@@ -11,8 +11,8 @@ LoreleisRoom_Script:
LoreleiShowOrHideExitBlock:
; Blocks or clears the exit to the next room.
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
ld hl, wElite4Flags
set BIT_STARTED_ELITE_4, [hl]
diff --git a/scripts/PewterGym.asm b/scripts/PewterGym.asm
index 0029be19..6c4c9443 100644
--- a/scripts/PewterGym.asm
+++ b/scripts/PewterGym.asm
@@ -1,7 +1,7 @@
PewterGym_Script:
ld hl, wCurrentMapScriptFlags
- bit 6, [hl]
- res 6, [hl]
+ bit BIT_CUR_MAP_LOADED_2, [hl]
+ res BIT_CUR_MAP_LOADED_2, [hl]
call nz, .LoadNames
call EnableAutoTextBoxDrawing
ld hl, PewterGymTrainerHeaders
diff --git a/scripts/PokemonMansion1F.asm b/scripts/PokemonMansion1F.asm
index a93bd33b..d06a234a 100644
--- a/scripts/PokemonMansion1F.asm
+++ b/scripts/PokemonMansion1F.asm
@@ -10,8 +10,8 @@ PokemonMansion1F_Script:
Mansion1CheckReplaceSwitchDoorBlocks:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
CheckEvent EVENT_MANSION_SWITCH_ON
jr nz, .switchTurnedOn
@@ -103,7 +103,7 @@ PokemonMansion1FSwitchText:
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
ld hl, .PressedText
call PrintText
ld a, SFX_GO_INSIDE
diff --git a/scripts/PokemonMansion2F.asm b/scripts/PokemonMansion2F.asm
index df424a19..7da9e50f 100644
--- a/scripts/PokemonMansion2F.asm
+++ b/scripts/PokemonMansion2F.asm
@@ -10,8 +10,8 @@ PokemonMansion2F_Script:
Mansion2CheckReplaceSwitchDoorBlocks:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
CheckEvent EVENT_MANSION_SWITCH_ON
jr nz, .switchTurnedOn
@@ -108,7 +108,7 @@ PokemonMansion2FSwitchText:
ld a, $1
ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
ld hl, .PressedText
call PrintText
ld a, SFX_GO_INSIDE
diff --git a/scripts/PokemonMansion3F.asm b/scripts/PokemonMansion3F.asm
index f5347446..de8bd1dd 100644
--- a/scripts/PokemonMansion3F.asm
+++ b/scripts/PokemonMansion3F.asm
@@ -10,8 +10,8 @@ PokemonMansion3F_Script:
Mansion3CheckReplaceSwitchDoorBlocks:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
CheckEvent EVENT_MANSION_SWITCH_ON
jr nz, .switchTurnedOn
diff --git a/scripts/PokemonMansionB1F.asm b/scripts/PokemonMansionB1F.asm
index e359621d..e31bbd3e 100644
--- a/scripts/PokemonMansionB1F.asm
+++ b/scripts/PokemonMansionB1F.asm
@@ -10,8 +10,8 @@ PokemonMansionB1F_Script:
MansionB1FCheckReplaceSwitchDoorBlocks:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
CheckEvent EVENT_MANSION_SWITCH_ON
jr nz, .switchTurnedOn
diff --git a/scripts/RocketHideoutB1F.asm b/scripts/RocketHideoutB1F.asm
index f6c64bda..9354a0c7 100644
--- a/scripts/RocketHideoutB1F.asm
+++ b/scripts/RocketHideoutB1F.asm
@@ -10,8 +10,8 @@ RocketHideoutB1F_Script:
RocketHideoutB1FDoorCallbackScript:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
CheckEvent EVENT_677
jr nz, .door_open
diff --git a/scripts/RocketHideoutB4F.asm b/scripts/RocketHideoutB4F.asm
index 920aa089..2c630067 100644
--- a/scripts/RocketHideoutB4F.asm
+++ b/scripts/RocketHideoutB4F.asm
@@ -10,8 +10,8 @@ RocketHideoutB4F_Script:
RocketHideoutB4FDoorCallbackScript:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
CheckEvent EVENT_ROCKET_HIDEOUT_4_DOOR_UNLOCKED
jr nz, .door_already_unlocked
@@ -67,7 +67,7 @@ RocketHideoutB4FBeatGiovanniScript:
xor a
ld [wJoyIgnore], a
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
ld a, SCRIPT_ROCKETHIDEOUTB4F_DEFAULT
ld [wRocketHideoutB4FCurScript], a
ld [wCurMapScript], a
diff --git a/scripts/RocketHideoutElevator.asm b/scripts/RocketHideoutElevator.asm
index 71ff0758..bd6fb498 100644
--- a/scripts/RocketHideoutElevator.asm
+++ b/scripts/RocketHideoutElevator.asm
@@ -1,12 +1,12 @@
RocketHideoutElevator_Script:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
push hl
call nz, RocketHideoutElevatorStoreWarpEntriesScript
pop hl
- bit 7, [hl]
- res 7, [hl]
+ bit BIT_CUR_MAP_USED_ELEVATOR, [hl]
+ res BIT_CUR_MAP_USED_ELEVATOR, [hl]
call nz, RocketHideoutElevatorShakeScript
xor a
ld [wAutoTextBoxDrawingControl], a
diff --git a/scripts/Route23.asm b/scripts/Route23.asm
index ffd968df..ac4853d8 100644
--- a/scripts/Route23.asm
+++ b/scripts/Route23.asm
@@ -7,8 +7,8 @@ Route23_Script:
Route23SetVictoryRoadBoulders:
ld hl, wCurrentMapScriptFlags
- bit 6, [hl]
- res 6, [hl]
+ bit BIT_CUR_MAP_LOADED_2, [hl]
+ res BIT_CUR_MAP_LOADED_2, [hl]
ret z
ResetEvents EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH1, EVENT_VICTORY_ROAD_2_BOULDER_ON_SWITCH2
ResetEvents EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1, EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH2
diff --git a/scripts/Route25.asm b/scripts/Route25.asm
index ef0e8fd2..a85144a8 100644
--- a/scripts/Route25.asm
+++ b/scripts/Route25.asm
@@ -10,8 +10,8 @@ Route25_Script:
Route25ShowHideBillScript:
ld hl, wCurrentMapScriptFlags
- bit 6, [hl]
- res 6, [hl]
+ bit BIT_CUR_MAP_LOADED_2, [hl]
+ res BIT_CUR_MAP_LOADED_2, [hl]
ret z
CheckEventHL EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING
ret nz
diff --git a/scripts/SaffronGym.asm b/scripts/SaffronGym.asm
index 556cd4c5..4bfb7b2c 100644
--- a/scripts/SaffronGym.asm
+++ b/scripts/SaffronGym.asm
@@ -1,7 +1,7 @@
SaffronGym_Script:
ld hl, wCurrentMapScriptFlags
- bit 6, [hl]
- res 6, [hl]
+ bit BIT_CUR_MAP_LOADED_2, [hl]
+ res BIT_CUR_MAP_LOADED_2, [hl]
call nz, .LoadNames
call EnableAutoTextBoxDrawing
ld hl, SaffronGymTrainerHeaders
diff --git a/scripts/SilphCo10F.asm b/scripts/SilphCo10F.asm
index 7cc2c58e..d9650bc8 100644
--- a/scripts/SilphCo10F.asm
+++ b/scripts/SilphCo10F.asm
@@ -10,8 +10,8 @@ SilphCo10F_Script:
SilphCo10FGateCallbackScript:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
ld hl, .GateCoordinates
call SilphCo2F_SetCardKeyDoorYScript
diff --git a/scripts/SilphCo11F.asm b/scripts/SilphCo11F.asm
index d5e4cb08..6953d37c 100644
--- a/scripts/SilphCo11F.asm
+++ b/scripts/SilphCo11F.asm
@@ -10,8 +10,8 @@ SilphCo11F_Script:
SilphCo11FGateCallbackScript:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
ld hl, SilphCo11GateCoords
call SilphCo11F_SetCardKeyDoorYScript
diff --git a/scripts/SilphCo2F.asm b/scripts/SilphCo2F.asm
index 52241b95..7ca57c45 100644
--- a/scripts/SilphCo2F.asm
+++ b/scripts/SilphCo2F.asm
@@ -10,8 +10,8 @@ SilphCo2F_Script:
SilphCo2FGateCallbackScript:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
ld hl, .GateCoordinates
call SilphCo2F_SetCardKeyDoorYScript
diff --git a/scripts/SilphCo3F.asm b/scripts/SilphCo3F.asm
index df9df9e8..146cbb07 100644
--- a/scripts/SilphCo3F.asm
+++ b/scripts/SilphCo3F.asm
@@ -10,8 +10,8 @@ SilphCo3F_Script:
SilphCo3FGateCallbackScript:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
ld hl, .GateCoordinates
call SilphCo2F_SetCardKeyDoorYScript
diff --git a/scripts/SilphCo4F.asm b/scripts/SilphCo4F.asm
index 91453d65..f84ef995 100644
--- a/scripts/SilphCo4F.asm
+++ b/scripts/SilphCo4F.asm
@@ -10,8 +10,8 @@ SilphCo4F_Script:
SilphCo4FGateCallbackScript:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
ld hl, .GateCoordinates
call SilphCo4F_SetCardKeyDoorYScript
diff --git a/scripts/SilphCo5F.asm b/scripts/SilphCo5F.asm
index 1834bfa8..599c1743 100644
--- a/scripts/SilphCo5F.asm
+++ b/scripts/SilphCo5F.asm
@@ -10,8 +10,8 @@ SilphCo5F_Script:
SilphCo5FGateCallbackScript:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
ld hl, .GateCoordinates
call SilphCo4F_SetCardKeyDoorYScript
diff --git a/scripts/SilphCo6F.asm b/scripts/SilphCo6F.asm
index 0626ffdb..ad8e83f4 100644
--- a/scripts/SilphCo6F.asm
+++ b/scripts/SilphCo6F.asm
@@ -10,8 +10,8 @@ SilphCo6F_Script:
SilphCo6F_GateCallbackScript:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
ld hl, .GateCoordinates
call SilphCo4F_SetCardKeyDoorYScript
diff --git a/scripts/SilphCo7F.asm b/scripts/SilphCo7F.asm
index 381eff7a..bf517d29 100644
--- a/scripts/SilphCo7F.asm
+++ b/scripts/SilphCo7F.asm
@@ -10,8 +10,8 @@ SilphCo7F_Script:
SilphCo7F_GateCallbackScript:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
ld hl, .GateCoordinates
call SilphCo7F_SetCardKeyDoorYScript
diff --git a/scripts/SilphCo8F.asm b/scripts/SilphCo8F.asm
index cdd7f486..dcba85c0 100644
--- a/scripts/SilphCo8F.asm
+++ b/scripts/SilphCo8F.asm
@@ -10,8 +10,8 @@ SilphCo8F_Script:
SilphCo8FGateCallbackScript:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
ld hl, .GateCoordinates
call SilphCo8F_SetCardKeyDoorYScript
diff --git a/scripts/SilphCo9F.asm b/scripts/SilphCo9F.asm
index fe7f3da2..aec4dbf8 100644
--- a/scripts/SilphCo9F.asm
+++ b/scripts/SilphCo9F.asm
@@ -10,8 +10,8 @@ SilphCo9F_Script:
SilphCo9FGateCallbackScript:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
ld hl, .GateCoordinates
call SilphCo9F_SetCardKeyDoorYScript
diff --git a/scripts/SilphCoElevator.asm b/scripts/SilphCoElevator.asm
index a2ed009e..ffdf101e 100644
--- a/scripts/SilphCoElevator.asm
+++ b/scripts/SilphCoElevator.asm
@@ -1,12 +1,12 @@
SilphCoElevator_Script:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
push hl
call nz, SilphCoElevatorStoreWarpEntriesScript
pop hl
- bit 7, [hl]
- res 7, [hl]
+ bit BIT_CUR_MAP_USED_ELEVATOR, [hl]
+ res BIT_CUR_MAP_USED_ELEVATOR, [hl]
call nz, SilphCoElevatorShakeScript
xor a
ld [wAutoTextBoxDrawingControl], a
diff --git a/scripts/VermilionCity.asm b/scripts/VermilionCity.asm
index fd5905df..40a08dbc 100644
--- a/scripts/VermilionCity.asm
+++ b/scripts/VermilionCity.asm
@@ -1,13 +1,13 @@
VermilionCity_Script:
call EnableAutoTextBoxDrawing
ld hl, wCurrentMapScriptFlags
- bit 6, [hl]
- res 6, [hl]
+ bit BIT_CUR_MAP_LOADED_2, [hl]
+ res BIT_CUR_MAP_LOADED_2, [hl]
push hl
call nz, VermilionCityLeftSSAnneCallbackScript
pop hl
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
call nz, .setFirstLockTrashCanIndex
ld hl, VermilionCity_ScriptPointers
ld a, [wVermilionCityCurScript]
diff --git a/scripts/VermilionGym.asm b/scripts/VermilionGym.asm
index d7828e42..8d3a33b6 100644
--- a/scripts/VermilionGym.asm
+++ b/scripts/VermilionGym.asm
@@ -1,12 +1,12 @@
VermilionGym_Script:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
push hl
call nz, .LoadNames
pop hl
- bit 6, [hl]
- res 6, [hl]
+ bit BIT_CUR_MAP_LOADED_2, [hl]
+ res BIT_CUR_MAP_LOADED_2, [hl]
call nz, VermilionGymSetDoorTile
call EnableAutoTextBoxDrawing
ld hl, VermilionGymTrainerHeaders
diff --git a/scripts/VictoryRoad1F.asm b/scripts/VictoryRoad1F.asm
index e80e17d5..554ae39f 100644
--- a/scripts/VictoryRoad1F.asm
+++ b/scripts/VictoryRoad1F.asm
@@ -1,7 +1,7 @@
VictoryRoad1F_Script:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
call nz, .next
call EnableAutoTextBoxDrawing
ld hl, VictoryRoad1TrainerHeaders
@@ -31,7 +31,7 @@ VictoryRoad1FDefaultScript:
call CheckBoulderCoords
jp nc, CheckFightingMapTrainers
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
SetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH
ret
diff --git a/scripts/VictoryRoad2F.asm b/scripts/VictoryRoad2F.asm
index 5e31da7a..85356247 100644
--- a/scripts/VictoryRoad2F.asm
+++ b/scripts/VictoryRoad2F.asm
@@ -1,11 +1,11 @@
VictoryRoad2F_Script:
ld hl, wCurrentMapScriptFlags
- bit 6, [hl]
- res 6, [hl]
+ bit BIT_CUR_MAP_LOADED_2, [hl]
+ res BIT_CUR_MAP_LOADED_2, [hl]
call nz, VictoryRoad2FResetBoulderEventScript
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
call nz, VictoryRoad2FCheckBoulderEventScript
call EnableAutoTextBoxDrawing
ld hl, VictoryRoad2TrainerHeaders
@@ -60,7 +60,7 @@ VictoryRoad2FDefaultScript:
ret nz
.set_script_flag
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
ret
.SwitchCoords:
diff --git a/scripts/VictoryRoad3F.asm b/scripts/VictoryRoad3F.asm
index e9295a15..2b1b11c0 100644
--- a/scripts/VictoryRoad3F.asm
+++ b/scripts/VictoryRoad3F.asm
@@ -10,8 +10,8 @@ VictoryRoad3F_Script:
VictoryRoad3FCheckBoulderEventScript:
ld hl, wCurrentMapScriptFlags
- bit 5, [hl]
- res 5, [hl]
+ bit BIT_CUR_MAP_LOADED_1, [hl]
+ res BIT_CUR_MAP_LOADED_1, [hl]
ret z
CheckEventHL EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1
ret z
@@ -38,7 +38,7 @@ VictoryRoad3FDefaultScript:
cp $1
jr nz, .handle_hole
ld hl, wCurrentMapScriptFlags
- set 5, [hl]
+ set BIT_CUR_MAP_LOADED_1, [hl]
SetEvent EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1
ret
.handle_hole