summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2015-07-21 14:21:14 -0700
committerYamaArashi <shadow962@live.com>2015-07-21 14:21:14 -0700
commitdcc7f3bc9f41f2d5e0f7448b4688c1058da0040b (patch)
tree7f9cbc30a08550b4e5b37b28810887472672610b
parent5ce58a048cecba5435d74b14652c58004d3f95b1 (diff)
named more constants
-rwxr-xr-xconstants/event_constants.asm34
-rwxr-xr-xengine/hall_of_fame.asm2
-rwxr-xr-xengine/hidden_object_functions7.asm42
-rwxr-xr-xengine/pokedex_rating.asm2
-rw-r--r--home.asm4
-rwxr-xr-xscripts/cinnabargym.asm40
-rwxr-xr-xscripts/halloffameroom.asm2
-rwxr-xr-xscripts/indigoplateaulobby.asm4
-rwxr-xr-xscripts/lorelei.asm2
-rwxr-xr-xwram.asm5
10 files changed, 71 insertions, 66 deletions
diff --git a/constants/event_constants.asm b/constants/event_constants.asm
index 1eb68941..4e3a2849 100755
--- a/constants/event_constants.asm
+++ b/constants/event_constants.asm
@@ -3,7 +3,7 @@ const_value = 0
const EVENT_FOLLOWED_OAK_INTO_LAB ; 000, (D747, bit 0)
const EVENT_001 ; 001, (D747, bit 1)
const EVENT_002 ; 002, (D747, bit 2)
- const EVENT_003 ; 003, (D747, bit 3)
+ const EVENT_HALL_OF_FAME_DEX_RATING ; 003, (D747, bit 3)
const EVENT_004 ; 004, (D747, bit 4)
const EVENT_005 ; 005, (D747, bit 5)
const EVENT_PALLET_AFTER_GETTING_POKEBALLS ; 006, (D747, bit 6)
@@ -666,13 +666,13 @@ const_value = 0
const EVENT_297 ; 297, (D799, bit 7)
const EVENT_GOT_TM38 ; 298, (D79A, bit 0)
const EVENT_BEAT_BLAINE ; 299, (D79A, bit 1)
- const EVENT_29A ; 29A, (D79A, bit 2)
- const EVENT_29B ; 29B, (D79A, bit 3)
- const EVENT_29C ; 29C, (D79A, bit 4)
- const EVENT_29D ; 29D, (D79A, bit 5)
- const EVENT_29E ; 29E, (D79A, bit 6)
- const EVENT_29F ; 29F, (D79A, bit 7)
- const EVENT_2A0 ; 2A0, (D79B, bit 0)
+ const EVENT_BEAT_CINNABAR_GYM_TRAINER_0 ; 29A, (D79A, bit 2)
+ const EVENT_BEAT_CINNABAR_GYM_TRAINER_1 ; 29B, (D79A, bit 3)
+ const EVENT_BEAT_CINNABAR_GYM_TRAINER_2 ; 29C, (D79A, bit 4)
+ const EVENT_BEAT_CINNABAR_GYM_TRAINER_3 ; 29D, (D79A, bit 5)
+ const EVENT_BEAT_CINNABAR_GYM_TRAINER_4 ; 29E, (D79A, bit 6)
+ const EVENT_BEAT_CINNABAR_GYM_TRAINER_5 ; 29F, (D79A, bit 7)
+ const EVENT_BEAT_CINNABAR_GYM_TRAINER_6 ; 2A0, (D79B, bit 0)
const EVENT_2A1 ; 2A1, (D79B, bit 1)
const EVENT_2A2 ; 2A2, (D79B, bit 2)
const EVENT_2A3 ; 2A3, (D79B, bit 3)
@@ -680,13 +680,13 @@ const_value = 0
const EVENT_2A5 ; 2A5, (D79B, bit 5)
const EVENT_2A6 ; 2A6, (D79B, bit 6)
const EVENT_2A7 ; 2A7, (D79B, bit 7)
- const EVENT_2A8 ; 2A8, (D79C, bit 0)
- const EVENT_2A9 ; 2A9, (D79C, bit 1)
- const EVENT_2AA ; 2AA, (D79C, bit 2)
- const EVENT_2AB ; 2AB, (D79C, bit 3)
- const EVENT_2AC ; 2AC, (D79C, bit 4)
- const EVENT_2AD ; 2AD, (D79C, bit 5)
- const EVENT_2AE ; 2AE, (D79C, bit 6)
+ const EVENT_CINNABAR_GYM_GATE0_UNLOCKED ; 2A8, (D79C, bit 0) doesn't exist, but the bit is set
+ const EVENT_CINNABAR_GYM_GATE1_UNLOCKED ; 2A9, (D79C, bit 1)
+ const EVENT_CINNABAR_GYM_GATE2_UNLOCKED ; 2AA, (D79C, bit 2)
+ const EVENT_CINNABAR_GYM_GATE3_UNLOCKED ; 2AB, (D79C, bit 3)
+ const EVENT_CINNABAR_GYM_GATE4_UNLOCKED ; 2AC, (D79C, bit 4)
+ const EVENT_CINNABAR_GYM_GATE5_UNLOCKED ; 2AD, (D79C, bit 5)
+ const EVENT_CINNABAR_GYM_GATE6_UNLOCKED ; 2AE, (D79C, bit 6)
const EVENT_2AF ; 2AF, (D79C, bit 7)
const EVENT_2B0 ; 2B0, (D79D, bit 0)
const EVENT_2B1 ; 2B1, (D79D, bit 1)
@@ -2272,7 +2272,7 @@ const_value = 0
const EVENT_8DD ; 8DD, (D862, bit 5)
const EVENT_8DE ; 8DE, (D862, bit 6)
const EVENT_8DF ; 8DF, (D862, bit 7)
- const EVENT_ELITE4_EVENTS_START ; 8E0, (D863, bit 0)
+ const ELITE4_EVENTS_START ; 8E0, (D863, bit 0)
const EVENT_BEAT_LORELEIS_ROOM_TRAINER_0 ; 8E1, (D863, bit 1)
const EVENT_8E2 ; 8E2, (D863, bit 2)
const EVENT_8E3 ; 8E3, (D863, bit 3)
@@ -2311,7 +2311,7 @@ const_value = 0
const EVENT_904 ; 904, (D867, bit 4)
const EVENT_905 ; 905, (D867, bit 5)
const EVENT_906 ; 906, (D867, bit 6)
- const EVENT_907 ; 907, (D867, bit 7)
+ const ELITE4_CHAMPION_EVENTS_END ; 907, (D867, bit 7)
const EVENT_908 ; 908, (D868, bit 0)
const EVENT_909 ; 909, (D868, bit 1)
const EVENT_90A ; 90A, (D868, bit 2)
diff --git a/engine/hall_of_fame.asm b/engine/hall_of_fame.asm
index 7361fea2..1fc2c5c5 100755
--- a/engine/hall_of_fame.asm
+++ b/engine/hall_of_fame.asm
@@ -207,7 +207,7 @@ HoFLoadMonPlayerPicTileIDs: ; 7036d (1c:436d)
predef_jump CopyTileIDsFromList
HoFDisplayPlayerStats: ; 70377 (1c:4377)
- SetEvent EVENT_003
+ SetEvent EVENT_HALL_OF_FAME_DEX_RATING
predef DisplayDexRating
coord hl, 0, 4
ld b, $6
diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm
index 90de784f..08aadf02 100755
--- a/engine/hidden_object_functions7.asm
+++ b/engine/hidden_object_functions7.asm
@@ -188,8 +188,8 @@ CinnabarQuizQuestionsText6: ; 1ea85 (7:6a85)
TX_FAR _CinnabarQuizQuestionsText6
db "@"
-CinnabarGymQuiz_1ea8a: ; 1ea8a (7:6a8a)
- EventFlagAddress hl, EVENT_2A8
+CinnabarGymGateFlagAction: ; 1ea8a (7:6a8a)
+ EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED
predef_jump FlagActionPredef
CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92)
@@ -206,11 +206,11 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92)
ld hl, CinnabarGymQuizCorrectText
call PrintText
ld a, [$ffe0]
- AdjustEventBit EVENT_2A8, 0
+ AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0
ld c, a
ld b, FLAG_SET
- call CinnabarGymQuiz_1ea8a
- jp CinnabarGymQuiz_1eb0a
+ call CinnabarGymGateFlagAction
+ jp UpdateCinnabarGymGateTileBlocks_
.asm_1eab8
call WaitForSoundToFinish
ld a, SFX_DENIED
@@ -220,10 +220,10 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92)
call PrintText
ld a, [$ffdb]
add $2
- AdjustEventBit EVENT_29A, 2
+ AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2
ld c, a
ld b, FLAG_TEST
- EventFlagAddress hl, EVENT_29A
+ EventFlagAddress hl, EVENT_BEAT_CINNABAR_GYM_TRAINER_0
predef FlagActionPredef
ld a, c
and a
@@ -240,10 +240,10 @@ CinnabarGymQuizCorrectText: ; 1eae3 (7:6ae3)
TX_ASM
ld a, [$ffe0]
- AdjustEventBit EVENT_2A8, 0
+ AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0
ld c, a
ld b, FLAG_TEST
- call CinnabarGymQuiz_1ea8a
+ call CinnabarGymGateFlagAction
ld a, c
and a
jp nz, TextScriptEnd
@@ -257,15 +257,17 @@ CinnabarGymQuizIncorrectText: ; 1eb05 (7:6b05)
TX_FAR _CinnabarGymQuizIncorrectText
db "@"
-CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a)
- ld a, $6
+UpdateCinnabarGymGateTileBlocks_: ; 1eb0a (7:6b0a)
+; Update the overworld map with open floor blocks or locked gate blocks
+; depending on event flags.
+ ld a, 6
ld [$ffdb], a
-.asm_1eb0e
+.loop
ld a, [$ffdb]
dec a
add a
add a
- ld d, $0
+ ld d, 0
ld e, a
ld hl, CinnabarGymGateCoords
add hl, de
@@ -278,24 +280,24 @@ CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a)
push bc
ld a, [$ffdb]
ld [$ffe0], a
- AdjustEventBit EVENT_2A8, 0
+ AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0
ld c, a
ld b, FLAG_TEST
- call CinnabarGymQuiz_1ea8a
+ call CinnabarGymGateFlagAction
ld a, c
and a
- jr nz, .asm_1eb36
+ jr nz, .unlocked
ld a, [wd12f]
- jr .asm_1eb38
-.asm_1eb36
+ jr .next
+.unlocked
ld a, $e
-.asm_1eb38
+.next
pop bc
ld [wd09f], a
predef ReplaceTileBlock
ld hl, $ffdb
dec [hl]
- jr nz, .asm_1eb0e
+ jr nz, .loop
ret
CinnabarGymGateCoords: ; 1eb48 (7:6b48)
diff --git a/engine/pokedex_rating.asm b/engine/pokedex_rating.asm
index 2d7073df..ca88673f 100755
--- a/engine/pokedex_rating.asm
+++ b/engine/pokedex_rating.asm
@@ -23,7 +23,7 @@ DisplayDexRating: ; 44169 (11:4169)
ld a, [hli]
ld h, [hl]
ld l, a ; load text pointer into hl
- CheckAndResetEventA EVENT_003
+ CheckAndResetEventA EVENT_HALL_OF_FAME_DEX_RATING
jr nz, .label3
push hl
ld hl, PokedexRatingText_441cc
diff --git a/home.asm b/home.asm
index 6bb54df2..f58f6c16 100644
--- a/home.asm
+++ b/home.asm
@@ -4590,8 +4590,8 @@ Random::
INCLUDE "home/predef.asm"
-Func_3ead:: ; 3ead (0:3ead)
- jpba CinnabarGymQuiz_1eb0a
+UpdateCinnabarGymGateTileBlocks:: ; 3ead (0:3ead)
+ jpba UpdateCinnabarGymGateTileBlocks_
CheckForHiddenObjectOrBookshelfOrCardKeyDoor:: ; 3eb5 (0:3eb5)
ld a, [H_LOADEDROMBANK]
diff --git a/scripts/cinnabargym.asm b/scripts/cinnabargym.asm
index f5c07317..18737d2b 100755
--- a/scripts/cinnabargym.asm
+++ b/scripts/cinnabargym.asm
@@ -14,7 +14,7 @@ CinnabarGymScript_75759: ; 75759 (1d:5759)
pop hl
bit 5, [hl]
res 5, [hl]
- call nz, Func_3ead
+ call nz, UpdateCinnabarGymGateTileBlocks
ResetEvent EVENT_2A7
ret
CinnabarGymScript_75772: ; 75772 (1d:5772)
@@ -88,7 +88,7 @@ CinnabarGymScript1: ; 757dc (1d:57dc)
ld [hSpriteIndexOrTextID], a
jp DisplayTextID
-CinnabarGymScript_757f1: ; 757f1 (1d:57f1)
+CinnabarGymFlagAction: ; 757f1 (1d:57f1)
predef_jump FlagActionPredef
CinnabarGymScript2: ; 757f6 (1d:57f6)
@@ -97,11 +97,11 @@ CinnabarGymScript2: ; 757f6 (1d:57f6)
jp z, CinnabarGymScript_75792
ld a, [wTrainerHeaderFlagBit]
ld [$ffdb], a
- AdjustEventBit EVENT_29A, 2
+ AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2
ld c, a
ld b, FLAG_TEST
- EventFlagAddress hl, EVENT_29A
- call CinnabarGymScript_757f1
+ EventFlagAddress hl, EVENT_BEAT_CINNABAR_GYM_TRAINER_0
+ call CinnabarGymFlagAction
ld a, c
and a
jr nz, .asm_7581b
@@ -112,19 +112,19 @@ CinnabarGymScript2: ; 757f6 (1d:57f6)
.asm_7581b
ld a, [wTrainerHeaderFlagBit]
ld [$ffdb], a
- AdjustEventBit EVENT_29A, 2
+ AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2
ld c, a
ld b, FLAG_SET
- EventFlagAddress hl, EVENT_29A
- call CinnabarGymScript_757f1
+ EventFlagAddress hl, EVENT_BEAT_CINNABAR_GYM_TRAINER_0
+ call CinnabarGymFlagAction
ld a, [wTrainerHeaderFlagBit]
sub $2
- AdjustEventBit EVENT_2A8, 0
+ AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0
ld c, a
ld b, FLAG_SET
- EventFlagAddress hl, EVENT_2A8
- call CinnabarGymScript_757f1
- call Func_3ead
+ EventFlagAddress hl, EVENT_CINNABAR_GYM_GATE0_UNLOCKED
+ call CinnabarGymFlagAction
+ call UpdateCinnabarGymGateTileBlocks
xor a
ld [wJoyIgnore], a
ld [wda38], a
@@ -163,7 +163,7 @@ CinnabarGymScript3_75857: ; 75857 (1d:5857)
set 6, [hl]
; deactivate gym trainers
- SetEventRange EVENT_29A, EVENT_2A0
+ SetEventRange EVENT_BEAT_CINNABAR_GYM_TRAINER_0, EVENT_BEAT_CINNABAR_GYM_TRAINER_6
ld hl, wd126
set 5, [hl]
@@ -258,7 +258,7 @@ TM38NoRoomText: ; 75934 (1d:5934)
CinnabarGymText2: ; 75939 (1d:5939)
TX_ASM
call CinnabarGymScript_757a0
- CheckEvent EVENT_29A
+ CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_0
jr nz, .asm_46bb4
ld hl, CinnabarGymText_7595f
call PrintText
@@ -286,7 +286,7 @@ CinnabarGymText_75969: ; 75969 (1d:5969)
CinnabarGymText3: ; 7596e (1d:596e)
TX_ASM
call CinnabarGymScript_757a0
- CheckEvent EVENT_29B
+ CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_1
jr nz, .asm_4b406
ld hl, CinnabarGymText_75994
call PrintText
@@ -314,7 +314,7 @@ CinnabarGymText_7599e: ; 7599e (1d:599e)
CinnabarGymText4: ; 759a3 (1d:59a3)
TX_ASM
call CinnabarGymScript_757a0
- CheckEvent EVENT_29C
+ CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_2
jr nz, .asm_c0673
ld hl, CinnabarGymText_759c9
call PrintText
@@ -342,7 +342,7 @@ CinnabarGymText_759d3: ; 759d3 (1d:59d3)
CinnabarGymText5: ; 759d8 (1d:59d8)
TX_ASM
call CinnabarGymScript_757a0
- CheckEvent EVENT_29D
+ CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_3
jr nz, .asm_5cfd7
ld hl, CinnabarGymText_759fe
call PrintText
@@ -370,7 +370,7 @@ CinnabarGymText_75a08: ; 75a08 (1d:5a08)
CinnabarGymText6: ; 75a0d (1d:5a0d)
TX_ASM
call CinnabarGymScript_757a0
- CheckEvent EVENT_29E
+ CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_4
jr nz, .asm_776b4
ld hl, CinnabarGymText_75a33
call PrintText
@@ -398,7 +398,7 @@ CinnabarGymText_75a3d: ; 75a3d (1d:5a3d)
CinnabarGymText7: ; 75a42 (1d:5a42)
TX_ASM
call CinnabarGymScript_757a0
- CheckEvent EVENT_29F
+ CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_5
jr nz, .asm_2f755
ld hl, CinnabarGymText_75a68
call PrintText
@@ -426,7 +426,7 @@ CinnabarGymText_75a72: ; 75a72 (1d:5a72)
CinnabarGymText8: ; 75a77 (1d:5a77)
TX_ASM
call CinnabarGymScript_757a0
- CheckEvent EVENT_2A0
+ CheckEvent EVENT_BEAT_CINNABAR_GYM_TRAINER_6
jr nz, .asm_d87be
ld hl, CinnabarGymText_75a9d
call PrintText
diff --git a/scripts/halloffameroom.asm b/scripts/halloffameroom.asm
index 503327f3..9a5b595a 100755
--- a/scripts/halloffameroom.asm
+++ b/scripts/halloffameroom.asm
@@ -40,7 +40,7 @@ HallofFameRoomScript2: ; 5a4bb (16:64bb)
ld [W_LANCECURSCRIPT], a
ld [W_HALLOFFAMEROOMCURSCRIPT], a
; Elite 4 events
- ResetEventRange EVENT_ELITE4_EVENTS_START, EVENT_907, 1
+ ResetEventRange ELITE4_EVENTS_START, ELITE4_CHAMPION_EVENTS_END, 1
xor a
ld [W_HALLOFFAMEROOMCURSCRIPT], a
ld a, PALLET_TOWN
diff --git a/scripts/indigoplateaulobby.asm b/scripts/indigoplateaulobby.asm
index e4a64ce6..7655d8c7 100755
--- a/scripts/indigoplateaulobby.asm
+++ b/scripts/indigoplateaulobby.asm
@@ -6,12 +6,12 @@ IndigoPlateauLobbyScript: ; 19c5b (6:5c5b)
res 6, [hl]
ret z
ResetEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH
- ld hl, wd734
+ ld hl, wBeatLorelei
bit 1, [hl]
res 1, [hl]
ret z
; Elite 4 events
- ResetEventRange EVENT_ELITE4_EVENTS_START, EVENT_LANCES_ROOM_LOCK_DOOR
+ ResetEventRange ELITE4_EVENTS_START, EVENT_LANCES_ROOM_LOCK_DOOR
ret
IndigoPlateauLobbyTextPointers: ; 19c7f (6:5c7f)
diff --git a/scripts/lorelei.asm b/scripts/lorelei.asm
index fe136784..4a245d93 100755
--- a/scripts/lorelei.asm
+++ b/scripts/lorelei.asm
@@ -13,7 +13,7 @@ LoreleiScript_76191: ; 76191 (1d:6191)
bit 5, [hl]
res 5, [hl]
ret z
- ld hl, wd734
+ ld hl, wBeatLorelei
set 1, [hl]
CheckEvent EVENT_BEAT_LORELEIS_ROOM_TRAINER_0
jr z, .asm_761a9
diff --git a/wram.asm b/wram.asm
index 767cc0d4..275ccc40 100755
--- a/wram.asm
+++ b/wram.asm
@@ -2547,7 +2547,10 @@ W_FLAGS_D733:: ; d733
; bit 7: used fly out of battle
ds 1
-wd734:: ds 2 ; flag for indigo plateau and lorelei (not sure what it's for)
+wBeatLorelei:: ; d734
+; bit 1: set when you beat Lorelei and reset in Indigo Plateau lobby
+; the game uses this to tell when Elite 4 events need to be reset
+ ds 2
wd736:: ; d736
; bit 0: check if the player is standing on a door and make him walk down a step if so