From f88eeb607409528dadbf841f2cb8e805d6e86deb Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Tue, 10 Jan 2017 23:17:43 -0500 Subject: more labels and finish decompiling battle_ai.c except for unk_24 (#184) * labels for save_menu_util.c * formatting, i suck at it * fix sub_80712B4 to not use MyTask struct * pls don't kill me * current changes * decompile BattleAICmd_if_damage_bonus * formatting * label thinking struct unk8 * decompile BattleAICMd_if_status_not_in_party * decompile more battle_ai.c functions * Began decompilation of a random file * decompile BattleAICmd_if_can_faint and BattleAICmd_if_cant_faint * decompile unk_3F and unk_40 * decompile if_move_effect and if_not_move_effect * formatting, silly * decompile if_last_move_did_damage and if_encored * decompile unk_45 if_random_2 and unk_47 * decompile get_hold_effect and get_gender * decompile is_first_turn and get_stockpile_count * decompile unk_4C and get_item * decompile unk_4E unk_4F and unk_50 * decompile get_protect_count and the remaining stub macros * decompile call jump and unk_5A * decompile if_level_cond * decompile the last AI macros besides unk_24 * finish decompiling battle_ai.c except for unk_24 --- src/save_menu_util.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/save_menu_util.c') diff --git a/src/save_menu_util.c b/src/save_menu_util.c index d2fda59d6..64acd12f7 100644 --- a/src/save_menu_util.c +++ b/src/save_menu_util.c @@ -15,7 +15,8 @@ void HandleDrawSaveWindowInfo(s16 left, s16 top) { u32 width = 12; - if (sub_809473C()) + // old handle for setting window width? + if (IsResizeSaveWindowEnabled()) width = 13; if (FlagGet(SYS_POKEDEX_GET)) @@ -39,11 +40,12 @@ void HandleDrawSaveWindowInfo(s16 left, s16 top) } } -void sub_80946C8(u16 left, u16 top) +void HandleCloseSaveWindow(u16 left, u16 top) { u32 width = 12; - if (sub_809473C()) + // old handle for setting window width? + if (IsResizeSaveWindowEnabled()) width = 13; if (FlagGet(SYS_POKEDEX_GET)) @@ -52,9 +54,14 @@ void sub_80946C8(u16 left, u16 top) MenuZeroFillWindowRect(left, top, left + width, top + 9); } -u8 sub_809473C() +/* +theory: This function was used to handle the save menu window's width being auto sized from +either 12 or 13 in an older source. Whatever was here might have either been optimized out by +GF's compiler or was dummied out to always return a TRUE at some point. +*/ +u8 IsResizeSaveWindowEnabled(void) // i don't know what else to name it.. { - return 1; + return TRUE; } void PrintSavePlayerName(s16 x, s16 y) -- 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/save_menu_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/save_menu_util.c') diff --git a/src/save_menu_util.c b/src/save_menu_util.c index 64acd12f7..a6c9578dc 100644 --- a/src/save_menu_util.c +++ b/src/save_menu_util.c @@ -1,10 +1,10 @@ #include "global.h" #include "save_menu_util.h" #include "asm.h" -#include "menu.h" #include "event_data.h" -#include "string_util.h" +#include "menu.h" #include "pokedex.h" +#include "string_util.h" extern u8 gOtherText_Player[]; extern u8 gOtherText_Badges[]; -- cgit v1.2.3 From 801877553db80267a62c0c3c0b2805b6716d1ef9 Mon Sep 17 00:00:00 2001 From: Marijn van der Werf Date: Tue, 17 Jan 2017 14:38:44 +0100 Subject: Remove trailing whitespace --- src/save_menu_util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/save_menu_util.c') diff --git a/src/save_menu_util.c b/src/save_menu_util.c index a6c9578dc..7790bbb1b 100644 --- a/src/save_menu_util.c +++ b/src/save_menu_util.c @@ -54,9 +54,9 @@ void HandleCloseSaveWindow(u16 left, u16 top) MenuZeroFillWindowRect(left, top, left + width, top + 9); } -/* -theory: This function was used to handle the save menu window's width being auto sized from -either 12 or 13 in an older source. Whatever was here might have either been optimized out by +/* +theory: This function was used to handle the save menu window's width being auto sized from +either 12 or 13 in an older source. Whatever was here might have either been optimized out by GF's compiler or was dummied out to always return a TRUE at some point. */ u8 IsResizeSaveWindowEnabled(void) // i don't know what else to name it.. -- cgit v1.2.3 From 6035511c139549a0291b6b3d43b9b080f792b2b6 Mon Sep 17 00:00:00 2001 From: ProjectRevoTPP Date: Sat, 18 Mar 2017 04:00:15 +0100 Subject: reorganize and add new headers for many files --- src/save_menu_util.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/save_menu_util.c') diff --git a/src/save_menu_util.c b/src/save_menu_util.c index 7790bbb1b..7899fabb1 100644 --- a/src/save_menu_util.c +++ b/src/save_menu_util.c @@ -81,22 +81,18 @@ void PrintSaveMapName(s16 x, s16 y) void PrintSaveBadges(s16 x, s16 y) { char badges[16]; - u8 badgeCount; MenuPrint(gOtherText_Badges, x, y); - badgeCount = GetBadgeCount(); - ConvertIntToDecimalString(badges, badgeCount); + ConvertIntToDecimalString(badges, GetBadgeCount()); MenuPrint_RightAligned(badges, x + 12, y); } void PrintSavePokedexCount(s16 x, s16 y) { char pokedex[16]; - u16 pokedexCount; MenuPrint(gOtherText_Pokedex, x, y); - pokedexCount = GetPokedexSeenCount(); - ConvertIntToDecimalStringN(pokedex, pokedexCount, 1, 3); + ConvertIntToDecimalStringN(pokedex, GetPokedexSeenCount(), 1, 3); MenuPrint_RightAligned(pokedex, x + 12, y); } -- cgit v1.2.3