This commit is contained in:
PikalaxALT
2019-05-05 14:56:59 -04:00
parent 7f07bd6607
commit a37da53f20
24 changed files with 2770 additions and 3338 deletions
File diff suppressed because it is too large Load Diff
+1353
View File
File diff suppressed because it is too large Load Diff
+13 -13
View File
@@ -426,9 +426,9 @@ static const u8 gUnknown_845FD54[][5] = {
void box_print(u8 windowId, u8 fontId, u8 x, u8 y, const struct TextColor * color, s8 speed, const u8 * str)
{
struct TextSubPrinter printer;
struct TextPrinterTemplate printer;
printer.current_text_offset = str;
printer.currentChar = str;
printer.windowId = windowId;
printer.fontId = fontId;
printer.x = x;
@@ -437,8 +437,8 @@ void box_print(u8 windowId, u8 fontId, u8 x, u8 y, const struct TextColor * colo
printer.currentY = printer.y;
printer.letterSpacing = GetFontAttribute(fontId, 2);
printer.lineSpacing = GetFontAttribute(fontId, 3);
printer.fontColor_l = 0;
printer.fontColor_h = color->bgColor;
printer.unk = 0;
printer.fgColor = color->bgColor;
printer.bgColor = color->fgColor;
printer.shadowColor = color->shadowColor;
AddTextPrinter(&printer, speed, NULL);
@@ -446,9 +446,9 @@ void box_print(u8 windowId, u8 fontId, u8 x, u8 y, const struct TextColor * colo
void AddTextPrinterParametrized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const struct TextColor *color, s8 speed, const u8 *str)
{
struct TextSubPrinter printer;
struct TextPrinterTemplate printer;
printer.current_text_offset = str;
printer.currentChar = str;
printer.windowId = windowId;
printer.fontId = fontId;
printer.x = x;
@@ -457,18 +457,18 @@ void AddTextPrinterParametrized2(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSp
printer.currentY = printer.y;
printer.letterSpacing = letterSpacing;
printer.lineSpacing = lineSpacing;
printer.fontColor_l = 0;
printer.fontColor_h = color->bgColor;
printer.unk = 0;
printer.fgColor = color->bgColor;
printer.bgColor = color->fgColor;
printer.shadowColor = color->shadowColor;
AddTextPrinter(&printer, speed, NULL);
}
void sub_812E62C(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 letterSpacing, u8 lineSpacing)
void sub_812E62C(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 letterSpacing, u8 lineSpacing)
{
struct TextSubPrinter printer;
struct TextPrinterTemplate printer;
printer.current_text_offset = str;
printer.currentChar = str;
printer.windowId = windowId;
printer.fontId = fontId;
printer.x = x;
@@ -477,8 +477,8 @@ void sub_812E62C(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, vo
printer.currentY = y;
printer.letterSpacing = letterSpacing;
printer.lineSpacing = lineSpacing;
printer.fontColor_l = 0;
printer.fontColor_h = GetFontAttribute(fontId, 5);
printer.unk = 0;
printer.fgColor = GetFontAttribute(fontId, 5);
printer.bgColor = GetFontAttribute(fontId, 6);
printer.shadowColor = GetFontAttribute(fontId, 7);
AddTextPrinter(&printer, speed, callback);
+3 -3
View File
@@ -535,7 +535,7 @@ static void Task_OaksSpeech1(u8 taskId)
break;
case 5:
sOakSpeechResources->textSpeed = GetTextSpeedSetting();
gTextFlags.flag_0 = TRUE;
gTextFlags.canABSpeedUpPrint = TRUE;
decompress_and_copy_tile_data_to_vram(1, sOakSpeechGfx_GameStartHelpUI, 0, 0, 0);
break;
case 6:
@@ -1516,7 +1516,7 @@ static void Task_OakSpeech42(u8 taskId)
sub_8044D80();
Free(sOakSpeechResources);
sOakSpeechResources = NULL;
gTextFlags.flag_0 = FALSE;
gTextFlags.canABSpeedUpPrint = FALSE;
SetMainCallback2(CB2_NewGame);
DestroyTask(taskId);
}
@@ -1600,7 +1600,7 @@ static void CB2_ReturnFromNamingScreen(void)
ShowBg(2);
EnableInterrupts(INTR_FLAG_VBLANK);
SetVBlankCallback(VBlankCB_NewGameOaksSpeech);
gTextFlags.flag_0 = TRUE;
gTextFlags.canABSpeedUpPrint = TRUE;
SetMainCallback2(CB2_NewGameOaksSpeech);
return;
}
+7 -7
View File
@@ -1415,13 +1415,13 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data)
case MON_DATA_LANGUAGE:
retVal = boxMon->language;
break;
case MON_DATA_SANITY_BIT1:
case MON_DATA_SANITY_IS_BAD_EGG:
retVal = boxMon->isBadEgg;
break;
case MON_DATA_SANITY_BIT2:
case MON_DATA_SANITY_HAS_SPECIES:
retVal = boxMon->hasSpecies;
break;
case MON_DATA_SANITY_BIT3:
case MON_DATA_SANITY_IS_EGG:
retVal = boxMon->isEgg;
break;
case MON_DATA_OT_NAME:
@@ -1809,13 +1809,13 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg)
case MON_DATA_LANGUAGE:
SET8(boxMon->language);
break;
case MON_DATA_SANITY_BIT1:
case MON_DATA_SANITY_IS_BAD_EGG:
SET8(boxMon->isBadEgg);
break;
case MON_DATA_SANITY_BIT2:
case MON_DATA_SANITY_HAS_SPECIES:
SET8(boxMon->hasSpecies);
break;
case MON_DATA_SANITY_BIT3:
case MON_DATA_SANITY_IS_EGG:
SET8(boxMon->isEgg);
break;
case MON_DATA_OT_NAME:
@@ -5223,7 +5223,7 @@ void sub_8043B48(struct Pokemon *mon, int species, u8 unused, u32 data)
}
}
bool32 sub_8043B90(struct Pokemon *mon)
bool8 TryIncrementMonLevel(struct Pokemon *mon)
{
u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL);
u8 level = GetMonData(mon, MON_DATA_LEVEL, NULL);
+5 -5
View File
@@ -1055,7 +1055,7 @@ void sub_8111438(void)
{
for (r6 = 0; r6 < 30; r6++)
{
if (GetBoxMonDataFromAnyBox(r3, r6, MON_DATA_SANITY_BIT2))
if (GetBoxMonDataFromAnyBox(r3, r6, MON_DATA_SANITY_HAS_SPECIES))
{
sub_808BCB4(r3, r6);
r5--;
@@ -1074,7 +1074,7 @@ void sub_8111438(void)
for (r6 = 0; r6 < IN_BOX_COUNT; r6++)
{
struct BoxPokemon * boxMon = GetBoxedMonPtr(r3, r6);
if (!GetBoxMonData(boxMon, MON_DATA_SANITY_BIT2))
if (!GetBoxMonData(boxMon, MON_DATA_SANITY_HAS_SPECIES))
{
CopyMon(boxMon, &r9->mon.box, sizeof(struct BoxPokemon));
r5++;
@@ -1104,7 +1104,7 @@ u16 sub_8111618(void)
for (i = 0; i < PARTY_SIZE; i++)
{
if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_BIT2))
if (GetMonData(&gPlayerParty[i], MON_DATA_SANITY_HAS_SPECIES))
count++;
}
@@ -1120,7 +1120,7 @@ u16 sub_811164C(void)
{
for (j = 0; j < IN_BOX_COUNT; j++)
{
if (GetBoxMonDataFromAnyBox(i, j, MON_DATA_SANITY_BIT2))
if (GetBoxMonDataFromAnyBox(i, j, MON_DATA_SANITY_HAS_SPECIES))
count++;
}
}
@@ -1599,7 +1599,7 @@ void sub_81120AC(u8 taskId)
gUnknown_203AE94 = (struct UnkStruct_203AE94){};
sub_80696C0();
ScriptContext2_Disable();
gTextFlags.flag_2 = FALSE;
gTextFlags.autoScroll = FALSE;
gUnknown_2036E28 = 0;
sub_8082740(0);
gUnknown_3005ECC = 1;
+6 -6
View File
@@ -453,7 +453,7 @@ void TextPrinterInitDownArrowCounters(struct TextPrinter *textPrinter)
{
struct TextPrinterSubStruct *subStruct = &textPrinter->sub_union.sub;
if (gTextFlags.flag_2 == 1)
if (gTextFlags.autoScroll == 1)
subStruct->frames_visible_counter = 0;
else
{
@@ -467,7 +467,7 @@ void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter)
struct TextPrinterSubStruct *subStruct = &textPrinter->sub_union.sub;
const u8 *arrowTiles;
if (gTextFlags.flag_2 == 0)
if (gTextFlags.autoScroll == 0)
{
if (subStruct->field_1 != 0)
{
@@ -483,7 +483,7 @@ void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter)
10,
12);
switch (gTextFlags.flag_1)
switch (gTextFlags.useAlternateDownArrow)
{
case 0:
default:
@@ -544,7 +544,7 @@ bool8 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter)
bool16 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter)
{
bool8 result = FALSE;
if (gTextFlags.flag_2 != 0)
if (gTextFlags.autoScroll != 0)
{
result = TextPrinterWaitAutoMode(textPrinter);
}
@@ -563,7 +563,7 @@ bool16 TextPrinterWaitWithDownArrow(struct TextPrinter *textPrinter)
bool16 TextPrinterWait(struct TextPrinter *textPrinter)
{
bool16 result = FALSE;
if (gTextFlags.flag_2 != 0)
if (gTextFlags.autoScroll != 0)
{
result = TextPrinterWaitAutoMode(textPrinter);
}
@@ -591,7 +591,7 @@ void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *c
FillWindowPixelRect(windowId, (bgColor << 4) | bgColor, x, y, 10, 12);
if (drawArrow == 0)
{
switch (gTextFlags.flag_1)
switch (gTextFlags.useAlternateDownArrow)
{
case 0:
default:
+7 -7
View File
@@ -48,11 +48,11 @@ void DeactivateAllTextPrinters (void)
sTextPrinters[printer].sub_union.sub.active = 0;
}
u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextSubPrinter *, u16))
u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16))
{
struct TextSubPrinter subPrinter;
struct TextPrinterTemplate subPrinter;
subPrinter.current_text_offset = str;
subPrinter.currentChar = str;
subPrinter.windowId = windowId;
subPrinter.fontId = fontId;
subPrinter.x = x;
@@ -61,14 +61,14 @@ u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 x, u8
subPrinter.currentY = y;
subPrinter.letterSpacing = gFonts[fontId].letterSpacing;
subPrinter.lineSpacing = gFonts[fontId].lineSpacing;
subPrinter.fontColor_l = gFonts[fontId].fontColor_l;
subPrinter.fontColor_h = gFonts[fontId].fontColor_h;
subPrinter.unk = gFonts[fontId].unk;
subPrinter.fgColor = gFonts[fontId].fgColor;
subPrinter.bgColor = gFonts[fontId].bgColor;
subPrinter.shadowColor = gFonts[fontId].shadowColor;
return AddTextPrinter(&subPrinter, speed, callback);
}
bool16 AddTextPrinter(struct TextSubPrinter *textSubPrinter, u8 speed, void (*callback)(struct TextSubPrinter *, u16))
bool16 AddTextPrinter(struct TextPrinterTemplate *textSubPrinter, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16))
{
int i;
u16 j;
@@ -92,7 +92,7 @@ bool16 AddTextPrinter(struct TextSubPrinter *textSubPrinter, u8 speed, void (*ca
sTempTextPrinter.minLetterSpacing = 0;
sTempTextPrinter.japanese = 0;
GenerateFontHalfRowLookupTable(textSubPrinter->fontColor_h, textSubPrinter->bgColor, textSubPrinter->shadowColor);
GenerateFontHalfRowLookupTable(textSubPrinter->fgColor, textSubPrinter->bgColor, textSubPrinter->shadowColor);
if (speed != TEXT_SPEED_FF && speed != 0x0)
{
--sTempTextPrinter.text_speed;
+1 -1
View File
@@ -281,7 +281,7 @@ void InitTMCase(u8 type, void (* callback)(void), u8 a2)
sTMCaseStaticResources.savedCallback = callback;
if (a2 != 0xFF)
sTMCaseStaticResources.unk_05 = a2;
gTextFlags.flag_2 = FALSE;
gTextFlags.autoScroll = FALSE;
SetMainCallback2(CB2_SetUpTMCaseUI_Blocking);
}