Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renamed gStringVar4 to gStringVarBuffer #2097

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion asm/macros/battle_frontier/battle_palace.inc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
special CallBattlePalaceFunction
.endm

@ Buffer the opponents intro speech to gStringVar4. Also used by Battle Arena and Factory
@ Buffer the opponents intro speech to gStringVarBuffer. Also used by Battle Arena and Factory
.macro palace_getopponentintro
setvar VAR_0x8004, BATTLE_PALACE_FUNC_GET_OPPONENT_INTRO
special CallBattlePalaceFunction
Expand Down
4 changes: 2 additions & 2 deletions asm/macros/battle_frontier/battle_pike.inc
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
special CallBattlePikeFunction
.endm

@ Buffers a message for the lone NPC in the NPC room to gStringVar4
@ Buffers a message for the lone NPC in the NPC room to gStringVarBuffer
.macro pike_getnpcmsg
setvar VAR_0x8004, BATTLE_PIKE_FUNC_BUFFER_NPC_MSG
special CallBattlePikeFunction
Expand Down Expand Up @@ -120,7 +120,7 @@
special CallBattlePikeFunction
.endm

@ Buffer the opponents battle intro speech to gStringVar4. \trainer 0 for Trainer A, 1 for Trainer B
@ Buffer the opponents battle intro speech to gStringVarBuffer. \trainer 0 for Trainer A, 1 for Trainer B
.macro pike_gettrainerintro trainer:req
setvar VAR_0x8004, BATTLE_PIKE_FUNC_GET_TRAINER_INTRO
setvar VAR_0x8005, \trainer
Expand Down
2 changes: 1 addition & 1 deletion asm/macros/event.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,7 @@
.4byte \text
.endm

@ Expands the given text at the pointer (- the relative address set by setvaddress) into gStringVar4
@ Expands the given text at the pointer (- the relative address set by setvaddress) into gStringVarBuffer
.macro vbuffermessage text:req
.byte SCR_OP_VBUFFERMESSAGE
.4byte \text
Expand Down
2 changes: 1 addition & 1 deletion data/maps/BattleFrontier_BattleArenaBattleRoom/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ BattleFrontier_BattleArenaBattleRoom_EventScript_AnnounceTrainers::
applymovement LOCALID_OPPONENT, BattleFrontier_BattleArenaBattleRoom_Movement_OpponentStepForward
waitmovement 0
palace_getopponentintro
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
waitmessage
call BattleFrontier_BattleArenaBattleRoom_EventScript_DoArenaBattle
switch VAR_RESULT
Expand Down
2 changes: 1 addition & 1 deletion data/maps/BattleFrontier_BattleDomeBattleRoom/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ BattleFrontier_BattleDomeBattleRoom_EventScript_BattleOpponent::
applymovement LOCALID_OPPONENT, BattleFrontier_BattleDomeBattleRoom_Movement_OpponentStepForward
waitmovement 0
tower_getopponentintro 0
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
closemessage
dome_initopponentparty
call BattleFrontier_BattleDomeBattleRoom_EventScript_DoDomeBattle
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleOpponent::
goto_if_ne VAR_TEMP_F, FRONTIER_BRAIN_NOT_READY, BattleFrontier_BattleFactoryBattleRoom_EventScript_BattleNoland
palace_getopponentintro
lockall
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
waitmessage
closemessage
frontier_set FRONTIER_DATA_RECORD_DISABLED, FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ BattleFrontier_BattlePalaceBattleRoom_EventScript_NextOpponentEnter::
applymovement LOCALID_OPPONENT, BattleFrontier_BattlePalaceBattleRoom_Movement_OpponentEnter
waitmovement 0
palace_getopponentintro
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
waitmessage
call BattleFrontier_BattlePalaceBattleRoom_EventScript_DoPalaceBattle
switch VAR_RESULT
Expand Down
10 changes: 5 additions & 5 deletions data/maps/BattleFrontier_BattlePikeRoomNormal/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_EnterSingleBattleRoom::
applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_ApproachPlayer
waitmovement 0
pike_gettrainerintro 0
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
waitmessage
closemessage
releaseall
Expand Down Expand Up @@ -62,7 +62,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_EnterHardBattleRoom::
applymovement LOCALID_OBJ_0, BattleFrontier_BattlePikeRoomNormal_Movement_ApproachPlayer
waitmovement 0
pike_gettrainerintro 0
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
waitmessage
closemessage
releaseall
Expand Down Expand Up @@ -249,13 +249,13 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_EnterDoubleBattleRoom::
applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePikeRoomNormal_Movement_PlayerFaceTrainer1
waitmovement 0
pike_gettrainerintro 0
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
closemessage
delay 16
applymovement OBJ_EVENT_ID_PLAYER, BattleFrontier_BattlePikeRoomNormal_Movement_PlayerFaceTrainer2
waitmovement 0
pike_gettrainerintro 1
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
closemessage
setvar VAR_0x8004, SPECIAL_BATTLE_PIKE_DOUBLE
setvar VAR_0x8005, 0
Expand Down Expand Up @@ -539,7 +539,7 @@ BattleFrontier_BattlePikeRoomNormal_EventScript_NormalNPC::
lock
faceplayer
pike_getnpcmsg
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
waitmessage
closemessage
release
Expand Down
2 changes: 1 addition & 1 deletion data/maps/BattleFrontier_BattleTowerBattleRoom/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ BattleFrontier_BattleTowerBattleRoom_EventScript_OpponentEnter::
applymovement LOCALID_OPPONENT, BattleFrontier_BattleTowerBattleRoom_Movement_OpponentEnter
waitmovement 0
tower_getopponentintro 0
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
waitmessage
call BattleFrontier_BattleTowerBattleRoom_EventScript_DoTowerBattle
switch VAR_RESULT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_OpponentsEnter::
delay 15
applymovement LOCALID_OPPONENT_1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_WalkInPlaceLeft
waitmovement 0
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
waitmessage
tower_getopponentintro 1
applymovement LOCALID_OPPONENT_2, BattleFrontier_BattleTowerMultiBattleRoom_Movement_WalkInPlaceLeft
waitmovement 0
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
waitmessage
goto BattleFrontier_BattleTowerMultiBattleRoom_EventScript_DoTowerBattle

Expand All @@ -89,13 +89,13 @@ BattleFrontier_BattleTowerMultiBattleRoom_EventScript_DoOpponentIntrosLink::
delay 15
applymovement LOCALID_OPPONENT_1, BattleFrontier_BattleTowerMultiBattleRoom_Movement_WalkInPlaceLeft
waitmovement 0
messageautoscroll gStringVar4
messageautoscroll gStringVarBuffer
waitmessage
delay 48
tower_getopponentintro 1
applymovement LOCALID_OPPONENT_2, BattleFrontier_BattleTowerMultiBattleRoom_Movement_WalkInPlaceLeft
waitmovement 0
messageautoscroll gStringVar4
messageautoscroll gStringVarBuffer
waitmessage
delay 48
BattleFrontier_BattleTowerMultiBattleRoom_EventScript_DoTowerBattle::
Expand Down
2 changes: 1 addition & 1 deletion data/maps/FallarborTown_BattleTentBattleRoom/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ FallarborTown_BattleTentBattleRoom_EventScript_NextOpponentEnter::
waitmovement 0
msgbox BattleFrontier_BattleArenaBattleRoom_Text_SetKOTourneyBegin, MSGBOX_DEFAULT
battletent_getopponentintro
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
waitmessage
call BattleFrontier_BattleArenaBattleRoom_EventScript_DoArenaBattle
switch VAR_RESULT
Expand Down
2 changes: 1 addition & 1 deletion data/maps/SlateportCity_BattleTentBattleRoom/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ SlateportCity_BattleTentBattleRoom_EventScript_EnterRoom::
waitmovement 0
battletent_getopponentintro
lockall
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
waitmessage
closemessage
special HealPlayerParty
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ SootopolisCity_MysteryEventsHouse_B1F_EventScript_BattleVisitingTrainer::
applymovement OBJ_EVENT_ID_PLAYER, SootopolisCity_MysteryEventsHouse_B1F_Movement_PlayerEnterBasement
waitmovement 0
special CopyEReaderTrainerGreeting
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
closemessage
setvar VAR_0x8004, SPECIAL_BATTLE_EREADER
setvar VAR_0x8005, 0
Expand Down
2 changes: 1 addition & 1 deletion data/maps/VerdanturfTown_BattleTentBattleRoom/scripts.inc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ VerdanturfTown_BattleTentBattleRoom_EventScript_NextOpponentEnter::
applymovement LOCALID_OPPONENT, VerdanturfTown_BattleTentBattleRoom_Movement_OpponentEnter
waitmovement 0
battletent_getopponentintro
msgbox gStringVar4, MSGBOX_DEFAULT
msgbox gStringVarBuffer, MSGBOX_DEFAULT
waitmessage
call BattleFrontier_BattlePalaceBattleRoom_EventScript_DoPalaceBattle
switch VAR_RESULT
Expand Down
2 changes: 1 addition & 1 deletion include/string_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
extern u8 gStringVar1[0x100];
extern u8 gStringVar2[0x100];
extern u8 gStringVar3[0x100];
extern u8 gStringVar4[0x3E8];
extern u8 gStringVarBuffer[0x3E8];

enum StringConvertMode
{
Expand Down
6 changes: 3 additions & 3 deletions src/apprentice.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void BufferApprenticeChallengeText(u8 saveApprenticeId)
ConvertInternationalString(gStringVar1, gSaveBlock2Ptr->apprentices[saveApprenticeId].language);
ConvertIntToDecimalStringN(gStringVar2, gSaveBlock2Ptr->apprentices[saveApprenticeId].number, STR_CONV_MODE_RIGHT_ALIGN, i);
challengeText = sApprenticeChallengeTexts[gSaveBlock2Ptr->apprentices[saveApprenticeId].id];
StringExpandPlaceholders(gStringVar4, challengeText);
StringExpandPlaceholders(gStringVarBuffer, challengeText);
}

void Apprentice_ScriptContext_Enable(void)
Expand Down Expand Up @@ -902,7 +902,7 @@ static void PrintApprenticeMessage(void)
return;
}

StringExpandPlaceholders(gStringVar4, string);
StringExpandPlaceholders(gStringVarBuffer, string);
AddTextPrinterForMessage(TRUE);
CreateTask(Task_WaitForPrintingMessage, 1);
}
Expand Down Expand Up @@ -1082,7 +1082,7 @@ static void ApprenticeBufferString(void)
break;
case APPRENTICE_BUFF_WIN_SPEECH:
FrontierSpeechToString(gSaveBlock2Ptr->apprentices[0].speechWon);
StringCopy(stringDst, gStringVar4);
StringCopy(stringDst, gStringVarBuffer);
break;
case APPRENTICE_BUFF_LEAD_MON_SPECIES:
speciesArrayId = APPRENTICE_SPECIES_ID(PLAYER_APPRENTICE.leadMonId);
Expand Down
4 changes: 2 additions & 2 deletions src/battle_dome.c
Original file line number Diff line number Diff line change
Expand Up @@ -4928,8 +4928,8 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo)
textPrinter.fgColor = TEXT_DYNAMIC_COLOR_5;
textPrinter.bgColor = TEXT_COLOR_TRANSPARENT;
textPrinter.shadowColor = TEXT_DYNAMIC_COLOR_4;
StringExpandPlaceholders(gStringVar4, sBattleDomeWinTexts[winStringId]);
textPrinter.currentChar = gStringVar4;
StringExpandPlaceholders(gStringVarBuffer, sBattleDomeWinTexts[winStringId]);
textPrinter.currentChar = gStringVarBuffer;
textPrinter.windowId = windowId + WIN_MATCH_WIN_TEXT;
textPrinter.fontId = FONT_NORMAL;
PutWindowTilemap(windowId + WIN_MATCH_WIN_TEXT);
Expand Down
24 changes: 12 additions & 12 deletions src/battle_factory_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -1884,9 +1884,9 @@ static void Select_PrintMonSpecies(void)

FillWindowPixelBuffer(SELECT_WIN_SPECIES, PIXEL_FILL(0));
species = GetMonData(&sFactorySelectScreen->mons[monId].monData, MON_DATA_SPECIES, NULL);
StringCopy(gStringVar4, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86);
AddTextPrinterParameterized3(SELECT_WIN_SPECIES, FONT_NORMAL, x, 1, sSpeciesNameTextColors, 0, gStringVar4);
StringCopy(gStringVarBuffer, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVarBuffer, 86);
AddTextPrinterParameterized3(SELECT_WIN_SPECIES, FONT_NORMAL, x, 1, sSpeciesNameTextColors, 0, gStringVarBuffer);
CopyWindowToVram(SELECT_WIN_SPECIES, COPYWIN_GFX);
}

Expand Down Expand Up @@ -3789,9 +3789,9 @@ static void Swap_PrintMonSpecies(void)
species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES, NULL);
else
species = GetMonData(&gEnemyParty[monId], MON_DATA_SPECIES, NULL);
StringCopy(gStringVar4, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86);
AddTextPrinterParameterized3(SWAP_WIN_SPECIES, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4);
StringCopy(gStringVarBuffer, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVarBuffer, 86);
AddTextPrinterParameterized3(SWAP_WIN_SPECIES, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVarBuffer);
CopyWindowToVram(SWAP_WIN_SPECIES, COPYWIN_FULL);
}
}
Expand Down Expand Up @@ -3898,9 +3898,9 @@ static void Swap_PrintMonSpeciesAtFade(void)
species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES, NULL);
else
species = GetMonData(&gEnemyParty[monId], MON_DATA_SPECIES, NULL);
StringCopy(gStringVar4, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86);
AddTextPrinterParameterized3(SWAP_WIN_SPECIES_AT_FADE, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4);
StringCopy(gStringVarBuffer, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVarBuffer, 86);
AddTextPrinterParameterized3(SWAP_WIN_SPECIES_AT_FADE, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVarBuffer);
CopyWindowToVram(SWAP_WIN_SPECIES_AT_FADE, COPYWIN_FULL);
}
}
Expand All @@ -3925,9 +3925,9 @@ static void Swap_PrintMonSpeciesForTransition(void)
species = GetMonData(&gPlayerParty[monId], MON_DATA_SPECIES, NULL);
else
species = GetMonData(&gEnemyParty[monId], MON_DATA_SPECIES, NULL);
StringCopy(gStringVar4, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86);
AddTextPrinterParameterized3(SWAP_WIN_SPECIES, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4);
StringCopy(gStringVarBuffer, gSpeciesNames[species]);
x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVarBuffer, 86);
AddTextPrinterParameterized3(SWAP_WIN_SPECIES, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVarBuffer);
CopyWindowToVram(SWAP_WIN_SPECIES, COPYWIN_FULL);
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/battle_message.c
Original file line number Diff line number Diff line change
Expand Up @@ -2601,12 +2601,12 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
{
CopyFrontierTrainerText(FRONTIER_PLAYER_WON_TEXT, gTrainerBattleOpponent_A);
toCpy = gStringVar4;
toCpy = gStringVarBuffer;
}
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
CopyTrainerHillTrainerText(TRAINER_HILL_TEXT_PLAYER_WON, gTrainerBattleOpponent_A);
toCpy = gStringVar4;
toCpy = gStringVarBuffer;
}
else
{
Expand All @@ -2617,12 +2617,12 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
{
CopyFrontierTrainerText(FRONTIER_PLAYER_LOST_TEXT, gTrainerBattleOpponent_A);
toCpy = gStringVar4;
toCpy = gStringVarBuffer;
}
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
CopyTrainerHillTrainerText(TRAINER_HILL_TEXT_PLAYER_LOST, gTrainerBattleOpponent_A);
toCpy = gStringVar4;
toCpy = gStringVarBuffer;
}
break;
case B_TXT_26: // ?
Expand Down Expand Up @@ -2698,12 +2698,12 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
{
CopyFrontierTrainerText(FRONTIER_PLAYER_WON_TEXT, gTrainerBattleOpponent_B);
toCpy = gStringVar4;
toCpy = gStringVarBuffer;
}
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
CopyTrainerHillTrainerText(TRAINER_HILL_TEXT_PLAYER_WON, gTrainerBattleOpponent_B);
toCpy = gStringVar4;
toCpy = gStringVarBuffer;
}
else
{
Expand All @@ -2714,12 +2714,12 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
{
CopyFrontierTrainerText(FRONTIER_PLAYER_LOST_TEXT, gTrainerBattleOpponent_B);
toCpy = gStringVar4;
toCpy = gStringVarBuffer;
}
else if (gBattleTypeFlags & BATTLE_TYPE_TRAINER_HILL)
{
CopyTrainerHillTrainerText(TRAINER_HILL_TEXT_PLAYER_LOST, gTrainerBattleOpponent_B);
toCpy = gStringVar4;
toCpy = gStringVarBuffer;
}
break;
case B_TXT_PARTNER_CLASS:
Expand Down
Loading
Loading