From 3cd3efd06002a188cebf37d935411d7d73b153be Mon Sep 17 00:00:00 2001 From: "U-Daniel-PC\\Daniel" Date: Fri, 12 Jun 2015 10:26:00 -0500 Subject: Name the last of unnamed text --- engine/hidden_object_functions17.asm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'engine/hidden_object_functions17.asm') diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 9dbcbf98..69f3c7f4 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -435,11 +435,13 @@ VermilionGymTrashSuccesText1: ; 5dec8 (17:5ec8) call WaitForSoundToFinish jp TextScriptEnd +; unused VermilionGymTrashSuccesText2: ; 5dedb (17:5edb) TX_FAR _VermilionGymTrashSuccesText2 db "@" -UnnamedText_5dee0: ; 5dee0 (17:5ee0) +; unused +VermilionGymTrashSuccesPlaySfx: ; 5dee0 (17:5ee0) db $08 ; asm call WaitForSoundToFinish ld a, (SFX_02_49 - SFX_Headers_02) / 3 -- cgit v1.2.3 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_functions17.asm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'engine/hidden_object_functions17.asm') diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 69f3c7f4..822f59a5 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -61,7 +61,7 @@ DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9) ; Displays a pokemon's front sprite in a pop-up window. ; [wcf91] = pokemon interal id number ld a, $1 - ld [H_AUTOBGTRANSFERENABLED], a ; $ffba + ld [H_AUTOBGTRANSFERENABLED], a call Delay3 xor a ld [hWY], a @@ -78,7 +78,7 @@ DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9) ld a, $80 ld [$ffe1], a hlCoord 10, 11 - predef Func_3f073 + predef AnimateSendingOutMon call WaitForTextScrollButtonPress call LoadScreenTilesFromBuffer1 call Delay3 @@ -125,10 +125,10 @@ LinkCableHelp: ; 5dc29 (17:5c29) call PrintText call HandleMenuInput bit 1, a - jr nz, .asm_5dc93 ; 0x5dc74 $1d + jr nz, .asm_5dc93 ld a, [wCurrentMenuItem] cp $3 - jr z, .asm_5dc93 ; 0x5dc7b $16 + jr z, .asm_5dc93 ld hl, wd730 res 6, [hl] ld hl, LinkCableInfoTexts @@ -316,7 +316,7 @@ VermilionGymTrashText: ; 5ddf7 (17:5df7) GymTrashScript: ; 5ddfc (17:5dfc) call EnableAutoTextBoxDrawing - ld a, [wWhichTrade] ; wWhichTrade + ld a, [wWhichTrade] ld [wcd5b], a ; Don't do the trash can puzzle if it's already been done. @@ -345,7 +345,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) ld hl, wd773 set 1, [hl] - ld hl, GymTrashCans ; $5e7d + ld hl, GymTrashCans ld a, [wcd5b] ; * 5 ld b, a -- 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_functions17.asm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'engine/hidden_object_functions17.asm') diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 822f59a5..b7b2fa00 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -95,7 +95,7 @@ PrintBlackboardLinkCableText: ; 5dc1a (17:5c1a) ret LinkCableHelp: ; 5dc29 (17:5c29) - db $08 ; asm + TX_ASM call SaveScreenTilesToBuffer1 ld hl, LinkCableHelpText1 call PrintText @@ -179,7 +179,7 @@ LinkCableInfoText3: ; 5dce8 (17:5ce8) db "@" ViridianSchoolBlackboard: ; 5dced (17:5ced) - db $08 ; asm + TX_ASM call SaveScreenTilesToBuffer1 ld hl, ViridianSchoolBlackboardText1 call PrintText @@ -428,7 +428,7 @@ GymTrashCans: ; 5de7d (17:5e7d) VermilionGymTrashSuccesText1: ; 5dec8 (17:5ec8) TX_FAR _VermilionGymTrashSuccesText1 - db $08 ; asm + TX_ASM call WaitForSoundToFinish ld a, (SFX_02_49 - SFX_Headers_02) / 3 call PlaySound @@ -442,7 +442,7 @@ VermilionGymTrashSuccesText2: ; 5dedb (17:5edb) ; unused VermilionGymTrashSuccesPlaySfx: ; 5dee0 (17:5ee0) - db $08 ; asm + TX_ASM call WaitForSoundToFinish ld a, (SFX_02_49 - SFX_Headers_02) / 3 call PlaySound @@ -451,7 +451,7 @@ VermilionGymTrashSuccesPlaySfx: ; 5dee0 (17:5ee0) VermilionGymTrashSuccesText3: ; 5deef (17:5eef) TX_FAR _VermilionGymTrashSuccesText3 - db $08 ; asm + TX_ASM call WaitForSoundToFinish ld a, (SFX_02_57 - SFX_Headers_02) / 3 call PlaySound @@ -460,7 +460,7 @@ VermilionGymTrashSuccesText3: ; 5deef (17:5eef) VermilionGymTrashFailText: ; 5df02 (17:5f02) TX_FAR _VermilionGymTrashFailText - db $08 ; asm + TX_ASM call WaitForSoundToFinish ld a, (SFX_02_51 - SFX_Headers_02) / 3 call PlaySound -- 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_functions17.asm | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) (limited to 'engine/hidden_object_functions17.asm') diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index b7b2fa00..46140927 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -1,7 +1,6 @@ PrintRedsNESText: ; 5db79 (17:5b79) call EnableAutoTextBoxDrawing - ld a, $4 ; RedBedroomSNESText - jp PrintPredefTextID + tx_pre_jump RedBedroomSNESText RedBedroomSNESText: ; 5db81 (17:5b81) TX_FAR _RedBedroomSNESText @@ -9,19 +8,17 @@ RedBedroomSNESText: ; 5db81 (17:5b81) OpenRedsPC: ; 5db86 (17:5b86) call EnableAutoTextBoxDrawing - ld a, $3 - jp PrintPredefTextID + tx_pre_jump RedBedroomPCText -RedBedroomPC: ; 5db8e (17:5b8e) +RedBedroomPCText: ; 5db8e (17:5b8e) db $fc ; FuncTX_ItemStoragePC Route15GateLeftBinoculars: ; 5db8f (17:5b8f) ld a, [wSpriteStateData1 + 9] - cp $4 ; i + cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing - ld a, $a ; text id Route15UpstairsBinocularsText - call PrintPredefTextID + tx_pre Route15UpstairsBinocularsText ld a, ARTICUNO ld [wcf91], a call PlayCry @@ -36,8 +33,7 @@ AerodactylFossil: ; 5dbad (17:5bad) ld [wcf91], a call DisplayMonFrontSpriteInBox call EnableAutoTextBoxDrawing - ld a, $9 - call PrintPredefTextID + tx_pre AerodactylFossilText ret AerodactylFossilText: ; 5dbbe (17:5bbe) @@ -49,8 +45,7 @@ KabutopsFossil: ; 5bdc3 (17:5bc3) ld [wcf91], a call DisplayMonFrontSpriteInBox call EnableAutoTextBoxDrawing - ld a, $b - call PrintPredefTextID + tx_pre KabutopsFossilText ret KabutopsFossilText: ; 5dbd4 (17:5bd4) @@ -307,8 +302,7 @@ ViridianBlackboardFrozenText: ; 5ddea (17:5dea) PrintTrashText: ; 5ddef (17:5def) call EnableAutoTextBoxDrawing - ld a, $26 - jp PrintPredefTextID + tx_pre_jump VermilionGymTrashText VermilionGymTrashText: ; 5ddf7 (17:5df7) TX_FAR _VermilionGymTrashText @@ -324,8 +318,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) bit 0, a jr z, .ok - ld a, $26 ; DisplayTextID $26 = VermilionGymTrashText (nothing in the trash) - jp PrintPredefTextID + tx_pre_jump VermilionGymTrashText .ok bit 1, a @@ -337,7 +330,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) cp b jr z, .openFirstLock - ld a, $26 ; DisplayTextID $26 = VermilionGymTrashText (nothing in the trash) + tx_pre_id VermilionGymTrashText jr .done .openFirstLock @@ -375,7 +368,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) and $f ld [wd744], a - ld a, $3b ; DisplayTextID $3b = VermilionGymTrashSuccesText1 (first lock opened!) + tx_pre_id VermilionGymTrashSuccesText1 jr .done .trySecondLock @@ -393,7 +386,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) and $e ld [wd743], a - ld a, $3e ; DisplayTextID $3e = VermilionGymTrashFailText (locks reset!) + tx_pre_id VermilionGymTrashFailText jr .done .openSecondLock @@ -403,7 +396,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) ld hl, wd126 set 6, [hl] - ld a, $3d ; DisplayTextID $3d = VermilionGymTrashSuccesText3 (2nd lock opened!) + tx_pre_id VermilionGymTrashSuccesText3 .done jp PrintPredefTextID -- 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_functions17.asm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'engine/hidden_object_functions17.asm') diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 46140927..a8b4f812 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -109,11 +109,11 @@ LinkCableHelp: ; 5dc29 (17:5c29) .asm_5c51 ld hl, wd730 set 6, [hl] - ld hl, wTileMap + hlCoord 0, 0 ld b, $8 ld c, $d call TextBoxBorder - ld hl, wTileMap + $2a + hlCoord 2, 2 ld de, HowToLinkText call PlaceString ld hl, LinkCableHelpText2 @@ -193,13 +193,13 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) .asm_5dd15 ld hl, wd730 set 6, [hl] - ld hl, wTileMap + hlCoord 0, 0 ld bc, $060a call TextBoxBorder - ld hl, wTileMap + $29 + hlCoord 1, 2 ld de, StatusAilmentText1 call PlaceString - ld hl, wTileMap + $2e + hlCoord 6, 2 ld de, StatusAilmentText2 call PlaceString ld hl, ViridianSchoolBlackboardText2 -- 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_functions17.asm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'engine/hidden_object_functions17.asm') diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index a8b4f812..841929b8 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -72,7 +72,7 @@ DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9) call LoadMonFrontSprite ld a, $80 ld [$ffe1], a - hlCoord 10, 11 + coord hl, 10, 11 predef AnimateSendingOutMon call WaitForTextScrollButtonPress call LoadScreenTilesFromBuffer1 @@ -109,11 +109,11 @@ LinkCableHelp: ; 5dc29 (17:5c29) .asm_5c51 ld hl, wd730 set 6, [hl] - hlCoord 0, 0 + coord hl, 0, 0 ld b, $8 ld c, $d call TextBoxBorder - hlCoord 2, 2 + coord hl, 2, 2 ld de, HowToLinkText call PlaceString ld hl, LinkCableHelpText2 @@ -193,13 +193,13 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) .asm_5dd15 ld hl, wd730 set 6, [hl] - hlCoord 0, 0 + coord hl, 0, 0 ld bc, $060a call TextBoxBorder - hlCoord 1, 2 + coord hl, 1, 2 ld de, StatusAilmentText1 call PlaceString - hlCoord 6, 2 + coord hl, 6, 2 ld de, StatusAilmentText2 call PlaceString ld hl, ViridianSchoolBlackboardText2 -- 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_functions17.asm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engine/hidden_object_functions17.asm') diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 841929b8..44941d36 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -55,7 +55,7 @@ KabutopsFossilText: ; 5dbd4 (17:5bd4) DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9) ; Displays a pokemon's front sprite in a pop-up window. ; [wcf91] = pokemon interal id number - ld a, $1 + ld a, 1 ld [H_AUTOBGTRANSFERENABLED], a call Delay3 xor a @@ -85,7 +85,7 @@ PrintBlackboardLinkCableText: ; 5dc1a (17:5c1a) call EnableAutoTextBoxDrawing ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a - ld a, [wWhichTrade] + ld a, [wHiddenObjectFunctionArgument] call PrintPredefTextID ret @@ -310,7 +310,7 @@ VermilionGymTrashText: ; 5ddf7 (17:5df7) GymTrashScript: ; 5ddfc (17:5dfc) call EnableAutoTextBoxDrawing - ld a, [wWhichTrade] + ld a, [wHiddenObjectFunctionArgument] ld [wcd5b], a ; Don't do the trash can puzzle if it's already been done. -- 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_functions17.asm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engine/hidden_object_functions17.asm') diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 841929b8..b65ee2c8 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -423,7 +423,7 @@ VermilionGymTrashSuccesText1: ; 5dec8 (17:5ec8) TX_FAR _VermilionGymTrashSuccesText1 TX_ASM call WaitForSoundToFinish - ld a, (SFX_02_49 - SFX_Headers_02) / 3 + ld a, SFX_SWITCH call PlaySound call WaitForSoundToFinish jp TextScriptEnd @@ -437,7 +437,7 @@ VermilionGymTrashSuccesText2: ; 5dedb (17:5edb) VermilionGymTrashSuccesPlaySfx: ; 5dee0 (17:5ee0) TX_ASM call WaitForSoundToFinish - ld a, (SFX_02_49 - SFX_Headers_02) / 3 + ld a, SFX_SWITCH call PlaySound call WaitForSoundToFinish jp TextScriptEnd @@ -446,7 +446,7 @@ VermilionGymTrashSuccesText3: ; 5deef (17:5eef) TX_FAR _VermilionGymTrashSuccesText3 TX_ASM call WaitForSoundToFinish - ld a, (SFX_02_57 - SFX_Headers_02) / 3 + ld a, SFX_GO_INSIDE call PlaySound call WaitForSoundToFinish jp TextScriptEnd @@ -455,7 +455,7 @@ VermilionGymTrashFailText: ; 5df02 (17:5f02) TX_FAR _VermilionGymTrashFailText TX_ASM call WaitForSoundToFinish - ld a, (SFX_02_51 - SFX_Headers_02) / 3 + ld a, SFX_DENIED call PlaySound call WaitForSoundToFinish jp TextScriptEnd -- 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_functions17.asm | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'engine/hidden_object_functions17.asm') diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 94b37193..01787e3e 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -314,8 +314,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) ld [wcd5b], a ; Don't do the trash can puzzle if it's already been done. - ld a, [wd773] - bit 0, a + CheckEvent EVENT_2ND_LOCK_OPENED jr z, .ok tx_pre_jump VermilionGymTrashText @@ -335,8 +334,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) .openFirstLock ; Next can is trying for the second switch. - ld hl, wd773 - set 1, [hl] + SetEvent EVENT_1ST_LOCK_OPENED ld hl, GymTrashCans ld a, [wcd5b] @@ -379,8 +377,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) jr z, .openSecondLock ; Reset the cans. - ld hl, wd773 - res 1, [hl] + ResetEvent EVENT_1ST_LOCK_OPENED call Random and $e @@ -391,8 +388,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) .openSecondLock ; Completed the trash can puzzle. - ld hl, wd773 - set 0, [hl] + SetEvent EVENT_2ND_LOCK_OPENED ld hl, wd126 set 6, [hl] -- 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_functions17.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/hidden_object_functions17.asm') diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 01787e3e..97681b79 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -71,7 +71,7 @@ DisplayMonFrontSpriteInBox: ; 5dbd9 (17:5bd9) ld de, vChars1 + $310 call LoadMonFrontSprite ld a, $80 - ld [$ffe1], a + ld [hStartTileID], a coord hl, 10, 11 predef AnimateSendingOutMon call WaitForTextScrollButtonPress -- cgit v1.2.3 From 7f6d0d49b61a77cfba76057d99881634b882486b Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Fri, 24 Jul 2015 20:27:59 -0700 Subject: more naming variables --- engine/hidden_object_functions17.asm | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'engine/hidden_object_functions17.asm') diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 97681b79..788dd777 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -311,7 +311,7 @@ VermilionGymTrashText: ; 5ddf7 (17:5df7) GymTrashScript: ; 5ddfc (17:5dfc) call EnableAutoTextBoxDrawing ld a, [wHiddenObjectFunctionArgument] - ld [wcd5b], a + ld [wGymTrashCanIndex], a ; Don't do the trash can puzzle if it's already been done. CheckEvent EVENT_2ND_LOCK_OPENED @@ -320,12 +320,12 @@ GymTrashScript: ; 5ddfc (17:5dfc) tx_pre_jump VermilionGymTrashText .ok - bit 1, a + CheckEventReuseA EVENT_1ST_LOCK_OPENED jr nz, .trySecondLock - ld a, [wd743] + ld a, [wFirstLockTrashCanIndex] ld b, a - ld a, [wcd5b] + ld a, [wGymTrashCanIndex] cp b jr z, .openFirstLock @@ -337,7 +337,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) SetEvent EVENT_1ST_LOCK_OPENED ld hl, GymTrashCans - ld a, [wcd5b] + ld a, [wGymTrashCanIndex] ; * 5 ld b, a add a @@ -364,15 +364,15 @@ GymTrashScript: ; 5ddfc (17:5dfc) add hl, de ld a, [hl] and $f - ld [wd744], a + ld [wSecondLockTrashCanIndex], a tx_pre_id VermilionGymTrashSuccesText1 jr .done .trySecondLock - ld a, [wd744] + ld a, [wSecondLockTrashCanIndex] ld b, a - ld a, [wcd5b] + ld a, [wGymTrashCanIndex] cp b jr z, .openSecondLock @@ -381,7 +381,7 @@ GymTrashScript: ; 5ddfc (17:5dfc) call Random and $e - ld [wd743], a + ld [wFirstLockTrashCanIndex], a tx_pre_id VermilionGymTrashFailText jr .done -- 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_functions17.asm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'engine/hidden_object_functions17.asm') diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index 788dd777..aad8c468 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -349,12 +349,21 @@ GymTrashScript: ; 5ddfc (17:5dfc) add hl, de ld a, [hli] - ld [$ffdb], a +; There is a bug in this code. It should calculate a value in the range [0, 3] +; but if the mask and random number don't have any 1 bits in common, then +; the result of the AND will be 0. When 1 is subtracted from that, the value +; will become $ff. This will result in 255 being added to hl, which will cause +; hl to point to one of the zero bytes that pad the end of the ROM bank. +; Trash can 0 was intended to be able to have the second lock only when the +; first lock was in trash can 1 or 3. However, due to this bug, trash can 0 can +; have the second lock regardless of which trash can had the first lock. + + ld [hGymTrashCanRandNumMask], a push hl call Random swap a ld b, a - ld a, [$ffdb] + ld a, [hGymTrashCanRandNumMask] and b dec a pop hl @@ -398,6 +407,12 @@ GymTrashScript: ; 5ddfc (17:5dfc) jp PrintPredefTextID GymTrashCans: ; 5de7d (17:5e7d) +; byte 0: mask for random number +; bytes 1-4: indices of the trash cans that can have the second lock +; (but see the comment above explaining a bug regarding this) +; Note that the mask is simply the number of valid trash can indices that +; follow. The remaining bytes are filled with 0 to pad the length of each entry +; to 5 bytes. db 2, 1, 3, 0, 0 ; 0 db 3, 0, 2, 4, 0 ; 1 db 2, 1, 5, 0, 0 ; 2 -- cgit v1.2.3 From f8a9c37a0019eb085c22c6e3ae53b16ff0cd4f6a Mon Sep 17 00:00:00 2001 From: dannye Date: Wed, 5 Aug 2015 16:20:29 -0500 Subject: Use more lb and other clean up --- engine/hidden_object_functions17.asm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engine/hidden_object_functions17.asm') diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index aad8c468..a2167b54 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -194,7 +194,7 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) ld hl, wd730 set 6, [hl] coord hl, 0, 0 - ld bc, $060a + lb bc, 6, 10 call TextBoxBorder coord hl, 1, 2 ld de, StatusAilmentText1 -- 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_functions17.asm | 48 +++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 22 deletions(-) (limited to 'engine/hidden_object_functions17.asm') diff --git a/engine/hidden_object_functions17.asm b/engine/hidden_object_functions17.asm index a2167b54..77f3eeb9 100755 --- a/engine/hidden_object_functions17.asm +++ b/engine/hidden_object_functions17.asm @@ -98,7 +98,7 @@ LinkCableHelp: ; 5dc29 (17:5c29) ld [W_ANIMATIONID], a ld [wCurrentMenuItem], a ld [wLastMenuItem], a - ld a, $3 + ld a, A_BUTTON | B_BUTTON ld [wMenuWatchedKeys], a ld a, $3 ld [wMaxMenuItem], a @@ -106,7 +106,7 @@ LinkCableHelp: ; 5dc29 (17:5c29) ld [wTopMenuItemY], a ld a, $1 ld [wTopMenuItemX], a -.asm_5c51 +.linkHelpLoop ld hl, wd730 set 6, [hl] coord hl, 0, 0 @@ -119,11 +119,11 @@ LinkCableHelp: ; 5dc29 (17:5c29) ld hl, LinkCableHelpText2 call PrintText call HandleMenuInput - bit 1, a - jr nz, .asm_5dc93 + bit 1, a ; pressed b + jr nz, .exit ld a, [wCurrentMenuItem] - cp $3 - jr z, .asm_5dc93 + cp $3 ; pressed a on "STOP READING" + jr z, .exit ld hl, wd730 res 6, [hl] ld hl, LinkCableInfoTexts @@ -135,8 +135,8 @@ LinkCableHelp: ; 5dc29 (17:5c29) ld h, [hl] ld l, a call PrintText - jp .asm_5c51 -.asm_5dc93 + jp .linkHelpLoop +.exit ld hl, wd730 res 6, [hl] call LoadScreenTilesFromBuffer1 @@ -182,7 +182,7 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) ld [W_ANIMATIONID], a ld [wCurrentMenuItem], a ld [wLastMenuItem], a - ld a, $33 + ld a, D_LEFT | D_RIGHT | A_BUTTON | B_BUTTON ld [wMenuWatchedKeys], a ld a, $2 ld [wMaxMenuItem], a @@ -190,7 +190,7 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) ld [wTopMenuItemY], a ld a, $1 ld [wTopMenuItemX], a -.asm_5dd15 +.blackboardLoop ld hl, wd730 set 6, [hl] coord hl, 0, 0 @@ -204,11 +204,12 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) call PlaceString ld hl, ViridianSchoolBlackboardText2 call PrintText - call HandleMenuInput - bit 1, a + call HandleMenuInput ; pressing up and down is handled in here + bit 1, a ; pressed b jr nz, .exitBlackboard - bit 4, a - jr z, .asm_5dd5c + bit 4, a ; pressed right + jr z, .didNotPressRight + ; move cursor to right column ld a, $2 ld [wMaxMenuItem], a ld a, $2 @@ -217,10 +218,11 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) ld [wTopMenuItemX], a ld a, $3 ld [W_ANIMATIONID], a - jr .asm_5dd15 -.asm_5dd5c - bit 5, a - jr z, .asm_5dd75 + jr .blackboardLoop +.didNotPressRight + bit 5, a ; pressed left + jr z, .didNotPressLeftOrRight + ; move cursor to left column ld a, $2 ld [wMaxMenuItem], a ld a, $2 @@ -229,14 +231,16 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) ld [wTopMenuItemX], a xor a ld [W_ANIMATIONID], a - jr .asm_5dd15 -.asm_5dd75 + jr .blackboardLoop +.didNotPressLeftOrRight ld a, [wCurrentMenuItem] ld b, a ld a, [W_ANIMATIONID] add b - cp $5 + cp $5 ; cursor is pointing to "QUIT" jr z, .exitBlackboard + ; we must have pressed a on a status condition + ; so print the text ld hl, wd730 res 6, [hl] ld hl, ViridianBlackboardStatusPointers @@ -248,7 +252,7 @@ ViridianSchoolBlackboard: ; 5dced (17:5ced) ld h, [hl] ld l, a call PrintText - jp .asm_5dd15 + jp .blackboardLoop .exitBlackboard ld hl, wd730 res 6, [hl] -- cgit v1.2.3