From bad170b0cb7a0a7ecb8725e6fc458a39c11a7e4d Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Wed, 8 Aug 2018 23:53:21 -0700 Subject: Continue decompiling field_specials --- src/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index 96dda3075..223f8fd52 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1143,7 +1143,7 @@ void SetWindowTemplateFields(struct WindowTemplate *template, u8 bg, u8 left, u8 template->baseBlock = baseBlock; } -struct WindowTemplate sub_8198A50(u8 bg, u8 left, u8 top, u8 width, u8 height, u8 paletteNum, u16 baseBlock) +struct WindowTemplate CreateWindowTemplate(u8 bg, u8 left, u8 top, u8 width, u8 height, u8 paletteNum, u16 baseBlock) { struct WindowTemplate template; SetWindowTemplateFields(&template, bg, left, top, width, height, paletteNum, baseBlock); -- cgit v1.2.3 From 12ff59f9c1d9618a2c7b7408c9ffea8e4c617629 Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Fri, 10 Aug 2018 00:42:06 -0700 Subject: Continue decompiling field_specials --- src/menu.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index 223f8fd52..f4ffec023 100644 --- a/src/menu.c +++ b/src/menu.c @@ -120,7 +120,6 @@ extern void DrawWindowBorder(u8, u8, u8, u8, u8, u8); extern void sub_81980A8(u8, u8, u8, u8, u8, u8); extern u8 MoveMenuCursor(s8); extern u8 sub_8199134(s8, s8); -extern void sub_8199F74(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 letterSpacing, u8 lineSpacing); extern void sub_8198C78(void); extern void task_free_buf_after_copying_tile_data_to_vram(u8 taskId); -- cgit v1.2.3 From 2dd5fc23d4d34890e17a412ae9ad80e23c7aa50d Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Sun, 12 Aug 2018 12:54:07 -0700 Subject: Prepare learn_move for merge --- src/menu.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index f4ffec023..eda9513ba 100644 --- a/src/menu.c +++ b/src/menu.c @@ -986,7 +986,7 @@ s8 ProcessMenuInput(void) return MENU_NOTHING_CHOSEN; } -s8 ProcessMenuInputNoWrapAround(void) +s8 Menu_ProcessInputNoWrapAround(void) { u8 oldPos = gUnknown_0203CD90.cursorPos; @@ -1044,7 +1044,7 @@ s8 ProcessMenuInput_other(void) return MENU_NOTHING_CHOSEN; } -s8 ProcessMenuInputNoWrapAround_other(void) +s8 Menu_ProcessInputNoWrapAround_other(void) { u8 oldPos = gUnknown_0203CD90.cursorPos; @@ -1187,9 +1187,9 @@ void sub_8198C34(const struct WindowTemplate *window, u8 fontId, u16 baseTileNum sub_8198AF8(window, fontId, 0, 1, baseTileNum, paletteNum, 0); } -s8 ProcessMenuInputNoWrap_(void) +s8 Menu_ProcessInputNoWrap_(void) { - s8 result = ProcessMenuInputNoWrapAround(); + s8 result = Menu_ProcessInputNoWrapAround(); if (result != MENU_NOTHING_CHOSEN) sub_8198C78(); return result; -- cgit v1.2.3 From 63cbc8f3ccb11b05c627717a2de82d3134d599d9 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 18 Aug 2018 00:54:18 +0200 Subject: battle dome - a couple more functions --- src/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index eda9513ba..8a4b4fce5 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1801,7 +1801,7 @@ void *decompress_and_copy_tile_data_to_vram(u8 bgId, const void *src, int size, return NULL; } -void copy_decompressed_tile_data_to_vram_autofree(u8 bgId, const void *src, int size, u16 offset, u8 mode) +void DecompressAndLoadBgGfxUsingHeap(u8 bgId, const void *src, int size, u16 offset, u8 mode) { int sizeOut; void *ptr = malloc_and_decompress(src, &sizeOut); -- cgit v1.2.3 From f74adc80c126bd451767c917d53e7240ebcc7950 Mon Sep 17 00:00:00 2001 From: Slawter666 <38655737+Slawter666@users.noreply.github.com> Date: Sun, 2 Sep 2018 17:53:52 +0100 Subject: Format more templates --- src/menu.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index 8a4b4fce5..3acb44985 100644 --- a/src/menu.c +++ b/src/menu.c @@ -65,13 +65,27 @@ static const u8 gUnknown_0860F094[] = { 8, 4, 1 }; static const struct WindowTemplate gUnknown_0860F098[] = { - { 0x00, 0x02, 0x0F, 0x1B, 0x04, 0x0F, 0x194 }, + { + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 15, + .width = 27, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x194 + }, DUMMY_WIN_TEMPLATE }; static const struct WindowTemplate gUnknown_0860F0A8 = { - 0x00, 0x15, 0x09, 0x05, 0x04, 0x0F, 0x125 + .priority = 0, + .tilemapLeft = 21, + .tilemapTop = 9, + .width = 5, + .height = 4, + .paletteNum = 15, + .baseBlock = 0x125 }; const u16 gUnknown_0860F0B0[] = INCBIN_U16("graphics/interface/860F0B0.gbapal"); -- cgit v1.2.3 From 24b9cd721ff1f5c7f2fdd674299d0d2d9f396be2 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 3 Sep 2018 22:55:55 +0200 Subject: More Battle Factory --- src/menu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index 8a4b4fce5..7c9c2f8a8 100644 --- a/src/menu.c +++ b/src/menu.c @@ -799,7 +799,7 @@ void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram) PutWindowTilemap(gUnknown_0203CDA0); FillWindowPixelBuffer(gUnknown_0203CDA0, 0xFF); width = GetStringWidth(0, string, 0); - box_print(gUnknown_0203CDA0, + AddTextPrinterParameterized3(gUnknown_0203CDA0, 0, 0xEC - (GetWindowAttribute(gUnknown_0203CDA0, WINDOW_TILEMAP_LEFT) * 8) - a2 - width, 1, @@ -835,7 +835,7 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo if (string2 != NULL) { width = GetStringWidth(0, string2, 0); - box_print(gUnknown_0203CDA0, + AddTextPrinterParameterized3(gUnknown_0203CDA0, 0, 0xEC - (GetWindowAttribute(gUnknown_0203CDA0, WINDOW_TILEMAP_LEFT) * 8) - a4 - width, 1, @@ -1925,7 +1925,7 @@ void sub_8199DF0(u32 bg, u8 a1, int a2, int a3) RequestDma3Fill(a1 << 24 | a1 << 16 | a1 << 8 | a1, addr + VRAM, a3 * temp, 1); } -void box_print(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str) +void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str) { struct TextSubPrinter printer; -- cgit v1.2.3 From 2f59df03ab8dbd5d9edb28b5680cc668aafc6684 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Sat, 8 Sep 2018 23:38:30 +0200 Subject: Standartize AddTextPrinterParametrized functions, --- src/menu.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index 7c9c2f8a8..38d355cf2 100644 --- a/src/menu.c +++ b/src/menu.c @@ -149,7 +149,7 @@ u16 sub_8197224(void) return IsTextPrinterActive(0); } -u16 AddTextPrinterParameterized(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 fgColor, u8 bgColor, u8 shadowColor) +u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 fgColor, u8 bgColor, u8 shadowColor) { struct TextSubPrinter printer; @@ -175,19 +175,19 @@ void AddTextPrinterForMessage(bool8 allowSkippingDelayWithButtonPress) { void (*callback)(struct TextSubPrinter *, u16) = NULL; gTextFlags.flag_0 = allowSkippingDelayWithButtonPress; - AddTextPrinterParameterized(0, 1, gStringVar4, GetPlayerTextSpeed(), callback, 2, 1, 3); + AddTextPrinterParameterized2(0, 1, gStringVar4, GetPlayerTextSpeed(), callback, 2, 1, 3); } void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress) { gTextFlags.flag_0 = allowSkippingDelayWithButtonPress; - AddTextPrinterParameterized(0, 1, gStringVar4, GetPlayerTextSpeed(), NULL, 2, 1, 3); + AddTextPrinterParameterized2(0, 1, gStringVar4, GetPlayerTextSpeed(), NULL, 2, 1, 3); } void AddTextPrinterWithCustomSpeedForMessage(bool8 allowSkippingDelayWithButtonPress, u8 speed) { gTextFlags.flag_0 = allowSkippingDelayWithButtonPress; - AddTextPrinterParameterized(0, 1, gStringVar4, speed, NULL, 2, 1, 3); + AddTextPrinterParameterized2(0, 1, gStringVar4, speed, NULL, 2, 1, 3); } void sub_81973A4(void) @@ -525,7 +525,7 @@ void RemoveMapNamePopUpWindow(void) void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextSubPrinter *, u16)) { gTextFlags.flag_0 = a1; - AddTextPrinterParameterized(0, 1, gStringVar4, GetPlayerTextSpeed(), callback, 2, 1, 3); + AddTextPrinterParameterized2(0, 1, gStringVar4, GetPlayerTextSpeed(), callback, 2, 1, 3); } void sub_8197AE8(bool8 copyToVram) @@ -843,7 +843,7 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo 0, string2); } - AddTextPrinterParameterized2(gUnknown_0203CDA0, 1, 4, 1, 0, 0, color, 0, string); + AddTextPrinterParameterized4(gUnknown_0203CDA0, 1, 4, 1, 0, 0, color, 0, string); if (copyToVram) CopyWindowToVram(gUnknown_0203CDA0, 3); } @@ -918,7 +918,7 @@ void RedrawMenuCursor(u8 oldPos, u8 newPos) width = GetMenuCursorDimensionByFont(gUnknown_0203CD90.fontId, 0); height = GetMenuCursorDimensionByFont(gUnknown_0203CD90.fontId, 1); FillWindowPixelRect(gUnknown_0203CD90.windowId, 0x11, gUnknown_0203CD90.left, gUnknown_0203CD90.optionHeight * oldPos + gUnknown_0203CD90.top, width, height); - PrintTextOnWindow(gUnknown_0203CD90.windowId, gUnknown_0203CD90.fontId, gText_SelectorArrow3, gUnknown_0203CD90.left, gUnknown_0203CD90.optionHeight * newPos + gUnknown_0203CD90.top, 0, 0); + AddTextPrinterParameterized(gUnknown_0203CD90.windowId, gUnknown_0203CD90.fontId, gText_SelectorArrow3, gUnknown_0203CD90.left, gUnknown_0203CD90.optionHeight * newPos + gUnknown_0203CD90.top, 0, 0); } u8 MoveMenuCursor(s8 cursorDelta) @@ -1079,7 +1079,7 @@ void PrintTextArray(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 i u8 i; for (i = 0; i < itemCount; i++) { - PrintTextOnWindow(windowId, fontId, strs[i].text, left, (lineHeight * i) + top, 0xFF, NULL); + AddTextPrinterParameterized(windowId, fontId, strs[i].text, left, (lineHeight * i) + top, 0xFF, NULL); } CopyWindowToVram(windowId, 2); } @@ -1089,7 +1089,7 @@ void sub_81987BC(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 item u8 i; for (i = 0; i < itemCount; i++) { - sub_8199F74(windowId, fontId, strs[i].text, left, (lineHeight * i) + top, 0xFF, NULL, a6, a7); + AddTextPrinterParameterized5(windowId, fontId, strs[i].text, left, (lineHeight * i) + top, 0xFF, NULL, a6, a7); } CopyWindowToVram(windowId, 2); } @@ -1209,7 +1209,7 @@ void sub_8198C94(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 a5, u8 a6, u { for (j = 0; j < a6; j++) { - PrintTextOnWindow(windowId, fontId, strs[(i * a6) + j].text, (a4 * j) + left, (a5 * i) + top, 0xFF, NULL); + AddTextPrinterParameterized(windowId, fontId, strs[(i * a6) + j].text, (a4 * j) + left, (a5 * i) + top, 0xFF, NULL); } } CopyWindowToVram(windowId, 2); @@ -1303,7 +1303,7 @@ void sub_8199060(u8 oldCursorPos, u8 newCursorPos) cursorHeight); xPos = (newCursorPos % gUnknown_0203CD90.horizontalCount) * gUnknown_0203CD90.optionWidth + gUnknown_0203CD90.left; yPos = (newCursorPos / gUnknown_0203CD90.horizontalCount) * gUnknown_0203CD90.optionHeight + gUnknown_0203CD90.top; - PrintTextOnWindow(gUnknown_0203CD90.windowId, + AddTextPrinterParameterized(gUnknown_0203CD90.windowId, gUnknown_0203CD90.fontId, gText_SelectorArrow3, xPos, @@ -1588,7 +1588,7 @@ void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *strs) for (i = 0; i < itemCount; i++) { - PrintTextOnWindow(windowId, 1, strs[i].text, 8, (i * 16) + 1, 0xFF, NULL); + AddTextPrinterParameterized(windowId, 1, strs[i].text, 8, (i * 16) + 1, 0xFF, NULL); } CopyWindowToVram(windowId, 2); @@ -1654,7 +1654,7 @@ void sub_81997AC(u8 windowId, u8 a4, u8 a6, u8 a7, const struct MenuAction *strs { for (j = 0; j < a6; j++) { - PrintTextOnWindow(windowId, 1, strs[(i * a6) + j].text, (a4 * j) + 8, (i * 16) + 1, 0xFF, NULL); + AddTextPrinterParameterized(windowId, 1, strs[(i * a6) + j].text, (a4 * j) + 8, (i * 16) + 1, 0xFF, NULL); } } CopyWindowToVram(windowId, 2); @@ -1946,7 +1946,7 @@ void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const AddTextPrinter(&printer, speed, NULL); } -void AddTextPrinterParameterized2(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str) +void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 left, u8 top, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str) { struct TextSubPrinter printer; @@ -1967,7 +1967,7 @@ void AddTextPrinterParameterized2(u8 windowId, u8 fontId, u8 left, u8 top, u8 le AddTextPrinter(&printer, speed, NULL); } -void sub_8199F74(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 letterSpacing, u8 lineSpacing) +void AddTextPrinterParameterized5(u8 windowId, u8 fontId, const u8 *str, u8 left, u8 top, u8 speed, void (*callback)(struct TextSubPrinter *, u16), u8 letterSpacing, u8 lineSpacing) { struct TextSubPrinter printer; @@ -1997,7 +1997,7 @@ void PrintPlayerNameOnWindow(u8 windowId, const u8 *src, u16 x, u16 y) StringExpandPlaceholders(gStringVar4, src); - PrintTextOnWindow(windowId, 1, gStringVar4, x, y, 0xFF, 0); + AddTextPrinterParameterized(windowId, 1, gStringVar4, x, y, 0xFF, 0); } //Screw this function, it's long and unreferenced and ugh -- cgit v1.2.3 From b860d583e4a5b6fd39e725df998ee9837f7f3029 Mon Sep 17 00:00:00 2001 From: Diegoisawesome Date: Fri, 14 Sep 2018 12:15:46 -0500 Subject: Document main_menu --- src/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index c5d70f555..0e5d1b856 100644 --- a/src/menu.c +++ b/src/menu.c @@ -157,7 +157,7 @@ void sub_8197200(void) sub_81973A4(); } -u16 sub_8197224(void) +u16 RunTextPrintersAndIsPrinter0Active(void) { RunTextPrinters(); return IsTextPrinterActive(0); -- cgit v1.2.3