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: [PATCH] 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(-) diff --git a/data/text/text_1.asm b/data/text/text_1.asm index 2acc6f6852..538396ebed 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 d4b1b7db92..4362e0f20c 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 1d40d6b7af..ba09a0f688 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 39c7ab91b0..f1c73a8851 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 fb0cac666f..1eee599c3b 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 194afa7bc8..8109b65932 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 fcb27d2085..54629faff6 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 ab4d1c5660..ae399a01ac 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 b2daebfe1d..82be49e06b 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 4feef343b1..fe784dd637 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 fa373038be..9aab3feb31 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 4d40fd827c..b25d5a1106 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 eb82a5b1c5..171fa99a3e 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 b26bc90f0b..0c6ec1ea6d 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 54588e7d6c..c62225baf4 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 e771504d35..0c3394516a 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 ccbe022584..a98402682c 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 e5796e53f7..9dd66de564 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 08ff22e4ad..27bccbb546 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 f512051885..85447300d3 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 50a9838ca8..6c8cd6ebc3 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 d37d95f88f..6dd9aab1c2 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 95ebcabe5c..40c75f620c 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 9d168cc72c..931538c0a5 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 98d1158e08..a564862bb2 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 0b7fb96cd6..73ba8071e0 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 fa6930c102..1c7c328cf0 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 0377caa41f..981fe13aeb 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 1629b18869..3d864222b4 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 f7751fa03d..2e5e1501a4 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 c27739d77e..cd3823fd0c 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 131fbd8548..b228f086ab 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 4ff730dd0b..3bdf5a7bb5 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 73c128058d..b5960c812b 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 0e04367b61..ad1434dcac 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 044d5e504d..da0acfea00 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 a198dbd783..8522a14938 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 92f23f69c8..9e62e5de88 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 6701bbd03f..be0bc94742 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 87cde965f4..be9b8eab2c 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 106a2cf00b..3d2d5eaa02 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 11accbd449..e839149e02 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 921b640700..cdccbf939f 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