diff options
author | dannye <corrnondacqb@yahoo.com> | 2015-07-04 00:44:12 -0500 |
---|---|---|
committer | dannye <corrnondacqb@yahoo.com> | 2015-07-04 00:47:29 -0500 |
commit | f702fc7840e30f00c840ce619a1ea15d763438de (patch) | |
tree | e28c8b27278228f95139f7a73daf214ac680014e | |
parent | bc6f0bc08a73a4afafc24d5349d56108d3971e2a (diff) |
Start using text predef macros
also sprite direction constants
36 files changed, 225 insertions, 219 deletions
diff --git a/data/hidden_objects.asm b/data/hidden_objects.asm index 74d053bb..0e36dbc4 100755 --- a/data/hidden_objects.asm +++ b/data/hidden_objects.asm @@ -233,10 +233,10 @@ ViridianPokecenterHiddenObjects: ; 46b93 (11:6b93) ViridianMartHiddenObjects: ; 46ba0 (11:6ba0) db $FF ViridianSchoolHiddenObjects: ; 46ba1 (11:6ba1) - db $04,$03,$20 ; ViridianSchoolNotebook + db $04,$03,(ViridianSchoolNotebook_id - TextPredefs) / 2 + 1 db Bank(PrintNotebookText) dw PrintNotebookText - db $00,$03,$21 ; ViridianSchoolBlackboard + db $00,$03,(ViridianSchoolBlackboard_id - TextPredefs) / 2 + 1 db BANK(PrintBlackboardLinkCableText) dw PrintBlackboardLinkCableText db $FF @@ -743,13 +743,13 @@ LavenderHouse1HiddenObjects: ; 46fc2 (11:6fc2) dw PrintMagazinesText db $FF CeladonMansion5HiddenObjects: ; 46fd5 (11:6fd5) - db $00,$03,$34 ; LinkCableHelp + db $00,$03,(LinkCableHelp_id - TextPredefs) / 2 + 1 db BANK(PrintBlackboardLinkCableText) dw PrintBlackboardLinkCableText - db $00,$04,$34 ; LinkCableHelp + db $00,$04,(LinkCableHelp_id - TextPredefs) / 2 + 1 db BANK(PrintBlackboardLinkCableText) dw PrintBlackboardLinkCableText - db $04,$03,$35 ; TMNotebook + db $04,$03,(TMNotebook_id - TextPredefs) / 2 + 1 db Bank(PrintNotebookText) dw PrintNotebookText db $FF diff --git a/engine/game_corner_slots.asm b/engine/game_corner_slots.asm index 52f61daf..01d42d21 100755 --- a/engine/game_corner_slots.asm +++ b/engine/game_corner_slots.asm @@ -27,13 +27,13 @@ StartSlotMachine: ; 37e2d (d:7e2d) call PromptUserToPlaySlots ret .printOutOfOrder - ld a, $28 + tx_pre_id GameCornerOutOfOrderText jr .printText .printOutToLunch - ld a, $29 + tx_pre_id GameCornerOutToLunchText jr .printText .printSomeonesKeys - ld a, $2a + tx_pre_id GameCornerSomeonesKeysText .printText push af call EnableAutoTextBoxDrawing diff --git a/engine/game_corner_slots2.asm b/engine/game_corner_slots2.asm index 66e51237..850b1f99 100755 --- a/engine/game_corner_slots2.asm +++ b/engine/game_corner_slots2.asm @@ -6,13 +6,13 @@ AbleToPlaySlotsCheck ; 2ff09 (b:7f09) predef IsItemInBag_ ; IsItemInBag_ ld a, b and a - ld b, $33 ; GameCornerCoinCaseText + ld b, (GameCornerCoinCaseText_id - TextPredefs) / 2 + 1 jr z, .printCoinCaseRequired ld hl, wPlayerCoins ld a, [hli] or [hl] jr nz, .done ; able to play - ld b, $32 ; GameCornerNoCoinsText + ld b, (GameCornerNoCoinsText_id - TextPredefs) / 2 + 1 .printCoinCaseRequired call EnableAutoTextBoxDrawing ld a, b diff --git a/engine/hidden_object_functions14.asm b/engine/hidden_object_functions14.asm index 5b97b815..e0ed973d 100755 --- a/engine/hidden_object_functions14.asm +++ b/engine/hidden_object_functions14.asm @@ -66,8 +66,7 @@ ViridianSchoolNotebookText4: ; 52a03 (14:6a03) PrintFightingDojoText2: ; 52a08 (14:6a08) call EnableAutoTextBoxDrawing - ld a, $37 - jp PrintPredefTextID + tx_pre_jump FightingDojoText_52a10 FightingDojoText_52a10: ; 52a10 (14:6a10) TX_FAR _FightingDojoText_52a10 @@ -75,8 +74,7 @@ FightingDojoText_52a10: ; 52a10 (14:6a10) PrintFightingDojoText3: ; 52a15 (14:6a15) call EnableAutoTextBoxDrawing - ld a, $38 - jp PrintPredefTextID + tx_pre_jump FightingDojoText_52a1d FightingDojoText_52a1d: ; 52a1d (14:6a1d) TX_FAR _FightingDojoText_52a1d @@ -84,8 +82,7 @@ FightingDojoText_52a1d: ; 52a1d (14:6a1d) PrintFightingDojoText: ; 52a22 (14:6a22) call EnableAutoTextBoxDrawing - ld a, $36 - jp PrintPredefTextID + tx_pre_jump FightingDojoText FightingDojoText: ; 52a2a (14:6a2a) TX_FAR _FightingDojoText @@ -93,11 +90,10 @@ FightingDojoText: ; 52a2a (14:6a2a) PrintIndigoPlateauHQText: ; 52a2f (14:6a2f) ld a, [wSpriteStateData1 + 9] - cp $4 + cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing - ld a, $27 - jp PrintPredefTextID + tx_pre_jump IndigoPlateauHQText IndigoPlateauHQText: ; 52a3d (14:6a3d) TX_FAR _IndigoPlateauHQText 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 diff --git a/engine/hidden_object_functions18.asm b/engine/hidden_object_functions18.asm index 44be4c31..e293b0a0 100755 --- a/engine/hidden_object_functions18.asm +++ b/engine/hidden_object_functions18.asm @@ -1,31 +1,31 @@ GymStatues: ; 62419 (18:6419) -; if in a gym and have the corresponding badge, a = $D and jp PrintPredefTextID -; if in a gym and don’t have the corresponding badge, a = $C and jp PrintPredefTextID +; if in a gym and have the corresponding badge, a = GymStatueText2_id and jp PrintPredefTextID +; if in a gym and don’t have the corresponding badge, a = GymStatueText1_id and jp PrintPredefTextID ; else ret call EnableAutoTextBoxDrawing ld a, [wSpriteStateData1 + 9] - cp $4 + cp SPRITE_FACING_UP ret nz ld hl, .BadgeFlags ld a, [W_CURMAP] ld b, a -.asm_62429 +.loop ld a, [hli] cp $ff ret z cp b - jr z, .asm_62433 + jr z, .match inc hl - jr .asm_62429 -.asm_62433 + jr .loop +.match ld b, [hl] ld a, [wd72a] and b cp b - ld a, $d - jr z, .asm_6243f - ld a, $c -.asm_6243f + tx_pre_id GymStatueText2 + jr z, .haveBadge + tx_pre_id GymStatueText1 +.haveBadge jp PrintPredefTextID .BadgeFlags: ; 62442 (18:6442) @@ -49,41 +49,53 @@ GymStatueText2: ; 62458 (18:6458) PrintBenchGuyText: ; 6245d (18:645d) call EnableAutoTextBoxDrawing - ld hl, PokeCenterMapIDList + ld hl, BenchGuyTextPointers ld a, [W_CURMAP] ld b, a -.asm_62467 +.loop ld a, [hli] cp $ff ret z cp b - jr z, .asm_62472 + jr z, .match inc hl inc hl - jr .asm_62467 -.asm_62472 + jr .loop +.match ld a, [hli] ld b, a ld a, [wSpriteStateData1 + 9] cp b - jr nz, .asm_62467 + jr nz, .loop ; player isn't facing left at the bench guy ld a, [hl] jp PrintPredefTextID -; format: db map id, 08, text id of PredefTextIDPointerTable -PokeCenterMapIDList: ; 6247e (18:647e) - db VIRIDIAN_POKECENTER,$08,$0F - db PEWTER_POKECENTER,$08,$10 - db CERULEAN_POKECENTER,$08,$11 - db LAVENDER_POKECENTER,$08,$12 - db VERMILION_POKECENTER,$08,$13 - db CELADON_POKECENTER,$08,$14 - db CELADON_HOTEL,$08,$15 - db FUCHSIA_POKECENTER,$08,$16 - db CINNABAR_POKECENTER,$08,$17 - db SAFFRON_POKECENTER,$08,$18 - db MT_MOON_POKECENTER,$08,$19 - db ROCK_TUNNEL_POKECENTER,$08,$1A +; format: db map id, player sprite facing direction, text id of PredefTextIDPointerTable +BenchGuyTextPointers: ; 6247e (18:647e) + db VIRIDIAN_POKECENTER, SPRITE_FACING_LEFT + db (ViridianCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db PEWTER_POKECENTER, SPRITE_FACING_LEFT + db (PewterCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db CERULEAN_POKECENTER, SPRITE_FACING_LEFT + db (CeruleanCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db LAVENDER_POKECENTER, SPRITE_FACING_LEFT + db (LavenderCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db VERMILION_POKECENTER, SPRITE_FACING_LEFT + db (VermilionCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db CELADON_POKECENTER, SPRITE_FACING_LEFT + db (CeladonCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db CELADON_HOTEL, SPRITE_FACING_LEFT + db (CeladonCityHotelText_id - TextPredefs) / 2 + 1 + db FUCHSIA_POKECENTER, SPRITE_FACING_LEFT + db (FuchsiaCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db CINNABAR_POKECENTER, SPRITE_FACING_LEFT + db (CinnabarIslandPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db SAFFRON_POKECENTER, SPRITE_FACING_LEFT + db (SaffronCityPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db MT_MOON_POKECENTER, SPRITE_FACING_LEFT + db (MtMoonPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 + db ROCK_TUNNEL_POKECENTER,SPRITE_FACING_LEFT + db (RockTunnelPokecenterBenchGuyText_id - TextPredefs) / 2 + 1 db $FF ViridianCityPokecenterBenchGuyText: ; 624a3 (18:64a3) @@ -163,13 +175,12 @@ CeladonCityHotelText: ; 62502 (18:6502) ret -TerminatorText_62508: ; 62508 (18:6508) +UnusedPredefText: ; 62508 (18:6508) db "@" PrintBookcaseText: ; 6509 (18:6509) call EnableAutoTextBoxDrawing - ld a, $e ; BookcaseText - jp PrintPredefTextID + tx_pre_jump BookcaseText BookcaseText: ; 62511 (18:6511) TX_FAR _BookcaseText @@ -177,13 +188,12 @@ BookcaseText: ; 62511 (18:6511) OpenPokemonCenterPC: ; 62516 (18:6516) ld a, [wSpriteStateData1 + 9] - cp $4 ; check to see if player is facing up + cp SPRITE_FACING_UP ; check to see if player is facing up ret nz call EnableAutoTextBoxDrawing ld a, $1 ld [wAutoTextBoxDrawingControl], a - ld a, $1f ; PredefText1f - jp PrintPredefTextID + tx_pre_jump PokemonCenterPCText -PredefText1f: ; 62529 (18:6529) +PokemonCenterPCText: ; 62529 (18:6529) db $F9 ; FuncTX_PokemonCenterPC diff --git a/engine/hidden_object_functions3.asm b/engine/hidden_object_functions3.asm index 23254c11..c40073cb 100755 --- a/engine/hidden_object_functions3.asm +++ b/engine/hidden_object_functions3.asm @@ -40,23 +40,40 @@ PrintBookshelfText: ; fb50 (3:7b50) ; format: db tileset id, bookshelf tile id, text id BookshelfTileIDs: ; fb8b (3:7b8b) - db PLATEAU, $30, $3A - db HOUSE, $3D, $3F - db HOUSE, $1E, $40 - db MANSION, $32, $40 - db REDS_HOUSE_1, $32, $40 - db LAB, $28, $40 - db LOBBY, $16, $41 - db GYM, $1D, $40 - db DOJO, $1D, $40 - db GATE, $22, $40 - db MART, $54, $42 - db MART, $55, $42 - db POKECENTER, $54, $42 - db POKECENTER, $55, $42 - db LOBBY, $50, $42 - db LOBBY, $52, $42 - db SHIP, $36, $40 + db PLATEAU, $30 + db (IndigoPlateauStatues_id - TextPredefs) / 2 + 1 + db HOUSE, $3D + db (TownMapText_id - TextPredefs) / 2 + 1 + db HOUSE, $1E + db (BookOrSculptureText_id - TextPredefs) / 2 + 1 + db MANSION, $32 + db (BookOrSculptureText_id - TextPredefs) / 2 + 1 + db REDS_HOUSE_1, $32 + db (BookOrSculptureText_id - TextPredefs) / 2 + 1 + db LAB, $28 + db (BookOrSculptureText_id - TextPredefs) / 2 + 1 + db LOBBY, $16 + db (ElevatorText_id - TextPredefs) / 2 + 1 + db GYM, $1D + db (BookOrSculptureText_id - TextPredefs) / 2 + 1 + db DOJO, $1D + db (BookOrSculptureText_id - TextPredefs) / 2 + 1 + db GATE, $22 + db (BookOrSculptureText_id - TextPredefs) / 2 + 1 + db MART, $54 + db (PokemonStuffText_id - TextPredefs) / 2 + 1 + db MART, $55 + db (PokemonStuffText_id - TextPredefs) / 2 + 1 + db POKECENTER, $54 + db (PokemonStuffText_id - TextPredefs) / 2 + 1 + db POKECENTER, $55 + db (PokemonStuffText_id - TextPredefs) / 2 + 1 + db LOBBY, $50 + db (PokemonStuffText_id - TextPredefs) / 2 + 1 + db LOBBY, $52 + db (PokemonStuffText_id - TextPredefs) / 2 + 1 + db SHIP, $36 + db (BookOrSculptureText_id - TextPredefs) / 2 + 1 db $FF IndigoPlateauStatues: ; fbbf (3:7bbf) 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 diff --git a/engine/menu/bills_pc.asm b/engine/menu/bills_pc.asm index 3018529a..c9dd41b1 100644 --- a/engine/menu/bills_pc.asm +++ b/engine/menu/bills_pc.asm @@ -523,8 +523,7 @@ CableClubLeftGameboy:: ; 5824 (8:5825) .asm_2183a ld [wLinkState], a call EnableAutoTextBoxDrawing - ld a, $22 ; JustAMomentText - jp PrintPredefTextID + tx_pre_jump JustAMomentText CableClubRightGameboy:: ; 5845 (8:5845) ld a, [hSerialConnectionStatus] @@ -541,8 +540,7 @@ CableClubRightGameboy:: ; 5845 (8:5845) .asm_2185a ld [wLinkState], a call EnableAutoTextBoxDrawing - ld a, $22 ; JustAMomentText - jp PrintPredefTextID + tx_pre_jump JustAMomentText JustAMomentText:: ; 21865 (8:5865) TX_FAR _JustAMomentText @@ -552,9 +550,8 @@ JustAMomentText:: ; 21865 (8:5865) cp SPRITE_FACING_UP ret nz call EnableAutoTextBoxDrawing - ld a, $23 - jp PrintPredefTextID + tx_pre_jump OpenBillsPCText -PredefText23:: ; 21878 (8:5878) +OpenBillsPCText:: ; 21878 (8:5878) db $FD ; FuncTX_BillsPC diff --git a/engine/overworld/card_key.asm b/engine/overworld/card_key.asm index c4df0d51..94c1868c 100755 --- a/engine/overworld/card_key.asm +++ b/engine/overworld/card_key.asm @@ -27,7 +27,7 @@ PrintCardKeyText: ; 52673 (14:6673) jr z, .noCardKey call GetCoordsInFrontOfPlayer push de - ld a, $1 + tx_pre_id CardKeySuccessText ld [H_DOWNARROWBLINKCNT2], a call PrintPredefTextID pop de @@ -54,7 +54,7 @@ PrintCardKeyText: ; 52673 (14:6673) ld a, (SFX_1f_57 - SFX_Headers_1f) / 3 jp PlaySound .noCardKey - ld a, $2 + tx_pre_id CardKeyFailText ld [H_DOWNARROWBLINKCNT2], a jp PrintPredefTextID diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index 215bf103..26a65b5b 100755 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -185,26 +185,26 @@ Func_f09f: ; f09f (3:709f) add hl, bc ld a, [wSpriteStateData1 + 9] and a - jr z, .asm_f0c7 - cp $4 - jr z, .asm_f0cf - cp $8 - jr z, .asm_f0d7 + jr z, .down + cp SPRITE_FACING_UP + jr z, .up + cp SPRITE_FACING_LEFT + jr z, .left ld a, [W_XBLOCKCOORD] and a jr z, .asm_f0e0 jr .asm_f0ec -.asm_f0c7 +.down ld a, [W_YBLOCKCOORD] and a jr z, .asm_f0e0 jr .asm_f0df -.asm_f0cf +.up ld a, [W_YBLOCKCOORD] and a jr z, .asm_f0e1 jr .asm_f0e0 -.asm_f0d7 +.left ld a, [W_XBLOCKCOORD] and a jr z, .asm_f0e6 diff --git a/engine/overworld/hidden_items.asm b/engine/overworld/hidden_items.asm index afe9e3c3..868f118f 100755 --- a/engine/overworld/hidden_items.asm +++ b/engine/overworld/hidden_items.asm @@ -16,8 +16,7 @@ HiddenItems: ; 76688 (1d:6688) ld a, [wWhichTrade] ; item ID ld [wd11e], a call GetItemName - ld a, $24 - jp PrintPredefTextID + tx_pre_jump FoundHiddenItemText INCLUDE "data/hidden_item_coords.asm" @@ -112,10 +111,10 @@ HiddenCoins: ; 76799 (1d:6799) ld a, [wPlayerCoins + 1] cp $99 jr nz, .RoomInCoinCase - ld a, $2c + tx_pre_id DroppedHiddenCoinsText jr .done .RoomInCoinCase - ld a, $2b + tx_pre_id FoundHiddenCoinsText .done jp PrintPredefTextID diff --git a/engine/overworld/movement.asm b/engine/overworld/movement.asm index 75b4f3ea..dac03f3a 100644 --- a/engine/overworld/movement.asm +++ b/engine/overworld/movement.asm @@ -27,34 +27,34 @@ UpdatePlayerSprite: ; 4e31 (1:4e31) jr nz, .asm_4e90 ld a, [wd528] bit 2, a - jr z, .asm_4e65 - xor a - jr .asm_4e86 -.asm_4e65 + jr z, .notDown + xor a ; ld a, SPRITE_FACING_DOWN + jr .done +.notDown bit 3, a - jr z, .asm_4e6d - ld a, $4 - jr .asm_4e86 -.asm_4e6d + jr z, .notUp + ld a, SPRITE_FACING_UP + jr .done +.notUp bit 1, a - jr z, .asm_4e75 - ld a, $8 - jr .asm_4e86 -.asm_4e75 + jr z, .notLeft + ld a, SPRITE_FACING_LEFT + jr .done +.notLeft bit 0, a - jr z, .asm_4e7d - ld a, $c - jr .asm_4e86 -.asm_4e7d + jr z, .notRight + ld a, SPRITE_FACING_RIGHT + jr .done +.notRight xor a ld [wSpriteStateData1 + 7], a ld [wSpriteStateData1 + 8], a jr .asm_4eab -.asm_4e86 +.done ld [wSpriteStateData1 + 9], a ld a, [wFontLoaded] bit 0, a - jr nz, .asm_4e7d + jr nz, .notRight .asm_4e90 ld a, [wd736] bit 7, a @@ -4679,7 +4679,7 @@ SetMapTextPointer:: ; 3f0f (0:3f0f) TextPredefs:: add_tx_pre CardKeySuccessText ; 01 add_tx_pre CardKeyFailText ; 02 - add_tx_pre RedBedroomPC ; 03 + add_tx_pre RedBedroomPCText ; 03 add_tx_pre RedBedroomSNESText ; 04 add_tx_pre PushStartText ; 05 add_tx_pre SaveOptionText ; 06 @@ -4703,17 +4703,17 @@ TextPredefs:: add_tx_pre SaffronCityPokecenterBenchGuyText ; 18 add_tx_pre MtMoonPokecenterBenchGuyText ; 19 add_tx_pre RockTunnelPokecenterBenchGuyText ; 1A - add_tx_pre UnusedBenchGuyText1 ; 1B - add_tx_pre UnusedBenchGuyText2 ; 1C - add_tx_pre UnusedBenchGuyText3 ; 1D - add_tx_pre TerminatorText_62508 ; 1E - add_tx_pre PredefText1f ; 1F + add_tx_pre UnusedBenchGuyText1 ; 1B XXX unused + add_tx_pre UnusedBenchGuyText2 ; 1C XXX unused + add_tx_pre UnusedBenchGuyText3 ; 1D XXX unused + add_tx_pre UnusedPredefText ; 1E XXX unused + add_tx_pre PokemonCenterPCText ; 1F add_tx_pre ViridianSchoolNotebook ; 20 add_tx_pre ViridianSchoolBlackboard ; 21 add_tx_pre JustAMomentText ; 22 - add_tx_pre PredefText23 ; 23 + add_tx_pre OpenBillsPCText ; 23 add_tx_pre FoundHiddenItemText ; 24 - add_tx_pre HiddenItemBagFullText ; 25 + add_tx_pre HiddenItemBagFullText ; 25 XXX unused add_tx_pre VermilionGymTrashText ; 26 add_tx_pre IndigoPlateauHQText ; 27 add_tx_pre GameCornerOutOfOrderText ; 28 @@ -4736,7 +4736,7 @@ TextPredefs:: add_tx_pre NewBicycleText ; 39 add_tx_pre IndigoPlateauStatues ; 3A add_tx_pre VermilionGymTrashSuccesText1 ; 3B - add_tx_pre VermilionGymTrashSuccesText2 ; 3C + add_tx_pre VermilionGymTrashSuccesText2 ; 3C XXX unused add_tx_pre VermilionGymTrashSuccesText3 ; 3D add_tx_pre VermilionGymTrashFailText ; 3E add_tx_pre TownMapText ; 3F diff --git a/home/overworld.asm b/home/overworld.asm index 4aea2102..0e62a932 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -1120,7 +1120,7 @@ IsSpriteInFrontOfPlayer2:: ; 0b6d (0:0b6d) ld bc,$3c40 ; Y and X position of player sprite ld a,[wSpriteStateData1 + 9] ; direction the player is facing .checkIfPlayerFacingUp - cp a,$04 + cp SPRITE_FACING_UP jr nz,.checkIfPlayerFacingDown ; facing up ld a,b @@ -1129,7 +1129,7 @@ IsSpriteInFrontOfPlayer2:: ; 0b6d (0:0b6d) ld a,$08 jr .doneCheckingDirection .checkIfPlayerFacingDown - cp a,$00 + cp SPRITE_FACING_DOWN jr nz,.checkIfPlayerFacingRight ; facing down ld a,b @@ -1138,7 +1138,7 @@ IsSpriteInFrontOfPlayer2:: ; 0b6d (0:0b6d) ld a,$04 jr .doneCheckingDirection .checkIfPlayerFacingRight - cp a,$0c + cp SPRITE_FACING_RIGHT jr nz,.playerFacingLeft ; facing right ld a,c @@ -226,7 +226,7 @@ add_tx_pre: MACRO ENDM tx_pre_id: MACRO - ld a, (\1_id - TextPredefs) / 2 + ld a, (\1_id - TextPredefs) / 2 + 1 ENDM tx_pre: MACRO @@ -2339,7 +2339,7 @@ _GetTileAndCoordsInFrontOfPlayer: ; c589 (3:4589) ld a, [W_XCOORD] ld e, a ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction - and a + and a ; cp SPRITE_FACING_DOWN jr nz, .notFacingDown ; facing down aCoord 8, 11 @@ -2378,7 +2378,7 @@ GetTileTwoStepsInFrontOfPlayer: ; c5be (3:45be) ld d, a ld e, [hl] ld a, [wSpriteStateData1 + 9] ; player's sprite facing direction - and a + and a ; cp SPRITE_FACING_DOWN jr nz, .notFacingDown ; facing down ld hl, $ffdb diff --git a/scripts/battlecenterm.asm b/scripts/battlecenterm.asm index 997be7c1..dcb20d83 100755 --- a/scripts/battlecenterm.asm +++ b/scripts/battlecenterm.asm @@ -19,14 +19,14 @@ BattleCenterMScript: ; 4fd10 (13:7d10) ld [hli], a ld a, $a ld [hl], a - ld a, $8 + ld a, SPRITE_FACING_LEFT ld [wSpriteStateData1 + $19], a ld a, [$ffaa] cp $2 ret z ld a, $7 ld [wSpriteStateData2 + $15], a - ld a, $c + ld a, SPRITE_FACING_RIGHT ld [wSpriteStateData1 + $19], a ret diff --git a/scripts/billshouse.asm b/scripts/billshouse.asm index df608de3..1db6934a 100755 --- a/scripts/billshouse.asm +++ b/scripts/billshouse.asm @@ -17,11 +17,11 @@ BillsHouseScript0: ; 1e782 (7:6782) BillsHouseScript1: ; 1e783 (7:6783) ld a, [wSpriteStateData1 + 9] - and a + and a ; cp SPRITE_FACING_DOWN ld de, MovementData_1e79c - jr nz, .asm_1e78f + jr nz, .notDown ld de, MovementData_1e7a0 -.asm_1e78f +.notDown ld a, $1 ld [$ff8c], a call MoveSprite @@ -32,6 +32,7 @@ BillsHouseScript1: ; 1e783 (7:6783) MovementData_1e79c: ; 1e79c (7:679c) db $40,$40,$40,$FF +; make Bill walk around the player MovementData_1e7a0: ; 1e7a0 (7:67a0) db $C0,$40,$40,$80,$40,$FF diff --git a/scripts/copycatshouse2f.asm b/scripts/copycatshouse2f.asm index 6a9c2236..51a633b1 100755 --- a/scripts/copycatshouse2f.asm +++ b/scripts/copycatshouse2f.asm @@ -85,11 +85,11 @@ CopycatsHouse2FText6: ; 5ccfe (17:4cfe) CopycatsHouse2FText7: ; 5cd03 (17:4d03) TX_ASM ld a, [wSpriteStateData1 + 9] - cp $4 + cp SPRITE_FACING_UP ld hl, CopycatsHouse2FText_5cd1c - jr nz, .asm_399a4 + jr nz, .notUp ld hl, CopycatsHouse2FText_5cd17 -.asm_399a4 +.notUp call PrintText jp TextScriptEnd diff --git a/scripts/mansion1.asm b/scripts/mansion1.asm index e5c7eb0a..d658b425 100755 --- a/scripts/mansion1.asm +++ b/scripts/mansion1.asm @@ -48,7 +48,7 @@ Mansion1ReplaceBlock: ; 44310 (11:4310) Mansion1Script_Switches: ; 44316 (11:4316) ld a, [wSpriteStateData1 + 9] - cp $4 + cp SPRITE_FACING_UP ret nz xor a ld [hJoyHeld], a diff --git a/scripts/mansion2.asm b/scripts/mansion2.asm index 334753df..40827be1 100755 --- a/scripts/mansion2.asm +++ b/scripts/mansion2.asm @@ -44,7 +44,7 @@ Mansion2Script_5202f: ; 5202f (14:602f) Mansion2Script_Switches: ; 52037 (14:6037) ld a, [wSpriteStateData1 + 9] - cp $4 + cp SPRITE_FACING_UP ret nz xor a ld [hJoyHeld], a diff --git a/scripts/mansion3.asm b/scripts/mansion3.asm index d7c0d6ef..dfecde99 100755 --- a/scripts/mansion3.asm +++ b/scripts/mansion3.asm @@ -75,7 +75,7 @@ Mansion3Script_5225b: ; 5225b (14:625b) Mansion3Script_Switches: ; 5227a (14:627a) ld a, [wSpriteStateData1 + 9] - cp $4 + cp SPRITE_FACING_UP ret nz xor a ld [hJoyHeld], a diff --git a/scripts/mansion4.asm b/scripts/mansion4.asm index 4f1bd742..c23cb2d7 100755 --- a/scripts/mansion4.asm +++ b/scripts/mansion4.asm @@ -46,7 +46,7 @@ Mansion4Script_523cf: ; 523cf (14:63cf) Mansion4Script_Switches: ; 52420 (14:6420) ld a, [wSpriteStateData1 + 9] - cp $4 + cp SPRITE_FACING_UP ret nz xor a ld [hJoyHeld], a diff --git a/scripts/oakslab.asm b/scripts/oakslab.asm index ceb8a761..7c99d802 100755 --- a/scripts/oakslab.asm +++ b/scripts/oakslab.asm @@ -454,6 +454,7 @@ OaksLabScript14: ; 1ce6d (7:4e6d) ld a, $12 ld [W_OAKSLABCURSCRIPT], a jr .done +; make the player keep facing the rival as he walks away .asm_1ce8c ld a, [wcf0f] cp $5 @@ -461,17 +462,17 @@ OaksLabScript14: ; 1ce6d (7:4e6d) ld a, [W_XCOORD] cp $4 jr nz, .asm_1cea1 - ld a, $c + ld a, SPRITE_FACING_RIGHT ld [wSpriteStateData1 + 9], a jr .done .asm_1cea1 - ld a, $8 + ld a, SPRITE_FACING_LEFT ld [wSpriteStateData1 + 9], a jr .done .asm_1cea8 cp $4 ret nz - xor a + xor a ; ld a, SPRITE_FACING_DOWN ld [wSpriteStateData1 + 9], a .done ret diff --git a/scripts/pallettown.asm b/scripts/pallettown.asm index c05b87c1..d625a7be 100755 --- a/scripts/pallettown.asm +++ b/scripts/pallettown.asm @@ -97,7 +97,7 @@ PalletTownScript3: ; 18f12 (6:4f12) ld a,[wd730] bit 0,a ret nz - xor a + xor a ; ld a, SPRITE_FACING_DOWN ld [wSpriteStateData1 + 9],a ld a,1 ld [wcf0d],a diff --git a/scripts/pokemontower7.asm b/scripts/pokemontower7.asm index 4462fb78..ab96fd9b 100755 --- a/scripts/pokemontower7.asm +++ b/scripts/pokemontower7.asm @@ -69,7 +69,7 @@ PokemonTower7Script4: ; 60d86 (18:4d86) ld a, HS_POKEMONTOWER_7_MR_FUJI ld [wcc4d], a predef HideObject - ld a, $4 + ld a, SPRITE_FACING_UP ld [wSpriteStateData1 + 9], a ld a, LAVENDER_HOUSE_1 ld [H_DOWNARROWBLINKCNT1], a diff --git a/scripts/redshouse1f.asm b/scripts/redshouse1f.asm index b630fffe..0f5251b8 100755 --- a/scripts/redshouse1f.asm +++ b/scripts/redshouse1f.asm @@ -52,11 +52,11 @@ MomHealText2: ; 481c1 (12:41c1) RedsHouse1FText2: ; 0x481c6 TV TX_ASM ld a,[wSpriteStateData1 + 9] - cp 4 + cp SPRITE_FACING_UP ld hl,TVWrongSideText - jr nz,.done ; if player is not facing up + jr nz,.notUp ld hl,StandByMeText -.done +.notUp call PrintText jp TextScriptEnd diff --git a/scripts/route11gateupstairs.asm b/scripts/route11gateupstairs.asm index abea062c..eded4165 100755 --- a/scripts/route11gateupstairs.asm +++ b/scripts/route11gateupstairs.asm @@ -50,8 +50,8 @@ Route11GateUpstairsText_494a3: ; 494a3 (12:54a3) Route11GateUpstairsText3: ; 494a8 (12:54a8) TX_ASM ld a, [wSpriteStateData1 + 9] - cp $4 - jp nz, Route12GateUpstairsScript_495c9 + cp SPRITE_FACING_UP + jp nz, GateUpstairsScript_PrintIfFacingUp ld a, [wd7d8] bit 7, a ; fought snorlax? ld hl, BinocularsSnorlaxText @@ -72,7 +72,7 @@ BinocularsNoSnorlaxText: Route11GateUpstairsText4: ; 494ce (12:54ce) TX_ASM ld hl, Route11GateUpstairsText_494d5 - jp Route12GateUpstairsScript_495c9 + jp GateUpstairsScript_PrintIfFacingUp Route11GateUpstairsText_494d5: ; 494d5 (12:54d5) TX_FAR _Route11GateUpstairsText_494d5 diff --git a/scripts/route12gateupstairs.asm b/scripts/route12gateupstairs.asm index 6ec8cfe3..d4e8e983 100755 --- a/scripts/route12gateupstairs.asm +++ b/scripts/route12gateupstairs.asm @@ -50,7 +50,7 @@ TM39NoRoomText: ; 495ac (12:55ac) Route12GateUpstairsText2: ; 495b1 (12:55b1) TX_ASM ld hl, Route12GateUpstairsText_495b8 - jp Route12GateUpstairsScript_495c9 + jp GateUpstairsScript_PrintIfFacingUp Route12GateUpstairsText_495b8: ; 495b8 (12:55b8) TX_FAR _Route12GateUpstairsText_495b8 @@ -59,21 +59,21 @@ Route12GateUpstairsText_495b8: ; 495b8 (12:55b8) Route12GateUpstairsText3: ; 495bd (12:55bd) TX_ASM ld hl, Route12GateUpstairsText_495c4 - jp Route12GateUpstairsScript_495c9 + jp GateUpstairsScript_PrintIfFacingUp Route12GateUpstairsText_495c4: ; 495c4 (12:55c4) TX_FAR _Route12GateUpstairsText_495c4 db "@" -Route12GateUpstairsScript_495c9: ; 495c9 (12:55c9) +GateUpstairsScript_PrintIfFacingUp: ; 495c9 (12:55c9) ld a, [wSpriteStateData1 + 9] - cp $4 - jr z, .asm_495d4 + cp SPRITE_FACING_UP + jr z, .up ld a, $1 - jr .asm_495d8 -.asm_495d4 + jr .done +.up call PrintText xor a -.asm_495d8 +.done ld [wDoNotWaitForButtonPressAfterDisplayingText], a jp TextScriptEnd diff --git a/scripts/route15gateupstairs.asm b/scripts/route15gateupstairs.asm index 05bcbeea..8969fd74 100755 --- a/scripts/route15gateupstairs.asm +++ b/scripts/route15gateupstairs.asm @@ -39,7 +39,7 @@ Route15GateUpstairsText_4968c: ; 4968c (12:568c) Route15GateUpstairsText2: ; 49691 (12:5691) TX_ASM ld hl, Route15GateUpstairsText_49698 - jp Route12GateUpstairsScript_495c9 + jp GateUpstairsScript_PrintIfFacingUp Route15GateUpstairsText_49698: ; 49698 (12:5698) TX_FAR _Route15GateUpstairsText_49698 diff --git a/scripts/route16gateupstairs.asm b/scripts/route16gateupstairs.asm index 6027d57b..64b43e10 100755 --- a/scripts/route16gateupstairs.asm +++ b/scripts/route16gateupstairs.asm @@ -30,7 +30,7 @@ Route16GateUpstairsText_4982f: ; 4982f (12:582f) Route16GateUpstairsText3: ; 49834 (12:5834) TX_ASM ld hl, Route16GateUpstairsText_4983b - jp Route12GateUpstairsScript_495c9 + jp GateUpstairsScript_PrintIfFacingUp Route16GateUpstairsText_4983b: ; 4983b (12:583b) TX_FAR _Route16GateUpstairsText_4983b @@ -39,7 +39,7 @@ Route16GateUpstairsText_4983b: ; 4983b (12:583b) Route16GateUpstairsText4: ; 49840 (12:5840) TX_ASM ld hl, Route16GateUpstairsText_49847 - jp Route12GateUpstairsScript_495c9 + jp GateUpstairsScript_PrintIfFacingUp Route16GateUpstairsText_49847: ; 49847 (12:5847) TX_FAR _Route16GateUpstairsText_49847 diff --git a/scripts/route18gateupstairs.asm b/scripts/route18gateupstairs.asm index 7fc76eda..4e1014e0 100755 --- a/scripts/route18gateupstairs.asm +++ b/scripts/route18gateupstairs.asm @@ -16,7 +16,7 @@ Route18GateUpstairsText1: ; 4997e (12:597e) Route18GateUpstairsText2: ; 4998c (12:598c) TX_ASM ld hl, Route18GateUpstairsText_49993 - jp Route12GateUpstairsScript_495c9 + jp GateUpstairsScript_PrintIfFacingUp Route18GateUpstairsText_49993: ; 49993 (12:5993) TX_FAR _Route18GateUpstairsText_49993 @@ -25,7 +25,7 @@ Route18GateUpstairsText_49993: ; 49993 (12:5993) Route18GateUpstairsText3: ; 49998 (12:5998) TX_ASM ld hl, Route18GateUpstairsText_4999f - jp Route12GateUpstairsScript_495c9 + jp GateUpstairsScript_PrintIfFacingUp Route18GateUpstairsText_4999f: ; 4999f (12:599f) TX_FAR _Route18GateUpstairsText_4999f diff --git a/scripts/route22.asm b/scripts/route22.asm index 88f69bea..7d70924b 100755 --- a/scripts/route22.asm +++ b/scripts/route22.asm @@ -148,13 +148,13 @@ Route22Script2: ; 50fb5 (14:4fb5) cp $ff jp z, Route22Script_50ece ld a, [wSpriteStateData1 + 9] - and a - jr nz, .asm_50fc7 - ld a, $4 - jr .asm_50fc9 -.asm_50fc7 - ld a, $c -.asm_50fc9 + and a ; cp SPRITE_FACING_DOWN + jr nz, .notDown + ld a, SPRITE_FACING_UP + jr .done +.notDown + ld a, SPRITE_FACING_RIGHT +.done ld [$ff8d], a ld a, $1 ld [$ff8c], a diff --git a/scripts/safarizoneentrance.asm b/scripts/safarizoneentrance.asm index 6b9029f6..b64868e5 100755 --- a/scripts/safarizoneentrance.asm +++ b/scripts/safarizoneentrance.asm @@ -24,7 +24,7 @@ SafariZoneEntranceScriptPointers: ; 751d9 (1d:51d9) ld [wJoyIgnore], a xor a ld [hJoyHeld], a - ld a, $c + ld a, SPRITE_FACING_RIGHT ld [wSpriteStateData1 + 9], a ld a, [wWhichTrade] cp $1 @@ -247,7 +247,7 @@ SafariZoneEntranceTextPointers: ; 752b9 (1d:52b9) .asm_7539c ld hl, .SafariZoneEntranceText_753c0 call PrintText - ld a, $4 + ld a, SPRITE_FACING_UP ld [wSpriteStateData1 + 9], a ld a, $40 ld c, $1 diff --git a/scripts/vermilioncity.asm b/scripts/vermilioncity.asm index 9fd05776..0f71a4d0 100755 --- a/scripts/vermilioncity.asm +++ b/scripts/vermilioncity.asm @@ -40,7 +40,7 @@ VermilionCityScriptPointers: ; 197dc (6:57dc) VermilionCityScript0: ; 197e6 (6:57e6) ld a, [wSpriteStateData1 + 9] - and a + and a ; cp SPRITE_FACING_DOWN ret nz ld hl, CoordsData_19823 call ArePlayerCoordsInArray @@ -54,7 +54,7 @@ VermilionCityScript0: ; 197e6 (6:57e6) ld a, [wd803] bit 2, a jr nz, .asm_19810 - ld b, $3f + ld b, S_S__TICKET predef IsItemInBag_ ld a, b and a @@ -162,7 +162,7 @@ VermilionCityText3: ; 198b1 (6:58b1) bit 2, a jr nz, .asm_198f6 ld a, [wSpriteStateData1 + 9] - cp $c + cp SPRITE_FACING_RIGHT jr z, .asm_198c8 ld hl, VermilionCityCoords1 call ArePlayerCoordsInArray |