From b8d3542b46621299bc2056b53209fc22646bef2f Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Sun, 18 Dec 2016 11:52:33 -0800 Subject: move functions from start_menu.c to menu.c --- src/menu.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index 0b5eab831..6b35fd5dd 100644 --- a/src/menu.c +++ b/src/menu.c @@ -6,6 +6,8 @@ #include "text_window.h" #include "sound.h" #include "menu_cursor.h" +#include "map_obj_lock.h" +#include "script.h" struct Menu { @@ -41,6 +43,21 @@ EWRAM_DATA u16 gMenuMessageBoxContentTileOffset = 0; extern const struct MenuAction gUnknown_08376D74[]; +void sub_8071C20(void) +{ + PlaySE(SE_SELECT); + MenuZeroFillScreen(); + sub_8064E2C(); + ScriptContext2_Disable(); + sub_8072DEC(); +} + +void AppendToList(u8 *list, u8 *pindex, u32 value) +{ + list[*pindex] = value; + (*pindex)++; +} + void InitMenuWindow(const struct WindowConfig *winConfig) { InitMenuWindowInternal(winConfig, 1); -- cgit v1.2.3 From dd6ae92faca208a03f0f32e47b80f1442f546b35 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Fri, 30 Dec 2016 00:02:01 -0800 Subject: decompile sub_80B5578 and sub_80B5684 --- src/menu.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index 6b35fd5dd..a06463ba3 100644 --- a/src/menu.c +++ b/src/menu.c @@ -26,8 +26,8 @@ static void MultistepInitMenuWindowInternal(const struct WindowConfig *, u16); static void InitMenuWindowInternal(const struct WindowConfig *, u16); static bool8 sub_80723D4(void); static u8 sub_8072484(u8, u8, u8, u8, u8, u8, u32); -static u8 sub_80724F4(u8, u8, u8, u8 * const [][2], u8); -static void sub_8072620(u8, u8, u8, u8 * const [][2], u8); +static u8 sub_80724F4(u8, u8, u8, const struct MenuAction[], u8); +static void sub_8072620(u8, u8, u8, const struct MenuAction[], u8); static void sub_8072D18(u8, u8); static struct Menu gMenu; @@ -407,7 +407,7 @@ static u8 sub_8072484(u8 a1, u8 a2, u8 menuItemCount, u8 a4, u8 width, u8 a6, u3 return a4; } -static u8 sub_80724F4(u8 left, u8 top, u8 menuItemCount, u8 * const menuItems[][2], u8 columnCount) +static u8 sub_80724F4(u8 left, u8 top, u8 menuItemCount, const struct MenuAction menuItems[], u8 columnCount) { u8 i; u8 maxWidth; @@ -419,7 +419,7 @@ static u8 sub_80724F4(u8 left, u8 top, u8 menuItemCount, u8 * const menuItems[][ maxWidth = 0; for (i = 0; i < menuItemCount; i++) { - u8 width = (sub_8072CA4(menuItems[i][0]) + 7) / 8; + u8 width = (sub_8072CA4(menuItems[i].text) + 7) / 8; if (width > maxWidth) maxWidth = width; @@ -465,7 +465,7 @@ static u8 sub_80724F4(u8 left, u8 top, u8 menuItemCount, u8 * const menuItems[][ return maxWidth; } -static void sub_8072620(u8 left, u8 top, u8 menuItemCount, u8 * const menuItems[][2], u8 columnCount) +static void sub_8072620(u8 left, u8 top, u8 menuItemCount, const struct MenuAction menuItems[], u8 columnCount) { u8 i; u8 maxWidth; @@ -476,7 +476,7 @@ static void sub_8072620(u8 left, u8 top, u8 menuItemCount, u8 * const menuItems[ maxWidth = 0; for (i = 0; i < menuItemCount; i++) { - u8 width = (sub_8072CA4(menuItems[i][0]) + 7) / 8; + u8 width = (sub_8072CA4(menuItems[i].text) + 7) / 8; if (width > maxWidth) maxWidth = width; @@ -495,11 +495,11 @@ static void sub_8072620(u8 left, u8 top, u8 menuItemCount, u8 * const menuItems[ u8 row = 0; u8 j; for (j = 0; i + j < menuItemCount; j += columnCount, row++) - MenuPrint(menuItems[i + j][0], left + gMenu.columnXCoords[i % columnCount], top + 2 * row); + MenuPrint(menuItems[i + j].text, left + gMenu.columnXCoords[i % columnCount], top + 2 * row); } } -void sub_807274C(u8 left, u8 top, u8 menuItemCount, u8 a4, u8 * const menuItems[][2], u8 columnCount, u32 a7) +void sub_807274C(u8 left, u8 top, u8 menuItemCount, u8 a4, const struct MenuAction menuItems[], u8 columnCount, u32 a7) { u8 maxWidth = sub_80724F4(left, top, menuItemCount, menuItems, columnCount); -- cgit v1.2.3 From bdb3dea2b751e65a349ec2d637b461f39cc5ef74 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Tue, 3 Jan 2017 03:30:20 -0500 Subject: more labels in battle_ai.c and intro.c and misc places (#151) * make ROM match again * clean up item_use.c labels and clarify functions. * label and clarify some functions in decompress.c * label and clarify berry.c * rename 20239F8 to gBattleTypeFlags * formatting * label intro.c a bit * label battle_ai.c and document some stuff * formatting * more labeling and clarification. * more label stuff --- src/menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index a06463ba3..5960e2f79 100644 --- a/src/menu.c +++ b/src/menu.c @@ -41,7 +41,7 @@ EWRAM_DATA u16 gMenuTextWindowTileOffset = 0; EWRAM_DATA u16 gMenuTextWindowContentTileOffset = 0; EWRAM_DATA u16 gMenuMessageBoxContentTileOffset = 0; -extern const struct MenuAction gUnknown_08376D74[]; +extern const struct MenuAction gMenuYesNoItems[]; void sub_8071C20(void) { @@ -575,7 +575,7 @@ void PrintMenuItemsReordered(u8 left, u8 top, u8 menuItemCount, const struct Men void InitYesNoMenu(u8 left, u8 top, u8 a3) { - PrintMenuItems(left + 1, top + 1, 2, gUnknown_08376D74); + PrintMenuItems(left + 1, top + 1, 2, gMenuYesNoItems); InitMenu(0, left + 1, top + 1, 2, 0, a3); } -- cgit v1.2.3 From 41d2b112ebdf91da3d85b4495ceb95e69d69ef0a Mon Sep 17 00:00:00 2001 From: Cameron Hall Date: Wed, 4 Jan 2017 16:32:45 -0600 Subject: almost finish decompiling matsuda_debug_menu.c (#158) * almost finish decompiling matsuda_debug_menu.c * rename sub_8071C20 to CloseMenu --- 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 5960e2f79..4bb4dbec2 100644 --- a/src/menu.c +++ b/src/menu.c @@ -43,7 +43,7 @@ EWRAM_DATA u16 gMenuMessageBoxContentTileOffset = 0; extern const struct MenuAction gMenuYesNoItems[]; -void sub_8071C20(void) +void CloseMenu(void) { PlaySE(SE_SELECT); MenuZeroFillScreen(); -- cgit v1.2.3 From ef6bf02e7039a8e6f3b249ca3491987c42ca2d46 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Wed, 4 Jan 2017 19:24:48 -0800 Subject: decompile more summary screen 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 4bb4dbec2..31841146d 100644 --- a/src/menu.c +++ b/src/menu.c @@ -143,7 +143,7 @@ void BasicInitMenuWindow(const struct WindowConfig *winConfig) gMenuWindowPtr->tileDataStartOffset = gMenuTextTileOffset; } -void MenuPrint(u8 *str, u8 left, u8 top) +void MenuPrint(const u8 *str, u8 left, u8 top) { sub_8003460(gMenuWindowPtr, str, gMenuTextTileOffset, left, top); } -- cgit v1.2.3 From 9b0872d1b84d6b4ed4e36a576049b3f409674b95 Mon Sep 17 00:00:00 2001 From: YamaArashi Date: Thu, 5 Jan 2017 04:24:19 -0800 Subject: define some menu data in C --- src/menu.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index 31841146d..ee9376079 100644 --- a/src/menu.c +++ b/src/menu.c @@ -22,6 +22,9 @@ struct Menu u8 columnXCoords[8]; }; +extern u8 OtherText_Yes[]; +extern u8 OtherText_No[]; + static void MultistepInitMenuWindowInternal(const struct WindowConfig *, u16); static void InitMenuWindowInternal(const struct WindowConfig *, u16); static bool8 sub_80723D4(void); @@ -41,7 +44,11 @@ EWRAM_DATA u16 gMenuTextWindowTileOffset = 0; EWRAM_DATA u16 gMenuTextWindowContentTileOffset = 0; EWRAM_DATA u16 gMenuMessageBoxContentTileOffset = 0; -extern const struct MenuAction gMenuYesNoItems[]; +const struct MenuAction gMenuYesNoItems[] = +{ + { OtherText_Yes, NULL }, + { OtherText_No, NULL }, +}; void CloseMenu(void) { -- cgit v1.2.3 From c9722602cb47eb5b6ecbccddf13df5f286a8ef7b Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Tue, 17 Jan 2017 14:13:04 +0100 Subject: Sort includes --- src/menu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index ee9376079..a4e5d9065 100644 --- a/src/menu.c +++ b/src/menu.c @@ -1,13 +1,13 @@ #include "global.h" #include "menu.h" #include "main.h" -#include "text.h" -#include "songs.h" -#include "text_window.h" -#include "sound.h" -#include "menu_cursor.h" #include "map_obj_lock.h" +#include "menu_cursor.h" #include "script.h" +#include "songs.h" +#include "sound.h" +#include "text.h" +#include "text_window.h" struct Menu { -- cgit v1.2.3 From 9a500a622b7fb666b8b45e1280af02084fcbc12d Mon Sep 17 00:00:00 2001 From: Cameron Hall Date: Sat, 28 Jan 2017 13:08:09 -0500 Subject: define data in title_screen.c and fix build (#221) * define more data in C * correct typo in comments * define data in title_screen.c * define data in title_screen.c and fix build --- 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 a4e5d9065..ba98ff057 100644 --- a/src/menu.c +++ b/src/menu.c @@ -654,7 +654,7 @@ u8 *sub_8072C44(u8 *a1, s32 a2, u8 a3, u8 a4) return AlignInt2(gMenuWindowPtr, a1, a2, a3, a4); } -u8 *sub_8072C74(u8 *a1, u8 *a2, u8 a3, u8 a4) +u8 *sub_8072C74(u8 *a1, const u8 *a2, u8 a3, u8 a4) { return AlignString(gMenuWindowPtr, a1, a2, a3, a4); } -- cgit v1.2.3 From 14c5c79f3e3f903e3e7b34b5c0c9bb3b90e7ab75 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 17 May 2017 17:40:04 -0500 Subject: fill holes in party_menu.c and add battle_interface.h header --- 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 ba98ff057..3759d22c9 100644 --- a/src/menu.c +++ b/src/menu.c @@ -598,7 +598,7 @@ s8 ProcessMenuInputNoWrap_(void) return ProcessMenuInputNoWrap(); } -u8 MenuPrint_PixelCoords(u8 *text, u8 left, u16 top, u8 a4) +u8 MenuPrint_PixelCoords(const u8 *text, u8 left, u16 top, u8 a4) { return sub_8004D04(gMenuWindowPtr, text, gMenuTextTileOffset, left, top, a4); } -- cgit v1.2.3 From 7c4f99560812cd5a8eedb124a9bc99c3f4243438 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sun, 21 May 2017 11:37:35 +0200 Subject: Remove duplicate strings.h declarations --- src/menu.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index 3759d22c9..f9b9dbf0b 100644 --- a/src/menu.c +++ b/src/menu.c @@ -6,6 +6,7 @@ #include "script.h" #include "songs.h" #include "sound.h" +#include "strings.h" #include "text.h" #include "text_window.h" @@ -22,9 +23,6 @@ struct Menu u8 columnXCoords[8]; }; -extern u8 OtherText_Yes[]; -extern u8 OtherText_No[]; - static void MultistepInitMenuWindowInternal(const struct WindowConfig *, u16); static void InitMenuWindowInternal(const struct WindowConfig *, u16); static bool8 sub_80723D4(void); @@ -603,7 +601,7 @@ u8 MenuPrint_PixelCoords(const u8 *text, u8 left, u16 top, u8 a4) return sub_8004D04(gMenuWindowPtr, text, gMenuTextTileOffset, left, top, a4); } -u8 sub_8072A18(u8 *text, u8 left, u16 top, u8 width, u32 a5) +u8 sub_8072A18(const u8 *text, u8 left, u16 top, u8 width, u32 a5) { return sub_8004FD0(gMenuWindowPtr, 0, text, gMenuTextTileOffset, left, top, width, a5); } @@ -659,7 +657,7 @@ u8 *sub_8072C74(u8 *a1, const u8 *a2, u8 a3, u8 a4) return AlignString(gMenuWindowPtr, a1, a2, a3, a4); } -u8 sub_8072CA4(u8 *str) +u8 sub_8072CA4(const u8 *str) { return GetStringWidth(gMenuWindowPtr, str); } -- cgit v1.2.3 From d35dc5bd698b8e359669ac0e5bc74b2df0e58bd8 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sun, 21 May 2017 12:46:28 +0200 Subject: Add strings2.h --- src/menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index f9b9dbf0b..61eaebb6f 100644 --- a/src/menu.c +++ b/src/menu.c @@ -173,7 +173,7 @@ void MenuDrawTextWindow(u8 left, u8 top, u8 right, u8 bottom) DrawTextWindow(gMenuWindowPtr, left, top, right, bottom); } -void sub_8071F40(u8 *str) +void sub_8071F40(const u8 *str) { MenuDrawTextWindow(2, 14, 28, 19); MenuPrint(str, 3, 15); @@ -637,7 +637,7 @@ void sub_8072B80(u8 *a1, u8 a2, u8 a3, u8 *a4) sub_8003460(gMenuWindowPtr, buffer, gMenuTextTileOffset, a2, a3); } -void sub_8072BD8(u8 *a1, u8 a2, u8 a3, u16 a4) +void sub_8072BD8(const u8 *a1, u8 a2, u8 a3, u16 a4) { sub_8004DB0(gMenuWindowPtr, a1, gMenuTextTileOffset, a2, a3, a4); } -- cgit v1.2.3 From acd08a46a52bca689914d018430777bd6e2710d6 Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Wed, 17 May 2017 17:40:04 -0500 Subject: fill holes in party_menu.c and add battle_interface.h header --- 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 ba98ff057..3759d22c9 100644 --- a/src/menu.c +++ b/src/menu.c @@ -598,7 +598,7 @@ s8 ProcessMenuInputNoWrap_(void) return ProcessMenuInputNoWrap(); } -u8 MenuPrint_PixelCoords(u8 *text, u8 left, u16 top, u8 a4) +u8 MenuPrint_PixelCoords(const u8 *text, u8 left, u16 top, u8 a4) { return sub_8004D04(gMenuWindowPtr, text, gMenuTextTileOffset, left, top, a4); } -- cgit v1.2.3 From 8ba066d303825722a78ffbc67cecc0f4598f6f1e Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sun, 21 May 2017 11:37:35 +0200 Subject: Remove duplicate strings.h declarations --- src/menu.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index 3759d22c9..f9b9dbf0b 100644 --- a/src/menu.c +++ b/src/menu.c @@ -6,6 +6,7 @@ #include "script.h" #include "songs.h" #include "sound.h" +#include "strings.h" #include "text.h" #include "text_window.h" @@ -22,9 +23,6 @@ struct Menu u8 columnXCoords[8]; }; -extern u8 OtherText_Yes[]; -extern u8 OtherText_No[]; - static void MultistepInitMenuWindowInternal(const struct WindowConfig *, u16); static void InitMenuWindowInternal(const struct WindowConfig *, u16); static bool8 sub_80723D4(void); @@ -603,7 +601,7 @@ u8 MenuPrint_PixelCoords(const u8 *text, u8 left, u16 top, u8 a4) return sub_8004D04(gMenuWindowPtr, text, gMenuTextTileOffset, left, top, a4); } -u8 sub_8072A18(u8 *text, u8 left, u16 top, u8 width, u32 a5) +u8 sub_8072A18(const u8 *text, u8 left, u16 top, u8 width, u32 a5) { return sub_8004FD0(gMenuWindowPtr, 0, text, gMenuTextTileOffset, left, top, width, a5); } @@ -659,7 +657,7 @@ u8 *sub_8072C74(u8 *a1, const u8 *a2, u8 a3, u8 a4) return AlignString(gMenuWindowPtr, a1, a2, a3, a4); } -u8 sub_8072CA4(u8 *str) +u8 sub_8072CA4(const u8 *str) { return GetStringWidth(gMenuWindowPtr, str); } -- cgit v1.2.3 From 17d352b0f8f2e17c02fac0b8e3e2238b7cd44f37 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sun, 21 May 2017 12:46:28 +0200 Subject: Add strings2.h --- src/menu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index f9b9dbf0b..61eaebb6f 100644 --- a/src/menu.c +++ b/src/menu.c @@ -173,7 +173,7 @@ void MenuDrawTextWindow(u8 left, u8 top, u8 right, u8 bottom) DrawTextWindow(gMenuWindowPtr, left, top, right, bottom); } -void sub_8071F40(u8 *str) +void sub_8071F40(const u8 *str) { MenuDrawTextWindow(2, 14, 28, 19); MenuPrint(str, 3, 15); @@ -637,7 +637,7 @@ void sub_8072B80(u8 *a1, u8 a2, u8 a3, u8 *a4) sub_8003460(gMenuWindowPtr, buffer, gMenuTextTileOffset, a2, a3); } -void sub_8072BD8(u8 *a1, u8 a2, u8 a3, u16 a4) +void sub_8072BD8(const u8 *a1, u8 a2, u8 a3, u16 a4) { sub_8004DB0(gMenuWindowPtr, a1, gMenuTextTileOffset, a2, a3, a4); } -- cgit v1.2.3 From f5b7921fa3b4356c2d79a117858fc543fd2cf15f Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Fri, 9 Jun 2017 02:43:39 -0400 Subject: cleanup player_pc.c --- src/menu.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index ba98ff057..d11c45c6f 100644 --- a/src/menu.c +++ b/src/menu.c @@ -56,7 +56,7 @@ void CloseMenu(void) MenuZeroFillScreen(); sub_8064E2C(); ScriptContext2_Disable(); - sub_8072DEC(); + HandleDestroyMenuCursors(); } void AppendToList(u8 *list, u8 *pindex, u32 value) @@ -272,14 +272,14 @@ s8 ProcessMenuInput(void) { PlaySE(SE_SELECT); if (gMenu.menu_field_7) - sub_8072DEC(); + HandleDestroyMenuCursors(); return gMenu.cursorPos; } if (gMain.newKeys & B_BUTTON) { if (gMenu.menu_field_7) - sub_8072DEC(); + HandleDestroyMenuCursors(); return -1; } @@ -307,14 +307,14 @@ s8 ProcessMenuInputNoWrap(void) { PlaySE(SE_SELECT); if (gMenu.menu_field_7) - sub_8072DEC(); + HandleDestroyMenuCursors(); return gMenu.cursorPos; } if (gMain.newKeys & B_BUTTON) { if (gMenu.menu_field_7) - sub_8072DEC(); + HandleDestroyMenuCursors(); return -1; } @@ -519,7 +519,7 @@ s8 sub_80727CC(void) if (gMain.newKeys & A_BUTTON) { if (gMenu.menu_field_7) - sub_8072DEC(); + HandleDestroyMenuCursors(); PlaySE(SE_SELECT); return GetMenuCursorPos(); } @@ -527,7 +527,7 @@ s8 sub_80727CC(void) if (gMain.newKeys & B_BUTTON) { if (gMenu.menu_field_7) - sub_8072DEC(); + HandleDestroyMenuCursors(); return -1; } @@ -733,7 +733,7 @@ void sub_8072DDC(u8 a1) sub_8072DCC(8 * a1); } -void sub_8072DEC(void) +void HandleDestroyMenuCursors(void) { - sub_814A7FC(); + DestroyMenuCursor(); } -- cgit v1.2.3 From ffa2474021a3f72496028a679a67d49e9fd2baef Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Mon, 12 Jun 2017 14:40:30 -0500 Subject: sub_8072B80 const --- 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 61eaebb6f..db1724855 100644 --- a/src/menu.c +++ b/src/menu.c @@ -629,7 +629,7 @@ void MenuPrint_RightAligned(u8 *str, u8 left, u8 top) sub_8004D38(gMenuWindowPtr, str, gMenuTextTileOffset, left, top); } -void sub_8072B80(u8 *a1, u8 a2, u8 a3, u8 *a4) +void sub_8072B80(const u8 *a1, u8 a2, u8 a3, const u8 *a4) { u8 buffer[64]; u8 width = GetStringWidth(gMenuWindowPtr, a4); -- cgit v1.2.3 From 32f6422d2fc5ba5153869316ced65cd2f4370d9d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 12 Jun 2017 22:51:53 -0400 Subject: Convert data/decorations.inc to C --- src/menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 src/menu.c (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c old mode 100644 new mode 100755 index 61eaebb6f..3acac88a0 --- a/src/menu.c +++ b/src/menu.c @@ -611,7 +611,7 @@ u8 unref_sub_8072A5C(u8 *dest, u8 *src, u8 left, u16 top, u8 width, u32 a6) return sub_8004FD0(gMenuWindowPtr, dest, src, gMenuTextTileOffset, left, top, width, a6); } -int sub_8072AB0(u8 *str, u8 left, u16 top, u8 width, u8 height, u32 a6) +int sub_8072AB0(const u8 *str, u8 left, u16 top, u8 width, u8 height, u32 a6) { u8 newlineCount = sub_8004FD0(gMenuWindowPtr, NULL, str, gMenuTextTileOffset, left, top, width, a6); -- cgit v1.2.3 From ae287a511fd1759fd7a666c43f68279d00da495d Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 13 Jun 2017 19:19:58 -0400 Subject: File modes NotLikeThis --- src/menu.c | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 src/menu.c (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c old mode 100755 new mode 100644 -- cgit v1.2.3 From 24165f2bb71c063d05f974acc355536e7393468e Mon Sep 17 00:00:00 2001 From: camthesaxman Date: Tue, 13 Jun 2017 19:08:14 -0500 Subject: decompile sub_809207C - sub_80924A4 --- 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 db1724855..2932750d8 100644 --- a/src/menu.c +++ b/src/menu.c @@ -611,7 +611,7 @@ u8 unref_sub_8072A5C(u8 *dest, u8 *src, u8 left, u16 top, u8 width, u32 a6) return sub_8004FD0(gMenuWindowPtr, dest, src, gMenuTextTileOffset, left, top, width, a6); } -int sub_8072AB0(u8 *str, u8 left, u16 top, u8 width, u8 height, u32 a6) +int sub_8072AB0(const u8 *str, u8 left, u16 top, u8 width, u8 height, u32 a6) { u8 newlineCount = sub_8004FD0(gMenuWindowPtr, NULL, str, gMenuTextTileOffset, left, top, width, a6); -- cgit v1.2.3 From ec3fe21936b250b329e58941a47e11afb9b240e0 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Sat, 24 Jun 2017 18:06:32 +0200 Subject: first src changes --- src/menu.c | 134 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 134 insertions(+) (limited to 'src/menu.c') diff --git a/src/menu.c b/src/menu.c index d84a4c3c5..45cfbbc2f 100644 --- a/src/menu.c +++ b/src/menu.c @@ -9,6 +9,7 @@ #include "strings.h" #include "text.h" #include "text_window.h" +#include "string_util.h" struct Menu { @@ -611,6 +612,7 @@ u8 unref_sub_8072A5C(u8 *dest, u8 *src, u8 left, u16 top, u8 width, u32 a6) return sub_8004FD0(gMenuWindowPtr, dest, src, gMenuTextTileOffset, left, top, width, a6); } +#if ENGLISH int sub_8072AB0(const u8 *str, u8 left, u16 top, u8 width, u8 height, u32 a6) { u8 newlineCount = sub_8004FD0(gMenuWindowPtr, NULL, str, gMenuTextTileOffset, left, top, width, a6); @@ -623,6 +625,90 @@ int sub_8072AB0(const u8 *str, u8 left, u16 top, u8 width, u8 height, u32 a6) if (newlineCount < height) MenuFillWindowRectWithBlankTile(left, top + 2 * newlineCount, left + width - 1, height + top - 1); } +#elif GERMAN +__attribute__((naked)) +int sub_8072AB0(const u8 *str, u8 left, u16 top, u8 width, u8 height, u32 a6) +{ + asm(".syntax unified\n\ + push {r4-r7,lr}\n\ + sub sp, 0x10\n\ + mov r12, r0\n\ + ldr r0, [sp, 0x24]\n\ + ldr r4, [sp, 0x28]\n\ + str r4, [sp, 0xC]\n\ + lsls r1, 24\n\ + lsrs r5, r1, 24\n\ + lsls r2, 16\n\ + lsrs r4, r2, 16\n\ + lsls r3, 24\n\ + lsrs r6, r3, 24\n\ + lsls r0, 24\n\ + lsrs r7, r0, 24\n\ + ldr r0, _08072AF8 @ =gMenuWindowPtr\n\ + ldr r0, [r0]\n\ + ldr r1, _08072AFC @ =gMenuTextTileOffset\n\ + ldrh r3, [r1]\n\ + str r5, [sp]\n\ + str r4, [sp, 0x4]\n\ + str r6, [sp, 0x8]\n\ + movs r1, 0\n\ + mov r2, r12\n\ + bl sub_8004FD0\n\ + adds r1, r0, 0\n\ + lsls r1, 24\n\ + lsrs r2, r1, 24\n\ + movs r3, 0x7\n\ + ands r3, r5\n\ + cmp r3, 0\n\ + bne _08072B00\n\ + adds r1, r6, 0x7\n\ + asrs r1, 3\n\ + subs r1, 0x1\n\ + b _08072B0C\n\ + .align 2, 0\n\ +_08072AF8: .4byte gMenuWindowPtr\n\ +_08072AFC: .4byte gMenuTextTileOffset\n\ +_08072B00:\n\ + adds r3, r6, r3\n\ + subs r1, r3, 0x1\n\ + cmp r1, 0\n\ + bge _08072B0A\n\ + adds r1, r3, 0x6\n\ +_08072B0A:\n\ + asrs r1, 3\n\ +_08072B0C:\n\ + lsls r1, 24\n\ + lsrs r1, 24\n\ + adds r6, r1, 0\n\ + lsrs r5, 3\n\ + adds r1, r7, 0x7\n\ + asrs r1, 3\n\ + lsls r1, 24\n\ + lsrs r7, r1, 24\n\ + lsrs r4, 3\n\ + cmp r2, r7\n\ + bcs _08072B3E\n\ + lsls r1, r2, 1\n\ + adds r1, r4, r1\n\ + lsls r1, 24\n\ + lsrs r1, 24\n\ + adds r2, r5, r6\n\ + lsls r2, 24\n\ + lsrs r2, 24\n\ + adds r3, r7, r4\n\ + subs r3, 0x1\n\ + lsls r3, 24\n\ + lsrs r3, 24\n\ + adds r0, r5, 0\n\ + bl MenuFillWindowRectWithBlankTile\n\ +_08072B3E:\n\ + add sp, 0x10\n\ + pop {r4-r7}\n\ + pop {r1}\n\ + bx r1\n\ + .syntax divided\n"); +} +#endif void MenuPrint_RightAligned(u8 *str, u8 left, u8 top) { @@ -735,3 +821,51 @@ void HandleDestroyMenuCursors(void) { DestroyMenuCursor(); } + +#if GERMAN +void de_sub_8073110(u8 * buffer, u8 * name) { + u8 * ptr, *ptr2, *ptr3; + + ptr2 = buffer; + ptr = &gStringVar1[1 + StringLengthN(gStringVar1, 256)]; + ptr3 = ptr; + + for (;;) + { + if (*ptr2 == EOS) + break; + + if (*ptr2 == 0xFD) + { + + *ptr3 = EOS; + ptr2 += 2; + + StringAppend(ptr, name); + StringAppend(ptr, ptr2); + + buffer[0] = EOS; + StringAppend(buffer, ptr); + break; + } + + *ptr3 = *ptr2; + ptr2 += 1; + ptr3 += 1; + } +} + +u8 *de_sub_8073174(u8 *name, const u8 *format) { + u32 offset; + u8 *ptr; + + offset = StringLengthN(gStringVar2, 0x100); + ptr = &gStringVar2[1 + offset]; + + StringCopy(ptr, format); + + de_sub_8073110(ptr, name); + + return StringCopy(name, ptr); +} +#endif -- cgit v1.2.3