diff --git a/include/enums.h b/include/enums.h index 97da10122..fe72291c3 100644 --- a/include/enums.h +++ b/include/enums.h @@ -5368,14 +5368,14 @@ enum FileMenuMessages { /* 31 */ FILE_MESSAGE_HAS_BEEN_CREATED, // has been created.[End] #if VERSION_PAL // TODO: determine where these new entries should be placed - UNK1, - UNK2, + FILE_MESSAGE_PAL_UNK1, + FILE_MESSAGE_PAL_UNK2, #endif /* 32 */ FILE_MESSAGE_ENTER_A_FILE_NAME, // Enter a file name![End] /* 33 */ FILE_MESSAGE_QUESTION, // ?[End] /* 34 */ FILE_MESSAGE_PERIOD_34, // .[End] #if VERSION_PAL - FILE_MESSAGE_BASE_UNK, + FILE_MESSAGE_PAL_UNK3, #endif }; diff --git a/include/filemenu.h b/include/filemenu.h index 9c8b3ded8..b93863355 100644 --- a/include/filemenu.h +++ b/include/filemenu.h @@ -80,7 +80,7 @@ extern u8 D_filemenu_8025095C[4]; f32* scaleX, f32* scaleY,\ f32* rotX, f32* rotY, f32* rotZ,\ s32* darkening,\ - s32* opacity);\ + s32* opacity) WINDOW_UPDATE_FUNC(filemenu_update_show_name_input); WINDOW_UPDATE_FUNC(filemenu_update_show_options_left); diff --git a/include/functions.h b/include/functions.h index 0219cb913..ededaad1a 100644 --- a/include/functions.h +++ b/include/functions.h @@ -99,10 +99,10 @@ void pause_handle_input(s32 buttonsPressed, s32 buttonsHeld); void pause_cleanup(void); // file menu stuff -void filemenu_init(s32); +void filemenu_init(s32 mode); void filemenu_cleanup(void); void filemenu_update(void); -s32 func_80244BC4(void); +s32 filemenu_get_exit_mode(void); void filemenu_set_selected(MenuPanel* menu, s32 col, s32 row); void filemenu_set_cursor_alpha(s32 arg0); void filemenu_set_cursor_goal_pos(s32 windowIndex, s32 posX, s32 posY); diff --git a/src/battle/btl_states_menus.c b/src/battle/btl_states_menus.c index c593b5fbb..96005616d 100644 --- a/src/battle/btl_states_menus.c +++ b/src/battle/btl_states_menus.c @@ -444,13 +444,19 @@ BSS s32 D_802AD6D4; void create_battle_popup_menu(PopupMenu* popup); s32 get_player_anim_for_status(s32 animID); +<<<<<<< HEAD +======= +>>>>>>> upstream/main void btl_menu_moves_draw_content(void* data, s32 x, s32 y); void btl_menu_moves_show_title(void* data, s32 x, s32 y); void btl_menu_moves_show_icon(void* data, s32 x, s32 y); void btl_menu_moves_show_desc(void* data, s32 x, s32 y); void btl_menu_moves_show_error(void* data, s32 x, s32 y); +<<<<<<< HEAD +======= +>>>>>>> upstream/main void btl_menu_strats_draw_content(void* data, s32 x, s32 y); void btl_menu_strats_show_title(void* data, s32 x, s32 y); void btl_menu_strats_show_desc(void* data, s32 x, s32 y); diff --git a/src/filemenu/filemenu_common.c b/src/filemenu/filemenu_common.c index e999fab15..915e86ce9 100644 --- a/src/filemenu/filemenu_common.c +++ b/src/filemenu/filemenu_common.c @@ -733,15 +733,15 @@ void filemenu_update_hidden_name_confirm( } void filemenu_draw_cursor(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening) { - s32 temp_a1; + s32 alpha; filemenu_update_cursor(); - temp_a1 = filemenu_cursor_alpha; - if (temp_a1 > 0) { - if (temp_a1 > 255) { - temp_a1 = 255; + alpha = filemenu_cursor_alpha; + if (alpha > 0) { + if (alpha > 255) { + alpha = 255; } - hud_element_set_alpha(filemenu_cursorHIDs[0], temp_a1); + hud_element_set_alpha(filemenu_cursorHIDs[0], alpha); hud_element_set_render_pos(filemenu_cursorHIDs[0], baseX + filemenu_cursor_posX, baseY + filemenu_cursor_posY); hud_element_draw_without_clipping(filemenu_cursorHIDs[0]); } @@ -875,7 +875,8 @@ void filemenu_draw_contents_copy_arrow(MenuPanel* menu, s32 baseX, s32 baseY, s3 } // TODO bad match, look into -void filemenu_init(s32 arg0) { +void filemenu_init(s32 mode) { + MenuPanel** panelIt; MenuPanel* menu; s32 i; @@ -887,7 +888,7 @@ void filemenu_init(s32 arg0) { } filemenu_cursorHID = filemenu_cursorHIDs[0]; - if (arg0 == 0) { + if (mode == 0) { filemenu_common_windowBPs[0].style.customStyle->background.imgData = NULL; // ??? } setup_pause_menu_tab(filemenu_common_windowBPs, ARRAY_COUNT(filemenu_common_windowBPs)); @@ -952,18 +953,22 @@ void filemenu_cleanup(void) { set_window_update(WIN_PAUSE_TUTORIAL, WINDOW_UPDATE_HIDE); set_window_update(WIN_PAUSE_DECRIPTION, WINDOW_UPDATE_HIDE); - func_80244BC4(); + filemenu_get_exit_mode(); // part of a conditional that optimized out? } -s32 func_80244BC4() { +s32 filemenu_get_exit_mode() { if (filemenu_menus[FILE_MENU_MAIN]->state == FM_MAIN_SELECT_FILE && filemenu_currentMenu == FILE_MENU_CONFIRM - && filemenu_menus[FILE_MENU_CONFIRM]->selected == 0) - { + && filemenu_menus[FILE_MENU_CONFIRM]->selected == 0 + ) { return 2; - } else if (filemenu_menus[FILE_MENU_MAIN]->state == FM_MAIN_SELECT_FILE && filemenu_menus[FILE_MENU_MAIN]->selected < 4) { + } + + if (filemenu_menus[FILE_MENU_MAIN]->state == FM_MAIN_SELECT_FILE + && filemenu_menus[FILE_MENU_MAIN]->selected <= FM_MAIN_OPT_FILE_4 + ) { return 1; - } else { - return 0; } + + return 0; } diff --git a/src/filemenu/filemenu_createfile.c b/src/filemenu/filemenu_createfile.c index 1d6f902ac..8634b70f1 100644 --- a/src/filemenu/filemenu_createfile.c +++ b/src/filemenu/filemenu_createfile.c @@ -427,6 +427,8 @@ void filemenu_choose_name_handle_input(MenuPanel* menu) { } if (filemenu_pressedButtons & BUTTON_A) { + MenuPanel* confirmMenu; + switch (menu->selected) { case MSG_CHAR_MENU_SPACE: sfx_play_sound(SOUND_CREATE_FILE_SET_CHARACTER); @@ -540,6 +542,8 @@ void filemenu_choose_name_handle_input(MenuPanel* menu) { } if (filemenu_pressedButtons & BUTTON_START) { + MenuPanel* confirmMenu; + for (i = 0; i < ARRAY_COUNT(filemenu_filename); i++) { if (filemenu_filename[i] != MSG_CHAR_READ_SPACE) { break; diff --git a/src/filemenu/filemenu_info.c b/src/filemenu/filemenu_info.c index 7cb83977f..996bbe18f 100644 --- a/src/filemenu/filemenu_info.c +++ b/src/filemenu/filemenu_info.c @@ -96,7 +96,7 @@ void filemenu_info_draw_message_contents( xOffset += D_filemenu_802508FC[gCurrentLanguage]; draw_number(filemenu_menus[FILE_MENU_MAIN]->selected + 1, baseX + xOffset, baseY + 6, 0, 0, 255, 3); xOffset++; - filemenu_draw_message(filemenu_get_menu_message(0x1F), baseX + xOffset, baseY + 4, 255, 0, 0); + filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_PAL_UNK1), baseX + xOffset, baseY + 4, 255, 0, 0); break; } #else diff --git a/src/filemenu/filemenu_main.c b/src/filemenu/filemenu_main.c index 052f9539e..e7d626210 100644 --- a/src/filemenu/filemenu_main.c +++ b/src/filemenu/filemenu_main.c @@ -477,10 +477,9 @@ void filemenu_draw_contents_option_center( s32 yOffset; switch (menu->state) { - case 1: - case 2: - case 3: - case 4: + case FM_MAIN_SELECT_DELETE: + case FM_MAIN_SELECT_COPY_FROM: + case FM_MAIN_SELECT_COPY_TO: msgIdx = FILE_MESSAGE_CANCEL; xOffset = CENTER_CANCEL_X; yOffset = 0; @@ -623,12 +622,12 @@ void filemenu_draw_contents_file_title( filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_OK), baseX + FILE_X, baseY + 1, 255, 0, 1); if (!gSaveSlotHasData[fileIdx]) { - filemenu_draw_message(filemenu_get_menu_message(fileIdx + FILE_MESSAGE_BASE_UNK), + filemenu_draw_message(filemenu_get_menu_message(fileIdx + FILE_MESSAGE_PAL_UNK3), baseX + D_filemenu_802508D0[gCurrentLanguage], baseY + 1, 255, 0, 1); } else { s32 tmp = D_filemenu_802508D0[gCurrentLanguage]; - filemenu_draw_message(filemenu_get_menu_message(fileIdx + FILE_MESSAGE_BASE_UNK), + filemenu_draw_message(filemenu_get_menu_message(fileIdx + FILE_MESSAGE_PAL_UNK3), baseX + tmp, baseY + 1, 255, 0, 1); tmp += D_filemenu_802508D4[gCurrentLanguage]; @@ -753,6 +752,7 @@ void filemenu_main_init(MenuPanel* menu) { setup_pause_menu_tab(filemenu_main_windowBPs, ARRAY_COUNT(filemenu_main_windowBPs)); menu->selected = MENU_PANEL_SELECTED_GRID_DATA(menu); +#if VERSION_PAL gWindows[WIN_FILES_TITLE].pos.y = 1; gWindows[WIN_FILES_TITLE].width = 162; gWindows[WIN_FILES_TITLE].height = 25; diff --git a/src/filemenu/filemenu_msg.c b/src/filemenu/filemenu_msg.c index 59c3f9551..64b4d3554 100644 --- a/src/filemenu/filemenu_msg.c +++ b/src/filemenu/filemenu_msg.c @@ -589,21 +589,21 @@ s32 filemenu_draw_char(s32 c, s32 x, s32 y, s32 flag1, s32 color, s32 flag2) { } #endif - if (c == 0xF7) { + if (c == MSG_CHAR_READ_SPACE) { return charWidth - 6; } switch (c) { - case 0xF3: + case MSG_CHAR_READ_VARIANT0: filemenu_charset_raster_id = 0; break; - case 0xF4: + case MSG_CHAR_READ_VARIANT1: filemenu_charset_raster_id = 1; break; - case 0xF5: + case MSG_CHAR_READ_VARIANT2: filemenu_charset_raster_id = 2; break; - case 0xF6: + case MSG_CHAR_READ_VARIANT3: filemenu_charset_raster_id = 3; break; } @@ -637,7 +637,7 @@ void filemenu_draw_message(u8* message, s32 x, s32 y, s32 alpha, s32 color, u32 u8* tmp; filemenu_draw_char(0xF3, x, y, flag1, color, flag2); tmp = message; - while (*tmp != 0xFD) { + while (*tmp != MSG_CHAR_READ_END) { #if VERSION_IQUE int ord = *tmp; if (ord >= MSG_CHAR_MULTIBYTE_FIRST && ord <= MSG_CHAR_MULTIBYTE_LAST) { @@ -671,7 +671,7 @@ void filemenu_draw_file_name(u8* filename, s32 length, s32 x, s32 y, s32 alpha, for (i = 0; i < length; i++) { u32 c = filename[i]; - if (c != 0xF7) { + if (c != MSG_CHAR_READ_SPACE) { #if VERSION_IQUE // Numerals get drawn one pixel lower than other characters if (c >= MSG_CHAR_DIGIT_0 && c <= MSG_CHAR_DIGIT_9) { diff --git a/src/filemenu/filemenu_yesno.c b/src/filemenu/filemenu_yesno.c index 4948f7c7c..b95d28c3c 100644 --- a/src/filemenu/filemenu_yesno.c +++ b/src/filemenu/filemenu_yesno.c @@ -30,6 +30,9 @@ u8 filemenu_yesno_gridData[] = { 0, 1, +#if !VERSION_PAL + 0, 1, +#endif 0, 1, 0, 1, 0, 1, diff --git a/src/state_file_select.c b/src/state_file_select.c index 0f4667881..badcc6d36 100644 --- a/src/state_file_select.c +++ b/src/state_file_select.c @@ -125,7 +125,7 @@ void state_init_exit_file_select(void) { D_800A0932 = 0; D_800A0930 = 0; - if (func_80244BC4() == 0) { + if (filemenu_get_exit_mode() == 0) { set_map_transition_effect(TRANSITION_SLOW_FADE_TO_WHITE); } else { set_map_transition_effect(TRANSITION_ENTER_WORLD); @@ -136,7 +136,7 @@ void state_init_exit_file_select(void) { } void state_step_exit_file_select(void) { - s32 temp_s0 = func_80244BC4(); + s32 exitMode = filemenu_get_exit_mode(); s32 flagSum; s32 i; @@ -157,7 +157,7 @@ void state_step_exit_file_select(void) { } break; case 1: - if (temp_s0 == 0 || update_exit_map_screen_overlay(&D_800A0932) != 0) { + if (exitMode == 0 || update_exit_map_screen_overlay(D_800A0932) != 0) { D_800A0931 = 2; } break; @@ -167,7 +167,7 @@ void state_step_exit_file_select(void) { D_800A0931 = 3; case 3: set_time_freeze_mode(TIME_FREEZE_NONE); - if (temp_s0 == 0) { + if (exitMode == 0) { set_game_mode(GAME_MODE_TITLE_SCREEN); gOverrideFlags &= ~GLOBAL_OVERRIDES_WINDOWS_OVER_CURTAINS; } else { diff --git a/ver/jp/undefined_syms.txt b/ver/jp/undefined_syms.txt index b8662dd93..f8b5d6393 100644 --- a/ver/jp/undefined_syms.txt +++ b/ver/jp/undefined_syms.txt @@ -65,7 +65,7 @@ pause_handle_input = 0x80243BF4; pause_cleanup = 0x80243EC4; filemenu_init = 0x802440B0; filemenu_cleanup = 0x802442D0; -func_80244BC4 = 0x80244394; +filemenu_get_exit_mode = 0x80244394; heap_collisionHead = 0x80268000; shim_create_audio_system_obfuscated = 0x802B2000; shim_load_engine_data_obfuscated = 0x802B203C; diff --git a/ver/us/symbol_addrs.txt b/ver/us/symbol_addrs.txt index 690fa43c0..b13db9ba5 100644 --- a/ver/us/symbol_addrs.txt +++ b/ver/us/symbol_addrs.txt @@ -6342,7 +6342,7 @@ filemenu_draw_cursor = 0x80244030; // type:func rom:0x164890 filemenu_draw_contents_copy_arrow = 0x802440BC; // type:func rom:0x16491C filemenu_init = 0x802448E0; // type:func rom:0x165140 filemenu_cleanup = 0x80244B00; // type:func rom:0x165360 -func_80244BC4 = 0x80244BC4; // type:func rom:0x165424 +filemenu_get_exit_mode = 0x80244BC4; // type:func rom:0x165424 filemenu_draw_contents_title = 0x80244C30; // type:func rom:0x165490 filemenu_draw_contents_stereo = 0x80244CEC; // type:func rom:0x16554C filemenu_draw_contents_mono = 0x80244D60; // type:func rom:0x1655C0