From fcab935a0f449246380480613ac0896e0b90a0d8 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Mon, 20 Jul 2015 18:32:02 -0700 Subject: enumerate events --- engine/hidden_object_functions7.asm | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 8893e496..d4a0ce88 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -36,8 +36,7 @@ StrengthsAndWeaknessesText: ; 1e983 (7:6983) db "@" SafariZoneCheck: ; 1e988 (7:6988) - ld hl, wd790 - bit 7, [hl]; if we are not in the Safari Zone, + CheckEventHL EVENT_IN_SAFARI_ZONE ; if we are not in the Safari Zone, jr z, SafariZoneGameStillGoing ; don't bother printing game over text ld a, [W_NUMSAFARIBALLS] and a @@ -85,8 +84,7 @@ SafariZoneGameOver: ; 1e9b0 (7:69b0) ld [wDestinationWarpID], a ld a, $5 ld [W_SAFARIZONEENTRANCECURSCRIPT], a - ld hl, wd790 - set 6, [hl] + SetEvent EVENT_SAFARI_GAME_OVER ld a, $1 ld [wSafariZoneGameOver], a ret @@ -191,7 +189,7 @@ CinnabarQuizQuestionsText6: ; 1ea85 (7:6a85) db "@" CinnabarGymQuiz_1ea8a: ; 1ea8a (7:6a8a) - ld hl, wd79c + EventFlagAddress hl, EVENT_2A8 predef_jump FlagActionPredef CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) @@ -208,6 +206,7 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) ld hl, CinnabarGymQuizCorrectText call PrintText ld a, [$ffe0] + AdjustEventBit EVENT_2A8, 0 ld c, a ld b, FLAG_SET call CinnabarGymQuiz_1ea8a @@ -221,9 +220,10 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) call PrintText ld a, [$ffdb] add $2 + AdjustEventBit EVENT_29A, 2 ld c, a ld b, FLAG_TEST - ld hl, wd79a + EventFlagAddress hl, EVENT_29A predef FlagActionPredef ld a, c and a @@ -240,6 +240,7 @@ CinnabarGymQuizCorrectText: ; 1eae3 (7:6ae3) TX_ASM ld a, [$ffe0] + AdjustEventBit EVENT_2A8, 0 ld c, a ld b, FLAG_TEST call CinnabarGymQuiz_1ea8a @@ -277,6 +278,7 @@ CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a) push bc ld a, [$ffdb] ld [$ffe0], a + AdjustEventBit EVENT_2A8, 0 ld c, a ld b, FLAG_TEST call CinnabarGymQuiz_1ea8a @@ -320,12 +322,11 @@ BillsHousePC: ; 1eb6e (7:6b6e) ld a, [wSpriteStateData1 + 9] cp SPRITE_FACING_UP ret nz - ld a, [wd7f2] - bit 7, a + CheckEvent EVENT_55F jr nz, .asm_1ebd2 - bit 3, a + CheckEventReuseA EVENT_55B jr nz, .asm_1eb86 - bit 6, a + CheckEventReuseA EVENT_55E jr nz, .asm_1eb8b .asm_1eb86 tx_pre_jump BillsHouseMonitorText @@ -354,8 +355,7 @@ BillsHousePC: ; 1eb6e (7:6b6e) call PlaySound call WaitForSoundToFinish call PlayDefaultMusic - ld hl, wd7f2 - set 3, [hl] + SetEvent EVENT_55B ret .asm_1ebd2 ld a, $1 -- cgit v1.2.3 From 73171bfff573fa8900563319c014f3e626db6b3e Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Tue, 21 Jul 2015 10:36:03 -0700 Subject: named most of the used events --- engine/hidden_object_functions7.asm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index d4a0ce88..90de784f 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -322,11 +322,11 @@ BillsHousePC: ; 1eb6e (7:6b6e) ld a, [wSpriteStateData1 + 9] cp SPRITE_FACING_UP ret nz - CheckEvent EVENT_55F + CheckEvent EVENT_LEFT_BILLS_HOUSE_AFTER_HELPING jr nz, .asm_1ebd2 - CheckEventReuseA EVENT_55B + CheckEventReuseA EVENT_USED_CELL_SEPARATOR_ON_BILL jr nz, .asm_1eb86 - CheckEventReuseA EVENT_55E + CheckEventReuseA EVENT_BILL_SAID_USE_CELL_SEPARATOR jr nz, .asm_1eb8b .asm_1eb86 tx_pre_jump BillsHouseMonitorText @@ -355,7 +355,7 @@ BillsHousePC: ; 1eb6e (7:6b6e) call PlaySound call WaitForSoundToFinish call PlayDefaultMusic - SetEvent EVENT_55B + SetEvent EVENT_USED_CELL_SEPARATOR_ON_BILL ret .asm_1ebd2 ld a, $1 -- cgit v1.2.3 From dcc7f3bc9f41f2d5e0f7448b4688c1058da0040b Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Tue, 21 Jul 2015 14:21:14 -0700 Subject: named more constants --- engine/hidden_object_functions7.asm | 42 +++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'engine/hidden_object_functions7.asm') 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) -- cgit v1.2.3