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