From 8fafca714c07500d1d87bba224f12cf9cc2c8789 Mon Sep 17 00:00:00 2001 From: Sylvie <35663410+Rangi42@users.noreply.github.com> Date: Tue, 16 Jul 2024 13:02:54 -0400 Subject: Identify various flag labels and bit constants (#454) --- data/text/text_2.asm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'data/text') diff --git a/data/text/text_2.asm b/data/text/text_2.asm index dcb67c67..d4b1b7db 100644 --- a/data/text/text_2.asm +++ b/data/text/text_2.asm @@ -1229,7 +1229,7 @@ _GrewLevelText:: text_ram wcd6d text " grew" line "to level @" - text_decimal wCurEnemyLVL, 1, 3 + text_decimal wCurEnemyLevel, 1, 3 text "!@" text_end @@ -1435,7 +1435,7 @@ _RareCandyText:: text_ram wcd6d text " grew" line "to level @" - text_decimal wCurEnemyLVL, 1, 3 + text_decimal wCurEnemyLevel, 1, 3 text "!@" text_end -- cgit v1.3.1-sl0p From 6e3ab0a9e97ff14123ac65f56cb4b4ddab45b695 Mon Sep 17 00:00:00 2001 From: Sylvie <35663410+Rangi42@users.noreply.github.com> Date: Wed, 24 Jul 2024 12:21:59 -0400 Subject: Identify wcd6d as wNameBuffer and others (#455) --- data/text/text_1.asm | 2 +- data/text/text_2.asm | 46 ++++++++++++++++----------------- data/text/text_3.asm | 8 +++--- data/text/text_4.asm | 4 +-- data/text/text_5.asm | 10 +++---- data/text/text_6.asm | 8 +++--- data/text/text_7.asm | 6 ++--- engine/battle/core.asm | 10 +++---- engine/battle/get_trainer_name.asm | 4 +-- engine/battle/misc.asm | 8 +++--- engine/battle/move_effects/pay_day.asm | 6 ++--- engine/battle/save_trainer_name.asm | 2 +- engine/events/cinnabar_lab.asm | 2 +- engine/events/heal_party.asm | 4 +-- engine/events/in_game_trades.asm | 2 +- engine/items/item_effects.asm | 4 +-- engine/items/town_map.asm | 24 +++++++++-------- engine/link/cable_club.asm | 2 +- engine/menus/league_pc.asm | 2 +- engine/menus/naming_screen.asm | 2 +- engine/menus/party_menu.asm | 8 +++--- engine/movie/hall_of_fame.asm | 4 +-- engine/movie/oak_speech/oak_speech2.asm | 4 +-- engine/movie/trade.asm | 2 +- engine/movie/trade2.asm | 2 +- engine/pokemon/add_mon.asm | 4 +-- engine/pokemon/evos_moves.asm | 4 +-- engine/pokemon/learn_move.asm | 2 +- home/list_menu.asm | 2 +- home/names.asm | 19 +++++++------- home/names2.asm | 2 +- home/pokemon.asm | 4 +-- ram/wram.asm | 20 +++++++++++--- scripts/CeladonMartRoof.asm | 2 +- scripts/Route15Gate2F.asm | 2 +- scripts/Route23.asm | 2 +- scripts/Route2Gate.asm | 2 +- text/ChampionsRoom.asm | 2 +- text/CinnabarLabFossilRoom.asm | 4 +-- text/Daycare.asm | 6 ++--- text/NameRatersHouse.asm | 6 ++--- text/OaksLab.asm | 4 +-- text/Route23.asm | 8 +++--- 43 files changed, 142 insertions(+), 129 deletions(-) (limited to 'data/text') diff --git a/data/text/text_1.asm b/data/text/text_1.asm index 2acc6f68..538396eb 100644 --- a/data/text/text_1.asm +++ b/data/text/text_1.asm @@ -14,7 +14,7 @@ _CardKeyFailText:: done _TrainerNameText:: - text_ram wcd6d + text_ram wNameBuffer text ": @" text_end diff --git a/data/text/text_2.asm b/data/text/text_2.asm index d4b1b7db..4362e0f2 100644 --- a/data/text/text_2.asm +++ b/data/text/text_2.asm @@ -10,7 +10,7 @@ _AIBattleUseItemText:: text_ram wTrainerName text_start line "used @" - text_ram wcd6d + text_ram wNameBuffer text_start cont "on @" text_ram wEnemyMonNick @@ -36,7 +36,7 @@ _TradeSendsText:: text_ram wLinkEnemyTrainerName text " sends" line "@" - text_ram wcd6d + text_ram wNameBuffer text "." done @@ -47,7 +47,7 @@ _TradeWavesFarewellText:: done _TradeTransferredText:: - text_ram wcd6d + text_ram wNameBuffer text " is" line "transferred." done @@ -55,7 +55,7 @@ _TradeTransferredText:: _TradeTakeCareText:: text "Take good care of" line "@" - text_ram wcd6d + text_ram wNameBuffer text "." done @@ -63,7 +63,7 @@ _TradeWillTradeText:: text_ram wLinkEnemyTrainerName text " will" line "trade @" - text_ram wcd6d + text_ram wNameBuffer text_start done @@ -751,7 +751,7 @@ _VermilionGymTrashFailText:: _FoundHiddenItemText:: text " found" line "@" - text_ram wcd6d + text_ram wNameBuffer text "!@" text_end @@ -1070,7 +1070,7 @@ _CantMoveText:: _MoveIsDisabledText:: text "'s" line "@" - text_ram wcd6d + text_ram wNameBuffer text " is" cont "disabled!" prompt @@ -1205,7 +1205,7 @@ _HitXTimesText:: prompt _GainedText:: - text_ram wcd6d + text_ram wNameBuffer text " gained" line "@" text_end @@ -1226,7 +1226,7 @@ _ExpPointsText:: prompt _GrewLevelText:: - text_ram wcd6d + text_ram wNameBuffer text " grew" line "to level @" text_decimal wCurEnemyLevel, 1, 3 @@ -1382,7 +1382,7 @@ _PartyMenuSwapMonText:: done _PotionText:: - text_ram wcd6d + text_ram wNameBuffer text_start line "recovered by @" text_decimal wHPBarHPDifference, 2, 3 @@ -1390,49 +1390,49 @@ _PotionText:: done _AntidoteText:: - text_ram wcd6d + text_ram wNameBuffer text " was" line "cured of poison!" done _ParlyzHealText:: - text_ram wcd6d + text_ram wNameBuffer text "'s" line "rid of paralysis!" done _BurnHealText:: - text_ram wcd6d + text_ram wNameBuffer text "'s" line "burn was healed!" done _IceHealText:: - text_ram wcd6d + text_ram wNameBuffer text " was" line "defrosted!" done _AwakeningText:: - text_ram wcd6d + text_ram wNameBuffer text_start line "woke up!" done _FullHealText:: - text_ram wcd6d + text_ram wNameBuffer text "'s" line "health returned!" done _ReviveText:: - text_ram wcd6d + text_ram wNameBuffer text_start line "is revitalized!" done _RareCandyText:: - text_ram wcd6d + text_ram wNameBuffer text " grew" line "to level @" text_decimal wCurEnemyLevel, 1, 3 @@ -1487,7 +1487,7 @@ _DepositHowManyText:: done _ItemWasStoredText:: - text_ram wcd6d + text_ram wNameBuffer text " was" line "stored via PC." prompt @@ -1514,7 +1514,7 @@ _WithdrawHowManyText:: _WithdrewItemText:: text "Withdrew" line "@" - text_ram wcd6d + text_ram wNameBuffer text "." prompt @@ -1642,7 +1642,7 @@ _HereYouGoText:: _SoYouWantPrizeText:: text "So, you want" line "@" - text_ram wcd6d + text_ram wNameBuffer text "?" done @@ -1756,7 +1756,7 @@ _DoYouWantToNicknameText:: text "Do you want to" line "give a nickname" cont "to @" - text_ram wcd6d + text_ram wNameBuffer text "?" done @@ -1775,7 +1775,7 @@ _WillBeTradedText:: text_ram wNameOfPlayerMonToBeTraded text " and" line "@" - text_ram wcd6d + text_ram wNameBuffer text " will" cont "be traded." done diff --git a/data/text/text_3.asm b/data/text/text_3.asm index 1d40d6b7..ba09a0f6 100644 --- a/data/text/text_3.asm +++ b/data/text/text_3.asm @@ -40,7 +40,7 @@ _EvolvedText:: _IntoText:: text_start line "into @" - text_ram wcd6d + text_ram wNameBuffer text "!" done @@ -181,14 +181,14 @@ _MimicLearnedMoveText:: text "" line "learned" cont "@" - text_ram wcd6d + text_ram wNameBuffer text "!" prompt _MoveWasDisabledText:: text "'s" line "@" - text_ram wcd6d + text_ram wNameBuffer text " was" cont "disabled!" prompt @@ -291,7 +291,7 @@ _TransformedText:: text "" line "transformed into" cont "@" - text_ram wcd6d + text_ram wNameBuffer text "!" prompt diff --git a/data/text/text_4.asm b/data/text/text_4.asm index 39c7ab91..f1c73a88 100644 --- a/data/text/text_4.asm +++ b/data/text/text_4.asm @@ -4,7 +4,7 @@ _PokemartGreetingText:: done _PokemonFaintedText:: - text_ram wcd6d + text_ram wNameBuffer text_start line "fainted!" done @@ -145,7 +145,7 @@ _ForgotAndText:: text_ram wLearnMoveMonName text " forgot" line "@" - text_ram wcd6d + text_ram wNameBuffer text "!" para "And..." diff --git a/data/text/text_5.asm b/data/text/text_5.asm index fb0cac66..1eee599c 100644 --- a/data/text/text_5.asm +++ b/data/text/text_5.asm @@ -9,13 +9,13 @@ _CableClubNPCMakingPreparationsText:: done _UsedStrengthText:: - text_ram wcd6d + text_ram wNameBuffer text " used" line "STRENGTH.@" text_end _CanMoveBouldersText:: - text_ram wcd6d + text_ram wNameBuffer text " can" line "move boulders." prompt @@ -41,13 +41,13 @@ _WarpToLastPokemonCenterText:: done _CannotUseTeleportNowText:: - text_ram wcd6d + text_ram wNameBuffer text " can't" line "use TELEPORT now." prompt _CannotFlyHereText:: - text_ram wcd6d + text_ram wNameBuffer text " can't" line "FLY here." prompt @@ -75,7 +75,7 @@ _CannotGetOffHereText:: _GotMonText:: text " got" line "@" - text_ram wcd6d + text_ram wNameBuffer text "!@" text_end diff --git a/data/text/text_6.asm b/data/text/text_6.asm index 194afa7b..8109b659 100644 --- a/data/text/text_6.asm +++ b/data/text/text_6.asm @@ -59,7 +59,7 @@ _ItemUseBallText06:: _SurfingGotOnText:: text " got on" line "@" - text_ram wcd6d + text_ram wNameBuffer text "!" prompt @@ -69,7 +69,7 @@ _SurfingNoPlaceToGetOffText:: prompt _VitaminStatRoseText:: - text_ram wcd6d + text_ram wNameBuffer text "'s" line "@" text_ram wStringBuffer @@ -174,7 +174,7 @@ _TeachMachineMoveText:: done _MonCannotLearnMachineMoveText:: - text_ram wcd6d + text_ram wNameBuffer text " is not" line "compatible with" cont "@" @@ -220,7 +220,7 @@ _NoCyclingAllowedHereText:: _NoSurfingHereText:: text "No SURFing on" line "@" - text_ram wcd6d + text_ram wNameBuffer text " here!" prompt diff --git a/data/text/text_7.asm b/data/text/text_7.asm index fcb27d20..54629faf 100644 --- a/data/text/text_7.asm +++ b/data/text/text_7.asm @@ -29,7 +29,7 @@ _GotOffBicycleText2:: _ThrewAwayItemText:: text "Threw away" line "@" - text_ram wcd6d + text_ram wNameBuffer text "." prompt @@ -46,7 +46,7 @@ _TooImportantToTossText:: prompt _AlreadyKnowsText:: - text_ram wcd6d + text_ram wNameBuffer text " knows" line "@" text_ram wStringBuffer @@ -194,7 +194,7 @@ _NothingToCutText:: prompt _UsedCutText:: - text_ram wcd6d + text_ram wNameBuffer text " hacked" line "away with CUT!" prompt diff --git a/engine/battle/core.asm b/engine/battle/core.asm index ab4d1c56..ae399a01 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -2878,7 +2878,7 @@ PrintMenuItem: add hl, bc ld a, [hl] and $3f - ld [wcd6d], a + ld [wBattleMenuCurrentPP], a ; print TYPE/ and / hlcoord 1, 9 ld de, TypeText @@ -2888,7 +2888,7 @@ PrintMenuItem: hlcoord 5, 9 ld [hl], "/" hlcoord 5, 11 - ld de, wcd6d + ld de, wBattleMenuCurrentPP lb bc, 1, 2 call PrintNumber hlcoord 8, 11 @@ -5631,7 +5631,7 @@ EnemyCanExecuteChargingMove: ld a, MOVE_NAME ld [wNameListType], a call GetName - ld de, wcd6d + ld de, wNameBuffer call CopyToStringBuffer EnemyCanExecuteMove: xor a @@ -6111,7 +6111,7 @@ GetCurrentMove: ld a, MOVE_NAME ld [wNameListType], a call GetName - ld de, wcd6d + ld de, wNameBuffer jp CopyToStringBuffer LoadEnemyMonData: @@ -6247,7 +6247,7 @@ LoadEnemyMonData: ld a, [wEnemyMonSpecies2] ld [wd11e], a call GetMonName - ld hl, wcd6d + ld hl, wNameBuffer ld de, wEnemyMonNick ld bc, NAME_LENGTH call CopyData diff --git a/engine/battle/get_trainer_name.asm b/engine/battle/get_trainer_name.asm index b2daebfe..82be49e0 100644 --- a/engine/battle/get_trainer_name.asm +++ b/engine/battle/get_trainer_name.asm @@ -17,8 +17,8 @@ GetTrainerName_:: ld a, BANK(TrainerNames) ld [wPredefBank], a call GetName - ld hl, wcd6d + ld hl, wNameBuffer .foundName ld de, wTrainerName - ld bc, $d + ld bc, ITEM_NAME_LENGTH jp CopyData diff --git a/engine/battle/misc.asm b/engine/battle/misc.asm index 4feef343..fe784dd6 100644 --- a/engine/battle/misc.asm +++ b/engine/battle/misc.asm @@ -14,10 +14,10 @@ FormatMovesString: ld a, MOVE_NAME ld [wNameListType], a call GetName - ld hl, wcd6d + ld hl, wNameBuffer .copyNameLoop ld a, [hli] - cp $50 + cp "@" jr z, .doneCopyingName ld [de], a inc de @@ -26,7 +26,7 @@ FormatMovesString: ld a, b ld [wNumMovesMinusOne], a inc b - ld a, $4e ; line break + ld a, "" ld [de], a inc de pop hl @@ -42,7 +42,7 @@ FormatMovesString: ld a, b cp NUM_MOVES jr z, .done - ld a, $4e ; line break + ld a, "" ld [de], a inc de jr .printDashLoop diff --git a/engine/battle/move_effects/pay_day.asm b/engine/battle/move_effects/pay_day.asm index fa373038..9aab3feb 100644 --- a/engine/battle/move_effects/pay_day.asm +++ b/engine/battle/move_effects/pay_day.asm @@ -1,6 +1,6 @@ PayDayEffect_: xor a - ld hl, wcd6d + ld hl, wPayDayMoney ld [hli], a ldh a, [hWhoseTurn] and a @@ -21,7 +21,7 @@ PayDayEffect_: ld b, $4 call Divide ldh a, [hQuotient + 3] - ld [hli], a + ld [hli], a ; wPayDayMoney + 1 ldh a, [hRemainder] ldh [hDividend + 3], a ld a, 10 @@ -33,7 +33,7 @@ PayDayEffect_: ld b, a ldh a, [hRemainder] add b - ld [hl], a + ld [hl], a ; wPayDayMoney + 2 ld de, wTotalPayDayMoney + 2 ld c, $3 predef AddBCDPredef diff --git a/engine/battle/save_trainer_name.asm b/engine/battle/save_trainer_name.asm index 4d40fd82..b25d5a11 100644 --- a/engine/battle/save_trainer_name.asm +++ b/engine/battle/save_trainer_name.asm @@ -9,7 +9,7 @@ SaveTrainerName:: ld a, [hli] ld h, [hl] ld l, a - ld de, wcd6d + ld de, wNameBuffer .CopyCharacter ld a, [hli] ld [de], a diff --git a/engine/events/cinnabar_lab.asm b/engine/events/cinnabar_lab.asm index eb82a5b1..171fa99a 100644 --- a/engine/events/cinnabar_lab.asm +++ b/engine/events/cinnabar_lab.asm @@ -104,7 +104,7 @@ PrintFossilsInBag: ldh a, [hItemCounter] ld bc, SCREEN_WIDTH * 2 call AddNTimes - ld de, wcd6d + ld de, wNameBuffer call PlaceString ld hl, hItemCounter inc [hl] diff --git a/engine/events/heal_party.asm b/engine/events/heal_party.asm index b26bc90f..0c6ec1ea 100644 --- a/engine/events/heal_party.asm +++ b/engine/events/heal_party.asm @@ -37,10 +37,10 @@ HealParty: ld hl, Moves ld bc, MOVE_LENGTH call AddNTimes - ld de, wcd6d + ld de, wMoveData ld a, BANK(Moves) call FarCopyData - ld a, [wcd6d + 5] ; PP is byte 5 of move data + ld a, [wMoveData + MOVE_PP] pop bc pop de diff --git a/engine/events/in_game_trades.asm b/engine/events/in_game_trades.asm index 54588e7d..c62225ba 100644 --- a/engine/events/in_game_trades.asm +++ b/engine/events/in_game_trades.asm @@ -79,7 +79,7 @@ InGameTrade_GetMonName: push de ld [wd11e], a call GetMonName - ld hl, wcd6d + ld hl, wNameBuffer pop de ld bc, NAME_LENGTH jp CopyData diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index e771504d..0c339451 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -2493,10 +2493,10 @@ GetMaxPP: ld hl, Moves ld bc, MOVE_LENGTH call AddNTimes - ld de, wcd6d + ld de, wMoveData ld a, BANK(Moves) call FarCopyData - ld de, wcd6d + 5 ; PP is byte 5 of move data + ld de, wMoveData + MOVE_PP ld a, [de] ld b, a ; b = normal max PP pop hl diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm index ccbe0225..a9840268 100644 --- a/engine/items/town_map.asm +++ b/engine/items/town_map.asm @@ -1,5 +1,7 @@ DEF NOT_VISITED EQU $fe +DEF BIRD_BASE_TILE EQU $04 + DisplayTownMap: call LoadTownMap ld hl, wUpdateSpritesEnabled @@ -12,15 +14,15 @@ DisplayTownMap: ld a, [wCurMap] push af ld b, $0 - call DrawPlayerOrBirdSprite ; player sprite + call DrawPlayerOrBirdSprite hlcoord 1, 0 - ld de, wcd6d + ld de, wNameBuffer call PlaceString ld hl, wShadowOAM ld de, wTileMapBackup ld bc, $10 call CopyData - ld hl, vSprites tile $04 + ld hl, vSprites tile BIRD_BASE_TILE ld de, TownMapCursor lb bc, BANK(TownMapCursor), (TownMapCursorEnd - TownMapCursor) / $8 call CopyVideoDataDouble @@ -50,15 +52,15 @@ DisplayTownMap: ld hl, wShadowOAMSprite04 call WriteTownMapSpriteOAM ; town map cursor sprite pop hl - ld de, wcd6d + ld de, wNameBuffer .copyMapName ld a, [hli] ld [de], a inc de - cp $50 + cp "@" jr nz, .copyMapName hlcoord 1, 0 - ld de, wcd6d + ld de, wNameBuffer call PlaceString ld hl, wShadowOAMSprite04 ld de, wTileMapBackup + 16 @@ -142,7 +144,7 @@ LoadTownMap_Fly:: call LoadPlayerSpriteGraphics call LoadFontTilePatterns ld de, BirdSprite - ld hl, vSprites tile $04 + ld hl, vSprites tile BIRD_BASE_TILE lb bc, BANK(BirdSprite), 12 call CopyVideoData ld de, TownMapUpArrow @@ -173,10 +175,10 @@ LoadTownMap_Fly:: call ClearScreenArea pop hl ld a, [hl] - ld b, $4 - call DrawPlayerOrBirdSprite ; draw bird sprite + ld b, BIRD_BASE_TILE + call DrawPlayerOrBirdSprite hlcoord 3, 0 - ld de, wcd6d + ld de, wNameBuffer call PlaceString ld c, 15 call DelayFrames @@ -356,7 +358,7 @@ DrawPlayerOrBirdSprite: call TownMapCoordsToOAMCoords call WritePlayerOrBirdSpriteOAM pop hl - ld de, wcd6d + ld de, wNameBuffer .loop ld a, [hli] ld [de], a diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index e5796e53..9dd66de5 100644 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -699,7 +699,7 @@ TradeCenter_Trade: ld a, [hl] ld [wd11e], a call GetMonName - ld hl, wcd6d + ld hl, wNameBuffer ld de, wNameOfPlayerMonToBeTraded ld bc, NAME_LENGTH call CopyData diff --git a/engine/menus/league_pc.asm b/engine/menus/league_pc.asm index 08ff22e4..27bccbb5 100644 --- a/engine/menus/league_pc.asm +++ b/engine/menus/league_pc.asm @@ -89,7 +89,7 @@ LeaguePCShowMon: ld [wWholeScreenPaletteMonSpecies], a ld a, [hli] ld [wHoFMonLevel], a - ld de, wcd6d + ld de, wNameBuffer ld bc, NAME_LENGTH call CopyData ld b, SET_PAL_POKEMON_WHOLE_SCREEN diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index f5120518..85447300 100644 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -45,7 +45,7 @@ AskName: .declinedNickname ld d, h ld e, l - ld hl, wcd6d + ld hl, wNameBuffer ld bc, NAME_LENGTH jp CopyData diff --git a/engine/menus/party_menu.asm b/engine/menus/party_menu.asm index 50a9838c..6c8cd6eb 100644 --- a/engine/menus/party_menu.asm +++ b/engine/menus/party_menu.asm @@ -121,19 +121,19 @@ RedrawPartyMenu_:: rl b ld c, a add hl, bc - ld de, wcd6d + ld de, wEvoDataBuffer ld a, BANK(EvosMovesPointerTable) ld bc, 2 call FarCopyData - ld hl, wcd6d + ld hl, wEvoDataBuffer ld a, [hli] ld h, [hl] ld l, a - ld de, wcd6d + ld de, wEvoDataBuffer ld a, BANK(EvosMovesPointerTable) ld bc, 4 * 3 + 1 ; enough for Eevee's three 4-byte evolutions and 0 terminator call FarCopyData - ld hl, wcd6d + ld hl, wEvoDataBuffer ld de, .notAbleToEvolveText ; loop through the pokemon's evolution entries .checkEvolutionsLoop diff --git a/engine/movie/hall_of_fame.asm b/engine/movie/hall_of_fame.asm index d37d95f8..6dd9aab1 100644 --- a/engine/movie/hall_of_fame.asm +++ b/engine/movie/hall_of_fame.asm @@ -165,7 +165,7 @@ HoFDisplayMonInfo: ld de, HoFMonInfoText call PlaceString hlcoord 1, 4 - ld de, wcd6d + ld de, wNameBuffer call PlaceString ld a, [wHoFMonLevel] hlcoord 8, 7 @@ -275,7 +275,7 @@ HoFRecordMonInfo: ld [hli], a ld e, l ld d, h - ld hl, wcd6d + ld hl, wNameBuffer ld bc, NAME_LENGTH jp CopyData diff --git a/engine/movie/oak_speech/oak_speech2.asm b/engine/movie/oak_speech/oak_speech2.asm index 95ebcabe..40c75f62 100644 --- a/engine/movie/oak_speech/oak_speech2.asm +++ b/engine/movie/oak_speech/oak_speech2.asm @@ -72,7 +72,7 @@ OakSpeechSlidePicLeft: ld c, 10 call DelayFrames pop de - ld hl, wcd6d + ld hl, wNameBuffer ld bc, NAME_LENGTH call CopyData call Delay3 @@ -209,7 +209,7 @@ GetDefaultName: .foundName ld h, d ld l, e - ld de, wcd6d + ld de, wNameBuffer ld bc, NAME_BUFFER_LENGTH jp CopyData diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm index 9d168cc7..931538c0 100644 --- a/engine/movie/trade.asm +++ b/engine/movie/trade.asm @@ -188,7 +188,7 @@ LoadTradingGFXAndMonNames: ld a, [wTradedPlayerMonSpecies] ld [wd11e], a call GetMonName - ld hl, wcd6d + ld hl, wNameBuffer ld de, wStringBuffer ld bc, NAME_LENGTH call CopyData diff --git a/engine/movie/trade2.asm b/engine/movie/trade2.asm index 98d1158e..a564862b 100644 --- a/engine/movie/trade2.asm +++ b/engine/movie/trade2.asm @@ -32,7 +32,7 @@ Trade_PrintEnemyMonInfoText: lb bc, LEADING_ZEROES | 1, 3 call PrintNumber hlcoord 5, 12 - ld de, wcd6d + ld de, wNameBuffer call PlaceString hlcoord 8, 14 ld de, wTradedEnemyMonOT diff --git a/engine/pokemon/add_mon.asm b/engine/pokemon/add_mon.asm index 0b7fb96c..73ba8071 100644 --- a/engine/pokemon/add_mon.asm +++ b/engine/pokemon/add_mon.asm @@ -261,13 +261,13 @@ AddPartyMon_WriteMovePP: ld hl, Moves ld bc, MOVE_LENGTH call AddNTimes - ld de, wcd6d + ld de, wMoveData ld a, BANK(Moves) call FarCopyData pop bc pop de pop hl - ld a, [wcd6d + 5] ; PP is byte 5 of move data + ld a, [wMoveData + MOVE_PP] .empty inc de ld [de], a diff --git a/engine/pokemon/evos_moves.asm b/engine/pokemon/evos_moves.asm index fa6930c1..1c7c328c 100644 --- a/engine/pokemon/evos_moves.asm +++ b/engine/pokemon/evos_moves.asm @@ -267,7 +267,7 @@ RenameEvolvedMon: call GetName pop af ld [wd0b5], a - ld hl, wcd6d + ld hl, wNameBuffer ld de, wStringBuffer .compareNamesLoop ld a, [de] @@ -283,7 +283,7 @@ RenameEvolvedMon: call AddNTimes push hl call GetName - ld hl, wcd6d + ld hl, wNameBuffer pop de jp CopyData diff --git a/engine/pokemon/learn_move.asm b/engine/pokemon/learn_move.asm index 0377caa4..981fe13a 100644 --- a/engine/pokemon/learn_move.asm +++ b/engine/pokemon/learn_move.asm @@ -3,7 +3,7 @@ LearnMove: ld a, [wWhichPokemon] ld hl, wPartyMonNicks call GetPartyMonName - ld hl, wcd6d + ld hl, wNameBuffer ld de, wLearnMoveMonName ld bc, NAME_LENGTH call CopyData diff --git a/home/list_menu.asm b/home/list_menu.asm index 1629b188..3d864222 100644 --- a/home/list_menu.asm +++ b/home/list_menu.asm @@ -156,7 +156,7 @@ DisplayListMenuIDLoop:: ld a, [wWhichPokemon] call GetPartyMonName .storeChosenEntry ; store the menu entry that the player chose and return - ld de, wcd6d + ld de, wNameBuffer call CopyToStringBuffer ld a, CHOSE_MENU_ITEM ld [wMenuExitMethod], a diff --git a/home/names.asm b/home/names.asm index f7751fa0..2e5e1501 100644 --- a/home/names.asm +++ b/home/names.asm @@ -8,14 +8,14 @@ GetMonName:: ld a, [wd11e] dec a ld hl, MonsterNames - ld c, 10 + ld c, NAME_LENGTH - 1 ld b, 0 call AddNTimes - ld de, wcd6d + ld de, wNameBuffer push de - ld bc, 10 + ld bc, NAME_LENGTH - 1 call CopyData - ld hl, wcd6d + 10 + ld hl, wNameBuffer + NAME_LENGTH - 1 ld [hl], "@" pop de pop af @@ -25,8 +25,7 @@ GetMonName:: ret GetItemName:: -; given an item ID at [wd11e], store the name of the item into a string -; starting at wcd6d +; given an item ID at [wd11e], store the name of the item in wNameBuffer push hl push bc ld a, [wd11e] @@ -44,13 +43,13 @@ GetItemName:: .Machine call GetMachineName .Finish - ld de, wcd6d ; pointer to where item name is stored in RAM + ld de, wNameBuffer pop bc pop hl ret GetMachineName:: -; copies the name of the TM/HM in [wd11e] to wcd6d +; copies the name of the TM/HM in [wd11e] to wNameBuffer push hl push de push bc @@ -69,7 +68,7 @@ GetMachineName:: ld hl, TechnicalPrefix ; points to "TM" ld bc, 2 .WriteMachinePrefix - ld de, wcd6d + ld de, wNameBuffer call CopyData ; now get the machine number and convert it to text @@ -136,6 +135,6 @@ GetMoveName:: ld a, BANK(MoveNames) ld [wPredefBank], a call GetName - ld de, wcd6d ; pointer to where move name is stored in RAM + ld de, wNameBuffer pop hl ret diff --git a/home/names2.asm b/home/names2.asm index c27739d7..cd3823fd 100644 --- a/home/names2.asm +++ b/home/names2.asm @@ -83,7 +83,7 @@ GetName:: jr nz, .nextName ld h, d ld l, e - ld de, wcd6d + ld de, wNameBuffer ld bc, NAME_BUFFER_LENGTH call CopyData .gotPtr diff --git a/home/pokemon.asm b/home/pokemon.asm index 131fbd85..b228f086 100644 --- a/home/pokemon.asm +++ b/home/pokemon.asm @@ -435,7 +435,7 @@ GetMonHeader:: ld [MBC1RomBank], a ret -; copy party pokemon's name to wcd6d +; copy party pokemon's name to wNameBuffer GetPartyMonName2:: ld a, [wWhichPokemon] ; index within party ld hl, wPartyMonNicks @@ -445,7 +445,7 @@ GetPartyMonName:: push hl push bc call SkipFixedLengthTextEntries ; add NAME_LENGTH to hl, a times - ld de, wcd6d + ld de, wNameBuffer push de ld bc, NAME_LENGTH call CopyData diff --git a/ram/wram.asm b/ram/wram.asm index 4ff730dd..3bdf5a7b 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -876,16 +876,28 @@ wDownscaledMonSize:: wNumMovesMinusOne:: db UNION -wcd6d:: ds NAME_BUFFER_LENGTH ; buffer for various data +; storage buffer for various name strings +wNameBuffer:: ds NAME_BUFFER_LENGTH NEXTU - ds 4 -; temp variable used to print a move's current PP on the status screen +; data copied from Moves for one move +wMoveData:: ds MOVE_LENGTH + +NEXTU +; amount of money made from one use of Pay Day +wPayDayMoney:: ds 3 + +NEXTU +; evolution data for one mon +wEvoDataBuffer:: ds 4 * 3 + 1 ; enough for Eevee's three 4-byte evolutions and 0 terminator + +NEXTU +wBattleMenuCurrentPP:: db + ds 3 wStatusScreenCurrentPP:: db ds 6 ; list of normal max PP (without PP up) values wNormalMaxPPList:: ds NUM_MOVES - ds 5 ENDU UNION diff --git a/scripts/CeladonMartRoof.asm b/scripts/CeladonMartRoof.asm index 73c12805..b5960c81 100644 --- a/scripts/CeladonMartRoof.asm +++ b/scripts/CeladonMartRoof.asm @@ -198,7 +198,7 @@ CeladonMartRoofScript_PrintDrinksInBag: ldh a, [hItemCounter] ld bc, SCREEN_WIDTH * 2 call AddNTimes - ld de, wcd6d + ld de, wNameBuffer call PlaceString ld hl, hItemCounter inc [hl] diff --git a/scripts/Route15Gate2F.asm b/scripts/Route15Gate2F.asm index 0e04367b..ad1434dc 100644 --- a/scripts/Route15Gate2F.asm +++ b/scripts/Route15Gate2F.asm @@ -16,7 +16,7 @@ Route15Gate2FOaksAideText: ldh [hOaksAideRewardItem], a ld [wd11e], a call GetItemName - ld hl, wcd6d + ld hl, wNameBuffer ld de, wOaksAideRewardItemName ld bc, ITEM_NAME_LENGTH call CopyData diff --git a/scripts/Route23.asm b/scripts/Route23.asm index 044d5e50..da0acfea 100644 --- a/scripts/Route23.asm +++ b/scripts/Route23.asm @@ -81,7 +81,7 @@ Route23CopyBadgeTextScript: ld a, [hli] ld h, [hl] ld l, a - ld de, wcd6d + ld de, wNameBuffer .copyTextLoop ld a, [hli] ld [de], a diff --git a/scripts/Route2Gate.asm b/scripts/Route2Gate.asm index a198dbd7..8522a149 100644 --- a/scripts/Route2Gate.asm +++ b/scripts/Route2Gate.asm @@ -16,7 +16,7 @@ Route2GateOaksAideText: ldh [hOaksAideRewardItem], a ld [wd11e], a call GetItemName - ld hl, wcd6d + ld hl, wNameBuffer ld de, wOaksAideRewardItemName ld bc, ITEM_NAME_LENGTH call CopyData diff --git a/text/ChampionsRoom.asm b/text/ChampionsRoom.asm index 92f23f69..9e62e5de 100644 --- a/text/ChampionsRoom.asm +++ b/text/ChampionsRoom.asm @@ -96,7 +96,7 @@ _ChampionsRoomOakCongratulatesPlayerText:: line "much since you" cont "first left with" cont "@" - text_ram wcd6d + text_ram wNameBuffer text "!" para ", you have" diff --git a/text/CinnabarLabFossilRoom.asm b/text/CinnabarLabFossilRoom.asm index 6701bbd0..be0bc947 100644 --- a/text/CinnabarLabFossilRoom.asm +++ b/text/CinnabarLabFossilRoom.asm @@ -38,7 +38,7 @@ _CinnabarLabFossilRoomScientist1FossilIsBackToLifeText:: _CinnabarLabFossilRoomScientist1SeesFossilText:: text "Oh! That is" line "@" - text_ram wcd6d + text_ram wNameBuffer text "!" para "It is fossil of" @@ -60,7 +60,7 @@ _CinnabarLabFossilRoomScientist1TakesFossilText:: para " handed" line "over @" - text_ram wcd6d + text_ram wNameBuffer text "!" prompt diff --git a/text/Daycare.asm b/text/Daycare.asm index 87cde965..be9b8eab 100644 --- a/text/Daycare.asm +++ b/text/Daycare.asm @@ -13,7 +13,7 @@ _DaycareGentlemanWhichMonText:: _DaycareGentlemanWillLookAfterMonText:: text "Fine, I'll look" line "after @" - text_ram wcd6d + text_ram wNameBuffer text_start cont "for a while." prompt @@ -25,7 +25,7 @@ _DaycareGentlemanComeSeeMeInAWhileText:: _DaycareGentlemanMonHasGrownText:: text "Your @" - text_ram wcd6d + text_ram wNameBuffer text_start line "has grown a lot!" @@ -55,7 +55,7 @@ _DaycareGentlemanGotMonBackText:: _DaycareGentlemanMonNeedsMoreTimeText:: text "Back already?" line "Your @" - text_ram wcd6d + text_ram wNameBuffer text_start cont "needs some more" cont "time with me." diff --git a/text/NameRatersHouse.asm b/text/NameRatersHouse.asm index 106a2cf0..3d2d5eaa 100644 --- a/text/NameRatersHouse.asm +++ b/text/NameRatersHouse.asm @@ -14,7 +14,7 @@ _NameRatersHouseNameRaterWhichPokemonText:: prompt _NameRatersHouseNameRaterGiveItANiceNameText:: - text_ram wcd6d + text_ram wNameBuffer text ", is it?" line "That is a decent" cont "nickname!" @@ -48,13 +48,13 @@ _NameRatersHouseNameRaterComeAnyTimeYouLikeText:: done _NameRatersHouseNameRaterATrulyImpeccableNameText:: - text_ram wcd6d + text_ram wNameBuffer text ", is it?" line "That is a truly" cont "impeccable name!" para "Take good care of" line "@" - text_ram wcd6d + text_ram wNameBuffer text "!" done diff --git a/text/OaksLab.asm b/text/OaksLab.asm index 11accbd4..e839149e 100644 --- a/text/OaksLab.asm +++ b/text/OaksLab.asm @@ -51,7 +51,7 @@ _OaksLabMonEnergeticText:: _OaksLabReceivedMonText:: text " received" line "a @" - text_ram wcd6d + text_ram wNameBuffer text "!@" text_end @@ -243,7 +243,7 @@ _OaksLabRivalIllTakeThisOneText:: _OaksLabRivalReceivedMonText:: text " received" line "a @" - text_ram wcd6d + text_ram wNameBuffer text "!@" text_end diff --git a/text/Route23.asm b/text/Route23.asm index 921b6407..cdccbf93 100644 --- a/text/Route23.asm +++ b/text/Route23.asm @@ -2,12 +2,12 @@ _Route23YouDontHaveTheBadgeYetText:: text "You can pass here" line "only if you have" cont "the @" - text_ram wcd6d + text_ram wNameBuffer text "!" para "You don't have the" line "@" - text_ram wcd6d + text_ram wNameBuffer text " yet!" para "You have to have" @@ -19,12 +19,12 @@ _Route23OhThatIsTheBadgeText:: text "You can pass here" line "only if you have" cont "the @" - text_ram wcd6d + text_ram wNameBuffer text "!" para "Oh! That is the" line "@" - text_ram wcd6d + text_ram wNameBuffer text "!@" text_end -- cgit v1.3.1-sl0p From 613d34678b7e9da1a467ec48fff23bfa75209871 Mon Sep 17 00:00:00 2001 From: Sylvie <35663410+Rangi42@users.noreply.github.com> Date: Wed, 18 Sep 2024 21:01:18 -0400 Subject: Split `hSpriteIndexOrTextID` into `hSpriteIndex` and `hTextID` (#462) Also identify `wPPUpCountAndMaxPP` --- data/text/text_2.asm | 2 +- engine/battle/battle_transitions.asm | 2 +- engine/battle/wild_encounters.asm | 2 +- engine/events/card_key.asm | 4 ++-- engine/events/hidden_objects/safari_game.asm | 2 +- engine/events/pick_up_item.asm | 4 ++-- engine/events/poison.asm | 4 ++-- engine/events/prize_menu.asm | 21 ++++++++---------- engine/items/item_effects.asm | 7 +++--- engine/menus/display_text_id_init.asm | 2 +- engine/overworld/push_boulder.asm | 6 +++--- home/overworld.asm | 20 ++++++++--------- home/predef_text.asm | 2 +- home/text.asm | 4 ++-- home/text_script.asm | 9 ++++---- home/trainers.asm | 4 ++-- home/uncompress.asm | 2 +- ram/hram.asm | 2 +- ram/wram.asm | 1 + scripts/AgathasRoom.asm | 4 ++-- scripts/BillsHouse.asm | 2 +- scripts/BrunosRoom.asm | 4 ++-- scripts/CeladonGym.asm | 6 +++--- scripts/CeruleanCity.asm | 10 ++++----- scripts/CeruleanGym.asm | 6 +++--- scripts/ChampionsRoom.asm | 12 +++++------ scripts/CinnabarGym.asm | 12 +++++------ scripts/CinnabarIsland.asm | 2 +- scripts/FightingDojo.asm | 6 +++--- scripts/FuchsiaGym.asm | 6 +++--- scripts/GameCorner.asm | 2 +- scripts/GameCornerPrizeRoom.asm | 1 + scripts/HallOfFame.asm | 2 +- scripts/LancesRoom.asm | 4 ++-- scripts/LoreleisRoom.asm | 4 ++-- scripts/MtMoonB2F.asm | 4 ++-- scripts/Museum1F.asm | 2 +- scripts/OaksLab.asm | 32 ++++++++++++++-------------- scripts/PalletTown.asm | 4 ++-- scripts/PewterCity.asm | 6 +++--- scripts/PewterGym.asm | 6 +++--- scripts/PokemonMansion1F.asm | 2 +- scripts/PokemonMansion2F.asm | 2 +- scripts/PokemonMansion3F.asm | 2 +- scripts/PokemonMansionB1F.asm | 2 +- scripts/PokemonTower2F.asm | 4 ++-- scripts/PokemonTower5F.asm | 2 +- scripts/PokemonTower6F.asm | 4 ++-- scripts/PokemonTower7F.asm | 2 +- scripts/RocketHideoutB4F.asm | 2 +- scripts/Route12.asm | 4 ++-- scripts/Route16.asm | 4 ++-- scripts/Route16Gate1F.asm | 4 ++-- scripts/Route18Gate1F.asm | 4 ++-- scripts/Route22.asm | 8 +++---- scripts/Route22Gate.asm | 2 +- scripts/Route23.asm | 2 +- scripts/Route24.asm | 6 +++--- scripts/Route5Gate.asm | 4 ++-- scripts/Route6Gate.asm | 4 ++-- scripts/Route7Gate.asm | 4 ++-- scripts/Route8Gate.asm | 4 ++-- scripts/SSAnne2F.asm | 4 ++-- scripts/SafariZoneGate.asm | 8 +++---- scripts/SaffronGym.asm | 6 +++--- scripts/SilphCo11F.asm | 4 ++-- scripts/SilphCo7F.asm | 6 +++--- scripts/VermilionCity.asm | 2 +- scripts/VermilionGym.asm | 6 +++--- scripts/ViridianCity.asm | 6 +++--- scripts/ViridianGym.asm | 6 +++--- scripts/ViridianMart.asm | 4 ++-- scripts/WardensHouse.asm | 2 +- 73 files changed, 182 insertions(+), 181 deletions(-) (limited to 'data/text') diff --git a/data/text/text_2.asm b/data/text/text_2.asm index 4362e0f2..df28740d 100644 --- a/data/text/text_2.asm +++ b/data/text/text_2.asm @@ -1781,7 +1781,7 @@ _WillBeTradedText:: done _TextIDErrorText:: - text_decimal hSpriteIndexOrTextID, 1, 2 + text_decimal hTextID, 1, 2 text " ERROR." done diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index 16311f48..5956d875 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -11,7 +11,7 @@ BattleTransition: ; Determine which OAM block is being used by the enemy trainer sprite (if there ; is one). ld hl, wSpritePlayerStateData1ImageIndex - ldh a, [hSpriteIndexOrTextID] ; enemy trainer sprite index (0 if wild battle) + ldh a, [hSpriteIndex] ; enemy trainer sprite index (0 if wild battle) ld c, a ld b, 0 ld de, $10 diff --git a/engine/battle/wild_encounters.asm b/engine/battle/wild_encounters.asm index ea451bcf..b5cf9f51 100644 --- a/engine/battle/wild_encounters.asm +++ b/engine/battle/wild_encounters.asm @@ -90,7 +90,7 @@ TryDoWildEncounter: .lastRepelStep ld [wRepelRemainingSteps], a ld a, TEXT_REPEL_WORE_OFF - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call EnableAutoTextBoxDrawing call DisplayTextID .CantEncounter2 diff --git a/engine/events/card_key.asm b/engine/events/card_key.asm index b052d3e2..1597e12b 100644 --- a/engine/events/card_key.asm +++ b/engine/events/card_key.asm @@ -28,7 +28,7 @@ PrintCardKeyText: call GetCoordsInFrontOfPlayer push de tx_pre_id CardKeySuccessText - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call PrintPredefTextID pop de srl d @@ -55,7 +55,7 @@ PrintCardKeyText: jp PlaySound .noCardKey tx_pre_id CardKeyFailText - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp PrintPredefTextID INCLUDE "data/events/card_key_maps.asm" diff --git a/engine/events/hidden_objects/safari_game.asm b/engine/events/hidden_objects/safari_game.asm index 6fac1afa..fc014ce0 100644 --- a/engine/events/hidden_objects/safari_game.asm +++ b/engine/events/hidden_objects/safari_game.asm @@ -41,7 +41,7 @@ SafariZoneGameOver: cp SFX_SAFARI_ZONE_PA jr nz, .waitForMusicToPlay ld a, TEXT_SAFARI_GAME_OVER - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID xor a ld [wPlayerMovingDirection], a diff --git a/engine/events/pick_up_item.asm b/engine/events/pick_up_item.asm index 548db5be..8fbdcfa2 100644 --- a/engine/events/pick_up_item.asm +++ b/engine/events/pick_up_item.asm @@ -1,7 +1,7 @@ PickUpItem: call EnableAutoTextBoxDrawing - ldh a, [hSpriteIndexOrTextID] + ldh a, [hSpriteIndex] ld b, a ld hl, wMissableObjectList .missableObjectsListLoop @@ -18,7 +18,7 @@ PickUpItem: ldh [hMissableObjectIndex], a ld hl, wMapSpriteExtraData - ldh a, [hSpriteIndexOrTextID] + ldh a, [hSpriteIndex] dec a add a ld d, 0 diff --git a/engine/events/poison.asm b/engine/events/poison.asm index 513d08a7..121bdc19 100644 --- a/engine/events/poison.asm +++ b/engine/events/poison.asm @@ -53,7 +53,7 @@ ApplyOutOfBattlePoisonDamage: ld [wJoyIgnore], a call EnableAutoTextBoxDrawing ld a, TEXT_MON_FAINTED - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID pop de pop hl @@ -100,7 +100,7 @@ ApplyOutOfBattlePoisonDamage: jr nz, .noBlackOut call EnableAutoTextBoxDrawing ld a, TEXT_BLACKED_OUT - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld hl, wStatusFlags4 set BIT_BATTLE_OVER_OR_BLACKOUT, [hl] diff --git a/engine/events/prize_menu.asm b/engine/events/prize_menu.asm index 4603b582..f99cdaaa 100644 --- a/engine/events/prize_menu.asm +++ b/engine/events/prize_menu.asm @@ -56,17 +56,14 @@ WhichPrizeTextPtr: text_end GetPrizeMenuId: -; determine which one among the three -; prize-texts has been selected -; using the text ID (stored in [hSpriteIndexOrTextID]) -; load the three prizes at wd13d-wd13f -; load the three prices at wd141-wd146 -; display the three prizes' names -; (distinguishing between Pokemon names -; and Items (specifically TMs) names) - ldh a, [hSpriteIndexOrTextID] - sub 3 ; prize-texts' id are 3, 4 and 5 - ld [wWhichPrizeWindow], a ; prize-texts' id (relative, i.e. 0, 1 or 2) +; determine which one among the three prize texts has been selected using the text ID (stored in [hTextID]) +; prize texts' IDs are TEXT_GAMECORNERPRIZEROOM_PRIZE_VENDOR_1-TEXT_GAMECORNERPRIZEROOM_PRIZE_VENDOR_3 +; load the three prizes at wPrize1-wPrice3 +; load the three prices at wPrize1Price-wPrize3Price +; display the three prizes' names, distinguishing between Pokemon names and item names (specifically TMs) + ldh a, [hTextID] + sub TEXT_GAMECORNERPRIZEROOM_PRIZE_VENDOR_1 + ld [wWhichPrizeWindow], a ; prize texts' relative ID (i.e. 0-2) add a add a ld d, 0 @@ -88,7 +85,7 @@ GetPrizeMenuId: ld bc, 6 call CopyData ld a, [wWhichPrizeWindow] - cp 2 ;is TM_menu? + cp 2 ; is TM_menu? jr nz, .putMonName ld a, [wPrize1] ld [wd11e], a diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm index 5b41516f..df050b03 100644 --- a/engine/items/item_effects.asm +++ b/engine/items/item_effects.asm @@ -688,11 +688,11 @@ ItemUseSurfboard: jp PrintText .tryToStopSurfing xor a - ldh [hSpriteIndexOrTextID], a + ldh [hSpriteIndex], a ld d, 16 ; talking range in pixels (normal range) call IsSpriteInFrontOfPlayer2 res 7, [hl] - ldh a, [hSpriteIndexOrTextID] + ldh a, [hSpriteIndex] and a ; is there a sprite in the way? jr nz, .cannotStopSurfing ld hl, TilePairCollisionsWater @@ -2512,9 +2512,10 @@ GetMaxPP: and %11000000 ; get PP Up count pop bc or b ; place normal max PP in 6 lower bits of a + assert wMoveData + MOVE_PP + 1 == wPPUpCountAndMaxPP ld h, d ld l, e - inc hl ; hl = wcd73 + inc hl ; hl = wPPUpCountAndMaxPP ld [hl], a xor a ; add the bonus for the existing PP Up count ld [wUsingPPUp], a diff --git a/engine/menus/display_text_id_init.asm b/engine/menus/display_text_id_init.asm index 7f2c1a59..a89696fb 100644 --- a/engine/menus/display_text_id_init.asm +++ b/engine/menus/display_text_id_init.asm @@ -5,7 +5,7 @@ DisplayTextIDInit:: ld a, [wAutoTextBoxDrawingControl] bit 0, a jr nz, .skipDrawingTextBoxBorder - ldh a, [hSpriteIndexOrTextID] ; text ID (or sprite ID) + ldh a, [hTextID] and a jr nz, .notStartMenu ; if text ID is 0 (i.e. the start menu) diff --git a/engine/overworld/push_boulder.asm b/engine/overworld/push_boulder.asm index 7eee844c..ff481439 100644 --- a/engine/overworld/push_boulder.asm +++ b/engine/overworld/push_boulder.asm @@ -6,15 +6,15 @@ TryPushingBoulder:: bit BIT_BOULDER_DUST, a ret nz xor a - ldh [hSpriteIndexOrTextID], a + ldh [hSpriteIndex], a call IsSpriteInFrontOfPlayer - ldh a, [hSpriteIndexOrTextID] + ldh a, [hSpriteIndex] ld [wBoulderSpriteIndex], a and a jp z, ResetBoulderPushFlags ld hl, wSpritePlayerStateData1MovementStatus ld d, $0 - ldh a, [hSpriteIndexOrTextID] + ldh a, [hSpriteIndex] swap a ld e, a add hl, de diff --git a/home/overworld.asm b/home/overworld.asm index 805a1b60..1595fdf0 100644 --- a/home/overworld.asm +++ b/home/overworld.asm @@ -76,7 +76,7 @@ OverworldLoopLessDelay:: jr z, .startButtonNotPressed ; if START is pressed xor a ; TEXT_START_MENU - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp .displayDialogue .startButtonNotPressed bit BIT_A_BUTTON, a @@ -92,7 +92,7 @@ OverworldLoopLessDelay:: and a jp z, OverworldLoop ; jump if a hidden object or bookshelf was found, but not if a card key door was found call IsSpriteOrSignInFrontOfPlayer - ldh a, [hSpriteIndexOrTextID] + ldh a, [hTextID] and a jp z, OverworldLoop .displayDialogue @@ -1072,11 +1072,11 @@ LoadEastWestConnectionsTileMap:: ret ; function to check if there is a sign or sprite in front of the player -; if so, it is stored in [hSpriteIndexOrTextID] -; if not, [hSpriteIndexOrTextID] is set to 0 +; if so, it is stored in [hTextID] +; if not, [hTextID] is set to 0 IsSpriteOrSignInFrontOfPlayer:: xor a - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a ld a, [wNumSigns] and a jr z, .extendRangeOverCounter @@ -1106,7 +1106,7 @@ IsSpriteOrSignInFrontOfPlayer:: dec c add hl, bc ld a, [hl] - ldh [hSpriteIndexOrTextID], a ; store sign text ID + ldh [hTextID], a ; store sign text ID pop bc pop hl ret @@ -1127,7 +1127,7 @@ IsSpriteOrSignInFrontOfPlayer:: jr nz, .counterTilesLoop ; part of the above function, but sometimes its called on its own, when signs are irrelevant -; the caller must zero [hSpriteIndexOrTextID] +; the caller must zero [hTextID] IsSpriteInFrontOfPlayer:: ld d, $10 ; talking range in pixels (normal range) IsSpriteInFrontOfPlayer2:: @@ -1212,7 +1212,7 @@ IsSpriteInFrontOfPlayer2:: ld l, a ; hl = x#SPRITESTATEDATA1_MOVEMENTSTATUS set 7, [hl] ; set flag to make the sprite face the player ld a, e - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a ret ; function to check if the player will jump down a ledge and check if the tile ahead is passable (when not surfing) @@ -1231,9 +1231,9 @@ CollisionCheckOnLand:: and d ; check if a sprite is in the direction the player is trying to go jr nz, .collision xor a - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call IsSpriteInFrontOfPlayer ; check for sprite collisions again? when does the above check fail to detect a sprite collision? - ldh a, [hSpriteIndexOrTextID] + ldh a, [hTextID] and a ; was there a sprite collision? jr nz, .collision ; if no sprite collision diff --git a/home/predef_text.asm b/home/predef_text.asm index 1537ad5b..bdecd3cf 100644 --- a/home/predef_text.asm +++ b/home/predef_text.asm @@ -1,5 +1,5 @@ PrintPredefTextID:: - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a ld hl, TextPredefs call SetMapTextPointer ld hl, wTextPredefFlag diff --git a/home/text.asm b/home/text.asm index e815fbf7..dc78b982 100644 --- a/home/text.asm +++ b/home/text.asm @@ -117,13 +117,13 @@ NullChar:: ; unused pop hl ; A "" character in a printed string ; displays an error message with the current value - ; of hSpriteIndexOrTextID in decimal format. + ; of hTextID in decimal format. ; This is a debugging leftover. ld de, TextIDErrorText dec de ret -TextIDErrorText:: ; "[hSpriteIndexOrTextID] ERROR." +TextIDErrorText:: ; "[hTextID] ERROR." text_far _TextIDErrorText text_end diff --git a/home/text_script.asm b/home/text_script.asm index 5c90a981..d367683d 100644 --- a/home/text_script.asm +++ b/home/text_script.asm @@ -1,6 +1,7 @@ ; this function is used to display sign messages, sprite dialog, etc. -; INPUT: [hSpriteIndexOrTextID] = sprite ID or text ID +; INPUT: [hSpriteIndex] = sprite ID or [hTextID] = text ID DisplayTextID:: + assert hSpriteIndex == hTextID ; these are at the same memory location ldh a, [hLoadedROMBank] push af farcall DisplayTextIDInit ; initialization @@ -18,7 +19,7 @@ DisplayTextID:: ld h, [hl] ld l, a ; hl = map text pointer ld d, $00 - ldh a, [hSpriteIndexOrTextID] ; text ID + ldh a, [hTextID] ld [wSpriteIndex], a dict TEXT_START_MENU, DisplayStartMenu @@ -29,7 +30,7 @@ DisplayTextID:: ld a, [wNumSprites] ld e, a - ldh a, [hSpriteIndexOrTextID] ; sprite ID + ldh a, [hSpriteIndex] ; sprite ID cp e jr z, .spriteHandling jr nc, .skipSpriteHandling @@ -42,7 +43,7 @@ DisplayTextID:: pop bc pop de ld hl, wMapSpriteData ; NPC text entries - ldh a, [hSpriteIndexOrTextID] + ldh a, [hSpriteIndex] dec a add a add l diff --git a/home/trainers.asm b/home/trainers.asm index 0038d48c..0a466cc1 100644 --- a/home/trainers.asm +++ b/home/trainers.asm @@ -7,7 +7,7 @@ StoreTrainerHeaderPointer:: ret ; executes the current map script from the function pointer array provided in de. -; a: map script index to execute (unless overridden by [wd733] bit 4) +; a: map script index to execute (unless overridden by [wStatusFlags7] BIT_USE_CUR_MAP_SCRIPT) ; hl: trainer header pointer ExecuteCurMapScriptInTable:: push af @@ -165,7 +165,7 @@ DisplayEnemyTrainerTextAndStartBattle:: ret nz ; return if the enemy trainer hasn't finished walking to the player's sprite ld [wJoyIgnore], a ld a, [wSpriteIndex] - ldh [hSpriteIndexOrTextID], a + ldh [hSpriteIndex], a call DisplayTextID ; fall through diff --git a/home/uncompress.asm b/home/uncompress.asm index d3d84b26..0e609f1c 100644 --- a/home/uncompress.asm +++ b/home/uncompress.asm @@ -52,7 +52,7 @@ _UncompressSpriteData:: ; bit 0 decides in which one the first chunk is placed ; fall through -; uncompresses a chunk from the sprite input data stream (pointed to at wd0da) into sSpriteBuffer1 or sSpriteBuffer2 +; uncompresses a chunk from the sprite input data stream (pointed to by wSpriteInputPtr) into sSpriteBuffer1 or sSpriteBuffer2 ; each chunk is a 1bpp sprite. A 2bpp sprite consist of two chunks which are merged afterwards ; note that this is an endless loop which is terminated during a call to MoveToNextBufferPosition by manipulating the stack UncompressSpriteDataLoop:: diff --git a/ram/hram.asm b/ram/hram.asm index 1a781da4..e7c3ef3c 100644 --- a/ram/hram.asm +++ b/ram/hram.asm @@ -16,7 +16,7 @@ hPreviousTileset:: hRLEByteValue:: db -hSpriteIndexOrTextID:: ; DisplayTextID's argument +hTextID:: ; DisplayTextID's argument hPartyMonIndex:: db diff --git a/ram/wram.asm b/ram/wram.asm index 8bfbfcf4..a4d75707 100644 --- a/ram/wram.asm +++ b/ram/wram.asm @@ -882,6 +882,7 @@ wNameBuffer:: ds NAME_BUFFER_LENGTH NEXTU ; data copied from Moves for one move wMoveData:: ds MOVE_LENGTH +wPPUpCountAndMaxPP:: db NEXTU ; amount of money made from one use of Pay Day diff --git a/scripts/AgathasRoom.asm b/scripts/AgathasRoom.asm index cf5254ac..0f3acc18 100644 --- a/scripts/AgathasRoom.asm +++ b/scripts/AgathasRoom.asm @@ -75,7 +75,7 @@ AgathasRoomDefaultScript: jr z, AgathaScriptWalkIntoRoom .stopPlayerFromLeaving ld a, TEXT_AGATHASROOM_AGATHA_DONT_RUN_AWAY - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, D_UP ld [wSimulatedJoypadStatesEnd], a @@ -111,7 +111,7 @@ AgathasRoomAgathaEndBattleScript: cp $ff jp z, ResetAgathaScript ld a, TEXT_AGATHASROOM_AGATHA - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, SCRIPT_CHAMPIONSROOM_PLAYER_ENTERS ld [wChampionsRoomCurScript], a diff --git a/scripts/BillsHouse.asm b/scripts/BillsHouse.asm index cf87ea64..86f79cb3 100644 --- a/scripts/BillsHouse.asm +++ b/scripts/BillsHouse.asm @@ -110,7 +110,7 @@ BillsHouseCleanupScript: BillsHousePCScript: ld a, TEXT_BILLSHOUSE_ACTIVATE_PC - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, SCRIPT_BILLSHOUSE_DEFAULT ld [wBillsHouseCurScript], a diff --git a/scripts/BrunosRoom.asm b/scripts/BrunosRoom.asm index 2a4ed6e6..94ec7d17 100644 --- a/scripts/BrunosRoom.asm +++ b/scripts/BrunosRoom.asm @@ -75,7 +75,7 @@ BrunosRoomDefaultScript: jr z, BrunoScriptWalkIntoRoom .stopPlayerFromLeaving ld a, TEXT_BRUNOSROOM_BRUNO_DONT_RUN_AWAY - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ; "Don't run away!" ld a, D_UP ld [wSimulatedJoypadStatesEnd], a @@ -111,7 +111,7 @@ BrunosRoomBrunoEndBattleScript: cp $ff jp z, ResetBrunoScript ld a, TEXT_BRUNOSROOM_BRUNO - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID BrunosRoom_TextPointers: diff --git a/scripts/CeladonGym.asm b/scripts/CeladonGym.asm index ea1f5053..ca7da4e5 100644 --- a/scripts/CeladonGym.asm +++ b/scripts/CeladonGym.asm @@ -45,20 +45,20 @@ CeladonGymErikaPostBattleScript: CeladonGymReceiveTM21: ld a, TEXT_CELADONGYM_RAINBOWBADGE_INFO - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_BEAT_ERIKA lb bc, TM_MEGA_DRAIN, 1 call GiveItem jr nc, .BagFull ld a, TEXT_CELADONGYM_RECEIVED_TM21 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_GOT_TM21 jr .gymVictory .BagFull ld a, TEXT_CELADONGYM_TM21_NO_ROOM - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID .gymVictory ld hl, wObtainedBadges diff --git a/scripts/CeruleanCity.asm b/scripts/CeruleanCity.asm index 2ff5f3be..9cf44891 100644 --- a/scripts/CeruleanCity.asm +++ b/scripts/CeruleanCity.asm @@ -28,7 +28,7 @@ CeruleanCityRocketDefeatedScript: ld [wJoyIgnore], a SetEvent EVENT_BEAT_CERULEAN_ROCKET_THIEF ld a, TEXT_CERULEANCITY_ROCKET - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID xor a ; SCRIPT_CERULEANCITY_DEFAULT ld [wJoyIgnore], a @@ -58,7 +58,7 @@ ENDC ld [wSprite02StateData1FacingDirection], a call Delay3 ld a, TEXT_CERULEANCITY_ROCKET - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID .skipRocketThiefEncounter CheckEvent EVENT_BEAT_CERULEAN_RIVAL @@ -131,7 +131,7 @@ CeruleanCityRivalBattleScript: xor a ld [wJoyIgnore], a ld a, TEXT_CERULEANCITY_RIVAL - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld hl, wStatusFlags3 set BIT_TALKED_TO_TRAINER, [hl] @@ -174,7 +174,7 @@ CeruleanCityRivalDefeatedScript: ld [wJoyIgnore], a SetEvent EVENT_BEAT_CERULEAN_RIVAL ld a, TEXT_CERULEANCITY_RIVAL - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a @@ -295,7 +295,7 @@ CeruleanCityRocketText: ld hl, .IGiveUpText ld de, .IGiveUpText call SaveEndBattleTextPointers - ldh a, [hSpriteIndexOrTextID] + ldh a, [hTextID] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/CeruleanGym.asm b/scripts/CeruleanGym.asm index 7795b70b..37d5e405 100644 --- a/scripts/CeruleanGym.asm +++ b/scripts/CeruleanGym.asm @@ -45,20 +45,20 @@ CeruleanGymMistyPostBattleScript: CeruleanGymReceiveTM11: ld a, TEXT_CERULEANGYM_MISTY_CASCADE_BADGE_INFO - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_BEAT_MISTY lb bc, TM_BUBBLEBEAM, 1 call GiveItem jr nc, .BagFull ld a, TEXT_CERULEANGYM_MISTY_RECEIVED_TM11 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_GOT_TM11 jr .gymVictory .BagFull ld a, TEXT_CERULEANGYM_MISTY_TM11_NO_ROOM - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID .gymVictory ld hl, wObtainedBadges diff --git a/scripts/ChampionsRoom.asm b/scripts/ChampionsRoom.asm index f3c9818d..efa66680 100644 --- a/scripts/ChampionsRoom.asm +++ b/scripts/ChampionsRoom.asm @@ -56,7 +56,7 @@ ChampionsRoomRivalReadyToBattleScript: ld hl, wOptions res BIT_BATTLE_ANIMATION, [hl] ld a, TEXT_CHAMPIONSROOM_RIVAL - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call Delay3 ld hl, wStatusFlags3 @@ -99,7 +99,7 @@ ChampionsRoomRivalDefeatedScript: ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a ld a, TEXT_CHAMPIONSROOM_RIVAL - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call ChampionsRoom_DisplayTextID_AllowABSelectStart ld a, CHAMPIONSROOM_RIVAL ldh [hSpriteIndex], a @@ -111,7 +111,7 @@ ChampionsRoomRivalDefeatedScript: ChampionsRoomOakArrivesScript: farcall Music_Cities1AlternateTempo ld a, TEXT_CHAMPIONSROOM_OAK - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call ChampionsRoom_DisplayTextID_AllowABSelectStart ld a, CHAMPIONSROOM_OAK ldh [hSpriteIndex], a @@ -152,7 +152,7 @@ ChampionsRoomOakCongratulatesPlayerScript: ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, TEXT_CHAMPIONSROOM_OAK_CONGRATULATES_PLAYER - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call ChampionsRoom_DisplayTextID_AllowABSelectStart ld a, SCRIPT_CHAMPIONSROOM_OAK_DISAPPOINTED_WITH_RIVAL ld [wChampionsRoomCurScript], a @@ -165,7 +165,7 @@ ChampionsRoomOakDisappointedWithRivalScript: ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, TEXT_CHAMPIONSROOM_OAK_DISAPPOINTED_WITH_RIVAL - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call ChampionsRoom_DisplayTextID_AllowABSelectStart ld a, SCRIPT_CHAMPIONSROOM_OAK_COME_WITH_ME ld [wChampionsRoomCurScript], a @@ -178,7 +178,7 @@ ChampionsRoomOakComeWithMeScript: ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, TEXT_CHAMPIONSROOM_OAK_COME_WITH_ME - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call ChampionsRoom_DisplayTextID_AllowABSelectStart ld de, OakExitChampionsRoomMovement ld a, CHAMPIONSROOM_OAK diff --git a/scripts/CinnabarGym.asm b/scripts/CinnabarGym.asm index a7608a4f..b7c9e1ba 100644 --- a/scripts/CinnabarGym.asm +++ b/scripts/CinnabarGym.asm @@ -38,7 +38,7 @@ CinnabarGymResetScripts: ret CinnabarGymSetTrainerHeader: - ldh a, [hSpriteIndexOrTextID] + ldh a, [hTextID] ld [wTrainerHeaderFlagBit], a ret @@ -88,7 +88,7 @@ CinnabarGymGetOpponentTextScript: ld [wJoyIgnore], a ld a, [wOpponentAfterWrongAnswer] ld [wTrainerHeaderFlagBit], a - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID CinnabarGymFlagAction: @@ -145,20 +145,20 @@ CinnabarGymBlainePostBattleScript: ; fallthrough CinnabarGymReceiveTM38: ld a, TEXT_CINNABARGYM_BLAINE_VOLCANO_BADGE_INFO - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_BEAT_BLAINE lb bc, TM_FIRE_BLAST, 1 call GiveItem jr nc, .BagFull ld a, TEXT_CINNABARGYM_BLAINE_RECEIVED_TM38 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_GOT_TM38 jr .gymVictory .BagFull ld a, TEXT_CINNABARGYM_BLAINE_TM38_NO_ROOM - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID .gymVictory ld hl, wObtainedBadges @@ -190,7 +190,7 @@ CinnabarGym_TextPointers: dw_const CinnabarGymBlaineTM38NoRoomText, TEXT_CINNABARGYM_BLAINE_TM38_NO_ROOM CinnabarGymStartBattleScript: - ldh a, [hSpriteIndexOrTextID] + ldh a, [hSpriteIndex] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/CinnabarIsland.asm b/scripts/CinnabarIsland.asm index aca1b995..ed38f690 100644 --- a/scripts/CinnabarIsland.asm +++ b/scripts/CinnabarIsland.asm @@ -26,7 +26,7 @@ CinnabarIslandDefaultScript: ld a, PLAYER_DIR_UP ld [wPlayerMovingDirection], a ld a, TEXT_CINNABARISLAND_DOOR_IS_LOCKED - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID xor a ldh [hJoyHeld], a diff --git a/scripts/FightingDojo.asm b/scripts/FightingDojo.asm index 4522b906..bffa4554 100644 --- a/scripts/FightingDojo.asm +++ b/scripts/FightingDojo.asm @@ -49,7 +49,7 @@ FightingDojoDefaultScript: ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, TEXT_FIGHTINGDOJO_KARATE_MASTER - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ret @@ -72,7 +72,7 @@ FightingDojoKarateMasterPostBattleScript: ld [wJoyIgnore], a SetEventRange EVENT_BEAT_KARATE_MASTER, EVENT_BEAT_FIGHTING_DOJO_TRAINER_3 ld a, TEXT_FIGHTINGDOJO_KARATE_MASTER_I_WILL_GIVE_YOU_A_POKEMON - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID xor a ; SCRIPT_FIGHTINGDOJO_DEFAULT ld [wJoyIgnore], a @@ -117,7 +117,7 @@ FightingDojoKarateMasterText: ld hl, .DefeatedText ld de, .DefeatedText call SaveEndBattleTextPointers - ldh a, [hSpriteIndexOrTextID] + ldh a, [hSpriteIndex] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/FuchsiaGym.asm b/scripts/FuchsiaGym.asm index d2f0ee40..8ccebe40 100644 --- a/scripts/FuchsiaGym.asm +++ b/scripts/FuchsiaGym.asm @@ -47,20 +47,20 @@ FuchsiaGymKogaPostBattleScript: ; fallthrough FuchsiaGymReceiveTM06: ld a, TEXT_FUCHSIAGYM_KOGA_SOUL_BADGE_INFO - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_BEAT_KOGA lb bc, TM_TOXIC, 1 call GiveItem jr nc, .BagFull ld a, TEXT_FUCHSIAGYM_KOGA_RECEIVED_TM06 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_GOT_TM06 jr .gymVictory .BagFull ld a, TEXT_FUCHSIAGYM_KOGA_TM06_NO_ROOM - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID .gymVictory ld hl, wObtainedBadges diff --git a/scripts/GameCorner.asm b/scripts/GameCorner.asm index b2ef1206..5d5236c5 100644 --- a/scripts/GameCorner.asm +++ b/scripts/GameCorner.asm @@ -58,7 +58,7 @@ GameCornerRocketBattleScript: ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a ld a, TEXT_GAMECORNER_ROCKET_AFTER_BATTLE - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, GAMECORNER_ROCKET ldh [hSpriteIndex], a diff --git a/scripts/GameCornerPrizeRoom.asm b/scripts/GameCornerPrizeRoom.asm index 443e0260..8e3bc0a6 100644 --- a/scripts/GameCornerPrizeRoom.asm +++ b/scripts/GameCornerPrizeRoom.asm @@ -8,6 +8,7 @@ GameCornerPrizeRoom_TextPointers: dw_const GameCornerPRizeRoomPrizeVendorText, TEXT_GAMECORNERPRIZEROOM_PRIZE_VENDOR_1 dw_const GameCornerPRizeRoomPrizeVendorText, TEXT_GAMECORNERPRIZEROOM_PRIZE_VENDOR_2 dw_const GameCornerPRizeRoomPrizeVendorText, TEXT_GAMECORNERPRIZEROOM_PRIZE_VENDOR_3 + EXPORT TEXT_GAMECORNERPRIZEROOM_PRIZE_VENDOR_1 ; used by engine/events/prize_menu.asm GameCornerPrizeRoomBaldingGuyText: text_far _GameCornerPrizeRoomBaldingGuyText diff --git a/scripts/HallOfFame.asm b/scripts/HallOfFame.asm index 46298813..ed3d2a73 100644 --- a/scripts/HallOfFame.asm +++ b/scripts/HallOfFame.asm @@ -92,7 +92,7 @@ HallOfFameOakCongratulationsScript: inc a ; PLAYER_DIR_RIGHT ld [wPlayerMovingDirection], a ld a, TEXT_HALLOFFAME_OAK - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a diff --git a/scripts/LancesRoom.asm b/scripts/LancesRoom.asm index fd1401c2..31b0f240 100644 --- a/scripts/LancesRoom.asm +++ b/scripts/LancesRoom.asm @@ -63,7 +63,7 @@ LancesRoomDefaultScript: cp $3 ; Is player standing next to Lance's sprite? jr nc, .notStandingNextToLance ld a, TEXT_LANCESROOM_LANCE - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID .notStandingNextToLance cp $5 ; Is player standing on the entrance staircase? @@ -90,7 +90,7 @@ LancesRoomLanceEndBattleScript: cp $ff jp z, ResetLanceScript ld a, TEXT_LANCESROOM_LANCE - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID WalkToLance: diff --git a/scripts/LoreleisRoom.asm b/scripts/LoreleisRoom.asm index 52d79b15..ec88f73e 100644 --- a/scripts/LoreleisRoom.asm +++ b/scripts/LoreleisRoom.asm @@ -77,7 +77,7 @@ LoreleisRoomDefaultScript: jr z, LoreleiScriptWalkIntoRoom .stopPlayerFromLeaving ld a, TEXT_LORELEISROOM_DONT_RUN_AWAY - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ; "Don't run away!" ld a, D_UP ld [wSimulatedJoypadStatesEnd], a @@ -113,7 +113,7 @@ LoreleisRoomLoreleiEndBattleScript: cp $ff jp z, ResetLoreleiScript ld a, TEXT_LORELEISROOM_LORELEI - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID LoreleisRoom_TextPointers: diff --git a/scripts/MtMoonB2F.asm b/scripts/MtMoonB2F.asm index 3afd14c8..d17d13fe 100644 --- a/scripts/MtMoonB2F.asm +++ b/scripts/MtMoonB2F.asm @@ -65,7 +65,7 @@ MtMoonB2FDefaultScript: xor a ldh [hJoyHeld], a ld a, TEXT_MTMOONB2F_SUPER_NERD - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID MtMoonB2FCheckGotAFossil: @@ -137,7 +137,7 @@ MtMoonB2FSuperNerdTakesOtherFossilScript: ld a, $1 ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld a, TEXT_MTMOONB2F_SUPER_NERD_THEN_THIS_IS_MINE - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID CheckEvent EVENT_GOT_DOME_FOSSIL jr z, .got_dome_fossil diff --git a/scripts/Museum1F.asm b/scripts/Museum1F.asm index 2939f51b..600c03c7 100644 --- a/scripts/Museum1F.asm +++ b/scripts/Museum1F.asm @@ -26,7 +26,7 @@ Museum1FDefaultScript: xor a ldh [hJoyHeld], a ld a, TEXT_MUSEUM1F_SCIENTIST1 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID Museum1FNoopScript: diff --git a/scripts/OaksLab.asm b/scripts/OaksLab.asm index 087e6a37..e89e0ee8 100644 --- a/scripts/OaksLab.asm +++ b/scripts/OaksLab.asm @@ -129,19 +129,19 @@ OaksLabOakChooseMonSpeechScript: ld a, SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a ld a, TEXT_OAKSLAB_RIVAL_FED_UP_WITH_WAITING - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call Delay3 ld a, TEXT_OAKSLAB_OAK_CHOOSE_MON - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call Delay3 ld a, TEXT_OAKSLAB_RIVAL_WHAT_ABOUT_ME - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call Delay3 ld a, TEXT_OAKSLAB_OAK_BE_PATIENT - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_OAK_ASKED_TO_CHOOSE_MON xor a @@ -167,7 +167,7 @@ OaksLabPlayerDontGoAwayScript: call SetSpriteFacingDirectionAndDelay call UpdateSprites ld a, TEXT_OAKSLAB_OAK_DONT_GO_AWAY_YET - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, $1 ld [wSimulatedJoypadStatesIndex], a @@ -301,7 +301,7 @@ OaksLabRivalChoosesStarterScript: ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, TEXT_OAKSLAB_RIVAL_ILL_TAKE_THIS_ONE - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, [wRivalStarterBallSpriteIndex] cp OAKSLAB_CHARMANDER_POKE_BALL @@ -330,7 +330,7 @@ OaksLabRivalChoosesStarterScript: ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, TEXT_OAKSLAB_RIVAL_RECEIVED_MON - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_GOT_STARTER xor a @@ -355,7 +355,7 @@ OaksLabRivalChallengesPlayerScript: ld a, MUSIC_MEET_RIVAL call PlayMusic ld a, TEXT_OAKSLAB_RIVAL_ILL_TAKE_YOU_ON - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, $1 ldh [hNPCPlayerRelativePosPerspective], a @@ -440,7 +440,7 @@ OaksLabRivalStartsExitScript: ld c, 20 call DelayFrames ld a, TEXT_OAKSLAB_RIVAL_SMELL_YOU_LATER - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID farcall Music_RivalAlternateStart ld a, OAKSLAB_RIVAL @@ -516,7 +516,7 @@ OaksLabRivalArrivesAtOaksRequestScript: call PlaySound farcall Music_RivalAlternateStart ld a, TEXT_OAKSLAB_RIVAL_GRAMPS - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call OaksLabCalcRivalMovementScript ld a, HS_OAKS_LAB_RIVAL @@ -561,21 +561,21 @@ OaksLabOakGivesPokedexScript: ld [wJoyIgnore], a call OaksLabRivalFaceUpOakFaceDownScript ld a, TEXT_OAKSLAB_RIVAL_WHAT_DID_YOU_CALL_ME_FOR - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call DelayFrame call OaksLabRivalFaceUpOakFaceDownScript ld a, TEXT_OAKSLAB_OAK_I_HAVE_A_REQUEST - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call DelayFrame call OaksLabRivalFaceUpOakFaceDownScript ld a, TEXT_OAKSLAB_OAK_MY_INVENTION_POKEDEX - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call DelayFrame ld a, TEXT_OAKSLAB_OAK_GOT_POKEDEX - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call Delay3 ld a, HS_POKEDEX_1 @@ -586,7 +586,7 @@ OaksLabOakGivesPokedexScript: predef HideObject call OaksLabRivalFaceUpOakFaceDownScript ld a, TEXT_OAKSLAB_OAK_THAT_WAS_MY_DREAM - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, OAKSLAB_RIVAL ldh [hSpriteIndex], a @@ -595,7 +595,7 @@ OaksLabOakGivesPokedexScript: call SetSpriteFacingDirectionAndDelay call Delay3 ld a, TEXT_OAKSLAB_RIVAL_LEAVE_IT_ALL_TO_ME - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_GOT_POKEDEX SetEvent EVENT_OAK_GOT_PARCEL diff --git a/scripts/PalletTown.asm b/scripts/PalletTown.asm index a787fcc4..14c5a840 100644 --- a/scripts/PalletTown.asm +++ b/scripts/PalletTown.asm @@ -47,7 +47,7 @@ PalletTownOakHeyWaitScript: xor a ld [wOakWalkedToPlayer], a ld a, TEXT_PALLETTOWN_OAK - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a @@ -101,7 +101,7 @@ PalletTownOakNotSafeComeWithMeScript: ld a, SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a ld a, TEXT_PALLETTOWN_OAK - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ; set up movement script that causes the player to follow Oak to his lab ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN diff --git a/scripts/PewterCity.asm b/scripts/PewterCity.asm index 07c143d3..5cf0c8c7 100644 --- a/scripts/PewterCity.asm +++ b/scripts/PewterCity.asm @@ -34,7 +34,7 @@ ENDC ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a ld a, TEXT_PEWTERCITY_YOUNGSTER - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID PewterCityPlayerLeavingEastCoords: @@ -60,7 +60,7 @@ PewterCitySuperNerd1ShowsPlayerMuseumScript: ld hl, wMiscFlags set BIT_NO_SPRITE_UPDATES, [hl] ld a, TEXT_PEWTERCITY_SUPER_NERD1_ITS_RIGHT_HERE - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, $3c ldh [hSpriteScreenYCoord], a @@ -128,7 +128,7 @@ PewterCityYoungsterShowsPlayerGymScript: ld hl, wMiscFlags set BIT_NO_SPRITE_UPDATES, [hl] ld a, TEXT_PEWTERCITY_YOUNGSTER_GO_TAKE_ON_BROCK - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, $3c ldh [hSpriteScreenYCoord], a diff --git a/scripts/PewterGym.asm b/scripts/PewterGym.asm index b5771026..0029be19 100644 --- a/scripts/PewterGym.asm +++ b/scripts/PewterGym.asm @@ -45,20 +45,20 @@ PewterGymBrockPostBattle: ; fallthrough PewterGymScriptReceiveTM34: ld a, TEXT_PEWTERGYM_BROCK_WAIT_TAKE_THIS - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_BEAT_BROCK lb bc, TM_BIDE, 1 call GiveItem jr nc, .BagFull ld a, TEXT_PEWTERGYM_RECEIVED_TM34 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_GOT_TM34 jr .gymVictory .BagFull ld a, TEXT_PEWTERGYM_TM34_NO_ROOM - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID .gymVictory ld hl, wObtainedBadges diff --git a/scripts/PokemonMansion1F.asm b/scripts/PokemonMansion1F.asm index b294a247..a93bd33b 100644 --- a/scripts/PokemonMansion1F.asm +++ b/scripts/PokemonMansion1F.asm @@ -52,7 +52,7 @@ Mansion1Script_Switches:: xor a ldh [hJoyHeld], a ld a, TEXT_POKEMONMANSION1F_SWITCH - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID PokemonMansion1F_ScriptPointers: diff --git a/scripts/PokemonMansion2F.asm b/scripts/PokemonMansion2F.asm index bc3d78e9..df424a19 100644 --- a/scripts/PokemonMansion2F.asm +++ b/scripts/PokemonMansion2F.asm @@ -48,7 +48,7 @@ Mansion2Script_Switches:: xor a ldh [hJoyHeld], a ld a, TEXT_POKEMONMANSION2F_SWITCH - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID PokemonMansion2F_ScriptPointers: diff --git a/scripts/PokemonMansion3F.asm b/scripts/PokemonMansion3F.asm index fab06bbd..f5347446 100644 --- a/scripts/PokemonMansion3F.asm +++ b/scripts/PokemonMansion3F.asm @@ -80,7 +80,7 @@ Mansion3Script_Switches:: xor a ldh [hJoyHeld], a ld a, TEXT_POKEMONMANSION3F_SWITCH - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID PokemonMansion3F_TextPointers: diff --git a/scripts/PokemonMansionB1F.asm b/scripts/PokemonMansionB1F.asm index 74f1648e..e359621d 100644 --- a/scripts/PokemonMansionB1F.asm +++ b/scripts/PokemonMansionB1F.asm @@ -50,7 +50,7 @@ Mansion4Script_Switches:: xor a ldh [hJoyHeld], a ld a, TEXT_POKEMONMANSIONB1F_SWITCH - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID PokemonMansionB1F_ScriptPointers: diff --git a/scripts/PokemonTower2F.asm b/scripts/PokemonTower2F.asm index 00f83fc5..6b3fe4ae 100644 --- a/scripts/PokemonTower2F.asm +++ b/scripts/PokemonTower2F.asm @@ -51,7 +51,7 @@ ENDC ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, TEXT_POKEMONTOWER2F_RIVAL - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID xor a ldh [hJoyHeld], a @@ -71,7 +71,7 @@ PokemonTower2FDefeatedRivalScript: ld [wJoyIgnore], a SetEvent EVENT_BEAT_POKEMON_TOWER_RIVAL ld a, TEXT_POKEMONTOWER2F_RIVAL - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld de, PokemonTower2FRivalDownThenRightMovement CheckEvent EVENT_POKEMON_TOWER_RIVAL_ON_LEFT diff --git a/scripts/PokemonTower5F.asm b/scripts/PokemonTower5F.asm index 8e256b1e..b35a2f0a 100644 --- a/scripts/PokemonTower5F.asm +++ b/scripts/PokemonTower5F.asm @@ -36,7 +36,7 @@ PokemonTower5FDefaultScript: call Delay3 call GBFadeInFromWhite ld a, TEXT_POKEMONTOWER5F_PURIFIEDZONE - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID xor a ld [wJoyIgnore], a diff --git a/scripts/PokemonTower6F.asm b/scripts/PokemonTower6F.asm index 9e2f4118..cf246c56 100644 --- a/scripts/PokemonTower6F.asm +++ b/scripts/PokemonTower6F.asm @@ -31,7 +31,7 @@ PokemonTower6FDefaultScript: xor a ldh [hJoyHeld], a ld a, TEXT_POKEMONTOWER6F_BEGONE - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, RESTLESS_SOUL ld [wCurOpponent], a @@ -63,7 +63,7 @@ PokemonTower6FMarowakBattleScript: jr nz, .did_not_defeat SetEvent EVENT_BEAT_GHOST_MAROWAK ld a, TEXT_POKEMONTOWER6F_MAROWAK_DEPARTED - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID xor a ld [wJoyIgnore], a diff --git a/scripts/PokemonTower7F.asm b/scripts/PokemonTower7F.asm index be9aacd9..41fba59c 100644 --- a/scripts/PokemonTower7F.asm +++ b/scripts/PokemonTower7F.asm @@ -32,7 +32,7 @@ PokemonTower7FEndBattleScript: ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a ld a, [wSpriteIndex] - ldh [hSpriteIndexOrTextID], a + ldh [hSpriteIndex], a call DisplayTextID call PokemonTower7FRocketLeaveMovementScript ld a, SCRIPT_POKEMONTOWER7F_HIDE_NPC diff --git a/scripts/RocketHideoutB4F.asm b/scripts/RocketHideoutB4F.asm index 02ddcdd5..920aa089 100644 --- a/scripts/RocketHideoutB4F.asm +++ b/scripts/RocketHideoutB4F.asm @@ -53,7 +53,7 @@ RocketHideoutB4FBeatGiovanniScript: ld [wJoyIgnore], a SetEvent EVENT_BEAT_ROCKET_HIDEOUT_GIOVANNI ld a, TEXT_ROCKETHIDEOUTB4F_GIOVANNI_HOPE_WE_MEET_AGAIN - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call GBFadeOutToBlack ld a, HS_ROCKET_HIDEOUT_B4F_GIOVANNI diff --git a/scripts/Route12.asm b/scripts/Route12.asm index 660b8a2d..ea9fc567 100644 --- a/scripts/Route12.asm +++ b/scripts/Route12.asm @@ -28,7 +28,7 @@ Route12DefaultScript: ResetEventReuseHL EVENT_FIGHT_ROUTE12_SNORLAX jp z, CheckFightingMapTrainers ld a, TEXT_ROUTE12_SNORLAX_WOKE_UP - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, SNORLAX ld [wCurOpponent], a @@ -51,7 +51,7 @@ Route12SnorlaxPostBattleScript: cp $2 jr z, .caught_snorlax ld a, TEXT_ROUTE12_SNORLAX_CALMED_DOWN - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID .caught_snorlax SetEvent EVENT_BEAT_ROUTE12_SNORLAX diff --git a/scripts/Route16.asm b/scripts/Route16.asm index ec33adf1..6e3da97c 100644 --- a/scripts/Route16.asm +++ b/scripts/Route16.asm @@ -28,7 +28,7 @@ Route16DefaultScript: ResetEventReuseHL EVENT_FIGHT_ROUTE16_SNORLAX jp z, CheckFightingMapTrainers ld a, TEXT_ROUTE16_SNORLAX_WOKE_UP - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, SNORLAX ld [wCurOpponent], a @@ -52,7 +52,7 @@ Route16SnorlaxPostBattleScript: cp $2 jr z, .caught ld a, TEXT_ROUTE16_SNORLAX_RETURNED_TO_MOUNTAINS - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID .caught SetEvent EVENT_BEAT_ROUTE16_SNORLAX diff --git a/scripts/Route16Gate1F.asm b/scripts/Route16Gate1F.asm index d42a80d4..a8bf2f0f 100644 --- a/scripts/Route16Gate1F.asm +++ b/scripts/Route16Gate1F.asm @@ -20,7 +20,7 @@ Route16Gate1FDefaultScript: call ArePlayerCoordsInArray ret nc ld a, TEXT_ROUTE16GATE1F_GUARD_WAIT_UP - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID xor a ldh [hJoyHeld], a @@ -60,7 +60,7 @@ Route16Gate1FPlayerMovingUpScript: Route16Gate1FGuardScript: ld a, TEXT_ROUTE16GATE1F_GUARD - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, $1 ld [wSimulatedJoypadStatesIndex], a diff --git a/scripts/Route18Gate1F.asm b/scripts/Route18Gate1F.asm index 79d982d7..a2b4dcdf 100644 --- a/scripts/Route18Gate1F.asm +++ b/scripts/Route18Gate1F.asm @@ -20,7 +20,7 @@ Route18Gate1FDefaultScript: call ArePlayerCoordsInArray ret nc ld a, TEXT_ROUTE18GATE1F_GUARD_EXCUSE_ME - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID xor a ldh [hJoyHeld], a @@ -60,7 +60,7 @@ Route18Gate1FPlayerMovingUpScript: Route18Gate1FGuardScript: ld a, TEXT_ROUTE18GATE1F_GUARD - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, $1 ld [wSimulatedJoypadStatesIndex], a diff --git a/scripts/Route22.asm b/scripts/Route22.asm index ad02b4c7..1a2602fd 100644 --- a/scripts/Route22.asm +++ b/scripts/Route22.asm @@ -124,7 +124,7 @@ Route22Rival1StartBattleScript: xor a ld [wJoyIgnore], a ld a, TEXT_ROUTE22_RIVAL1 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld hl, wStatusFlags3 set BIT_TALKED_TO_TRAINER, [hl] @@ -166,7 +166,7 @@ Route22Rival1AfterBattleScript: ld [wJoyIgnore], a SetEvent EVENT_BEAT_ROUTE22_RIVAL_1ST_BATTLE ld a, TEXT_ROUTE22_RIVAL1 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a @@ -280,7 +280,7 @@ Route22Rival2StartBattleScript: xor a ld [wJoyIgnore], a ld a, TEXT_ROUTE22_RIVAL2 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld hl, wStatusFlags3 set BIT_TALKED_TO_TRAINER, [hl] @@ -325,7 +325,7 @@ Route22Rival2AfterBattleScript: ld [wJoyIgnore], a SetEvent EVENT_BEAT_ROUTE22_RIVAL_2ND_BATTLE ld a, TEXT_ROUTE22_RIVAL2 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a diff --git a/scripts/Route22Gate.asm b/scripts/Route22Gate.asm index 9bca889d..d6160ad8 100644 --- a/scripts/Route22Gate.asm +++ b/scripts/Route22Gate.asm @@ -25,7 +25,7 @@ Route22GateDefaultScript: xor a ldh [hJoyHeld], a ld a, TEXT_ROUTE22GATE_GUARD - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID Route22GateScriptCoords: diff --git a/scripts/Route23.asm b/scripts/Route23.asm index da0acfea..ffd968df 100644 --- a/scripts/Route23.asm +++ b/scripts/Route23.asm @@ -46,7 +46,7 @@ Route23DefaultScript: ret nc .not_past_victory_road ld a, e - ldh [hSpriteIndexOrTextID], a + ldh [hSpriteIndex], a ld a, c ld [wWhichBadge], a ld b, FLAG_TEST diff --git a/scripts/Route24.asm b/scripts/Route24.asm index 6f8f0250..53185147 100644 --- a/scripts/Route24.asm +++ b/scripts/Route24.asm @@ -31,7 +31,7 @@ Route24DefaultScript: xor a ldh [hJoyHeld], a ld a, TEXT_ROUTE24_COOLTRAINER_M1 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID CheckAndResetEvent EVENT_NUGGET_REWARD_AVAILABLE ret z @@ -68,7 +68,7 @@ Route24AfterRocketBattleScript: ld [wJoyIgnore], a SetEvent EVENT_BEAT_ROUTE24_ROCKET ld a, TEXT_ROUTE24_COOLTRAINER_M1 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID xor a ld [wJoyIgnore], a @@ -125,7 +125,7 @@ Route24CooltrainerM1Text: ld hl, .DefeatedText ld de, .DefeatedText call SaveEndBattleTextPointers - ldh a, [hSpriteIndexOrTextID] + ldh a, [hSpriteIndex] ld [wSpriteIndex], a call EngageMapTrainer call InitBattleEnemyParameters diff --git a/scripts/Route5Gate.asm b/scripts/Route5Gate.asm index a0913c85..0ccf9fae 100644 --- a/scripts/Route5Gate.asm +++ b/scripts/Route5Gate.asm @@ -32,7 +32,7 @@ Route5GateDefaultScript: and a jr nz, .have_drink ld a, TEXT_ROUTE5GATE_GUARD_GEE_IM_THIRSTY - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call Route5GateMovePlayerUpScript ld a, SCRIPT_ROUTE5GATE_PLAYER_MOVING @@ -40,7 +40,7 @@ Route5GateDefaultScript: ret .have_drink ld a, TEXT_ROUTE5GATE_GUARD_GIVE_DRINK - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld hl, wStatusFlags1 set BIT_GAVE_SAFFRON_GUARDS_DRINK, [hl] diff --git a/scripts/Route6Gate.asm b/scripts/Route6Gate.asm index 7afba23e..48228c7d 100644 --- a/scripts/Route6Gate.asm +++ b/scripts/Route6Gate.asm @@ -26,7 +26,7 @@ Route6GateDefaultScript: and a jr nz, .have_drink ld a, TEXT_ROUTE6GATE_GUARD_GEE_IM_THIRSTY - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call Route6GateMovePlayerDownScript ld a, SCRIPT_ROUTE6GATE_PLAYER_MOVING @@ -36,7 +36,7 @@ Route6GateDefaultScript: ld hl, wStatusFlags1 set BIT_GAVE_SAFFRON_GUARDS_DRINK, [hl] ld a, TEXT_ROUTE6GATE_GUARD_GIVE_DRINK - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID .PlayerInCoordsArray: diff --git a/scripts/Route7Gate.asm b/scripts/Route7Gate.asm index 813fab21..e599e147 100644 --- a/scripts/Route7Gate.asm +++ b/scripts/Route7Gate.asm @@ -38,7 +38,7 @@ Route7DefaultScript: and a jr nz, .have_drink ld a, TEXT_ROUTE7GATE_GUARD_GEE_IM_THIRSTY - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call Route7GateMovePlayerLeftScript ld a, SCRIPT_ROUTE7GATE_PLAYER_MOVING @@ -46,7 +46,7 @@ Route7DefaultScript: ret .have_drink ld a, TEXT_ROUTE7GATE_GUARD_GIVE_DRINK - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld hl, wStatusFlags1 set BIT_GAVE_SAFFRON_GUARDS_DRINK, [hl] diff --git a/scripts/Route8Gate.asm b/scripts/Route8Gate.asm index 51dd6f1a..44e94a0c 100644 --- a/scripts/Route8Gate.asm +++ b/scripts/Route8Gate.asm @@ -37,7 +37,7 @@ Route8GateDefaultScript: and a jr nz, .have_drink ld a, TEXT_ROUTE8GATE_GUARD_GEE_IM_THIRSTY - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call Route8GateMovePlayerRightScript ld a, SCRIPT_ROUTE8GATE_PLAYER_MOVING @@ -47,7 +47,7 @@ Route8GateDefaultScript: ld hl, wStatusFlags1 set BIT_GAVE_SAFFRON_GUARDS_DRINK, [hl] ld a, TEXT_ROUTE8GATE_GUARD_GIVE_DRINK - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a jp DisplayTextID .PlayerInCoordsArray: diff --git a/scripts/SSAnne2F.asm b/scripts/SSAnne2F.asm index 1c7c6b5b..5bd5589d 100644 --- a/scripts/SSAnne2F.asm +++ b/scripts/SSAnne2F.asm @@ -94,7 +94,7 @@ SSAnne2FRivalStartBattleScript: xor a ld [wJoyIgnore], a ld a, TEXT_SSANNE2F_RIVAL - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call Delay3 ld a, OPP_RIVAL2 @@ -129,7 +129,7 @@ SSAnne2FRivalAfterBattleScript: ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a ld a, TEXT_SSANNE2F_RIVAL_CUT_MASTER - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, SSANNE2F_RIVAL ldh [hSpriteIndex], a diff --git a/scripts/SafariZoneGate.asm b/scripts/SafariZoneGate.asm index 14a8a79b..74a7baa1 100644 --- a/scripts/SafariZoneGate.asm +++ b/scripts/SafariZoneGate.asm @@ -20,7 +20,7 @@ SafariZoneGateDefaultScript: call ArePlayerCoordsInArray ret nc ld a, TEXT_SAFARIZONEGATE_SAFARI_ZONE_WORKER1_1 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a @@ -58,7 +58,7 @@ SafariZoneGateWouldYouLikeToJoinScript: ld [wJoyIgnore], a call UpdateSprites ld a, TEXT_SAFARIZONEGATE_SAFARI_ZONE_WORKER1_WOULD_YOU_LIKE_TO_JOIN - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, A_BUTTON | B_BUTTON | SELECT | START | D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a @@ -83,7 +83,7 @@ SafariZoneGateLeavingSafariScript: ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a ld a, TEXT_SAFARIZONEGATE_SAFARI_ZONE_WORKER1_GOOD_HAUL_COME_AGAIN - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID xor a ld [wNumSafariBalls], a @@ -95,7 +95,7 @@ SafariZoneGateLeavingSafariScript: jr .return .leaving_early ld a, TEXT_SAFARIZONEGATE_SAFARI_ZONE_WORKER1_LEAVING_EARLY - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID .return ret diff --git a/scripts/SaffronGym.asm b/scripts/SaffronGym.asm index 2de1081b..556cd4c5 100644 --- a/scripts/SaffronGym.asm +++ b/scripts/SaffronGym.asm @@ -45,20 +45,20 @@ SaffronGymSabrinaPostBattle: SaffronGymSabrinaReceiveTM46Script: ld a, TEXT_SAFFRONGYM_SABRINA_MARSH_BADGE_INFO - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_BEAT_SABRINA lb bc, TM_PSYWAVE, 1 call GiveItem jr nc, .BagFull ld a, TEXT_SAFFRONGYM_SABRINA_RECEIVED_TM46 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_GOT_TM46 jr .gymVictory .BagFull ld a, TEXT_SAFFRONGYM_SABRINA_TM46_NO_ROOM - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID .gymVictory ld hl, wObtainedBadges diff --git a/scripts/SilphCo11F.asm b/scripts/SilphCo11F.asm index 9caf2a70..d5e4cb08 100644 --- a/scripts/SilphCo11F.asm +++ b/scripts/SilphCo11F.asm @@ -176,7 +176,7 @@ SilphCo11FDefaultScript: ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a ld a, TEXT_SILPHCO11F_GIOVANNI - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, SILPHCO11F_GIOVANNI ldh [hSpriteIndex], a @@ -223,7 +223,7 @@ SilphCo11FGiovanniAfterBattleScript: ld a, D_RIGHT | D_LEFT | D_UP | D_DOWN ld [wJoyIgnore], a ld a, TEXT_SILPHCO11F_GIOVANNI_YOU_RUINED_OUR_PLANS - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call GBFadeOutToBlack call SilphCo11FTeamRocketLeavesScript diff --git a/scripts/SilphCo7F.asm b/scripts/SilphCo7F.asm index de9e689d..381eff7a 100644 --- a/scripts/SilphCo7F.asm +++ b/scripts/SilphCo7F.asm @@ -138,7 +138,7 @@ SilphCo7FDefaultScript: ld a, MUSIC_MEET_RIVAL call PlayMusic ld a, TEXT_SILPHCO7F_RIVAL - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, SILPHCO7F_RIVAL ldh [hSpriteIndex], a @@ -175,7 +175,7 @@ SilphCo7FRivalStartBattleScript: xor a ld [wJoyIgnore], a ld a, TEXT_SILPHCO7F_RIVAL_WAITED_HERE - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID call Delay3 ld hl, wStatusFlags3 @@ -218,7 +218,7 @@ SilphCo7FRivalAfterBattleScript: ldh [hSpriteFacingDirection], a call SetSpriteFacingDirectionAndDelay ld a, TEXT_SILPHCO7F_RIVAL_GOOD_LUCK_TO_YOU - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld a, SFX_STOP_ALL_MUSIC ld [wNewSoundID], a diff --git a/scripts/VermilionCity.asm b/scripts/VermilionCity.asm index 9d800233..fd5905df 100644 --- a/scripts/VermilionCity.asm +++ b/scripts/VermilionCity.asm @@ -49,7 +49,7 @@ VermilionCityDefaultScript: ldh [hJoyHeld], a ld [wSavedCoordIndex], a ; unnecessary ld a, TEXT_VERMILIONCITY_SAILOR1 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID CheckEvent EVENT_SS_ANNE_LEFT jr nz, .ship_departed diff --git a/scripts/VermilionGym.asm b/scripts/VermilionGym.asm index 194fce94..d7828e42 100644 --- a/scripts/VermilionGym.asm +++ b/scripts/VermilionGym.asm @@ -64,20 +64,20 @@ VermilionGymLTSurgeAfterBattleScript: VermilionGymLTSurgeReceiveTM24Script: ld a, TEXT_VERMILIONGYM_LT_SURGE_THUNDER_BADGE_INFO - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_BEAT_LT_SURGE lb bc, TM_THUNDERBOLT, 1 call GiveItem jr nc, .bag_full ld a, TEXT_VERMILIONGYM_LT_SURGE_RECEIVED_TM24 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_GOT_TM24 jr .gym_victory .bag_full ld a, TEXT_VERMILIONGYM_LT_SURGE_TM24_NO_ROOM - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID .gym_victory ld hl, wObtainedBadges diff --git a/scripts/ViridianCity.asm b/scripts/ViridianCity.asm index 0059bc60..473b7ee5 100644 --- a/scripts/ViridianCity.asm +++ b/scripts/ViridianCity.asm @@ -31,7 +31,7 @@ ViridianCityCheckGymOpenScript: cp 32 ret nz ld a, TEXT_VIRIDIANCITY_GYM_LOCKED - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID xor a ldh [hJoyHeld], a @@ -50,7 +50,7 @@ ViridianCityCheckGotPokedexScript: cp 19 ret nz ld a, TEXT_VIRIDIANCITY_OLD_MAN_SLEEPY - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID xor a ldh [hJoyHeld], a @@ -96,7 +96,7 @@ ViridianCityOldManEndCatchTrainingScript: xor a ld [wJoyIgnore], a ld a, TEXT_VIRIDIANCITY_OLD_MAN_YOU_NEED_TO_WEAKEN_THE_TARGET - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID xor a ld [wBattleType], a diff --git a/scripts/ViridianGym.asm b/scripts/ViridianGym.asm index a6f27bdf..55d849d2 100644 --- a/scripts/ViridianGym.asm +++ b/scripts/ViridianGym.asm @@ -137,20 +137,20 @@ ViridianGymGiovanniPostBattle: ; fallthrough ViridianGymReceiveTM27: ld a, TEXT_VIRIDIANGYM_GIOVANNI_EARTH_BADGE_INFO - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_BEAT_VIRIDIAN_GYM_GIOVANNI lb bc, TM_FISSURE, 1 call GiveItem jr nc, .bag_full ld a, TEXT_VIRIDIANGYM_GIOVANNI_RECEIVED_TM27 - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID SetEvent EVENT_GOT_TM27 jr .gym_victory .bag_full ld a, TEXT_VIRIDIANGYM_GIOVANNI_TM27_NO_ROOM - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID .gym_victory ld hl, wObtainedBadges diff --git a/scripts/ViridianMart.asm b/scripts/ViridianMart.asm index 8f91afd6..f54f3c26 100644 --- a/scripts/ViridianMart.asm +++ b/scripts/ViridianMart.asm @@ -28,7 +28,7 @@ ViridianMart_ScriptPointers: ViridianMartDefaultScript: call UpdateSprites ld a, TEXT_VIRIDIANMART_CLERK_YOU_CAME_FROM_PALLET_TOWN - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID ld hl, wSimulatedJoypadStatesEnd ld de, .PlayerMovement @@ -51,7 +51,7 @@ ViridianMartOaksParcelScript: ret nz call Delay3 ld a, TEXT_VIRIDIANMART_CLERK_PARCEL_QUEST - ldh [hSpriteIndexOrTextID], a + ldh [hTextID], a call DisplayTextID lb bc, OAKS_PARCEL, 1 call GiveItem diff --git a/scripts/WardensHouse.asm b/scripts/WardensHouse.asm index 1851e341..aa6be6ca 100644 --- a/scripts/WardensHouse.asm +++ b/scripts/WardensHouse.asm @@ -95,7 +95,7 @@ WardensHouseWardenText: WardensHouseDisplayText: text_asm - ldh a, [hSpriteIndexOrTextID] + ldh a, [hTextID] cp TEXT_WARDENSHOUSE_DISPLAY_LEFT ld hl, .MerchandiseText jr nz, .print_text -- cgit v1.3.1-sl0p