From cd649184f556db777d592671a7274bfa4a8423d7 Mon Sep 17 00:00:00 2001 From: "U-Daniel-PC\\Daniel" Date: Fri, 3 Jul 2015 14:37:53 -0500 Subject: Rename/organize part 1 of 4 rename functions, clean up address/wram comments, other misc only broken up so that all changes are viewable on github --- engine/hidden_object_functions7.asm | 46 ++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index f97190de..ce6d901f 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -40,29 +40,29 @@ StrengthsAndWeaknessesText: ; 1e983 (7:6983) SafariZoneCheck: ; 1e988 (7:6988) ld hl, wd790 bit 7, [hl] - jr z, asm_1e9ab - ld a, [W_NUMSAFARIBALLS] ; W_NUMSAFARIBALLS + jr z, SafariZoneGameOver + ld a, [W_NUMSAFARIBALLS] and a - jr z, asm_1e9b0 - jr asm_1e9ab + jr z, SafariZoneGameStillGoing + jr SafariZoneGameOver SafariZoneCheckSteps: ; 1e997 (7:6997) - ld a, [wSafariSteps] ; wd70d + ld a, [wSafariSteps] ld b, a - ld a, [wSafariSteps + 1] ; wd70e + ld a, [wSafariSteps + 1] ld c, a or b - jr z, asm_1e9b0 + jr z, SafariZoneGameStillGoing dec bc ld a, b - ld [wSafariSteps], a ; wd70d + ld [wSafariSteps], a ld a, c - ld [wSafariSteps + 1], a ; wd70e -asm_1e9ab: ; 1e9ab (7:69ab) + ld [wSafariSteps + 1], a +SafariZoneGameOver: ; 1e9ab (7:69ab) xor a ld [wSafariZoneGameOver], a ret -asm_1e9b0: ; 1e9b0 (7:69b0) +SafariZoneGameStillGoing: ; 1e9b0 (7:69b0) call EnableAutoTextBoxDrawing xor a ld [wMusicHeaderPointer], a @@ -76,12 +76,12 @@ asm_1e9b0: ; 1e9b0 (7:69b0) cp $b9 jr nz, .asm_1e9c2 ld a, $d3 - ld [H_DOWNARROWBLINKCNT2], a ; $ff8c + ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID xor a ld [wd528], a ld a, SAFARI_ZONE_ENTRANCE - ld [H_DOWNARROWBLINKCNT1], a ; $ff8b + ld [H_DOWNARROWBLINKCNT1], a ld a, $3 ld [wDestinationWarpID], a ld a, $5 @@ -100,7 +100,7 @@ PrintSafariGameOverText: ; 1e9ed (7:69ed) SafariGameOverText: ; 1e9f7 (7:69f7) db $08 ; asm - ld a, [W_NUMSAFARIBALLS] ; W_NUMSAFARIBALLS + ld a, [W_NUMSAFARIBALLS] and a jr z, .asm_1ea04 ld hl, TimesUpText @@ -130,7 +130,7 @@ CinnabarGymQuiz: ; 1ea25 (7:6a25) db $08 ; asm xor a ld [wda38], a - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] push af and $f ld [$ffdb], a @@ -200,7 +200,7 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) call YesNoChoice ld a, [$ffdc] ld c, a - ld a, [wCurrentMenuItem] ; wCurrentMenuItem + ld a, [wCurrentMenuItem] cp c jr nz, .asm_1eab8 ld hl, wd126 @@ -267,7 +267,7 @@ CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a) add a ld d, $0 ld e, a - ld hl, CinnabarGymGateCoords ; $6b48 + ld hl, CinnabarGymGateCoords add hl, de ld a, [hli] ld b, [hl] @@ -337,22 +337,22 @@ BillsHousePC: ; 1eb6e (7:6b6e) ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld a, $2e call PrintPredefTextID - ld c, $20 + ld c, 32 call DelayFrames ld a, (SFX_02_3c - SFX_Headers_02) / 3 call PlaySound call WaitForSoundToFinish - ld c, $50 + ld c, 80 call DelayFrames ld a, (SFX_02_48 - SFX_Headers_02) / 3 call PlaySound call WaitForSoundToFinish - ld c, $30 + ld c, 48 call DelayFrames ld a, (SFX_02_3c - SFX_Headers_02) / 3 call PlaySound call WaitForSoundToFinish - ld c, $20 + ld c, 32 call DelayFrames ld a, (SFX_02_3a - SFX_Headers_02) / 3 call PlaySound @@ -379,12 +379,12 @@ BillsHouseInitiatedText: ; 1ebe2 (7:6be2) ld a, $ff ld [wc0ee], a call PlaySound - ld c, $10 + ld c, 16 call DelayFrames ld a, (SFX_02_49 - SFX_Headers_02) / 3 call PlaySound call WaitForSoundToFinish - ld c, $3c + ld c, 60 call DelayFrames jp TextScriptEnd -- cgit v1.2.3 From 8431fa7756dace97413f4c35aaa44cd92cf5b6df Mon Sep 17 00:00:00 2001 From: "U-Daniel-PC\\Daniel" Date: Fri, 3 Jul 2015 14:58:50 -0500 Subject: TX_ASM --- 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 ce6d901f..b06f11ca 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -99,7 +99,7 @@ PrintSafariGameOverText: ; 1e9ed (7:69ed) jp PrintText SafariGameOverText: ; 1e9f7 (7:69f7) - db $08 ; asm + TX_ASM ld a, [W_NUMSAFARIBALLS] and a jr z, .asm_1ea04 @@ -127,7 +127,7 @@ PrintCinnabarQuiz: ; 1ea17 (7:6a17) jp PrintPredefTextID CinnabarGymQuiz: ; 1ea25 (7:6a25) - db $08 ; asm + TX_ASM xor a ld [wda38], a ld a, [wWhichTrade] @@ -375,7 +375,7 @@ BillsHouseMonitorText: ; 1ebdd (7:6bdd) BillsHouseInitiatedText: ; 1ebe2 (7:6be2) TX_FAR _BillsHouseInitiatedText db $06 - db $08 ; asm + TX_ASM ld a, $ff ld [wc0ee], a call PlaySound @@ -389,7 +389,7 @@ BillsHouseInitiatedText: ; 1ebe2 (7:6be2) jp TextScriptEnd BillsHousePokemonList: ; 1ec05 (7:6c05) - db $08 ; asm + TX_ASM call SaveScreenTilesToBuffer1 ld hl, BillsHousePokemonListText1 call PrintText -- cgit v1.2.3 From f702fc7840e30f00c840ce619a1ea15d763438de Mon Sep 17 00:00:00 2001 From: dannye Date: Sat, 4 Jul 2015 00:44:12 -0500 Subject: Start using text predef macros also sprite direction constants --- engine/hidden_object_functions7.asm | 38 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 23 deletions(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index b06f11ca..f29b0925 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -1,7 +1,6 @@ PrintNewBikeText: ; 1e94b (7:694b) call EnableAutoTextBoxDrawing - ld a, $39 - jp PrintPredefTextID + tx_pre_jump NewBicycleText NewBicycleText: ; 1e953 (7:6953) TX_FAR _NewBicycleText @@ -9,8 +8,7 @@ NewBicycleText: ; 1e953 (7:6953) DisplayOakLabLeftPoster: ; 1e958 (7:6958) call EnableAutoTextBoxDrawing - ld a, $05 ; PushStartText - jp PrintPredefTextID + tx_pre_jump PushStartText PushStartText: ; 1e960 (7:6960) TX_FAR _PushStartText @@ -23,10 +21,10 @@ DisplayOakLabRightPoster: ; 1e965 (7:6965) call CountSetBits ld a, [wd11e] cp $2 - ld a, $6 ; SaveOptionText - jr c, .asm_1e97b - ld a, $7 ; StrengthsAndWeaknessesText -.asm_1e97b + tx_pre_id SaveOptionText + jr c, .ownThreeOrMoreMon + tx_pre_id StrengthsAndWeaknessesText +.ownThreeOrMoreMon jp PrintPredefTextID SaveOptionText: ; 1e97e (7:697e) @@ -120,11 +118,10 @@ GameOverText: ; 1ea12 (7:6a12) PrintCinnabarQuiz: ; 1ea17 (7:6a17) ld a, [wSpriteStateData1 + 9] - cp $4 + cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing - ld a, $31 - jp PrintPredefTextID + tx_pre_jump CinnabarGymQuiz CinnabarGymQuiz: ; 1ea25 (7:6a25) TX_ASM @@ -309,8 +306,7 @@ CinnabarGymGateCoords: ; 1eb48 (7:6b48) PrintMagazinesText: ; 1eb60 (7:6b60) call EnableAutoTextBoxDrawing - ld a, $30 - call PrintPredefTextID + tx_pre MagazinesText ret MagazinesText: ; 1eb69 (7:6b69) @@ -320,7 +316,7 @@ MagazinesText: ; 1eb69 (7:6b69) BillsHousePC: ; 1eb6e (7:6b6e) call EnableAutoTextBoxDrawing ld a, [wSpriteStateData1 + 9] - cp $4 + cp SPRITE_FACING_UP ret nz ld a, [wd7f2] bit 7, a @@ -330,13 +326,11 @@ BillsHousePC: ; 1eb6e (7:6b6e) bit 6, a jr nz, .asm_1eb8b .asm_1eb86 - ld a, $2d - jp PrintPredefTextID + tx_pre_jump BillsHouseMonitorText .asm_1eb8b ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld a, $2e - call PrintPredefTextID + tx_pre BillsHouseInitiatedText ld c, 32 call DelayFrames ld a, (SFX_02_3c - SFX_Headers_02) / 3 @@ -364,8 +358,7 @@ BillsHousePC: ; 1eb6e (7:6b6e) .asm_1ebd2 ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld a, $2f - call PrintPredefTextID + tx_pre BillsHousePokemonList ret BillsHouseMonitorText: ; 1ebdd (7:6bdd) @@ -459,11 +452,10 @@ BillsHousePokemonListText2: ; 1ecaa (7:6caa) DisplayOakLabEmailText: ; 1ecaf (7:6caf) ld a, [wSpriteStateData1 + 9] - cp $4 + cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing - ld a, $8 ; OakLabEmailText - jp PrintPredefTextID + tx_pre_jump OakLabEmailText OakLabEmailText: ; 1ecbd (7:6cbd) TX_FAR _OakLabEmailText -- cgit v1.2.3 From b509b48a7f5a9a80225b9c030d7334b26b521c62 Mon Sep 17 00:00:00 2001 From: dannye Date: Tue, 14 Jul 2015 00:21:03 -0500 Subject: Use more *Coord also town map code relabelling YamaArashi just did town map relabelling but oh well I aleady made the changes and don't feel like redoing it --- engine/hidden_object_functions7.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index f29b0925..3c3b2fb0 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -401,11 +401,11 @@ BillsHousePokemonList: ; 1ec05 (7:6c05) .asm_1ec2d ld hl, wd730 set 6, [hl] - ld hl, wTileMap + hlCoord 0, 0 ld b, $a ld c, $9 call TextBoxBorder - ld hl, wTileMap + $2a + hlCoord 2, 2 ld de, BillsMonListText call PlaceString ld hl, BillsHousePokemonListText2 -- cgit v1.2.3 From 77ba61cb17665779673dcd536122271c66614252 Mon Sep 17 00:00:00 2001 From: dannye Date: Thu, 16 Jul 2015 23:41:44 -0500 Subject: Fix Safari Zone check labels --- engine/hidden_object_functions7.asm | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 3c3b2fb0..c835775e 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -37,12 +37,12 @@ StrengthsAndWeaknessesText: ; 1e983 (7:6983) SafariZoneCheck: ; 1e988 (7:6988) ld hl, wd790 - bit 7, [hl] - jr z, SafariZoneGameOver + bit 7, [hl]; if we are not in the Safari Zone, + jr z, SafariZoneGameStillGoing ; don't bother printing game over text ld a, [W_NUMSAFARIBALLS] and a - jr z, SafariZoneGameStillGoing - jr SafariZoneGameOver + jr z, SafariZoneGameOver + jr SafariZoneGameStillGoing SafariZoneCheckSteps: ; 1e997 (7:6997) ld a, [wSafariSteps] @@ -50,17 +50,18 @@ SafariZoneCheckSteps: ; 1e997 (7:6997) ld a, [wSafariSteps + 1] ld c, a or b - jr z, SafariZoneGameStillGoing + jr z, SafariZoneGameOver dec bc ld a, b ld [wSafariSteps], a ld a, c ld [wSafariSteps + 1], a -SafariZoneGameOver: ; 1e9ab (7:69ab) +SafariZoneGameStillGoing: ; 1e9ab (7:69ab) xor a ld [wSafariZoneGameOver], a ret -SafariZoneGameStillGoing: ; 1e9b0 (7:69b0) + +SafariZoneGameOver: ; 1e9b0 (7:69b0) call EnableAutoTextBoxDrawing xor a ld [wMusicHeaderPointer], a -- cgit v1.2.3 From 148d3f3cf28f9c270e3d5043af0692d95bc731c5 Mon Sep 17 00:00:00 2001 From: dannye Date: Sat, 18 Jul 2015 15:52:03 -0500 Subject: Consolidate coord macros --- engine/hidden_object_functions7.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index c835775e..810d9bfe 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -402,11 +402,11 @@ BillsHousePokemonList: ; 1ec05 (7:6c05) .asm_1ec2d ld hl, wd730 set 6, [hl] - hlCoord 0, 0 + coord hl, 0, 0 ld b, $a ld c, $9 call TextBoxBorder - hlCoord 2, 2 + coord hl, 2, 2 ld de, BillsMonListText call PlaceString ld hl, BillsHousePokemonListText2 -- cgit v1.2.3 From b96ef8d2d495b8c39f703742e8c1965c774fc54f Mon Sep 17 00:00:00 2001 From: dannye Date: Sat, 18 Jul 2015 23:53:43 -0500 Subject: A few missed TX_ASM --- engine/hidden_object_functions7.asm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 810d9bfe..31ae17a4 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -236,7 +236,8 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) CinnabarGymQuizCorrectText: ; 1eae3 (7:6ae3) db $0b TX_FAR _CinnabarGymQuizCorrectText - db $06,$08 + db $06 + TX_ASM ld a, [$ffe0] ld c, a -- cgit v1.2.3 From c169073eed4f0362ef42170098a141a2fcbd71d0 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 18 Jul 2015 20:49:52 -0700 Subject: misc --- engine/hidden_object_functions7.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 31ae17a4..8e8b27b1 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -128,7 +128,7 @@ CinnabarGymQuiz: ; 1ea25 (7:6a25) TX_ASM xor a ld [wda38], a - ld a, [wWhichTrade] + ld a, [wHiddenObjectFunctionArgument] push af and $f ld [$ffdb], a -- cgit v1.2.3 From ea9cc86949cecc3508aeac06b807372b6b0134d8 Mon Sep 17 00:00:00 2001 From: dannye Date: Sun, 19 Jul 2015 03:46:12 -0500 Subject: Name sound effects --- engine/hidden_object_functions7.asm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 31ae17a4..4c2ea816 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -68,7 +68,7 @@ SafariZoneGameOver: ; 1e9b0 (7:69b0) dec a call PlaySound ld c, BANK(SFX_02_5f) - ld a, (SFX_02_5f - SFX_Headers_02) / 3 + ld a, SFX_SAFARI_ZONE_PA call PlayMusic .asm_1e9c2 ld a, [wc02a] @@ -214,7 +214,7 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) jp CinnabarGymQuiz_1eb0a .asm_1eab8 call WaitForSoundToFinish - ld a, (SFX_02_51 - SFX_Headers_02) / 3 + ld a, SFX_DENIED call PlaySound call WaitForSoundToFinish ld hl, CinnabarGymQuizIncorrectText @@ -247,7 +247,7 @@ CinnabarGymQuizCorrectText: ; 1eae3 (7:6ae3) and a jp nz, TextScriptEnd call WaitForSoundToFinish - ld a, (SFX_02_57 - SFX_Headers_02) / 3 + ld a, SFX_GO_INSIDE call PlaySound call WaitForSoundToFinish jp TextScriptEnd @@ -335,22 +335,22 @@ BillsHousePC: ; 1eb6e (7:6b6e) tx_pre BillsHouseInitiatedText ld c, 32 call DelayFrames - ld a, (SFX_02_3c - SFX_Headers_02) / 3 + ld a, SFX_TINK call PlaySound call WaitForSoundToFinish ld c, 80 call DelayFrames - ld a, (SFX_02_48 - SFX_Headers_02) / 3 + ld a, SFX_SHRINK call PlaySound call WaitForSoundToFinish ld c, 48 call DelayFrames - ld a, (SFX_02_3c - SFX_Headers_02) / 3 + ld a, SFX_TINK call PlaySound call WaitForSoundToFinish ld c, 32 call DelayFrames - ld a, (SFX_02_3a - SFX_Headers_02) / 3 + ld a, SFX_GET_ITEM_1 call PlaySound call WaitForSoundToFinish call PlayDefaultMusic @@ -376,7 +376,7 @@ BillsHouseInitiatedText: ; 1ebe2 (7:6be2) call PlaySound ld c, 16 call DelayFrames - ld a, (SFX_02_49 - SFX_Headers_02) / 3 + ld a, SFX_SWITCH call PlaySound call WaitForSoundToFinish ld c, 60 -- cgit v1.2.3 From 1d86932cc9c38815434409f07d14c2bfe4e7a836 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sun, 19 Jul 2015 17:52:26 -0700 Subject: naming --- engine/hidden_object_functions7.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index f7deae66..397d2a02 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -78,7 +78,7 @@ SafariZoneGameOver: ; 1e9b0 (7:69b0) ld [H_DOWNARROWBLINKCNT2], a call DisplayTextID xor a - ld [wd528], a + ld [wPlayerMovingDirection], a ld a, SAFARI_ZONE_ENTRANCE ld [H_DOWNARROWBLINKCNT1], a ld a, $3 -- cgit v1.2.3 From db7d941d22d89cf8d6d13cbf768208c5cf2ac2c2 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sun, 19 Jul 2015 20:45:34 -0700 Subject: constants for flag actions --- 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 397d2a02..8893e496 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -209,7 +209,7 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) call PrintText ld a, [$ffe0] ld c, a - ld b, $1 + ld b, FLAG_SET call CinnabarGymQuiz_1ea8a jp CinnabarGymQuiz_1eb0a .asm_1eab8 @@ -222,7 +222,7 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) ld a, [$ffdb] add $2 ld c, a - ld b, $2 + ld b, FLAG_TEST ld hl, wd79a predef FlagActionPredef ld a, c @@ -241,7 +241,7 @@ CinnabarGymQuizCorrectText: ; 1eae3 (7:6ae3) ld a, [$ffe0] ld c, a - ld b, $2 + ld b, FLAG_TEST call CinnabarGymQuiz_1ea8a ld a, c and a @@ -278,7 +278,7 @@ CinnabarGymQuiz_1eb0a: ; 1eb0a (7:6b0a) ld a, [$ffdb] ld [$ffe0], a ld c, a - ld b, $2 + ld b, FLAG_TEST call CinnabarGymQuiz_1ea8a ld a, c and a -- cgit v1.2.3 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 From b4081e851ac4b7ce5cf1fa7c9fc83a490a4c83ec Mon Sep 17 00:00:00 2001 From: dannye Date: Wed, 22 Jul 2015 09:57:31 -0500 Subject: Rename sound effect files --- engine/hidden_object_functions7.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 8893e496..34d7f64d 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -67,7 +67,7 @@ SafariZoneGameOver: ; 1e9b0 (7:69b0) ld [wMusicHeaderPointer], a dec a call PlaySound - ld c, BANK(SFX_02_5f) + ld c, BANK(SFX_Safari_Zone_PA) ld a, SFX_SAFARI_ZONE_PA call PlayMusic .asm_1e9c2 -- cgit v1.2.3 From 323895af6dada7e1949ff79855970f75ad4b65b2 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Thu, 23 Jul 2015 20:48:35 -0700 Subject: fixed hram aliases and named wram var --- 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 6f1eef61..283bf32f 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -73,19 +73,19 @@ SafariZoneGameOver: ; 1e9b0 (7:69b0) ld a, [wc02a] cp $b9 jr nz, .asm_1e9c2 - ld a, $d3 - ld [H_DOWNARROWBLINKCNT2], a + ld a, TEXT_SAFARI_GAME_OVER + ld [hSpriteIndexOrTextID], a call DisplayTextID xor a ld [wPlayerMovingDirection], a ld a, SAFARI_ZONE_ENTRANCE - ld [H_DOWNARROWBLINKCNT1], a + ld [hWarpDestinationMap], a ld a, $3 ld [wDestinationWarpID], a ld a, $5 ld [W_SAFARIZONEENTRANCECURSCRIPT], a SetEvent EVENT_SAFARI_GAME_OVER - ld a, $1 + ld a, 1 ld [wSafariZoneGameOver], a ret -- cgit v1.2.3 From 82512e449115aa9d004e24a3d1526dd32570c56d Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Fri, 24 Jul 2015 14:39:45 -0700 Subject: named animation functions/variables --- engine/hidden_object_functions7.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 283bf32f..4e76d996 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -293,7 +293,7 @@ UpdateCinnabarGymGateTileBlocks_: ; 1eb0a (7:6b0a) ld a, $e .next pop bc - ld [wd09f], a + ld [wNewTileBlockID], a predef ReplaceTileBlock ld hl, $ffdb dec [hl] -- cgit v1.2.3 From 93255d6d17fbb3702a0f8670d7ecc2ed627af2a7 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 25 Jul 2015 19:26:54 -0700 Subject: yet more naming --- engine/hidden_object_functions7.asm | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 4e76d996..e3c296ca 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -125,21 +125,21 @@ PrintCinnabarQuiz: ; 1ea17 (7:6a17) CinnabarGymQuiz: ; 1ea25 (7:6a25) TX_ASM xor a - ld [wda38], a + ld [wOpponentAfterWrongAnswer], a ld a, [wHiddenObjectFunctionArgument] push af and $f - ld [$ffdb], a + ld [hGymGateIndex], a pop af and $f0 swap a ld [$ffdc], a ld hl, CinnabarGymQuizIntroText call PrintText - ld a, [$ffdb] + ld a, [hGymGateIndex] dec a add a - ld d, $0 + ld d, 0 ld e, a ld hl, CinnabarQuizQuestions add hl, de @@ -198,10 +198,10 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) ld c, a ld a, [wCurrentMenuItem] cp c - jr nz, .asm_1eab8 + jr nz, .wrongAnswer ld hl, wd126 set 5, [hl] - ld a, [$ffdb] + ld a, [hGymGateIndex] ld [$ffe0], a ld hl, CinnabarGymQuizCorrectText call PrintText @@ -211,14 +211,14 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) ld b, FLAG_SET call CinnabarGymGateFlagAction jp UpdateCinnabarGymGateTileBlocks_ -.asm_1eab8 +.wrongAnswer call WaitForSoundToFinish ld a, SFX_DENIED call PlaySound call WaitForSoundToFinish ld hl, CinnabarGymQuizIncorrectText call PrintText - ld a, [$ffdb] + ld a, [hGymGateIndex] add $2 AdjustEventBit EVENT_BEAT_CINNABAR_GYM_TRAINER_0, 2 ld c, a @@ -228,9 +228,9 @@ CinnabarGymQuiz_1ea92: ; 1ea92 (7:6a92) ld a, c and a ret nz - ld a, [$ffdb] + ld a, [hGymGateIndex] add $2 - ld [wda38], a + ld [wOpponentAfterWrongAnswer], a ret CinnabarGymQuizCorrectText: ; 1eae3 (7:6ae3) @@ -261,9 +261,9 @@ 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 + ld [hGymGateIndex], a .loop - ld a, [$ffdb] + ld a, [hGymGateIndex] dec a add a add a @@ -276,9 +276,9 @@ UpdateCinnabarGymGateTileBlocks_: ; 1eb0a (7:6b0a) ld c, a inc hl ld a, [hl] - ld [wd12f], a + ld [wGymGateTileBlock], a push bc - ld a, [$ffdb] + ld a, [hGymGateIndex] ld [$ffe0], a AdjustEventBit EVENT_CINNABAR_GYM_GATE0_UNLOCKED, 0 ld c, a @@ -287,7 +287,7 @@ UpdateCinnabarGymGateTileBlocks_: ; 1eb0a (7:6b0a) ld a, c and a jr nz, .unlocked - ld a, [wd12f] + ld a, [wGymGateTileBlock] jr .next .unlocked ld a, $e @@ -295,7 +295,7 @@ UpdateCinnabarGymGateTileBlocks_: ; 1eb0a (7:6b0a) pop bc ld [wNewTileBlockID], a predef ReplaceTileBlock - ld hl, $ffdb + ld hl, hGymGateIndex dec [hl] jr nz, .loop ret -- cgit v1.2.3 From 525f1b96f390a7b7625574405cad56277f200ef3 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Fri, 7 Aug 2015 04:24:06 -0700 Subject: named CountSetBits output variable --- engine/hidden_object_functions7.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index e3c296ca..0753531e 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -19,8 +19,8 @@ DisplayOakLabRightPoster: ; 1e965 (7:6965) ld hl, wPokedexOwned ld b, wPokedexOwnedEnd - wPokedexOwned call CountSetBits - ld a, [wd11e] - cp $2 + ld a, [wNumSetBits] + cp 2 tx_pre_id SaveOptionText jr c, .ownThreeOrMoreMon tx_pre_id StrengthsAndWeaknessesText -- cgit v1.2.3 From 2b018159997e3b580efd114ff4e3548a0de3cbc5 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sat, 8 Aug 2015 22:32:44 -0700 Subject: commented audio code --- engine/hidden_object_functions7.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engine/hidden_object_functions7.asm') diff --git a/engine/hidden_object_functions7.asm b/engine/hidden_object_functions7.asm index 0753531e..67e75301 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -63,14 +63,14 @@ SafariZoneGameStillGoing: ; 1e9ab (7:69ab) SafariZoneGameOver: ; 1e9b0 (7:69b0) call EnableAutoTextBoxDrawing xor a - ld [wMusicHeaderPointer], a + ld [wAudioFadeOutControl], a dec a call PlaySound ld c, BANK(SFX_Safari_Zone_PA) ld a, SFX_SAFARI_ZONE_PA call PlayMusic .asm_1e9c2 - ld a, [wc02a] + ld a, [wChannelSoundIDs + CH4] cp $b9 jr nz, .asm_1e9c2 ld a, TEXT_SAFARI_GAME_OVER @@ -374,7 +374,7 @@ BillsHouseInitiatedText: ; 1ebe2 (7:6be2) db $06 TX_ASM ld a, $ff - ld [wc0ee], a + ld [wNewSoundID], a call PlaySound ld c, 16 call DelayFrames -- cgit v1.2.3 From fb0a630c062cbb18026abe2792339dea27fac4d8 Mon Sep 17 00:00:00 2001 From: dannye Date: Tue, 11 Aug 2015 00:34:32 -0500 Subject: More joypad constants --- 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 67e75301..02d3928a 100755 --- a/engine/hidden_object_functions7.asm +++ b/engine/hidden_object_functions7.asm @@ -394,7 +394,7 @@ BillsHousePokemonList: ; 1ec05 (7:6c05) ld [W_ANIMATIONID], a ld [wCurrentMenuItem], a ld [wLastMenuItem], a - ld a, $3 + ld a, A_BUTTON | B_BUTTON ld [wMenuWatchedKeys], a ld a, $4 ld [wMaxMenuItem], a @@ -402,7 +402,7 @@ BillsHousePokemonList: ; 1ec05 (7:6c05) ld [wTopMenuItemY], a ld a, $1 ld [wTopMenuItemX], a -.asm_1ec2d +.billsPokemonLoop ld hl, wd730 set 6, [hl] coord hl, 0, 0 @@ -416,24 +416,24 @@ BillsHousePokemonList: ; 1ec05 (7:6c05) call PrintText call SaveScreenTilesToBuffer2 call HandleMenuInput - bit 1, a - jr nz, .asm_1ec74 + bit 1, a ; pressed b + jr nz, .cancel ld a, [wCurrentMenuItem] add EEVEE cp EEVEE - jr z, .asm_1ec6c + jr z, .displayPokedex cp FLAREON - jr z, .asm_1ec6c + jr z, .displayPokedex cp JOLTEON - jr z, .asm_1ec6c + jr z, .displayPokedex cp VAPOREON - jr z, .asm_1ec6c - jr .asm_1ec74 -.asm_1ec6c + jr z, .displayPokedex + jr .cancel +.displayPokedex call DisplayPokedex call LoadScreenTilesFromBuffer2 - jr .asm_1ec2d -.asm_1ec74 + jr .billsPokemonLoop +.cancel ld hl, wd730 res 6, [hl] call LoadScreenTilesFromBuffer2 -- cgit v1.2.3