diff --git a/gflib/bg.c b/gflib/bg.c index 66dd81a25e..d6b2cf31e9 100644 --- a/gflib/bg.c +++ b/gflib/bg.c @@ -34,8 +34,8 @@ struct BgConfig2 u32 unk_3:18; void* tilemap; - s32 bg_x; - s32 bg_y; + u32 bg_x; + u32 bg_y; }; static struct BgControl sGpuBgConfigs; diff --git a/gflib/text.c b/gflib/text.c index 636fe50a97..2f4dc4f193 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -154,7 +154,7 @@ u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 printerTemplate.currentY = y; printerTemplate.letterSpacing = gFonts[fontId].letterSpacing; printerTemplate.lineSpacing = gFonts[fontId].lineSpacing; - printerTemplate.unk = gFonts[fontId].unk; + printerTemplate.style = gFonts[fontId].style; printerTemplate.fgColor = gFonts[fontId].fgColor; printerTemplate.bgColor = gFonts[fontId].bgColor; printerTemplate.shadowColor = gFonts[fontId].shadowColor; @@ -484,7 +484,7 @@ u8 GetLastTextColor(u8 colorType) { \ dst = windowTiles + ((j / 8) * 32) + ((j & 7) >> 1) + ((i / 8) * widthOffset) + ((i & 7) * 4); \ bits = ((j & 1) * 4); \ - *dst = (toOrr << bits) | ((0xF0 >> bits) & *dst); \ + *dst = (toOrr << bits) | (*dst & (0xF0 >> bits)); \ } \ r5 >>= 4; \ } \ @@ -1567,7 +1567,7 @@ void SetDefaultFontsPointer(void) u8 GetFontAttribute(u8 fontId, u8 attributeId) { - int result = 0; + u8 result = 0; switch (attributeId) { case FONTATTR_MAX_LETTER_WIDTH: @@ -1582,8 +1582,8 @@ u8 GetFontAttribute(u8 fontId, u8 attributeId) case FONTATTR_LINE_SPACING: result = gFontInfos[fontId].lineSpacing; break; - case FONTATTR_UNKNOWN: - result = gFontInfos[fontId].unk; + case FONTATTR_STYLE: + result = gFontInfos[fontId].style; break; case FONTATTR_COLOR_FOREGROUND: result = gFontInfos[fontId].fgColor; diff --git a/gflib/text.h b/gflib/text.h index 0829d748f3..b76897757f 100644 --- a/gflib/text.h +++ b/gflib/text.h @@ -282,7 +282,7 @@ enum FONTATTR_MAX_LETTER_HEIGHT, FONTATTR_LETTER_SPACING, FONTATTR_LINE_SPACING, - FONTATTR_UNKNOWN, // dunno what this is yet + FONTATTR_STYLE, FONTATTR_COLOR_FOREGROUND, FONTATTR_COLOR_BACKGROUND, FONTATTR_COLOR_SHADOW @@ -310,7 +310,7 @@ struct TextPrinterTemplate u8 currentY; u8 letterSpacing; u8 lineSpacing; - u8 unk:4; // 0xC + u8 style:4; // 0xC u8 fgColor:4; u8 bgColor:4; u8 shadowColor:4; @@ -339,7 +339,7 @@ struct FontInfo u8 maxLetterHeight; u8 letterSpacing; u8 lineSpacing; - u8 unk:4; + u8 style:4; //unused u8 fgColor:4; u8 bgColor:4; u8 shadowColor:4; diff --git a/include/list_menu.h b/include/list_menu.h index 0a54a069ad..4697ba5aa6 100644 --- a/include/list_menu.h +++ b/include/list_menu.h @@ -24,7 +24,7 @@ struct ListMenu; struct ListMenuItem { const u8 *name; - s32 id; + u32 id; }; struct ListMenuTemplate @@ -98,7 +98,7 @@ struct CursorStruct extern struct ScrollArrowsTemplate gTempScrollArrowTemplate; extern struct ListMenuTemplate gMultiuseListMenuTemplate; -s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum); +u32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum); u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 selectedRow); u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenuWindowRect *arg1, u16 scrollOffset, u16 selectedRow); s32 ListMenu_ProcessInput(u8 listTaskId); diff --git a/src/battle_dome.c b/src/battle_dome.c index babc8d7df0..16798f46ca 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -4547,7 +4547,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) textPrinter.currentY = textPrinter.y; textPrinter.letterSpacing = 2; textPrinter.lineSpacing = 0; - textPrinter.unk = 0; + textPrinter.style = 0; textPrinter.fgColor = TEXT_DYNAMIC_COLOR_5; textPrinter.bgColor = TEXT_COLOR_TRANSPARENT; textPrinter.shadowColor = TEXT_DYNAMIC_COLOR_4; @@ -5080,7 +5080,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo) textPrinter.currentY = textPrinter.y; textPrinter.letterSpacing = 0; textPrinter.lineSpacing = 0; - textPrinter.unk = 0; + textPrinter.style = 0; textPrinter.fgColor = TEXT_DYNAMIC_COLOR_5; textPrinter.bgColor = TEXT_COLOR_TRANSPARENT; textPrinter.shadowColor = TEXT_DYNAMIC_COLOR_4; @@ -5578,7 +5578,7 @@ static void Task_ShowTourneyTree(u8 taskId) textPrinter.lineSpacing = 0; textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0x70, textPrinter.letterSpacing); textPrinter.currentY = 1; - textPrinter.unk = 0; + textPrinter.style = 0; textPrinter.fgColor = TEXT_DYNAMIC_COLOR_5; textPrinter.bgColor = TEXT_COLOR_TRANSPARENT; textPrinter.shadowColor = TEXT_DYNAMIC_COLOR_4; @@ -5759,7 +5759,7 @@ static void Task_HandleStaticTourneyTreeInput(u8 taskId) textPrinter.y = 0; textPrinter.letterSpacing = 2; textPrinter.lineSpacing = 0; - textPrinter.unk = 0; + textPrinter.style = 0; textPrinter.fgColor = TEXT_DYNAMIC_COLOR_2; textPrinter.bgColor = TEXT_COLOR_TRANSPARENT; textPrinter.shadowColor = TEXT_DYNAMIC_COLOR_4; diff --git a/src/battle_message.c b/src/battle_message.c index 191fffb016..4e87c93444 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -2995,7 +2995,7 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId) printerTemplate.currentY = printerTemplate.y; printerTemplate.letterSpacing = textInfo[windowId].letterSpacing; printerTemplate.lineSpacing = textInfo[windowId].lineSpacing; - printerTemplate.unk = 0; + printerTemplate.style = 0; printerTemplate.fgColor = textInfo[windowId].fgColor; printerTemplate.bgColor = textInfo[windowId].bgColor; printerTemplate.shadowColor = textInfo[windowId].shadowColor; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b2e02b2876..565e031067 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -6036,7 +6036,7 @@ static void PutLevelAndGenderOnLvlUpBox(void) printerTemplate.currentY = 0; printerTemplate.letterSpacing = 0; printerTemplate.lineSpacing = 0; - printerTemplate.unk = 0; + printerTemplate.style = 0; printerTemplate.fgColor = TEXT_COLOR_WHITE; printerTemplate.bgColor = TEXT_COLOR_TRANSPARENT; printerTemplate.shadowColor = TEXT_COLOR_DARK_GREY; diff --git a/src/contest.c b/src/contest.c index 4470ec2a2c..129bd77940 100644 --- a/src/contest.c +++ b/src/contest.c @@ -5411,7 +5411,7 @@ static void Contest_PrintTextToBg0WindowStd(u32 windowId, const u8 *b) printerTemplate.currentY = 1; printerTemplate.letterSpacing = 0; printerTemplate.lineSpacing = 0; - printerTemplate.unk = 0; + printerTemplate.style = 0; printerTemplate.fgColor = 15; printerTemplate.bgColor = 0; printerTemplate.shadowColor = 8; @@ -5434,7 +5434,7 @@ void Contest_PrintTextToBg0WindowAt(u32 windowId, u8 *currChar, s32 x, s32 y, s3 printerTemplate.currentY = y; printerTemplate.letterSpacing = 0; printerTemplate.lineSpacing = 0; - printerTemplate.unk = 0; + printerTemplate.style = 0; printerTemplate.fgColor = 15; printerTemplate.bgColor = 0; printerTemplate.shadowColor = 8; @@ -5458,7 +5458,7 @@ static void Contest_StartTextPrinter(const u8 *currChar, bool32 b) printerTemplate.currentY = 1; printerTemplate.letterSpacing = 0; printerTemplate.lineSpacing = 0; - printerTemplate.unk = 0; + printerTemplate.style = 0; printerTemplate.fgColor = 1; printerTemplate.bgColor = 0; printerTemplate.shadowColor = 8; diff --git a/src/contest_util.c b/src/contest_util.c index 00254248f8..cfcb7ca3ce 100644 --- a/src/contest_util.c +++ b/src/contest_util.c @@ -2201,7 +2201,7 @@ static void AddContestTextPrinter(int windowId, u8 *str, int x) textPrinter.currentY = 2; textPrinter.letterSpacing = 0; textPrinter.lineSpacing = 0; - textPrinter.unk = 0; + textPrinter.style = 0; textPrinter.fgColor = 1; textPrinter.bgColor = 0; textPrinter.shadowColor = 8; diff --git a/src/daycare.c b/src/daycare.c index 5d44804039..b87c326e95 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -1186,7 +1186,7 @@ static void DaycareAddTextPrinter(u8 windowId, const u8 *text, u32 x, u32 y) printer.y = y; printer.currentX = x; printer.currentY = y; - printer.unk = 0; + printer.style = 0; gTextFlags.useAlternateDownArrow = 0; printer.letterSpacing = 0; printer.lineSpacing = 1; diff --git a/src/list_menu.c b/src/list_menu.c index ebf02bab65..73fdba63e1 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -312,7 +312,7 @@ static void ListMenuDummyTask(u8 taskId) } -s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum) +u32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const struct ListMenuTemplate *listMenuTemplate, u8 arg2, u16 tileNum, u16 palNum) { switch (sMysteryGiftLinkMenu.state) { diff --git a/src/match_call.c b/src/match_call.c index 307b844136..21edb1b771 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -1335,7 +1335,7 @@ static void InitMatchCallTextPrinter(int windowId, const u8 *str) printerTemplate.currentY = 1; printerTemplate.letterSpacing = 0; printerTemplate.lineSpacing = 0; - printerTemplate.unk = 0; + printerTemplate.style = 0; printerTemplate.fgColor = 10; printerTemplate.bgColor = 8; printerTemplate.shadowColor = 14; diff --git a/src/menu.c b/src/menu.c index e9d4207c9a..eb980ed2ed 100644 --- a/src/menu.c +++ b/src/menu.c @@ -180,7 +180,7 @@ u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed printer.currentY = 1; printer.letterSpacing = 0; printer.lineSpacing = 0; - printer.unk = 0; + printer.style = 0; printer.fgColor = fgColor; printer.bgColor = bgColor; printer.shadowColor = shadowColor; @@ -1130,7 +1130,7 @@ void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 l printer.fgColor = GetFontAttribute(fontId, FONTATTR_COLOR_FOREGROUND); printer.bgColor = GetFontAttribute(fontId, FONTATTR_COLOR_BACKGROUND); printer.shadowColor = GetFontAttribute(fontId, FONTATTR_COLOR_SHADOW); - printer.unk = GetFontAttribute(fontId, FONTATTR_UNKNOWN); + printer.style = GetFontAttribute(fontId, FONTATTR_STYLE); printer.letterSpacing = letterSpacing; printer.lineSpacing = GetFontAttribute(fontId, FONTATTR_LINE_SPACING); printer.x = left; @@ -1194,7 +1194,7 @@ void sub_8198AF8(const struct WindowTemplate *window, u8 fontId, u8 left, u8 top printer.fgColor = GetFontAttribute(fontId, FONTATTR_COLOR_FOREGROUND); printer.bgColor = GetFontAttribute(fontId, FONTATTR_COLOR_BACKGROUND); printer.shadowColor = GetFontAttribute(fontId, FONTATTR_COLOR_SHADOW); - printer.unk = GetFontAttribute(fontId, FONTATTR_UNKNOWN); + printer.style = GetFontAttribute(fontId, FONTATTR_STYLE); printer.letterSpacing = GetFontAttribute(fontId, FONTATTR_LETTER_SPACING); printer.lineSpacing = GetFontAttribute(fontId, FONTATTR_LINE_SPACING); @@ -1252,7 +1252,7 @@ void sub_8198DBC(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 itemCount, u printer.fgColor = GetFontAttribute(fontId, FONTATTR_COLOR_FOREGROUND); printer.bgColor = GetFontAttribute(fontId, FONTATTR_COLOR_BACKGROUND); printer.shadowColor = GetFontAttribute(fontId, FONTATTR_COLOR_SHADOW); - printer.unk = GetFontAttribute(fontId, FONTATTR_UNKNOWN); + printer.style = GetFontAttribute(fontId, FONTATTR_STYLE); printer.letterSpacing = GetFontAttribute(fontId, FONTATTR_LETTER_SPACING); printer.lineSpacing = GetFontAttribute(fontId, FONTATTR_LINE_SPACING); @@ -1625,7 +1625,7 @@ void sub_81995E4(u8 windowId, u8 itemCount, const struct MenuAction *strs, const printer.fgColor = GetFontAttribute(1, FONTATTR_COLOR_FOREGROUND); printer.bgColor = GetFontAttribute(1, FONTATTR_COLOR_BACKGROUND); printer.shadowColor = GetFontAttribute(1, FONTATTR_COLOR_SHADOW); - printer.unk = GetFontAttribute(1, FONTATTR_UNKNOWN); + printer.style = GetFontAttribute(1, FONTATTR_STYLE); printer.letterSpacing = 0; printer.lineSpacing = 0; printer.x = 8; @@ -1659,7 +1659,7 @@ void CreateYesNoMenu(const struct WindowTemplate *window, u16 baseTileNum, u8 pa printer.fgColor = GetFontAttribute(1, FONTATTR_COLOR_FOREGROUND); printer.bgColor = GetFontAttribute(1, FONTATTR_COLOR_BACKGROUND); printer.shadowColor = GetFontAttribute(1, FONTATTR_COLOR_SHADOW); - printer.unk = GetFontAttribute(1, FONTATTR_UNKNOWN); + printer.style = GetFontAttribute(1, FONTATTR_STYLE); printer.letterSpacing = 0; printer.lineSpacing = 0; @@ -1690,7 +1690,7 @@ void sub_819983C(u8 windowId, u8 a4, u8 itemCount, u8 itemCount2, const struct M printer.fgColor = GetFontAttribute(1, FONTATTR_COLOR_FOREGROUND); printer.bgColor = GetFontAttribute(1, FONTATTR_COLOR_BACKGROUND); printer.shadowColor = GetFontAttribute(1, FONTATTR_COLOR_SHADOW); - printer.unk = GetFontAttribute(1, FONTATTR_UNKNOWN); + printer.style = GetFontAttribute(1, FONTATTR_STYLE); printer.letterSpacing = 0; printer.lineSpacing = 0; @@ -1957,7 +1957,7 @@ void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const printer.currentY = printer.y; printer.letterSpacing = GetFontAttribute(fontId, 2); printer.lineSpacing = GetFontAttribute(fontId, 3); - printer.unk = 0; + printer.style = 0; printer.fgColor = color[1]; printer.bgColor = color[0]; printer.shadowColor = color[2]; @@ -1978,7 +1978,7 @@ void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 left, u8 top, u8 le printer.currentY = printer.y; printer.letterSpacing = letterSpacing; printer.lineSpacing = lineSpacing; - printer.unk = 0; + printer.style = 0; printer.fgColor = color[1]; printer.bgColor = color[0]; printer.shadowColor = color[2]; @@ -1999,7 +1999,7 @@ void AddTextPrinterParameterized5(u8 windowId, u8 fontId, const u8 *str, u8 left printer.currentY = top; printer.letterSpacing = letterSpacing; printer.lineSpacing = lineSpacing; - printer.unk = 0; + printer.style = 0; printer.fgColor = GetFontAttribute(fontId, 5); printer.bgColor = GetFontAttribute(fontId, 6); diff --git a/src/union_room.c b/src/union_room.c index 639420d719..96c16deba3 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -3754,7 +3754,7 @@ static void UR_AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str printerTemplate.y = y; printerTemplate.currentX = x; printerTemplate.currentY = y; - printerTemplate.unk = 0; + printerTemplate.style = 0; gTextFlags.useAlternateDownArrow = FALSE; switch (colorIdx)