* migrated filemenu data

* matched filemenu_get_menu_message

* matched the rest of filemenu

* cleaning up

* fix
This commit is contained in:
Unnunu 2022-09-28 20:09:11 +03:00 committed by GitHub
parent 70590f890e
commit 50ab50f669
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 3166 additions and 2970 deletions

View File

@ -4793,7 +4793,9 @@ enum WindowId {
WINDOW_ID_21 = 21, WINDOW_ID_21 = 21,
WINDOW_ID_PAUSE_MAIN = 22, WINDOW_ID_PAUSE_MAIN = 22,
WINDOW_ID_PAUSE_DECRIPTION = 23, WINDOW_ID_PAUSE_DECRIPTION = 23,
WINDOW_ID_FILEMENU_CURSOR = 23, // same as previous
WINDOW_ID_PAUSE_TUTORIAL = 24, WINDOW_ID_PAUSE_TUTORIAL = 24,
WINDOW_ID_FILEMENU_COPYARROW = 24, // same as previous
WINDOW_ID_PAUSE_TAB_STATS = 25, WINDOW_ID_PAUSE_TAB_STATS = 25,
WINDOW_ID_PAUSE_TAB_BADGES = 26, WINDOW_ID_PAUSE_TAB_BADGES = 26,
WINDOW_ID_PAUSE_TAB_ITEMS = 27, WINDOW_ID_PAUSE_TAB_ITEMS = 27,
@ -4814,25 +4816,26 @@ enum WindowId {
WINDOW_ID_PAUSE_MAP_TITLE = 42, WINDOW_ID_PAUSE_MAP_TITLE = 42,
WINDOW_ID_PAUSE_TAB_INVIS = 43, WINDOW_ID_PAUSE_TAB_INVIS = 43,
WINDOW_ID_PAUSE_CURSOR = 44, WINDOW_ID_PAUSE_CURSOR = 44,
WINDOW_ID_45 = 45, WINDOW_ID_FILEMENU_MAIN = 44, // same as previous
WINDOW_ID_46 = 46, WINDOW_ID_FILEMENU_TITLE = 45,
WINDOW_ID_47 = 47, WINDOW_ID_FILEMENU_YESNO_PROMPT = 46,
WINDOW_ID_48 = 48, WINDOW_ID_FILEMENU_INFO = 47,
WINDOW_ID_49 = 49, WINDOW_ID_FILEMENU_CREATEFILE_HEADER = 48,
WINDOW_ID_50 = 50, WINDOW_ID_FILEMENU_KEYBOARD = 49,
WINDOW_ID_51 = 51, WINDOW_ID_FILEMENU_YESNO_OPTIONS = 50,
WINDOW_ID_52 = 52, WINDOW_ID_FILEMENU_STEREO = 51,
WINDOW_ID_53 = 53, WINDOW_ID_FILEMENU_MONO = 52,
WINDOW_ID_54 = 54, WINDOW_ID_FILEMENU_OPTION_LEFT = 53,
WINDOW_ID_55 = 55, WINDOW_ID_FILEMENU_OPTION_CENTER = 54,
WINDOW_ID_56 = 56, WINDOW_ID_FILEMENU_OPTION_RIGHT = 55,
WINDOW_ID_57 = 57, WINDOW_ID_FILEMENU_FILE0_INFO = 56,
WINDOW_ID_58 = 58, WINDOW_ID_FILEMENU_FILE1_INFO = 57,
WINDOW_ID_59 = 59, WINDOW_ID_FILEMENU_FILE2_INFO = 58,
WINDOW_ID_60 = 60, WINDOW_ID_FILEMENU_FILE3_INFO = 59,
WINDOW_ID_61 = 61, WINDOW_ID_FILEMENU_FILE0_TITLE = 60,
WINDOW_ID_62 = 62, WINDOW_ID_FILEMENU_FILE1_TITLE = 61,
WINDOW_ID_63 = 63, WINDOW_ID_FILEMENU_FILE2_TITLE = 62,
WINDOW_ID_FILEMENU_FILE3_TITLE = 63,
}; };
enum SimpleWindowUpdateId { enum SimpleWindowUpdateId {

View File

@ -7,17 +7,17 @@ extern MenuPanel* filemenu_menus[4];
extern BSS s32 filemenu_iterFileIdx; extern BSS s32 filemenu_iterFileIdx;
extern BSS s32 filemenu_pressedButtons; extern BSS s32 filemenu_pressedButtons;
extern BSS s32 filemenu_8024C088; extern BSS s32 filemenu_cursorHudElem;
extern BSS s32 filemenu_heldButtons; extern BSS s32 filemenu_heldButtons;
extern BSS s32 filemenu_8024C090; extern BSS s8 filemenu_filename_pos;
extern BSS s32 filemenu_loadedFileIdx; extern BSS s32 filemenu_loadedFileIdx;
extern BSS s8 filemenu_8024C098; extern BSS s8 filemenu_currentMenu;
extern BSS s32 filemenu_8024C09C; extern BSS s32 filemenu_8024C09C;
extern BSS s32 filemenu_cursorHudElemID[1]; extern BSS s32 filemenu_cursorHudElemID[1];
extern BSS s32 filemenu_8024C0A4[3]; extern BSS s32 filemenu_8024C0A4[3];
extern BSS s32 filemenu_hudElemIDs[20]; extern BSS s32 filemenu_hudElemIDs[20];
extern BSS s32 filemenu_8024C100[4]; extern BSS s32 filemenu_createfile_hudElems[4];
extern BSS u8 filemenu_8024C110[8]; extern BSS u8 filemenu_filename[8];
#define WINDOW_UPDATE_FUNC(name) void (name)( \ #define WINDOW_UPDATE_FUNC(name) void (name)( \
s32 windowIdx,\ s32 windowIdx,\
@ -49,6 +49,52 @@ WINDOW_UPDATE_FUNC(filemenu_update_hidden_name_confirm);
WINDOW_UPDATE_FUNC(main_menu_window_update); WINDOW_UPDATE_FUNC(main_menu_window_update);
WINDOW_UPDATE_FUNC(filemenu_update_show_title);
void filemenu_draw_file_name(u8*, s32, s32, s32, s32, s32, s32, s32); void filemenu_draw_file_name(u8*, s32, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_title(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_stereo(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_mono(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_option_left(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_option_center(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_option_right(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_file_0_info(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_file_0_title(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_file_1_info(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_file_1_title(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_file_2_info(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_file_2_title(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_file_3_info(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_file_3_title(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_yesno_draw_options_contents(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_yesno_draw_prompt_contents(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_info_draw_message_contents(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_file_create_header(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_choose_name(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_cursor(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_draw_contents_copy_arrow(MenuPanel*, s32, s32, s32, s32, s32, s32);
void filemenu_main_init(MenuPanel*);
void filemenu_main_handle_input(MenuPanel*);
void filemenu_main_update(MenuPanel*);
void filemenu_main_cleanup(MenuPanel*);
void filemenu_yesno_init(MenuPanel*);
void filemenu_yesno_handle_input(MenuPanel*);
void filemenu_yesno_update(MenuPanel*);
void filemenu_yesno_cleanup(MenuPanel*);
void filemenu_info_init(MenuPanel*);
void filemenu_info_handle_input(MenuPanel*);
void filemenu_info_update(MenuPanel*);
void filemenu_info_cleanup(MenuPanel*);
void filemenu_choose_name_init(MenuPanel*);
void filemenu_choose_name_handle_input(MenuPanel*);
void filemenu_choose_name_update(MenuPanel*);
void filemenu_choose_name_cleanup(MenuPanel*);
void filemenu_draw_message(u8*, s32, s32, s32, s32, u32);
void filemenu_draw_rect(s32 ulx, s32 uly, s32 lrx, s32 lry, s32 tileDescriptor, s32 uls, s32 ult, s32 dsdx, s32 dtdy);
extern WindowStyleCustom filemenu_windowStyles[];
extern u8 filemenu_createfile_gridData[];
#endif #endif

View File

@ -108,12 +108,10 @@ void pause_handle_input(s32 buttonsPressed, s32 buttonsHeld);
void pause_cleanup(void); void pause_cleanup(void);
// file menu stuff // file menu stuff
void func_80248170(s32 idx);
void filemenu_set_selected(MenuPanel* menu, s32 col, s32 row); void filemenu_set_selected(MenuPanel* menu, s32 col, s32 row);
void filemenu_set_cursor_alpha(s32 arg0); void filemenu_set_cursor_alpha(s32 arg0);
void filemenu_set_cursor_goal_pos(s32 windowIndex, s32 posX, s32 posY); void filemenu_set_cursor_goal_pos(s32 windowIndex, s32 posX, s32 posY);
u8* filemenu_get_menu_message(s32 idx); u8* filemenu_get_menu_message(s32 idx);
void filemenu_draw_message(s8*, s32 posX, s32 posY, s32 alpha, s32 color, s32 flags);
void gfx_task_background(void); void gfx_task_background(void);

View File

@ -1,862 +0,0 @@
#include "common.h"
#include "filemenu.h"
#include "hud_element.h"
#include "audio/public.h"
#include "fio.h"
extern HudScript* filemenu_hudElemScripts[14];
extern MenuWindowBP filemenu_windowBPs[14];
extern WindowStyleCustom D_8024BDA8[];
extern s8 D_8024C090;
void filemenu_draw_contents_title(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
s32 msgIdx;
s32 xOffset;
s32 yOffset;
switch (menu->page) {
case 0:
msgIdx = FILE_MESSAGE_SELECT_FILE_TO_START;
xOffset = 9;
yOffset = 4;
break;
case 1:
msgIdx = FILE_MESSAGE_SELECT_FILE_TO_DELETE;
xOffset = 8;
yOffset = 4;
break;
case 3:
msgIdx = FILE_MESSAGE_COPY_WHICH_FILE;
xOffset = 25;
yOffset = 4;
break;
case 4:
msgIdx = FILE_MESSAGE_COPY_TO_WHICH_FILE;
xOffset = 16;
yOffset = 4;
break;
case 2:
default:
msgIdx = FILE_MESSAGE_SELECT_FILE_TO_SAVE;
xOffset = 10;
yOffset = 4;
break;
}
filemenu_draw_message(filemenu_get_menu_message(msgIdx), baseX + xOffset, baseY + yOffset, 255, 0, 0);
}
void filemenu_draw_contents_stereo(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
if (gGameStatusPtr->soundOutputMode == SOUND_OUT_STEREO) {
hud_element_set_render_pos(filemenu_hudElemIDs[18], baseX + 34, baseY + 10);
hud_element_draw_without_clipping(filemenu_hudElemIDs[18]);
} else {
hud_element_set_render_pos(filemenu_hudElemIDs[19], baseX + 34, baseY + 10);
hud_element_draw_without_clipping(filemenu_hudElemIDs[19]);
}
}
void filemenu_draw_contents_mono(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
if (gGameStatusPtr->soundOutputMode == SOUND_OUT_MONO) {
hud_element_set_render_pos(filemenu_hudElemIDs[16], baseX + 34, baseY + 10);
hud_element_draw_without_clipping(filemenu_hudElemIDs[16]);
} else {
hud_element_set_render_pos(filemenu_hudElemIDs[17], baseX + 34, baseY + 10);
hud_element_draw_without_clipping(filemenu_hudElemIDs[17]);
}
}
void filemenu_draw_contents_option_left(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
if (menu->page != 2) {
if (menu->col == 0 && menu->row == 2) {
filemenu_set_cursor_goal_pos(53, baseX, baseY + 8);
}
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_DELETE_FILE), baseX + 8, baseY + 2, 255, 0, 1);
}
}
void filemenu_draw_contents_option_center(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
s32 msgIdx;
s32 xOffset;
s32 yOffset;
switch (menu->page) {
case 1:
case 2:
case 3:
case 4:
msgIdx = FILE_MESSAGE_CANCEL;
xOffset = 18;
yOffset = 0;
if (menu->col == 1 && menu->row == 2) {
filemenu_set_cursor_goal_pos(54, baseX + 8, baseY + 8);
}
break;
default:
msgIdx = FILE_MESSAGE_COPY_FILE;
xOffset = 14;
yOffset = 0;
if (menu->col == 1 && menu->row == 2) {
filemenu_set_cursor_goal_pos(54, baseX + 4, baseY + 8);
}
break;
}
filemenu_draw_message(filemenu_get_menu_message(msgIdx), baseX + xOffset, baseY + yOffset + 2, 255, 0, 1);
}
void filemenu_draw_contents_option_right(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
if (menu->page != 2) {
if (menu->col == 2 && menu->row == 2) {
filemenu_set_cursor_goal_pos(55, baseX + 8, baseY + 8);
}
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_CANCEL), baseX + 20, baseY + 2, 255, 0, 1);
}
}
void filemenu_draw_contents_file_info(s32 fileIdx,
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
SaveMetadata* save;
s32 temp_s0;
s32 temp_s0_3;
s32 temp_s1_2;
s32 temp_s3_2;
s32 temp_s3;
s32 id;
s32 i;
const int MAX_DISPLAYED_TIME = 100*60*60*60 - 1; // 100 hours minus one frame at 60 fps
if (!gSaveSlotHasData[fileIdx]) {
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_NEW), baseX + 50, baseY + 20, 0xFF, 0xA, 0);
return;
}
save = &gSaveSlotMetadata[fileIdx];
if (save->timePlayed == 0) {
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FIRST_PLAY), baseX + 30, baseY + 20, 0xFF, 0xA, 0);
return;
}
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_LEVEL), baseX + 0x22, baseY + 10, 0xFF, 0xA, 1);
temp_s3_2 = save->level;
temp_s3 = temp_s3_2;
temp_s0 = temp_s3 / 10;
draw_number(temp_s0, baseX + 79, baseY + 10, 1, 0xA, 0xFF, 2);
draw_number(temp_s3 - (temp_s0 * 10), baseX + 88, baseY + 10, 1, 0xA, 0xFF, 2);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_PLAY_TIME), baseX + 11, baseY + 24, 0xFF, 0xA, 1);
temp_s3_2 = save->timePlayed;
if (temp_s3_2 > MAX_DISPLAYED_TIME) {
temp_s3_2 = MAX_DISPLAYED_TIME;
}
draw_number((temp_s3_2 / 2160000) % 10, baseX + 76, baseY + 24, 1, 0xA, 0xFF, 2);
temp_s1_2 = temp_s3_2 / 216000;
draw_number(temp_s1_2 - ((temp_s3_2 / 2160000) * 10), baseX + 85, baseY + 24, 1, 0xA, 0xFF, 2);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_PERIOD_13), baseX + 95, baseY + 23, 0xFF, 0xA, 1);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_PERIOD_13), baseX + 95, baseY + 18, 0xFF, 0xA, 1);
temp_s0_3 = temp_s3_2 / 36000;
draw_number(temp_s0_3 - (temp_s1_2 * 6), baseX + 100, baseY + 24, 1, 0xA, 0xFF, 2);
draw_number((temp_s3_2 / 3600) - (temp_s0_3 * 10), baseX + 109, baseY + 24, 1, 0xA, 0xFF, 2);
for (i = 0; i < 7; i++) {
if (i < gSaveSlotMetadata[fileIdx].spiritsRescued) {
id = filemenu_hudElemIDs[i];
} else {
id = filemenu_hudElemIDs[i + 7];
}
hud_element_set_render_pos(id, baseX + 17 + (i * 16), baseY + 44);
if (i == 0) {
hud_element_draw_without_clipping(id);
} else {
hud_element_draw_next(id);
}
}
}
void filemenu_draw_contents_file_title(
s32 fileIdx,
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening)
{
if (filemenu_8024C098 == 0 && menu->selected == fileIdx) {
filemenu_set_cursor_goal_pos(fileIdx + 60, baseX - 3, baseY + 8);
}
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 5, baseY + 1, 255, 0, 1);
if (!gSaveSlotHasData[fileIdx]) {
draw_number(fileIdx + 1, baseX + 33, baseY + 1, 1, 0, 255, 2);
} else {
draw_number(fileIdx + 1, baseX + 33, baseY + 1, 1, 0, 255, 2);
filemenu_draw_file_name(
gSaveSlotMetadata[fileIdx].filename,
ARRAY_COUNT(gSaveSlotMetadata[fileIdx].filename),
baseX + 46, baseY + 1, 255, 0, 1, 9);
}
}
void filemenu_draw_contents_file_0_info(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
filemenu_draw_contents_file_info(0, menu, baseX, baseY, width, height, opacity, darkening);
}
void filemenu_draw_contents_file_1_info(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
filemenu_draw_contents_file_info(1, menu, baseX, baseY, width, height, opacity, darkening);
}
void filemenu_draw_contents_file_2_info(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
filemenu_draw_contents_file_info(2, menu, baseX, baseY, width, height, opacity, darkening);
}
void filemenu_draw_contents_file_3_info(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
filemenu_draw_contents_file_info(3, menu, baseX, baseY, width, height, opacity, darkening);
}
void filemenu_draw_contents_file_0_title(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
filemenu_draw_contents_file_title(0, menu, baseX, baseY, width, height, opacity, darkening);
}
void filemenu_draw_contents_file_1_title(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
filemenu_draw_contents_file_title(1, menu, baseX, baseY, width, height, opacity, darkening);
}
void filemenu_draw_contents_file_2_title(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
filemenu_draw_contents_file_title(2, menu, baseX, baseY, width, height, opacity, darkening);
}
void filemenu_draw_contents_file_3_title(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
filemenu_draw_contents_file_title(3, menu, baseX, baseY, width, height, opacity, darkening);
}
void filemenu_main_init(MenuPanel* menu) {
s32 halfWidth;
s32 halfWidth2;
s16* posXPtr;
s32 x;
s32 i;
for (i = 0; i < ARRAY_COUNT(filemenu_hudElemIDs); i++) {
filemenu_hudElemIDs[i] = hud_element_create(filemenu_hudElemScripts[i]);
hud_element_set_flags(filemenu_hudElemIDs[i], HUD_ELEMENT_FLAGS_80);
}
for (i = 0; i < ARRAY_COUNT(filemenu_windowBPs); i++) {
filemenu_windowBPs[i].tab = menu;
}
setup_pause_menu_tab(filemenu_windowBPs, ARRAY_COUNT(filemenu_windowBPs));
menu->selected = menu->gridData[(menu->page * menu->numCols * menu->numRows) +
(menu->numCols * menu->row) +
menu->col];
if (menu->page == 2) {
gWindows[45].pos.y = 1;
gWindows[45].width = 211;
gWindows[45].height = 25;
} else {
gWindows[45].pos.y = 1;
gWindows[45].width = 162;
gWindows[45].height = 25;
}
halfWidth = gWindows[45].width / 2;
posXPtr = &gWindows[45].pos.x;
if (gWindows[45].parent != -1) {
x = (gWindows[gWindows[45].parent].width / 2) - halfWidth;
} else {
x = 160 - halfWidth;
}
*posXPtr = x;
halfWidth2 = gWindows[54].width / 2;
posXPtr = &gWindows[54].pos.x;
if (gWindows[54].parent != -1) {
x = (gWindows[gWindows[54].parent].width / 2) - halfWidth2;
} else {
x = 160 - halfWidth2;
}
*posXPtr = x;
if (menu->page != 0) {
set_window_update(WINDOW_ID_53, WINDOW_UPDATE_HIDE);
set_window_update(WINDOW_ID_55, WINDOW_UPDATE_HIDE);
set_window_update(WINDOW_ID_51, WINDOW_UPDATE_HIDE);
set_window_update(WINDOW_ID_52, WINDOW_UPDATE_HIDE);
}
menu->initialized = 1;
}
void filemenu_main_handle_input(MenuPanel* menu) {
s32 originalSelected = menu->selected;
s32 i;
if (filemenu_heldButtons & BUTTON_STICK_LEFT) {
while(TRUE) {
menu->col--;
if (menu->col < 0) {
menu->col = 0;
break;
}
if (menu->selected != MENU_PANEL_SELECTED_GRID_DATA(menu)) {
break;
}
}
}
if (filemenu_heldButtons & BUTTON_STICK_RIGHT) {
while (TRUE) {
menu->col++;
if (menu->col >= menu->numCols) {
menu->col = menu->numCols - 1;
break;
}
if (menu->selected != MENU_PANEL_SELECTED_GRID_DATA(menu)) {
break;
}
}
}
if (filemenu_heldButtons & BUTTON_STICK_UP) {
menu->row--;
if (menu->row < 0) {
menu->row = 0;
}
}
if (filemenu_heldButtons & BUTTON_STICK_DOWN) {
menu->row++;
if (menu->row >= menu->numRows) {
menu->row = menu->numRows - 1;
}
}
switch (menu->page) {
case 0:
if (menu->col == 1 && (u8) menu->row < 2) {
menu->col = 0;
}
break;
case 1: // TODO required to duplicate cases 1-4 instead of using fallthrough
if (menu->col == 1 && (u8) menu->row < 2) {
menu->col = 0;
}
if (menu->row == 2) {
menu->col = 1;
}
break;
case 2:
if (menu->col == 1 && (u8) menu->row < 2) {
menu->col = 0;
}
if (menu->row == 2) {
menu->col = 1;
}
break;
case 3:
if (menu->col == 1 && (u8) menu->row < 2) {
menu->col = 0;
}
if (menu->row == 2) {
menu->col = 1;
}
break;
case 4:
if (menu->col == 1 && (u8) menu->row < 2) {
menu->col = 0;
}
if (menu->row == 2) {
menu->col = 1;
}
break;
}
menu->selected = MENU_PANEL_SELECTED_GRID_DATA(menu);
if (originalSelected != menu->selected) {
sfx_play_sound(SOUND_2101);
}
if (menu->page == 0) {
s32 originalOutputMode = gGameStatusPtr->soundOutputMode;
if (filemenu_pressedButtons & BUTTON_Z) {
gGameStatusPtr->soundOutputMode = SOUND_OUT_STEREO;
}
if (filemenu_pressedButtons & BUTTON_R) {
gGameStatusPtr->soundOutputMode = SOUND_OUT_MONO;
}
if (originalOutputMode != gGameStatusPtr->soundOutputMode) {
sfx_play_sound(SOUND_MENU_CHANGE_TAB);
if (gGameStatusPtr->soundOutputMode != SOUND_OUT_MONO) {
audio_set_stereo();
} else {
audio_set_mono();
}
}
}
if ((filemenu_pressedButtons & BUTTON_START) && menu->page == 0 && menu->selected < 4) {
filemenu_pressedButtons = BUTTON_A;
}
if (filemenu_pressedButtons & BUTTON_A) {
s32 cond = FALSE;
switch (menu->page) {
case 0:
if (menu->selected < 4 && !gSaveSlotHasData[menu->selected]) {
cond = TRUE;
}
if (cond) {
MenuPanel* temp_a0;
for (i = 0; i < ARRAY_COUNT(filemenu_8024C110); i++) {
filemenu_8024C110[i] = 0xF7;
}
D_8024C090 = 0;
set_window_update(WINDOW_ID_48, (s32)filemenu_update_show_name_input);
set_window_update(WINDOW_ID_49, (s32)filemenu_update_show_name_input);
set_window_update(WINDOW_ID_45, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_51, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_54, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_56, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_57, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_58, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_59, (s32)filemenu_update_hidden_with_rotation);
sfx_play_sound(SOUND_MENU_NEXT);
filemenu_8024C098 = 3;
temp_a0 = filemenu_menus[filemenu_8024C098];
temp_a0->page = 0;
filemenu_set_selected(temp_a0, 0, 0);
break;
}
if (menu->selected == 6) {
set_window_update(WINDOW_ID_51, (s32)filemenu_update_hidden_options_left);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_hidden_options_right);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_hidden_options_bottom);
set_window_update(WINDOW_ID_54, (s32)filemenu_update_hidden_options_bottom);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_hidden_options_bottom);
set_window_update(WINDOW_ID_56, (s32)filemenu_update_hidden_options_left);
set_window_update(WINDOW_ID_57, (s32)filemenu_update_hidden_options_right);
set_window_update(WINDOW_ID_58, (s32)filemenu_update_hidden_options_left);
set_window_update(WINDOW_ID_59, (s32)filemenu_update_hidden_options_right);
set_window_update(WINDOW_ID_45, (s32)filemenu_update_hidden_title);
sfx_play_sound(SOUND_D6);
set_game_mode(GAME_MODE_END_FILE_SELECT);
} else if (menu->selected == 4) {
sfx_play_sound(SOUND_MENU_NEXT);
menu->page = 1;
filemenu_set_selected(menu, 1, 2);
set_window_update(WINDOW_ID_51, (s32)filemenu_update_hidden_options_left);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_hidden_options_right);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_hidden_options_bottom);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_hidden_options_bottom);
} else if (menu->selected == 5) {
sfx_play_sound(SOUND_MENU_NEXT);
menu->page = 3;
filemenu_set_selected(menu, 1, 2);
set_window_update(WINDOW_ID_51, (s32)filemenu_update_hidden_options_left);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_hidden_options_right);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_hidden_options_bottom);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_hidden_options_bottom);
} else if (menu->selected < 4) {
MenuPanel* temp_a0;
sfx_play_sound(SOUND_MENU_NEXT);
set_window_update(WINDOW_ID_45, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_51, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_54, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_56, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_57, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_58, (s32)filemenu_update_hidden_with_rotation);
set_window_update(WINDOW_ID_59, (s32)filemenu_update_hidden_with_rotation);
set_window_update(menu->selected + WINDOW_ID_56, (s32)filemenu_update_select_file);
sfx_play_sound(SOUND_MENU_NEXT);
set_window_update(WINDOW_ID_50, WINDOW_UPDATE_SHOW);
gWindows[50].pos.y = 143;
gWindows[50].width = 69;
gWindows[50].height = 44;
gWindows[50].pos.x = ((gWindows[50].parent != -1)
? (gWindows[gWindows[50].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[50].width / 2;
gWindows[46].pos.y = -29;
gWindows[46].width = 192;
gWindows[46].height = 25;
gWindows[46].pos.x = ((gWindows[46].parent != -1)
? (gWindows[gWindows[46].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[46].width / 2;
filemenu_8024C098 = 1;
temp_a0 = filemenu_menus[filemenu_8024C098];
temp_a0->page = 4;
filemenu_set_selected(temp_a0, 0, 0);
}
break;
case 1:
if (menu->selected == 6) {
sfx_play_sound(SOUND_MENU_NEXT);
menu->page = 0;
set_window_update(WINDOW_ID_51, (s32)filemenu_update_show_options_left);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_show_options_right);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_options_bottom);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_show_options_bottom);
filemenu_set_selected(menu, 0, 2);
} else if (menu->selected < 4) {
if (gSaveSlotHasData[menu->selected]) {
MenuPanel* temp_a0;
sfx_play_sound(SOUND_MENU_NEXT);
set_window_update(50, (s32)filemenu_update_show_name_confirm);
gWindows[50].pos.y = 121;
gWindows[50].width = 69;
gWindows[50].height = 44;
gWindows[50].pos.x = ((gWindows[50].parent != -1)
? (gWindows[gWindows[50].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[50].width / 2;
gWindows[46].pos.y = -29;
gWindows[46].width = 118;
gWindows[46].height = 25;
gWindows[46].pos.x = ((gWindows[46].parent != -1)
? (gWindows[gWindows[46].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[46].width / 2;
filemenu_8024C098 = 1;
temp_a0 = filemenu_menus[filemenu_8024C098];
temp_a0->page = 0;
filemenu_set_selected(temp_a0, 0, 1);
} else {
sfx_play_sound(SOUND_MENU_ERROR);
}
}
break;
case 3:
if (menu->selected == 6) {
sfx_play_sound(SOUND_MENU_NEXT);
menu->page = 0;
set_window_update(WINDOW_ID_51, (s32)filemenu_update_show_options_left);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_show_options_right);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_options_bottom);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_show_options_bottom);
filemenu_set_selected(menu, 0, 1);
} else if (menu->selected < 4) {
if (gSaveSlotHasData[menu->selected]) {
sfx_play_sound(SOUND_MENU_NEXT);
menu->page = 4;
filemenu_loadedFileIdx = menu->selected;
} else {
sfx_play_sound(SOUND_MENU_ERROR);
}
}
break;
case 4:
if (menu->selected == 6) {
sfx_play_sound(SOUND_MENU_NEXT);
menu->page = 3;
filemenu_set_selected(menu, 0, 2);
} else if (menu->selected < 4) {
if (filemenu_loadedFileIdx == menu->selected) {
sfx_play_sound(SOUND_MENU_ERROR);
} else {
filemenu_iterFileIdx = menu->selected;
if (!gSaveSlotHasData[menu->selected]) {
sfx_play_sound(SOUND_MENU_NEXT);
filemenu_8024C098 = 2;
filemenu_menus[filemenu_8024C098]->page = 2;
gWindows[47].width = 154;
gWindows[47].height = 39;
gWindows[47].pos.x = ((gWindows[47].parent != -1)
? (gWindows[gWindows[47].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[47].width / 2;
gWindows[47].pos.y = ((gWindows[47].parent != -1)
? (gWindows[gWindows[47].parent].height / 2)
: SCREEN_HEIGHT / 2) - gWindows[47].height / 2;
set_window_update(WINDOW_ID_47, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_50, WINDOW_UPDATE_HIDE);
fio_load_game(filemenu_loadedFileIdx);
gSaveSlotMetadata[filemenu_iterFileIdx] = gSaveSlotMetadata[filemenu_loadedFileIdx];
fio_save_game(filemenu_iterFileIdx);
gSaveSlotHasData[filemenu_iterFileIdx] = TRUE;
} else {
MenuPanel* temp_a0;
sfx_play_sound(SOUND_MENU_NEXT);
set_window_update(WINDOW_ID_50, (s32)filemenu_update_show_name_confirm);
gWindows[50].pos.y = 121;
gWindows[50].width = 69;
gWindows[50].height = 44;
gWindows[50].pos.x = ((gWindows[50].parent != -1)
? (gWindows[gWindows[50].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[50].width / 2;
gWindows[46].pos.y = -43;
gWindows[46].width = 182;
gWindows[46].height = 39;
gWindows[46].pos.x = ((gWindows[46].parent != -1)
? (gWindows[gWindows[46].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[46].width / 2;
filemenu_8024C098 = 1;
temp_a0 = filemenu_menus[filemenu_8024C098];
temp_a0->page = 3;
filemenu_set_selected(temp_a0, 0, 1);
}
}
}
break;
case 2:
if (menu->selected == 6) {
sfx_play_sound(SOUND_MENU_NEXT);
set_game_mode(GAME_MODE_END_LANGUAGE_SELECT);
} else if (menu->selected < 4) {
if (!gSaveSlotHasData[menu->selected]) {
sfx_play_sound(SOUND_MENU_NEXT);
filemenu_8024C098 = 2;
filemenu_menus[filemenu_8024C098]->page = 1;
set_window_update(WINDOW_ID_PAUSE_CURSOR, (s32)main_menu_window_update);
set_window_update(WINDOW_ID_47, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_50, WINDOW_UPDATE_HIDE);
fio_save_game(menu->selected);
gSaveSlotHasData[menu->selected] = TRUE;
} else {
MenuPanel* temp_a0;
sfx_play_sound(SOUND_MENU_NEXT);
set_window_update(WINDOW_ID_50, (s32)filemenu_update_show_name_confirm);
gWindows[50].pos.y = 127;
gWindows[50].width = 69;
gWindows[50].height = 44;
gWindows[50].pos.x = ((gWindows[50].parent != -1)
? (gWindows[gWindows[50].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[50].width / 2;
gWindows[46].pos.y = -50;
gWindows[46].width = 148;
gWindows[46].height = 38;
gWindows[46].pos.x = ((gWindows[46].parent != -1)
? (gWindows[gWindows[46].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[46].width / 2;
filemenu_8024C098 = 1;
temp_a0 = filemenu_menus[filemenu_8024C098];
temp_a0->page = 1;
filemenu_set_selected(temp_a0, 0, 1);
}
}
break;
}
}
if (filemenu_pressedButtons & BUTTON_B) {
switch (menu->page) {
case 0:
filemenu_set_selected(menu, 2, 2);
break;
case 1:
filemenu_set_selected(menu, 1, 2);
break;
case 2:
filemenu_set_selected(menu, 1, 2);
break;
case 3:
filemenu_set_selected(menu, 1, 2);
break;
case 4:
filemenu_set_selected(menu, 1, 2);
break;
}
switch (menu->page) {
case 0:
set_window_update(WINDOW_ID_51, (s32)filemenu_update_hidden_options_left);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_hidden_options_right);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_hidden_options_bottom);
set_window_update(WINDOW_ID_54, (s32)filemenu_update_hidden_options_bottom);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_hidden_options_bottom);
set_window_update(WINDOW_ID_56, (s32)filemenu_update_hidden_options_left);
set_window_update(WINDOW_ID_57, (s32)filemenu_update_hidden_options_right);
set_window_update(WINDOW_ID_58, (s32)filemenu_update_hidden_options_left);
set_window_update(WINDOW_ID_59, (s32)filemenu_update_hidden_options_right);
set_window_update(WINDOW_ID_45, (s32)filemenu_update_hidden_title);
sfx_play_sound(SOUND_D6);
set_game_mode(GAME_MODE_END_FILE_SELECT);
break;
case 1:
menu->page = 0;
filemenu_set_selected(menu, 0, 2);
set_window_update(WINDOW_ID_51, (s32)filemenu_update_show_options_left);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_show_options_right);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_options_bottom);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_show_options_bottom);
sfx_play_sound(SOUND_MENU_BACK);
break;
case 3:
menu->page = 0;
filemenu_set_selected(menu, 1, 2);
set_window_update(WINDOW_ID_51, (s32)filemenu_update_show_options_left);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_show_options_right);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_options_bottom);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_show_options_bottom);
sfx_play_sound(SOUND_MENU_BACK);
break;
case 4:
menu->page = 3;
filemenu_set_selected(menu, (filemenu_loadedFileIdx % 2) * 2, filemenu_loadedFileIdx / 2);
sfx_play_sound(SOUND_MENU_BACK);
break;
case 2:
sfx_play_sound(SOUND_MENU_BACK);
set_game_mode(GAME_MODE_END_LANGUAGE_SELECT);
break;
}
}
}
void filemenu_main_update(MenuPanel* menu) {
gWindowStyles[56].customStyle = &D_8024BDA8[0];
gWindowStyles[57].customStyle = &D_8024BDA8[0];
gWindowStyles[58].customStyle = &D_8024BDA8[0];
gWindowStyles[59].customStyle = &D_8024BDA8[0];
gWindowStyles[60].customStyle = &D_8024BDA8[2];
gWindowStyles[61].customStyle = &D_8024BDA8[2];
gWindowStyles[62].customStyle = &D_8024BDA8[2];
gWindowStyles[63].customStyle = &D_8024BDA8[2];
switch (menu->selected) {
case 0:
gWindowStyles[56].customStyle = &D_8024BDA8[1];
gWindowStyles[60].customStyle = &D_8024BDA8[3];
break;
case 1:
gWindowStyles[57].customStyle = &D_8024BDA8[1];
gWindowStyles[61].customStyle = &D_8024BDA8[3];
break;
case 2:
gWindowStyles[58].customStyle = &D_8024BDA8[1];
gWindowStyles[62].customStyle = &D_8024BDA8[3];
break;
case 3:
gWindowStyles[59].customStyle = &D_8024BDA8[1];
gWindowStyles[63].customStyle = &D_8024BDA8[3];
break;
}
if (filemenu_menus[0]->page == 4) {
switch (filemenu_loadedFileIdx) {
case 0:
gWindowStyles[56].customStyle = &D_8024BDA8[1];
gWindowStyles[60].customStyle = &D_8024BDA8[3];
return;
case 1:
gWindowStyles[57].customStyle = &D_8024BDA8[1];
gWindowStyles[61].customStyle = &D_8024BDA8[3];
return;
case 2:
gWindowStyles[58].customStyle = &D_8024BDA8[1];
gWindowStyles[62].customStyle = &D_8024BDA8[3];
return;
case 3:
gWindowStyles[59].customStyle = &D_8024BDA8[1];
gWindowStyles[63].customStyle = &D_8024BDA8[3];
return;
}
}
}
void filemenu_main_cleanup(void) {
s32 i;
for (i = 0; i < ARRAY_COUNT(filemenu_hudElemIDs); i++) {
hud_element_free(filemenu_hudElemIDs[i]);
}
}

View File

@ -1,350 +0,0 @@
#include "common.h"
#include "filemenu.h"
#include "fio.h"
extern SaveMetadata gSaveSlotMetadata[4];
extern u8 gSaveSlotHasData[4];
extern MenuWindowBP D_8024A0CC[2];
void filemenu_yesno_draw_options_contents(MenuPanel* tab, s32 posX, s32 posY) {
s32 xOffset1;
s32 yOffset1;
s32 xOffset2;
s32 yOffset2;
s32 cursorGoalXOffset;
s32 cursorGoalYOffset;
switch (tab->page) {
case 0:
xOffset1 = 28;
yOffset1 = 4;
xOffset2 = 28;
yOffset2 = 21;
break;
case 1:
xOffset1 = 28;
yOffset1 = 4;
xOffset2 = 28;
yOffset2 = 21;
break;
case 2:
xOffset1 = 28;
yOffset1 = 4;
xOffset2 = 28;
yOffset2 = 21;
break;
case 3:
xOffset1 = 28;
yOffset1 = 4;
xOffset2 = 28;
yOffset2 = 21;
break;
case 4:
xOffset1 = 28;
yOffset1 = 4;
xOffset2 = 28;
yOffset2 = 21;
break;
}
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_YES), posX + xOffset1, posY + yOffset1, 0xFF, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_NO), posX + xOffset2, posY + yOffset2, 0xFF, 0, 0);
if (filemenu_8024C098 == 1) {
if (tab->selected == 0) {
cursorGoalXOffset = xOffset1 - 10;
cursorGoalYOffset = yOffset1 + 8;
} else {
cursorGoalXOffset = xOffset2 - 10;
cursorGoalYOffset = yOffset2 + 8;
}
filemenu_set_cursor_goal_pos(0x32, posX + cursorGoalXOffset, posY + cursorGoalYOffset);
}
}
void filemenu_yesno_draw_prompt_contents(MenuPanel* tab, s32 posX, s32 posY) {
s32 xOffset;
s32 i;
switch (tab->page) {
case 0:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_DELETE), posX + 10, posY + 4, 0xFF, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_22), posX + 60, posY + 4, 0xFF, 0, 0);
draw_number(filemenu_menus[0]->selected + 1, posX + 98, posY + 6, 0, 0, 0xFF, 3);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_QUESTION), posX + 99, posY + 4, 0xFF, 0, 0);
break;
case 3:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_22), posX + 10, posY + 4, 0xFF, 0, 0);
draw_number(filemenu_menus[0]->selected + 1, posX + 48, posY + 6, 0, 0, 0xFF, 3);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_WILL_BE_DELETED), posX + 49, posY + 4, 0xFF, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_OK_TO_COPY_TO_THIS_FILE), posX + 10, posY + 18, 0xFF, 0, 0);
break;
case 1:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_OVERRIDE_TO_NEW_DATA), posX + 10, posY + 4, 0xFF, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_SAVE_OK), posX + 10, posY + 18, 0xFF, 0, 0);
break;
case 2:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_NAME_IS), posX + 10, posY + 6, 0xFF, 0, 0);
for (i = ARRAY_COUNT(filemenu_8024C110) - 1; i >= 0; i--) {
if (filemenu_8024C110[i] != 0xF7) {
break;
}
}
xOffset = (147 - (i * 11)) / 2;
filemenu_draw_file_name(filemenu_8024C110, i + 1, posX + xOffset, posY + 22, 0xFF, 0, 8, 0xB);
xOffset += (i + 1) * 11;
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_PERIOD_20), posX + xOffset, posY + 22, 0xFF, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_OK), posX + 70, posY + 38, 0xFF, 0, 0);
break;
case 4:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_START_GAME_WITH), posX + 10, posY + 4, 0xFF, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_22), posX + 127, posY + 4, 0xFF, 0, 0);
draw_number(filemenu_menus[0]->selected + 1, posX + 165, posY + 6, 0, 0, 0xFF, 3);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_QUESTION), posX + 162, posY + 4, 0xFF, 0, 0);
break;
}
}
void filemenu_yesno_init(MenuPanel* tab) {
s32 i;
for (i = 0; i < ARRAY_COUNT(D_8024A0CC); i++) {
D_8024A0CC[i].tab = tab;
}
setup_pause_menu_tab(D_8024A0CC, ARRAY_COUNT(D_8024A0CC));
tab->initialized = TRUE;
}
void filemenu_yesno_handle_input(MenuPanel* menu) {
s32 oldSelected = menu->selected;
if (filemenu_heldButtons & BUTTON_STICK_UP) {
menu->row--;
if (menu->row < 0) {
menu->row = 0;
}
}
if (filemenu_heldButtons & BUTTON_STICK_DOWN) {
menu->row++;
if (menu->row >= menu->numRows) {
menu->row = menu->numRows - 1;
}
}
menu->selected = MENU_PANEL_SELECTED_GRID_DATA(menu);
if (oldSelected != menu->selected) {
sfx_play_sound(SOUND_MENU_CHANGE_SELECTION);
}
if ((filemenu_pressedButtons & BUTTON_START) && menu->page == 4) {
filemenu_set_selected(menu, 0, 0);
filemenu_pressedButtons = BUTTON_A;
}
if (filemenu_pressedButtons & BUTTON_A) {
u32 slot;
u32 slot2;
u32 slot3;
u32 slot4;
s32 i;
sfx_play_sound(SOUND_MENU_NEXT);
switch (menu->selected) {
case 0:
switch (menu->page) {
case 0:
filemenu_8024C098 = 2;
filemenu_menus[filemenu_8024C098]->page = 0;
gWindows[47].width = 182;
gWindows[47].height = 25;
gWindows[47].pos.x = ((gWindows[47].parent != -1)
? (gWindows[gWindows[47].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[47].width / 2;
gWindows[47].pos.y = ((gWindows[47].parent != -1)
? (gWindows[gWindows[47].parent].height / 2)
: SCREEN_HEIGHT / 2) - gWindows[47].height / 2;
set_window_update(WINDOW_ID_47, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm);
slot = filemenu_menus[0]->selected;
for (i = 0; i < ARRAY_COUNT(gSaveSlotMetadata->filename); i++) {
gSaveSlotMetadata[slot].filename[i] = 0xF7;
}
gSaveSlotMetadata[slot].level = 0;
gSaveSlotMetadata[slot].timePlayed = 0;
gSaveSlotMetadata[slot].spiritsRescued = 0;
fio_erase_game(slot);
gSaveSlotHasData[slot] = FALSE;
break;
case 3:
filemenu_8024C098 = 2;
filemenu_menus[filemenu_8024C098]->page = 2;
gWindows[47].width = 154;
gWindows[47].height = 39;
gWindows[47].pos.x = ((gWindows[47].parent != -1)
? (gWindows[gWindows[47].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[47].width / 2;
gWindows[47].pos.y = ((gWindows[47].parent != -1)
? (gWindows[gWindows[47].parent].height / 2)
: SCREEN_HEIGHT / 2) - gWindows[47].height / 2;
set_window_update(WINDOW_ID_47, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm);
fio_load_game(filemenu_loadedFileIdx);
gSaveSlotMetadata[filemenu_iterFileIdx] = gSaveSlotMetadata[filemenu_loadedFileIdx];
fio_save_game(filemenu_iterFileIdx);
gSaveSlotHasData[filemenu_iterFileIdx] = TRUE;
break;
case 1:
filemenu_8024C098 = 2;
filemenu_menus[filemenu_8024C098]->page = 1;
gWindows[47].width = 153;
gWindows[47].height = 25;
gWindows[47].pos.x = ((gWindows[47].parent != -1)
? (gWindows[gWindows[47].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[47].width / 2;
gWindows[47].pos.y = ((gWindows[47].parent != -1)
? (gWindows[gWindows[47].parent].height / 2)
: SCREEN_HEIGHT / 2) - gWindows[47].height / 2;
set_window_update(WINDOW_ID_47, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm);
gSaveSlotMetadata[filemenu_menus[0]->selected] = gSaveSlotMetadata[gGameStatusPtr->saveSlot];
fio_save_game(filemenu_menus[0]->selected);
gSaveSlotHasData[filemenu_menus[0]->selected] = TRUE;
break;
case 2:
clear_player_data();
clear_saved_variables();
gGameStatusPtr->areaID = 0;
gGameStatusPtr->mapID = 0xB;
gGameStatusPtr->entryID = 0;
evt_set_variable(NULL, GB_StoryProgress, STORY_INTRO);
slot2 = filemenu_menus[0]->selected;
for (i = 0; i < ARRAY_COUNT(gSaveSlotMetadata->filename); i++) {
gSaveSlotMetadata[slot2].filename[i] = filemenu_8024C110[i];
}
fio_save_game(slot2);
gSaveSlotHasData[slot2] = TRUE;
set_window_update(WINDOW_ID_48, (s32)filemenu_update_hidden_name_input);
set_window_update(WINDOW_ID_49, (s32)filemenu_update_hidden_name_input);
set_window_update(WINDOW_ID_45, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_51, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_54, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_56, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_57, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_58, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_59, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm);
filemenu_8024C098 = 2;
filemenu_menus[2]->page = 3;
gWindows[47].width = 184;
gWindows[47].height = 25;
gWindows[47].pos.x = ((gWindows[47].parent != -1)
? (gWindows[gWindows[47].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[47].width / 2;
gWindows[47].pos.y = ((gWindows[47].parent != -1)
? (gWindows[gWindows[47].parent].height / 2)
: SCREEN_HEIGHT / 2) - gWindows[47].height / 2;
set_window_update(WINDOW_ID_47, WINDOW_UPDATE_SHOW);
break;
case 4:
slot3 = filemenu_menus[0]->selected;
if (gGameStatusPtr->soundOutputMode != 1 - D_800D95E8.saveSlot ||
slot3 != (u8)D_800D95E8.saveCount)
{
D_800D95E8.saveSlot = 1 - gGameStatusPtr->soundOutputMode;
D_800D95E8.saveCount = slot3;
fio_flush_backups();
}
fio_load_game(slot3);
set_game_mode(GAME_MODE_END_FILE_SELECT);
break;
}
break;
case 1:
switch (menu->page) {
case 0:
case 1:
case 3:
filemenu_8024C098 = 0;
set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm);
break;
case 2:
filemenu_8024C098 = 3;
set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm);
break;
case 4:
filemenu_8024C098 = 0;
slot4 = filemenu_menus[0]->selected;
set_window_update(WINDOW_ID_45, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_51, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_54, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_56, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_57, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_58, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_59, (s32)filemenu_update_show_with_rotation);
set_window_update(slot4 + 0x38, (s32)filemenu_update_deselect_file);
set_window_update(WINDOW_ID_50, WINDOW_UPDATE_HIDE);
break;
}
break;
}
}
if (filemenu_pressedButtons & BUTTON_B) {
u32 slot;
sfx_play_sound(SOUND_MENU_BACK);
filemenu_set_selected(menu, 0, 1);
switch (menu->page) {
case 0:
case 1:
case 3:
filemenu_8024C098 = 0;
set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm);
break;
case 2:
filemenu_8024C098 = 3;
set_window_update(WINDOW_ID_50, (s32)filemenu_update_hidden_name_confirm);
break;
case 4:
filemenu_8024C098 = 0;
slot = filemenu_menus[0]->selected;
set_window_update(WINDOW_ID_45, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_51, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_54, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_56, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_57, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_58, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_59, (s32)filemenu_update_show_with_rotation);
set_window_update(slot + WINDOW_ID_56, (s32)filemenu_update_deselect_file);
set_window_update(WINDOW_ID_50, WINDOW_UPDATE_HIDE);
break;
}
}
}
void filemenu_yesno_update(void) {
}
void filemenu_yesno_cleanup(void) {
}

View File

@ -1,523 +0,0 @@
#include "common.h"
#include "filemenu.h"
#include "hud_element.h"
typedef struct UnkStruct8015A370 {
/* 0x00 */ u8 unk_00;
/* 0x01 */ char unk_01[0x3];
/* 0x04 */ void (*unk_04)(s32);
/* 0x08 */ char unk_08[0x14];
/* 0x1C */ u8 unk_1C;
} UnkStruct8015A370;
extern UnkStruct8015A370 D_8015A370;
extern MenuWindowBP D_8024A134[1];
extern HudScript* D_8024A180[3];
extern s32 D_8024A18C;
extern s32 D_8024C108;
extern MenuWindowBP D_8024A190[2];
extern s8 D_8024C090;
extern s32 D_8024C100_C09980[3];
extern u8 D_8024C117;
void filemenu_info_draw_message_contents(MenuPanel* menu, s32 baseX, s32 baseY) {
switch (menu->page) {
case 0:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 10, baseY + 4, 255, 0, 0);
draw_number(filemenu_menus[0]->selected + 1, baseX + 48, baseY + 6, 0, 0, 255, 3);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_HAS_BEEN_DELETED), baseX + 49, baseY + 4, 255, 0, 0);
break;
case 2:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_COPY_FROM), baseX + 10, baseY + 4, 255, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 84, baseY + 4, 255, 0, 0);
draw_number(filemenu_loadedFileIdx + 1, baseX + 122, baseY + 6, 0, 0, 255, 3);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_TO), baseX + 10, baseY + 18, 255, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 30, baseY + 18, 255, 0, 0);
draw_number(filemenu_iterFileIdx + 1, baseX + 68, baseY + 20, 0, 0, 255, 3);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_PERIOD_34), baseX + 65, baseY + 18, 255, 0, 0);
break;
case 1:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_28), baseX + 10, baseY + 4, 255, 0, 0);
break;
case 3:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 10, baseY + 4, 255, 0, 0);
draw_number(filemenu_menus[0]->selected + 1, baseX + 48, baseY + 6, 0, 0, 255, 3);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_HAS_BEEN_CREATED), baseX + 49, baseY + 4, 255, 0, 0);
break;
}
filemenu_set_cursor_alpha(0);
}
void filemenu_info_init(MenuPanel* tab) {
s32 i;
for (i = 0; i < ARRAY_COUNT(D_8024A134); i++) {
D_8024A134[i].tab = tab;
}
setup_pause_menu_tab(D_8024A134, ARRAY_COUNT(D_8024A134));
tab->initialized = TRUE;
}
void filemenu_info_handle_input(void) {
if (filemenu_pressedButtons & (BUTTON_A | BUTTON_B)) {
MenuPanel* menu = filemenu_menus[0];
filemenu_8024C098 = 0;
switch (menu->page) {
case 1:
menu->page = 0;
set_window_update(WINDOW_ID_51, (s32)filemenu_update_show_options_left);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_show_options_right);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_options_bottom);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_show_options_bottom);
filemenu_set_selected(menu, 0, 2);
break;
case 4:
menu->page = 0;
set_window_update(WINDOW_ID_51, (s32)filemenu_update_show_options_left);
set_window_update(WINDOW_ID_52, (s32)filemenu_update_show_options_right);
set_window_update(WINDOW_ID_53, (s32)filemenu_update_show_options_bottom);
set_window_update(WINDOW_ID_55, (s32)filemenu_update_show_options_bottom);
filemenu_set_selected(menu, 1, 2);
break;
case 2:
menu->page = 2;
filemenu_set_selected(menu, 1, 2);
break;
}
set_window_update(WINDOW_ID_47, WINDOW_UPDATE_HIDE);
}
}
void filemenu_info_update(void) {
}
void filemenu_info_cleanup(void) {
}
void func_80248170(s32 idx) {
Window* window = &gWindows[idx];
if (window->updateCounter == 8) {
window->flags &= ~WINDOW_FLAGS_INITIAL_ANIMATION;
set_window_update(idx, WINDOW_UPDATE_SHOW);
}
}
void filemenu_draw_contents_file_create_header(MenuPanel* menu, s32 baseX, s32 baseY) {
s32 xOffset;
s32 yOffset;
s32 i;
s32 tempAmt;
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_ENTER_A_FILE_NAME), baseX + 10, baseY + 6, 255, 0, 0);
filemenu_draw_file_name(filemenu_8024C110, 8, baseX + 36, baseY + 22, 255, 0, 0, 0xB);
xOffset = 41;
for (i = 0; i < 8; i++) {
hud_element_set_render_pos(D_8024C100_C09980[1], baseX + 42 + (i * 11), baseY + xOffset);
if (i == 0) {
hud_element_draw_without_clipping(D_8024C100_C09980[1]);
} else {
hud_element_draw_next(D_8024C100_C09980[1]);
}
}
tempAmt = 8;
if (filemenu_8024C098 == 3) {
s32 phi_v0 = 122;
if (D_8024C090 != tempAmt) {
phi_v0 = (D_8024C090 * 11) + 45;
}
hud_element_set_render_pos(D_8024C100_C09980[0], baseX + phi_v0, baseY + 45);
hud_element_draw_next(D_8024C100_C09980[0]);
}
}
void filemenu_draw_contents_choose_name(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening);
#ifdef NON_MATCHING
void filemenu_draw_contents_choose_name(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity,
s32 darkening)
{
s32 sp18;
s32 menuPage;
s32 pageNotOne;
s32 page;
s32 temp_s2;
s32 new_var;
s32 gridData;
s32 xOffset;
s32 yOffset;
s32 color;
s32 flags;
s32 i;
s32 r;
s32 c;
s32 new_var2;
if ((D_8015A370.unk_00 & 8) && D_8015A370.unk_04 == func_80248170) {
sp18 = D_8015A370.unk_1C * 2;
menuPage = menu->page;
pageNotOne = menu->page != 1;
if (sp18 > 0x10) {
sp18 = 0x10;
}
for (r = 0; r < menu->numRows; r++) {
temp_s2 = (r * 15); // ???
for (i = 0; i < 2; i++) {
if (i == 0) {
temp_s2 += 4;
page = menuPage;
gDPSetScissor(gMasterGfxPos++, G_SC_NON_INTERLACE,
baseX,
baseY + temp_s2,
baseX + width,
baseY + temp_s2 + sp18);
} else {
temp_s2 += 4;
page = pageNotOne;
gDPSetScissor(gMasterGfxPos++, G_SC_NON_INTERLACE,
baseX,
baseY + temp_s2 + sp18,
baseX + width,
baseY + temp_s2 + 0x10);
}
for (c = 0; c < menu->numCols; c++) {
gridData = menu->gridData[(page * menu->numCols * menu->numRows) + (menu->numCols * r) + c];
if (gridData != 0xF7) {
if (r == menu->col && c == menu->row) {
flags = 8;
color = 0;
} else {
flags = 0;
color = 10;
}
xOffset = (c * 19) + 12;
yOffset = (r * 17) + 5;
if ((u32) (gridData - 0xA2) < 0x4EU) {
if (gridData >= 0xC6) {
hud_element_set_render_pos(D_8024C108, baseX + xOffset + 22, baseY + yOffset + 8);
hud_element_draw_without_clipping(D_8024C108);
flags = 0;
}
}
if (gridData == 0xC6) {
xOffset -= 1;
}
if (gridData == 0xC9) {
xOffset += 5;
}
if (gridData == 0xCA) {
xOffset += 8;
}
if (gridData == 0xC6 || gridData == 0xCA || gridData == 0xC9) {
yOffset -= 1;
}
filemenu_draw_message((Message* ) gridData, baseX + xOffset, baseY + yOffset, 255, color, flags);
}
}
}
}
gDPSetScissor(gMasterGfxPos++, G_SC_NON_INTERLACE, baseX, baseY, baseX + width, baseY + height);
} else {
for (r = 0; r < menu->numCols; r++) {
for (c = 0; c < menu->numRows; c++) {
gridData = menu->gridData[(menu->page * menu->numCols * menu->numRows) + (menu->numCols * c) + r];
if (gridData != 0xF7) {
if (r == menu->col && c == menu->row) {
flags = 8;
color = 0;
} else {
flags = 0;
color = 10;
}
xOffset = (r * 19) + 12;
yOffset = (c * 17) + 5;
new_var2 = gridData; // ???
if ((u32) (gridData - 0xA2) < 0x4EU) {
if (gridData >= 0xC6) {
hud_element_set_render_pos(D_8024C108, baseX + xOffset + 22, baseY + yOffset + 8);
hud_element_draw_without_clipping(D_8024C108);
flags = 0;
}
}
if (gridData == 0xC6) {
xOffset -= 1;
}
if (gridData == 0xC9) {
xOffset += 5;
}
if (gridData == 0xCA) {
xOffset += 8;
}
if (gridData == 0xC6 || gridData == 0xCA || gridData == 0xC9) {
yOffset -= 1;
}
filemenu_draw_message((Message* ) new_var2, baseX + xOffset, baseY + yOffset, 255, color, flags);
}
}
}
}
if (filemenu_8024C098 == 3) {
if (filemenu_heldButtons & (BUTTON_STICK_RIGHT | BUTTON_STICK_LEFT | BUTTON_STICK_DOWN | BUTTON_STICK_UP)) {
D_8024A18C = -4;
}
D_8024A18C += 1;
filemenu_set_cursor_goal_pos(0x31, baseX + 2 + (menu->col * 19), baseY + 13 + (menu->row * 17));
}
}
#else
INCLUDE_ASM(s32, "168590", filemenu_draw_contents_choose_name);
#endif
void filemenu_choose_name_init(MenuPanel* menu) {
s32 i;
for (i = 0; i < ARRAY_COUNT(D_8024A180); i++) {
D_8024C100_C09980[i] = hud_element_create(D_8024A180[i]);
hud_element_set_flags(D_8024C100_C09980[i], HUD_ELEMENT_FLAGS_80);
}
for (i = 0; i < ARRAY_COUNT(D_8024A190); i++) {
D_8024A190[i].tab = menu;
}
setup_pause_menu_tab(D_8024A190, 2);
gWindows[48].pos.x = ((gWindows[48].parent != -1)
? (gWindows[gWindows[48].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[48].width / 2;
gWindows[49].pos.x = ((gWindows[49].parent != -1)
? (gWindows[gWindows[49].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[49].width / 2;
menu->initialized = TRUE;
}
void filemenu_choose_name_handle_input(MenuPanel* menu) {
s32 oldSelected = menu->selected;
MenuPanel* newMenu;
MenuPanel* newMenu2;
s32 temp;
s32 i;
if (filemenu_heldButtons & BUTTON_STICK_LEFT) {
menu->col--;
if (menu->col < 0) {
menu->col = menu->numCols - 1;
}
} else if (filemenu_heldButtons & BUTTON_STICK_RIGHT) {
menu->col++;
if (menu->col >= menu->numCols) {
menu->col = 0;
}
if (menu->row == menu->numRows - 1) {
if (menu->col > 10) {
menu->col = 0;
} else if (menu->col == 8 || menu->col == 9) {
menu->col = 10;
} else if (menu->col == 5 || menu->col == 6) {
menu->col = 7;
}
}
}
if (filemenu_heldButtons & BUTTON_STICK_UP) {
menu->row--;
if (menu->row < 0) {
menu->row = menu->numRows - 1;
}
} else if (filemenu_heldButtons & BUTTON_STICK_DOWN) {
menu->row++;
if (menu->row >= menu->numRows) {
menu->row = 0;
}
}
if (menu->row == menu->numRows - 1) {
if (menu->col > 10) {
menu->col = 10;
} else if (menu->col == 8 || menu->col == 9) {
menu->col = 7;
} else if (menu->col == 5 || menu->col == 6) {
menu->col = 4;
}
}
menu->selected = MENU_PANEL_SELECTED_GRID_DATA(menu);
if (oldSelected != menu->selected) {
sfx_play_sound(SOUND_2102);
}
if (filemenu_pressedButtons & BUTTON_A) {
switch (menu->selected) {
case 0xC6:
sfx_play_sound(SOUND_2103);
if (D_8024C090 == ARRAY_COUNT(filemenu_8024C110)) {
D_8024C090 = ARRAY_COUNT(filemenu_8024C110) - 1;
}
filemenu_8024C110[D_8024C090] = 0xF7;
D_8024C090++;
if (D_8024C090 > ARRAY_COUNT(filemenu_8024C110)) {
D_8024C090 = ARRAY_COUNT(filemenu_8024C110);
}
break;
case 0xC9:
break;
case 0xC7:
if (menu->page != 1) {
sfx_play_sound(SOUND_2105);
menu->page = 1;
filemenu_set_selected(menu, menu->col, menu->row);
set_window_update(WINDOW_ID_49, (s32)func_80248170);
}
break;
case 0xC8:
if (menu->page != 0) {
sfx_play_sound(SOUND_2105);
menu->page = 0;
filemenu_set_selected(menu, menu->col, menu->row);
set_window_update(WINDOW_ID_49, (s32)func_80248170);
}
break;
case 0xCA:
for (i = 0; i < ARRAY_COUNT(filemenu_8024C110); i++) {
if (filemenu_8024C110[i] != 0xF7) {
break;
}
}
if (i == ARRAY_COUNT(filemenu_8024C110)) {
sfx_play_sound(SOUND_MENU_ERROR);
break;
}
sfx_play_sound(SOUND_MENU_NEXT);
set_window_update(WINDOW_ID_50, (s32) filemenu_update_show_name_confirm);
gWindows[50].pos.y = 121;
gWindows[50].width = 69;
gWindows[50].height = 44;
gWindows[50].pos.x = ((gWindows[50].parent != -1)
? (gWindows[gWindows[50].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[50].width / 2;
gWindows[46].pos.y = -70;
gWindows[46].width = 164;
gWindows[46].height = 62;
gWindows[46].pos.x = ((gWindows[46].parent != -1)
? (gWindows[gWindows[46].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[46].width / 2;
filemenu_8024C098 = 1;
newMenu = filemenu_menus[filemenu_8024C098];
newMenu->page = 2;
filemenu_set_selected(newMenu, 0, 0);
return;
default:
sfx_play_sound(SOUND_2103);
if (D_8024C090 == ARRAY_COUNT(filemenu_8024C110)) {
D_8024C117 = menu->selected;
} else {
filemenu_8024C110[D_8024C090] = menu->selected;
D_8024C090++;
if (D_8024C090 > ARRAY_COUNT(filemenu_8024C110)) {
D_8024C090 = ARRAY_COUNT(filemenu_8024C110);
}
}
break;
}
if (((u8)(menu->selected + 0x39) >= 3) && (D_8024C090 == ARRAY_COUNT(filemenu_8024C110))) { // todo ???
filemenu_set_selected(menu, menu->numCols - 3, menu->numRows - 1);
}
}
if ((filemenu_pressedButtons & BUTTON_B) || ((filemenu_pressedButtons & BUTTON_A) && (menu->selected == 0xC9))) {
sfx_play_sound(SOUND_2104);
D_8024C090--;
if (D_8024C090 < 0) {
D_8024C090 = 0;
set_window_update(WINDOW_ID_48, (s32) &filemenu_update_hidden_name_input);
set_window_update(WINDOW_ID_49, (s32) &filemenu_update_hidden_name_input);
set_window_update(WINDOW_ID_45, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_51, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_52, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_53, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_54, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_55, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_53, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_56, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_57, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_58, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_59, (s32) &filemenu_update_show_with_rotation);
filemenu_8024C098 = 0;
return;
}
for (i = D_8024C090; i < ARRAY_COUNT(filemenu_8024C110); i++) {
filemenu_8024C110[i] = 0xF7;
}
}
if (filemenu_pressedButtons & BUTTON_START) {
for (i = 0; i < ARRAY_COUNT(filemenu_8024C110); i++) {
if (filemenu_8024C110[i] != 0xF7) {
break;
}
}
if (i == ARRAY_COUNT(filemenu_8024C110)) {
sfx_play_sound(SOUND_MENU_ERROR);
return;
}
sfx_play_sound(SOUND_MENU_NEXT);
set_window_update(WINDOW_ID_50, (s32) filemenu_update_show_name_confirm);
gWindows[50].pos.y = 121;
gWindows[50].width = 69;
gWindows[50].height = 44;
gWindows[50].pos.x = ((gWindows[50].parent != -1)
? (gWindows[gWindows[50].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[50].width / 2;
gWindows[46].pos.y = -70;
gWindows[46].width = 164;
gWindows[46].height = 62;
gWindows[46].pos.x = ((gWindows[46].parent != -1)
? (gWindows[gWindows[46].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[46].width / 2;
newMenu2 = filemenu_menus[1];
filemenu_8024C098 = 1;
newMenu2->page = 2;
filemenu_set_selected(newMenu2, 0, 0);
}
}
static const f32 padding[2] = { 0.0f, 0.0f }; // not sure why this is needed
void filemenu_choose_name_update(void) {
}
void filemenu_choose_name_cleanup(void) {
s32 i;
for (i = 0; i < ARRAY_COUNT(D_8024C100_C09980); i++) {
hud_element_free(D_8024C100_C09980[i]);
}
}

View File

@ -1,145 +0,0 @@
#include "common.h"
extern u8* gFileMenuMessages[35];
extern s32 D_8024B74C[];
extern Gfx D_8024B760[];
extern Gfx* D_8024B7C8; // some gfx pos
extern s32 D_8024B7CC;
extern s32 D_8024B7D0;
extern s32 D_8024B7D4;
extern MessageCharset* gMsgCharsets[5];
extern UnkMsgStruct8 D_802F4560[];
s32 filemenu_draw_char(s32 c, s32 x, s32 y, s32 flag1, s32 color, s32 flag2) {
MessageCharset* charset;
s32 texSizeX;
s32 texSizeY;
s32 charRasterSize;
MessageCharData* charData;
u8* raster;
s32 charWidth;
if (flag1 != D_8024B7CC) {
D_8024B7CC = flag1;
D_8024B7D0 = 0;
}
charset = gMsgCharsets[D_8024B7CC];
texSizeX = charset->texSize.x;
texSizeY = charset->texSize.y;
charRasterSize = charset->charRasterSize;
charData = &charset->rasters[D_8024B7D0];
charWidth = charData->monospaceWidth;
raster = charData->raster;
if (c < 0xA2) {
charWidth = charData->charWidthTable[c];
if (gMasterGfxPos != D_8024B7C8) {
gSPDisplayList(gMasterGfxPos++, D_8024B760);
D_8024B7D4 = -1;
}
if (D_8024B7D4 != color) {
D_8024B7D4 = color;
gDPLoadTLUT_pal16(gMasterGfxPos++, 0, &D_802F4560[color]);
}
if (texSizeX >= 16 && texSizeX % 16 == 0) {
gDPLoadTextureBlock_4b(gMasterGfxPos++, &raster[charRasterSize * c], G_IM_FMT_CI,
texSizeX, texSizeY, 0,
G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
} else {
gDPLoadTextureTile_4b(gMasterGfxPos++, &raster[charRasterSize * c], G_IM_FMT_CI,
texSizeX, texSizeY,
0, 0, texSizeX - 1, texSizeY - 1, 0,
G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
}
if (flag2) {
gDPSetCombineLERP(gMasterGfxPos++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
gDPSetRenderMode(gMasterGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
mainmenu_draw_rect((x + 2) * 4, (y + 2) * 4, (2 + x + texSizeX) * 4, (2 + y + texSizeY) * 4, 0, 0, 0, 0x400, 0x400);
gDPPipeSync(gMasterGfxPos++);
gDPSetCombineMode(gMasterGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA);
gDPSetRenderMode(gMasterGfxPos++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2);
}
mainmenu_draw_rect(x * 4, y * 4, (x + texSizeX) * 4, (y + texSizeY) * 4, 0, 0, 0, 0x400, 0x400);
D_8024B7C8 = gMasterGfxPos;
return charWidth;
}
if (c == 0xF7) {
return charWidth - 6;
}
switch (c) {
case 0xF3:
D_8024B7D0 = 0;
break;
case 0xF4:
D_8024B7D0 = 1;
break;
case 0xF5:
D_8024B7D0 = 2;
break;
case 0xF6:
D_8024B7D0 = 3;
break;
}
return 0;
}
// issue with the second filemenu_draw_char arg order
#ifdef NON_MATCHING
void filemenu_draw_message(u8* message, s32 x, s32 y, s32 alpha, s32 color, u32 flags) {
s32 flag1 = flags & 1;
s32 flag2 = flags >> 3;
flag2 &= 1;
if (flag1 == 1) {
y -= 2;
}
if (message < 0x100) {
if (message - 0xA2 >= 0x4E) {
filemenu_draw_char(message, x, y, flag1, color, flag2);
return;
}
if ((s32) message >= 0xC6) {
message = D_8024B74C[(s32) message - 0xC6];
}
}
if ((s32) message < 0) {
filemenu_draw_char(0xF3, x, y, flag1, color, flag2);
while (*message != 0xFD) {
x += filemenu_draw_char(*message++, x, y, flag1, color, flag2);
}
}
}
#else
INCLUDE_ASM(s32, "169BE0", filemenu_draw_message);
#endif
// data migration
#ifdef NON_MATCHING
u8* filemenu_get_menu_message(s32 idx) {
return gFileMenuMessages[idx];
}
#else
INCLUDE_ASM(s32, "169BE0", filemenu_get_menu_message);
#endif
void filemenu_draw_file_name(u8* filename, s32 length, s32 x, s32 y, s32 alpha, s32 arg5, s32 arg6, s32 charWidth) {
s32 i;
for (i = 0; i < length; i++) {
u32 c = filename[i];
if (c != 0xF7) {
filemenu_draw_message(c, x + (i * charWidth), y, alpha, arg5, arg6);
}
}
}

View File

@ -1115,8 +1115,6 @@ s32 bActorMessages[] = {
}; };
PopupMessage* D_802838F8 = NULL; PopupMessage* D_802838F8 = NULL;
extern s16 D_80159E7E;
// BSS // BSS
BSS PopupMessage popupMessages[32]; BSS PopupMessage popupMessages[32];
BSS s16 D_8029F640; BSS s16 D_8029F640;
@ -1915,7 +1913,7 @@ void func_8024FB3C(void* data) {
} }
} }
D_80159E7E = D_8029F64E + D_8029F650; gWindows[9].pos.y = D_8029F64E + D_8029F650;
duration = &popup->duration; // TODO required to match duration = &popup->duration; // TODO required to match
if (*duration != -1) { if (*duration != -1) {

View File

@ -237,28 +237,7 @@ BSS s16 MusicCurrentVolume;
BSS char D_80159AE8[0x8]; BSS char D_80159AE8[0x8];
BSS s8 gMusicSettings[0x60]; BSS s8 gMusicSettings[0x60];
BSS s8 D_80159B50[0x200]; BSS s8 D_80159B50[0x200];
BSS s32 gWindows; BSS s8 gWindows[0x800];
BSS s8 D_80159D54[0xC];
BSS s8 D_80159D60[0x110];
BSS s8 D_80159E70[0xC];
BSS char D_80159E7C;
BSS char D_80159E7D;
BSS char D_80159E7E;
BSS char D_80159E7F;
BSS s8 D_80159E80[0x190];
BSS s8 D_8015A010[0x60];
BSS s8 D_8015A070[0xC];
BSS s8 D_8015A07C[0x164];
BSS char D_8015A1E0;
BSS char D_8015A1E1;
BSS char D_8015A1E2;
BSS char D_8015A1E3;
BSS s8 D_8015A1E4[0xD8];
BSS s16 D_8015A2BC;
BSS s16 D_8015A2BE;
BSS char D_8015A2C0[0x10];
BSS s8 D_8015A2D0[0xA0];
BSS s8 D_8015A370[0x1E0];
BSS s8 gCollisionStatus[0x28]; BSS s8 gCollisionStatus[0x28];
BSS s16 gCurrentHiddenPanels; BSS s16 gCurrentHiddenPanels;
BSS s16 D_8015A57A; BSS s16 D_8015A57A;

View File

@ -4,33 +4,24 @@
#include "fio.h" #include "fio.h"
#include "ld_addrs.h" #include "ld_addrs.h"
void filemenu_draw_cursor(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening); extern HudScript HES_AnimatedCursorHand;
void filemenu_draw_contents_copy_arrow(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
);
extern HudScript D_80241ECC; extern MenuPanel filemenu_main_menuBP;
extern MenuPanel D_8024A098; extern MenuPanel filemenu_yesno_menuBP;
extern MenuPanel D_8024A114; extern MenuPanel filemenu_info_menuBP;
extern MenuPanel D_8024A158; extern MenuPanel filemenu_createfile_menuBP;
extern MenuPanel D_8024A1D8;
extern WindowStyleCustom D_8024BA60;
extern WindowStyleCustom D_8024BA98;
extern s32 D_8024C088;
HudScript* D_80249B80[] = { &D_80241ECC }; HudScript* filemenu_cursor_hudElemScripts[] = { &HES_AnimatedCursorHand };
MenuPanel* filemenu_menus[4] = { &D_8024A098, &D_8024A114, &D_8024A158, &D_8024A1D8 }; MenuPanel* filemenu_menus[] = { &filemenu_main_menuBP, &filemenu_yesno_menuBP, &filemenu_info_menuBP, &filemenu_createfile_menuBP };
s32 D_80249B94 = SCREEN_WIDTH / 2; s32 filemenu_cursor_posX = SCREEN_WIDTH / 2;
s32 D_80249B98 = -SCREEN_HEIGHT / 2; s32 filemenu_cursor_posY = -SCREEN_HEIGHT / 2;
s32 D_80249B9C = 0; s32 filemenu_cursor_alpha = 0;
s32 D_80249BA0 = SCREEN_WIDTH / 2; s32 filemenu_cursor_targetX = SCREEN_WIDTH / 2;
s32 D_80249BA4 = -SCREEN_HEIGHT / 2; s32 filemenu_cursor_targetY = -SCREEN_HEIGHT / 2;
s32 filemenu_cursorGoalAlpha = 0; s32 filemenu_cursorGoalAlpha = 0;
s32 filemenu_cursorGoalAlpha2 = 0; s32 filemenu_cursorGoalAlpha2 = 0;
s32 D_80249BB0[] = { TRUE, FALSE }; s32 D_80249BB0 = TRUE;
s32 D_80249BB4 = 0;
s32 D_80249BB8 = 0; s32 D_80249BB8 = 0;
s16 D_80249BBC[16] = { 315, 303, 283, 260, 235, 210, 185, 160, 135, 110, 85, 60, 37, 17, 5, 0 }; s16 D_80249BBC[16] = { 315, 303, 283, 260, 235, 210, 185, 160, 135, 110, 85, 60, 37, 17, 5, 0 };
s16 D_80249BDC[16] = { 315, 303, 283, 260, 235, 210, 185, 160, 135, 110, 85, 60, 37, 17, 5, 0 }; s16 D_80249BDC[16] = { 315, 303, 283, 260, 235, 210, 185, 160, 135, 110, 85, 60, 37, 17, 5, 0 };
@ -57,9 +48,9 @@ Vp D_80249D60 = {
}; };
f32 D_80249D70[15] = { 7.0f, 12.5f, 13.0f, 14.5f, 14.0f, 13.0f, 11.5f, 9.5f, 7.5f, 5.5f, 3.5f, 2.0f, 1.0f, 0.5f, 0.0f }; f32 D_80249D70[15] = { 7.0f, 12.5f, 13.0f, 14.5f, 14.0f, 13.0f, 11.5f, 9.5f, 7.5f, 5.5f, 3.5f, 2.0f, 1.0f, 0.5f, 0.0f };
MenuWindowBP D_80249DAC[3] = { MenuWindowBP filemenu_common_windowBPs[3] = {
{ {
.windowID = 0x2C, .windowID = WINDOW_ID_FILEMENU_MAIN,
.pos = { .pos = {
.x = 16, .x = 16,
.y = 24, .y = 24,
@ -70,65 +61,65 @@ MenuWindowBP D_80249DAC[3] = {
.fpDrawContents = NULL, .fpDrawContents = NULL,
.tab = NULL, .tab = NULL,
.parentID = -1, .parentID = -1,
.fpUpdate = { 1 }, .fpUpdate = { WINDOW_UPDATE_SHOW },
.extraFlags = 0x40, .extraFlags = WINDOW_FLAGS_40,
.style = { .customStyle = &D_8024BA60 }, .style = { .customStyle = &filemenu_windowStyles[0] },
}, },
{ {
.windowID = 0x18, .windowID = WINDOW_ID_FILEMENU_COPYARROW,
.pos = { .pos = {
.x = 0, .x = 0,
.y = 0, .y = 0,
}, },
.width = 0x120, .width = 288,
.height = 0xC0, .height = 192,
.priority = 0, .priority = 0,
.fpDrawContents = filemenu_draw_contents_copy_arrow, .fpDrawContents = filemenu_draw_contents_copy_arrow,
.tab = NULL, .tab = NULL,
.parentID = 0x2C, .parentID = WINDOW_ID_FILEMENU_MAIN,
.fpUpdate = { 1} , .fpUpdate = { WINDOW_UPDATE_SHOW } ,
.extraFlags = 0x00, .extraFlags = 0,
.style = { .customStyle = &D_8024BA98 }, .style = { .customStyle = &filemenu_windowStyles[1] },
}, },
{ {
.windowID = 0x17, .windowID = WINDOW_ID_FILEMENU_CURSOR,
.pos = { .pos = {
.x = 0, .x = 0,
.y = 0, .y = 0,
}, },
.width = 0x140, .width = 320,
.height = 0xF0, .height = 240,
.priority = 0, .priority = 0,
.fpDrawContents = filemenu_draw_cursor, .fpDrawContents = filemenu_draw_cursor,
.tab = NULL, .tab = NULL,
.parentID = -1, .parentID = -1,
.fpUpdate = { 1 }, .fpUpdate = { WINDOW_UPDATE_SHOW },
.extraFlags = 0x00, .extraFlags = 0,
.style = { .customStyle = &D_8024BA98 }, .style = { .customStyle = &filemenu_windowStyles[1] },
}, },
}; };
extern Gfx D_8024B600[]; extern Gfx filemenu_dl_copyarrow[];
extern Gfx D_8024B6F0[]; extern Gfx D_8024B6F0[];
extern Gfx D_8024B708[]; extern Gfx D_8024B708[];
BSS s32 filemenu_iterFileIdx; BSS s32 filemenu_iterFileIdx;
BSS s32 filemenu_pressedButtons; BSS s32 filemenu_pressedButtons;
BSS s32 filemenu_8024C088; BSS s32 filemenu_cursorHudElem;
BSS s32 filemenu_heldButtons; BSS s32 filemenu_heldButtons;
BSS s32 filemenu_8024C090; BSS s8 filemenu_filename_pos;
BSS s32 filemenu_loadedFileIdx; BSS s32 filemenu_loadedFileIdx;
BSS s8 filemenu_8024C098; BSS s8 filemenu_currentMenu;
BSS s32 filemenu_8024C09C; BSS s32 filemenu_8024C09C;
BSS s32 filemenu_cursorHudElemID[1]; BSS s32 filemenu_cursorHudElemID[1];
BSS s32 filemenu_8024C0A4[3]; BSS s32 filemenu_8024C0A4[3];
BSS s32 filemenu_hudElemIDs[20]; BSS s32 filemenu_hudElemIDs[20];
BSS s32 filemenu_8024C100[4]; BSS s32 filemenu_createfile_hudElems[4];
BSS u8 filemenu_8024C110[8]; BSS u8 filemenu_filename[8];
s32 func_80244BC4(void); s32 func_80244BC4(void);
void mainmenu_draw_rect(s32 ulx, s32 uly, s32 lrx, s32 lry, s32 tileDescriptor, s32 uls, s32 ult, s32 dsdx, s32 dtdy) { void filemenu_draw_rect(s32 ulx, s32 uly, s32 lrx, s32 lry, s32 tileDescriptor, s32 uls, s32 ult, s32 dsdx, s32 dtdy) {
if (ulx <= -2688 || uly <= -2688 || lrx <= 0 || lry <= 0) { if (ulx <= -2688 || uly <= -2688 || lrx <= 0 || lry <= 0) {
return; return;
} }
@ -153,71 +144,72 @@ void filemenu_set_cursor_alpha(s32 alpha) {
void filemenu_set_cursor_goal_pos(s32 windowID, s32 posX, s32 posY) { void filemenu_set_cursor_goal_pos(s32 windowID, s32 posX, s32 posY) {
Window* window = &gWindows[windowID]; Window* window = &gWindows[windowID];
if (D_80249BB0[0] if (D_80249BB0
|| get_game_mode() == GAME_MODE_END_FILE_SELECT || get_game_mode() == GAME_MODE_END_FILE_SELECT
|| get_game_mode() == GAME_MODE_END_LANGUAGE_SELECT) { || get_game_mode() == GAME_MODE_END_LANGUAGE_SELECT) {
if (D_80249BB0[0]) { if (D_80249BB0) {
s32 i; s32 i;
for (i = 0x2C; i < ARRAY_COUNT(gWindows); i++) { for (i = WINDOW_ID_FILEMENU_MAIN; i < ARRAY_COUNT(gWindows); i++) {
Window* window = &gWindows[i]; Window* window = &gWindows[i];
s8 parent = window->parent; s8 parent = window->parent;
if ((parent == -1 || parent == 0x2C) && (window->flags & 8)) { if ((parent == -1 || parent == WINDOW_ID_FILEMENU_MAIN) && (window->flags & WINDOW_FLAGS_INITIAL_ANIMATION)) {
break; break;
} }
} }
if (i >= ARRAY_COUNT(gWindows)) { if (i >= ARRAY_COUNT(gWindows)) {
D_80249BB0[0] = FALSE; D_80249BB0 = FALSE;
} }
} }
D_80249BA0 = posX; filemenu_cursor_targetX = posX;
D_80249B94 = posX; filemenu_cursor_posX = posX;
D_80249BA4 = posY; filemenu_cursor_targetY = posY;
D_80249B98 = posY; filemenu_cursor_posY = posY;
} else if (!(window->flags & 0x8) && (window->parent == -1 || !(gWindows[window->parent].flags & 8))) { } else if (!(window->flags & WINDOW_FLAGS_INITIAL_ANIMATION) &&
D_80249BA0 = posX; (window->parent == -1 || !(gWindows[window->parent].flags & WINDOW_FLAGS_INITIAL_ANIMATION))) {
D_80249BA4 = posY; filemenu_cursor_targetX = posX;
filemenu_cursor_targetY = posY;
} }
} }
void filemenu_update_cursor(void) { void filemenu_update_cursor(void) {
s32 targetPosX = D_80249BA0; s32 targetPosX = filemenu_cursor_targetX;
s32 targetPosY = D_80249BA4; s32 targetPosY = filemenu_cursor_targetY;
s32 xDelta; s32 xDelta;
s32 yDelta; s32 yDelta;
s32 i; s32 i;
xDelta = (targetPosX - D_80249B94) * 0.5; xDelta = (targetPosX - filemenu_cursor_posX) * 0.5;
yDelta = (targetPosY - D_80249B98) * 0.5; yDelta = (targetPosY - filemenu_cursor_posY) * 0.5;
if ((targetPosX != D_80249B94) || (targetPosY != D_80249B98)) { if ((targetPosX != filemenu_cursor_posX) || (targetPosY != filemenu_cursor_posY)) {
if ((xDelta == 0) && (yDelta == 0)) { if ((xDelta == 0) && (yDelta == 0)) {
D_80249B94 = targetPosX; filemenu_cursor_posX = targetPosX;
D_80249B98 = targetPosY; filemenu_cursor_posY = targetPosY;
} }
} }
D_80249B94 += xDelta; filemenu_cursor_posX += xDelta;
D_80249B98 += yDelta; filemenu_cursor_posY += yDelta;
if (filemenu_cursorGoalAlpha == 0) { if (filemenu_cursorGoalAlpha == 0) {
D_80249B9C -= 128; filemenu_cursor_alpha -= 128;
if (D_80249B9C < 0) { if (filemenu_cursor_alpha < 0) {
D_80249B9C = 0; filemenu_cursor_alpha = 0;
} }
} else { } else {
D_80249B9C += 32; filemenu_cursor_alpha += 32;
if (D_80249B9C > 255) { if (filemenu_cursor_alpha > 255) {
D_80249B9C = 255; filemenu_cursor_alpha = 255;
} }
} }
for (i = 0x2C; i < ARRAY_COUNT(gWindows); i++) { for (i = WINDOW_ID_FILEMENU_MAIN; i < ARRAY_COUNT(gWindows); i++) {
Window* window = &gWindows[i]; Window* window = &gWindows[i];
s8 parent = window->parent; s8 parent = window->parent;
if ((parent == -1 || parent == 0x2C) && (window->flags & 8)) { if ((parent == -1 || parent == WINDOW_ID_FILEMENU_MAIN) && (window->flags & WINDOW_FLAGS_INITIAL_ANIMATION)) {
break; break;
} }
} }
@ -233,8 +225,8 @@ void filemenu_update_cursor(void) {
if (D_80249BB8 != 0) { if (D_80249BB8 != 0) {
D_80249BB8--; D_80249BB8--;
if (D_80249BB8 == 0) { if (D_80249BB8 == 0) {
D_80249B94 = D_80249BA0; filemenu_cursor_posX = filemenu_cursor_targetX;
D_80249B98 = D_80249BA4; filemenu_cursor_posY = filemenu_cursor_targetY;
} }
} }
} }
@ -249,12 +241,12 @@ void filemenu_update_cursor(void) {
} }
void filemenu_update(void) { void filemenu_update(void) {
MenuPanel* menu = filemenu_menus[filemenu_8024C098]; MenuPanel* menu = filemenu_menus[filemenu_currentMenu];
MenuPanel** menuIt; MenuPanel** menuIt;
s32 i; s32 i;
for (i = 0x2C; i < ARRAY_COUNT(gWindows); i++) { for (i = WINDOW_ID_FILEMENU_MAIN; i < ARRAY_COUNT(gWindows); i++) {
if ((gWindows[i].parent == -1 || gWindows[i].parent == 0x2C) && if ((gWindows[i].parent == -1 || gWindows[i].parent == WINDOW_ID_FILEMENU_MAIN) &&
(gWindows[i].flags & WINDOW_FLAGS_INITIAL_ANIMATION)) (gWindows[i].flags & WINDOW_FLAGS_INITIAL_ANIMATION))
{ {
break; break;
@ -669,10 +661,7 @@ void filemenu_update_show_name_confirm(
) { ) {
Window* window = &gWindows[windowIdx]; Window* window = &gWindows[windowIdx];
s32 updateCounter = window->updateCounter; s32 updateCounter = window->updateCounter;
s32 temp_s1; u32 counter;
s32 temp_s2;
s32 temp_s3;
u32 temp_v1;
gDPPipeSync(gMasterGfxPos++); gDPPipeSync(gMasterGfxPos++);
gDPSetCycleType(gMasterGfxPos++, G_CYC_1CYCLE); gDPSetCycleType(gMasterGfxPos++, G_CYC_1CYCLE);
@ -681,21 +670,20 @@ void filemenu_update_show_name_confirm(
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, 140); gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, 140);
if (updateCounter < 10) { if (updateCounter < 10) {
temp_s2 = updateCounter * 48; s32 x = updateCounter * 16;
temp_s3 = updateCounter * 12; s32 y = updateCounter * 12;
mainmenu_draw_rect(0, 0, 1280, temp_s2, 0, 0, 0, 0, 0); filemenu_draw_rect(0, 0, SCREEN_WIDTH * 4, y * 4, 0, 0, 0, 0, 0);
temp_s1 = (SCREEN_HEIGHT - temp_s3) * 4; filemenu_draw_rect(0, (SCREEN_HEIGHT - y) * 4, SCREEN_WIDTH * 4, SCREEN_HEIGHT * 4, 0, 0, 0, 0, 0);
mainmenu_draw_rect(0, temp_s1, 1280, 960, 0, 0, 0, 0, 0); filemenu_draw_rect(0, y * 4, x * 4, (SCREEN_HEIGHT - y) * 4, 0, 0, 0, 0, 0);
mainmenu_draw_rect(0, temp_s2, updateCounter * 64, temp_s1, 0, 0, 0, 0, 0); filemenu_draw_rect((SCREEN_WIDTH - x) * 4, y * 4, SCREEN_WIDTH * 4, (SCREEN_HEIGHT - y) * 4, 0, 0, 0, 0, 0);
mainmenu_draw_rect((SCREEN_WIDTH - (updateCounter * 16)) * 4, temp_s2, 1280, temp_s1, 0, 0, 0, 0, 0);
} else { } else {
mainmenu_draw_rect(0, 0, 1280, 960, 0, 0, 0, 0, 0); filemenu_draw_rect(0, 0, SCREEN_WIDTH * 4, SCREEN_HEIGHT * 4, 0, 0, 0, 0, 0);
} }
temp_v1 = updateCounter - 10; counter = updateCounter - 10;
if (temp_v1 < 10) { if (counter < 10) {
window->flags &= ~WINDOW_FLAGS_HIDDEN; window->flags &= ~WINDOW_FLAGS_HIDDEN;
*posY -= D_80249D34[temp_v1]; *posY -= D_80249D34[counter];
} }
if (updateCounter >= 20) { if (updateCounter >= 20) {
window->flags &= ~WINDOW_FLAGS_INITIAL_ANIMATION; window->flags &= ~WINDOW_FLAGS_INITIAL_ANIMATION;
@ -719,8 +707,8 @@ void filemenu_update_hidden_name_confirm(
gDPSetCycleType(gMasterGfxPos++, G_CYC_1CYCLE); gDPSetCycleType(gMasterGfxPos++, G_CYC_1CYCLE);
gDPSetCombineMode(gMasterGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); gDPSetCombineMode(gMasterGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
gDPSetRenderMode(gMasterGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2); gDPSetRenderMode(gMasterGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, 140 - (updateCounter * 14)); gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, 140 - updateCounter * 14);
mainmenu_draw_rect(0, 0, 1280, 960, 0, 0, 0, 0, 0); filemenu_draw_rect(0, 0, 1280, 960, 0, 0, 0, 0, 0);
*posY -= D_80249D48[updateCounter]; *posY -= D_80249D48[updateCounter];
} else { } else {
window->flags &= ~WINDOW_FLAGS_INITIAL_ANIMATION; window->flags &= ~WINDOW_FLAGS_INITIAL_ANIMATION;
@ -732,13 +720,13 @@ void filemenu_draw_cursor(MenuPanel* menu, s32 baseX, s32 baseY, s32 width, s32
s32 temp_a1; s32 temp_a1;
filemenu_update_cursor(); filemenu_update_cursor();
temp_a1 = D_80249B9C; temp_a1 = filemenu_cursor_alpha;
if (temp_a1 > 0) { if (temp_a1 > 0) {
if (temp_a1 > 255) { if (temp_a1 > 255) {
temp_a1 = 255; temp_a1 = 255;
} }
hud_element_set_alpha(filemenu_cursorHudElemID[0], temp_a1); hud_element_set_alpha(filemenu_cursorHudElemID[0], temp_a1);
hud_element_set_render_pos(filemenu_cursorHudElemID[0], baseX + D_80249B94, baseY + D_80249B98); hud_element_set_render_pos(filemenu_cursorHudElemID[0], baseX + filemenu_cursor_posX, baseY + filemenu_cursor_posY);
hud_element_draw_without_clipping(filemenu_cursorHudElemID[0]); hud_element_draw_without_clipping(filemenu_cursorHudElemID[0]);
} }
} }
@ -754,7 +742,7 @@ void filemenu_draw_contents_copy_arrow(MenuPanel* menu, s32 baseX, s32 baseY, s3
f32 temp_f28; f32 temp_f28;
if (menu0->page == 4 && menu0->selected < 4) { if (menu0->page == 4 && menu0->selected < 4) {
if (menu0->selected != filemenu_loadedFileIdx && filemenu_8024C098 != 2) { if (menu0->selected != filemenu_loadedFileIdx && filemenu_currentMenu != 2) {
switch (filemenu_loadedFileIdx) { switch (filemenu_loadedFileIdx) {
case 0: case 0:
startX = 130.0f; startX = 130.0f;
@ -802,7 +790,7 @@ void filemenu_draw_contents_copy_arrow(MenuPanel* menu, s32 baseX, s32 baseY, s3
gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++], gSPMatrix(gMasterGfxPos++, &gDisplayContext->matrixStack[gMatrixListPos++],
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
gSPDisplayList(gMasterGfxPos++, D_8024B600); gSPDisplayList(gMasterGfxPos++, filemenu_dl_copyarrow);
gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, 128); gDPSetPrimColor(gMasterGfxPos++, 0, 0, 0, 0, 0, 128);
gDPSetEnvColor(gMasterGfxPos++, 0, 0, 0, 0); gDPSetEnvColor(gMasterGfxPos++, 0, 0, 0, 0);
@ -865,17 +853,17 @@ void filemenu_init(s32 arg0) {
dma_copy(ui_images_ROM_START, ui_images_ROM_END, ui_images_VRAM); dma_copy(ui_images_ROM_START, ui_images_ROM_END, ui_images_VRAM);
for (i = 0; i < ARRAY_COUNT(filemenu_cursorHudElemID); i++) { for (i = 0; i < ARRAY_COUNT(filemenu_cursorHudElemID); i++) {
filemenu_cursorHudElemID[i] = hud_element_create(D_80249B80[i]); filemenu_cursorHudElemID[i] = hud_element_create(filemenu_cursor_hudElemScripts[i]);
hud_element_set_flags(filemenu_cursorHudElemID[i], HUD_ELEMENT_FLAGS_DROP_SHADOW | HUD_ELEMENT_FLAGS_80); hud_element_set_flags(filemenu_cursorHudElemID[i], HUD_ELEMENT_FLAGS_DROP_SHADOW | HUD_ELEMENT_FLAGS_80);
} }
D_8024C088 = filemenu_cursorHudElemID[0]; filemenu_cursorHudElem = filemenu_cursorHudElemID[0];
if (!arg0) { if (!arg0) {
D_80249DAC[0].style.customStyle->background.imgData = NULL; // ??? filemenu_common_windowBPs[0].style.customStyle->background.imgData = NULL; // ???
} }
setup_pause_menu_tab(D_80249DAC, ARRAY_COUNT(D_80249DAC)); setup_pause_menu_tab(filemenu_common_windowBPs, ARRAY_COUNT(filemenu_common_windowBPs));
menu = filemenu_menus[0]; menu = filemenu_menus[0];
filemenu_8024C098 = 0; filemenu_currentMenu = 0;
if (!arg0) { if (!arg0) {
menu->page = 0; menu->page = 0;
@ -910,7 +898,7 @@ void filemenu_init(s32 arg0) {
(*panelIt)->fpInit((*panelIt)); (*panelIt)->fpInit((*panelIt));
} }
} }
update_window_hierarchy(0x17, 0x40); update_window_hierarchy(23, 64);
} }
// TODO bad match, look into // TODO bad match, look into
@ -931,7 +919,7 @@ void filemenu_cleanup(void) {
} }
} }
for (i = 0x2C; i < ARRAY_COUNT(gWindows); i++) { for (i = WINDOW_ID_FILEMENU_MAIN; i < ARRAY_COUNT(gWindows); i++) {
set_window_update(i, WINDOW_UPDATE_HIDE); set_window_update(i, WINDOW_UPDATE_HIDE);
} }
@ -941,7 +929,7 @@ void filemenu_cleanup(void) {
} }
s32 func_80244BC4() { s32 func_80244BC4() {
if (filemenu_menus[0]->page == 0 && filemenu_8024C098 == 1 && filemenu_menus[1]->selected == 0) { if (filemenu_menus[0]->page == 0 && filemenu_currentMenu == 1 && filemenu_menus[1]->selected == 0) {
return 2; return 2;
} else if (filemenu_menus[0]->page == 0 && filemenu_menus[0]->selected < 4) { } else if (filemenu_menus[0]->page == 0 && filemenu_menus[0]->selected < 4) {
return 1; return 1;

View File

@ -0,0 +1,485 @@
#include "common.h"
#include "filemenu.h"
#include "hud_element.h"
extern HudScript HES_FilenameCaret;
extern HudScript HES_FilenameSpace;
extern HudScript HES_134F60_135120;
HudScript* filemenu_createfile_hudElemScripts[] = {
&HES_FilenameCaret, &HES_FilenameSpace, &HES_134F60_135120
};
s32 D_8024A18C = -4;
MenuWindowBP filemenu_createfile_windowBPs[] = {
{
.windowID = WINDOW_ID_FILEMENU_CREATEFILE_HEADER,
.unk_01 = 0,
.pos = { .x = 68, .y = 10 },
.width = 164,
.height = 46,
.priority = 64,
.fpDrawContents = &filemenu_draw_contents_file_create_header,
.tab = NULL,
.parentID = WINDOW_ID_FILEMENU_MAIN,
.fpUpdate = { WINDOW_UPDATE_HIDE },
.extraFlags = 0,
.style = { .customStyle = &filemenu_windowStyles[21] }
},
{
.windowID = WINDOW_ID_FILEMENU_KEYBOARD,
.unk_01 = 0,
.pos = { .x = 12, .y = 67 },
.width = 262,
.height = 113,
.priority = 64,
.fpDrawContents = &filemenu_draw_contents_choose_name,
.tab = NULL,
.parentID = WINDOW_ID_FILEMENU_MAIN,
.fpUpdate = { WINDOW_UPDATE_HIDE },
.extraFlags = 0,
.style = { .customStyle = &filemenu_windowStyles[22] }
},
};
MenuPanel filemenu_createfile_menuBP = {
.initialized = FALSE,
.col = 0,
.row = 0,
.selected = 0,
.page = 0,
.numCols = 13,
.numRows = 6,
.numPages = 0,
.gridData = filemenu_createfile_gridData,
.fpInit = &filemenu_choose_name_init,
.fpHandleInput = &filemenu_choose_name_handle_input,
.fpUpdate = &filemenu_choose_name_update,
.fpCleanup = &filemenu_choose_name_cleanup
};
void filemenu_update_change_layout(
s32 windowIdx,
s32* flags,
s32* posX, s32* posY, s32* posZ,
f32* scaleX, f32* scaleY,
f32* rotX, f32* rotY, f32* rotZ,
s32* darkening,
s32* opacity
) {
Window* window = &gWindows[windowIdx];
if (window->updateCounter == 8) {
window->flags &= ~WINDOW_FLAGS_INITIAL_ANIMATION;
set_window_update(windowIdx, WINDOW_UPDATE_SHOW);
}
}
void filemenu_draw_contents_file_create_header(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
s32 xOffset;
s32 yOffset;
s32 i;
s32 tempAmt;
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_ENTER_A_FILE_NAME), baseX + 10, baseY + 6, 255, 0, 0);
filemenu_draw_file_name(filemenu_filename, 8, baseX + 36, baseY + 22, 255, 0, 0, 11);
xOffset = 41;
for (i = 0; i < ARRAY_COUNT(filemenu_filename); i++) {
hud_element_set_render_pos(filemenu_createfile_hudElems[1], baseX + 42 + (i * 11), baseY + xOffset);
if (i == 0) {
hud_element_draw_without_clipping(filemenu_createfile_hudElems[1]);
} else {
hud_element_draw_next(filemenu_createfile_hudElems[1]);
}
}
tempAmt = 8;
if (filemenu_currentMenu == 3) {
s32 phi_v0 = 122;
if (filemenu_filename_pos != tempAmt) {
phi_v0 = (filemenu_filename_pos * 11) + 45;
}
hud_element_set_render_pos(filemenu_createfile_hudElems[0], baseX + phi_v0, baseY + 45);
hud_element_draw_next(filemenu_createfile_hudElems[0]);
}
}
void filemenu_draw_contents_choose_name(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
s32 changeLayoutOffset;
s32 currentPage;
s32 previousPage;
s32 page;
s32 row, col;
s32 xOffset, yOffset;
s32 c, specialChar;
s32 layer;
s32 flags;
s32 color;
Window* window = &gWindows[WINDOW_ID_FILEMENU_KEYBOARD];
if ((window->flags & WINDOW_FLAGS_INITIAL_ANIMATION) && window->fpUpdate.func == filemenu_update_change_layout) {
changeLayoutOffset = window->updateCounter * 2;
currentPage = menu->page;
previousPage = menu->page != 1;
if (changeLayoutOffset > 0x10) {
changeLayoutOffset = 0x10;
}
for (row = 0; row < menu->numRows; row++) {
for (layer = 0; layer < 2; layer++) {
yOffset = 15 * row + 4;
if (layer == 0) {
page = currentPage;
gDPSetScissor(gMasterGfxPos++, G_SC_NON_INTERLACE,
baseX,
baseY + yOffset,
baseX + width,
baseY + yOffset + changeLayoutOffset);
} else {
page = previousPage;
gDPSetScissor(gMasterGfxPos++, G_SC_NON_INTERLACE,
baseX,
baseY + yOffset + changeLayoutOffset,
baseX + width,
baseY + yOffset + 0x10);
}
for (col = 0; col < menu->numCols; col++) {
c = menu->gridData[page * menu->numCols * menu->numRows + menu->numCols * row + col];
if (c != 0xF7) {
if (col == menu->col && row == menu->row) {
flags = 8;
color = 0;
} else {
flags = 0;
color = 10;
}
xOffset = 19 * col + 12;
yOffset = 17 * row + 5;
specialChar = c;
if (c >= 0xA2 && c < 0xF0) {
if (c >= 0xC6) {
hud_element_set_render_pos(filemenu_createfile_hudElems[2], baseX + xOffset + 22, baseY + yOffset + 8);
hud_element_draw_without_clipping(filemenu_createfile_hudElems[2]);
flags = 0;
}
}
if (specialChar == 0xC6) {
xOffset -= 1;
}
if (specialChar == 0xC9) {
xOffset += 5;
}
if (specialChar == 0xCA) {
xOffset += 8;
}
if (specialChar == 0xC6 || specialChar == 0xCA || specialChar == 0xC9) {
yOffset -= 1;
}
filemenu_draw_message((u8*)c, baseX + xOffset, baseY + yOffset, 255, color, flags);
}
}
}
}
gDPSetScissor(gMasterGfxPos++, G_SC_NON_INTERLACE, baseX, baseY, baseX + width, baseY + height);
} else {
for (col = 0; col < menu->numCols; col++) {
for (row = 0; row < menu->numRows; row++) {
c = menu->gridData[menu->page * menu->numCols * menu->numRows + menu->numCols * row + col];
if (c != 0xF7) {
if (col == menu->col && row == menu->row) {
flags = 8;
color = 0;
} else {
flags = 0;
color = 10;
}
xOffset = col * 19 + 12;
yOffset = row * 17 + 5;
specialChar = c;
if (c >= 0xA2 && c < 0xF0) {
if (c >= 0xC6) {
hud_element_set_render_pos(filemenu_createfile_hudElems[2], baseX + xOffset + 22, baseY + yOffset + 8);
hud_element_draw_without_clipping(filemenu_createfile_hudElems[2]);
flags = 0;
}
}
if (specialChar == 0xC6) {
xOffset -= 1;
}
if (specialChar == 0xC9) {
xOffset += 5;
}
if (specialChar == 0xCA) {
xOffset += 8;
}
if (specialChar == 0xC6 || specialChar == 0xCA || specialChar == 0xC9) {
yOffset -= 1;
}
filemenu_draw_message((u8*)c, baseX + xOffset, baseY + yOffset, 255, color, flags);
}
}
}
}
if (filemenu_currentMenu == 3) {
if (filemenu_heldButtons & (BUTTON_STICK_RIGHT | BUTTON_STICK_LEFT | BUTTON_STICK_DOWN | BUTTON_STICK_UP)) {
D_8024A18C = -4;
}
D_8024A18C += 1;
filemenu_set_cursor_goal_pos(WINDOW_ID_FILEMENU_KEYBOARD, baseX + 2 + menu->col * 19, baseY + 13 + menu->row * 17);
}
}
void filemenu_choose_name_init(MenuPanel* menu) {
s32 i;
for (i = 0; i < ARRAY_COUNT(filemenu_createfile_hudElemScripts); i++) {
filemenu_createfile_hudElems[i] = hud_element_create(filemenu_createfile_hudElemScripts[i]);
hud_element_set_flags(filemenu_createfile_hudElems[i], HUD_ELEMENT_FLAGS_80);
}
for (i = 0; i < ARRAY_COUNT(filemenu_createfile_windowBPs); i++) {
filemenu_createfile_windowBPs[i].tab = menu;
}
setup_pause_menu_tab(filemenu_createfile_windowBPs, ARRAY_COUNT(filemenu_createfile_windowBPs));
gWindows[WINDOW_ID_FILEMENU_CREATEFILE_HEADER].pos.x = ((gWindows[WINDOW_ID_FILEMENU_CREATEFILE_HEADER].parent != -1)
? (gWindows[gWindows[WINDOW_ID_FILEMENU_CREATEFILE_HEADER].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_CREATEFILE_HEADER].width / 2;
gWindows[WINDOW_ID_FILEMENU_KEYBOARD].pos.x = ((gWindows[WINDOW_ID_FILEMENU_KEYBOARD].parent != -1)
? (gWindows[gWindows[WINDOW_ID_FILEMENU_KEYBOARD].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_KEYBOARD].width / 2;
menu->initialized = TRUE;
}
void filemenu_choose_name_handle_input(MenuPanel* menu) {
s32 oldSelected = menu->selected;
MenuPanel* newMenu;
MenuPanel* newMenu2;
s32 temp;
s32 i;
if (filemenu_heldButtons & BUTTON_STICK_LEFT) {
menu->col--;
if (menu->col < 0) {
menu->col = menu->numCols - 1;
}
} else if (filemenu_heldButtons & BUTTON_STICK_RIGHT) {
menu->col++;
if (menu->col >= menu->numCols) {
menu->col = 0;
}
if (menu->row == menu->numRows - 1) {
if (menu->col > 10) {
menu->col = 0;
} else if (menu->col == 8 || menu->col == 9) {
menu->col = 10;
} else if (menu->col == 5 || menu->col == 6) {
menu->col = 7;
}
}
}
if (filemenu_heldButtons & BUTTON_STICK_UP) {
menu->row--;
if (menu->row < 0) {
menu->row = menu->numRows - 1;
}
} else if (filemenu_heldButtons & BUTTON_STICK_DOWN) {
menu->row++;
if (menu->row >= menu->numRows) {
menu->row = 0;
}
}
if (menu->row == menu->numRows - 1) {
if (menu->col > 10) {
menu->col = 10;
} else if (menu->col == 8 || menu->col == 9) {
menu->col = 7;
} else if (menu->col == 5 || menu->col == 6) {
menu->col = 4;
}
}
menu->selected = MENU_PANEL_SELECTED_GRID_DATA(menu);
if (oldSelected != menu->selected) {
sfx_play_sound(SOUND_2102);
}
if (filemenu_pressedButtons & BUTTON_A) {
switch (menu->selected) {
case 0xC6:
sfx_play_sound(SOUND_2103);
if (filemenu_filename_pos == ARRAY_COUNT(filemenu_filename)) {
filemenu_filename_pos = ARRAY_COUNT(filemenu_filename) - 1;
}
filemenu_filename[filemenu_filename_pos] = 0xF7;
filemenu_filename_pos++;
if (filemenu_filename_pos > ARRAY_COUNT(filemenu_filename)) {
filemenu_filename_pos = ARRAY_COUNT(filemenu_filename);
}
break;
case 0xC9:
break;
case 0xC7:
if (menu->page != 1) {
sfx_play_sound(SOUND_2105);
menu->page = 1;
filemenu_set_selected(menu, menu->col, menu->row);
set_window_update(WINDOW_ID_FILEMENU_KEYBOARD, (s32)filemenu_update_change_layout);
}
break;
case 0xC8:
if (menu->page != 0) {
sfx_play_sound(SOUND_2105);
menu->page = 0;
filemenu_set_selected(menu, menu->col, menu->row);
set_window_update(WINDOW_ID_FILEMENU_KEYBOARD, (s32)filemenu_update_change_layout);
}
break;
case 0xCA:
for (i = 0; i < ARRAY_COUNT(filemenu_filename); i++) {
if (filemenu_filename[i] != 0xF7) {
break;
}
}
if (i == ARRAY_COUNT(filemenu_filename)) {
sfx_play_sound(SOUND_MENU_ERROR);
break;
}
sfx_play_sound(SOUND_MENU_NEXT);
set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, (s32) filemenu_update_show_name_confirm);
gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].pos.y = 121;
gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].width = 69;
gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].height = 44;
gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].pos.x = ((gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].parent != -1)
? (gWindows[gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].width / 2;
gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].pos.y = -70;
gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].width = 164;
gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].height = 62;
gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].pos.x = ((gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].parent != -1)
? (gWindows[gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].width / 2;
filemenu_currentMenu = 1;
newMenu = filemenu_menus[filemenu_currentMenu];
newMenu->page = 2;
filemenu_set_selected(newMenu, 0, 0);
return;
default:
sfx_play_sound(SOUND_2103);
if (filemenu_filename_pos == ARRAY_COUNT(filemenu_filename)) {
filemenu_filename[7] = menu->selected;
} else {
filemenu_filename[filemenu_filename_pos] = menu->selected;
filemenu_filename_pos++;
if (filemenu_filename_pos > ARRAY_COUNT(filemenu_filename)) {
filemenu_filename_pos = ARRAY_COUNT(filemenu_filename);
}
}
break;
}
if (menu->selected != 0xC7 && menu->selected != 0xC8 && menu->selected != 0xC9 &&
filemenu_filename_pos == ARRAY_COUNT(filemenu_filename)) {
filemenu_set_selected(menu, menu->numCols - 3, menu->numRows - 1);
}
}
if ((filemenu_pressedButtons & BUTTON_B) || ((filemenu_pressedButtons & BUTTON_A) && menu->selected == 0xC9)) {
sfx_play_sound(SOUND_2104);
filemenu_filename_pos--;
if (filemenu_filename_pos < 0) {
filemenu_filename_pos = 0;
set_window_update(WINDOW_ID_FILEMENU_CREATEFILE_HEADER, (s32) &filemenu_update_hidden_name_input);
set_window_update(WINDOW_ID_FILEMENU_KEYBOARD, (s32) &filemenu_update_hidden_name_input);
set_window_update(WINDOW_ID_FILEMENU_TITLE, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_MONO, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_CENTER, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE0_INFO, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE1_INFO, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE2_INFO, (s32) &filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE3_INFO, (s32) &filemenu_update_show_with_rotation);
filemenu_currentMenu = 0;
return;
}
for (i = filemenu_filename_pos; i < ARRAY_COUNT(filemenu_filename); i++) {
filemenu_filename[i] = 0xF7;
}
}
if (filemenu_pressedButtons & BUTTON_START) {
for (i = 0; i < ARRAY_COUNT(filemenu_filename); i++) {
if (filemenu_filename[i] != 0xF7) {
break;
}
}
if (i == ARRAY_COUNT(filemenu_filename)) {
sfx_play_sound(SOUND_MENU_ERROR);
return;
}
sfx_play_sound(SOUND_MENU_NEXT);
set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, (s32) filemenu_update_show_name_confirm);
gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].pos.y = 121;
gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].width = 69;
gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].height = 44;
gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].pos.x = ((gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].parent != -1)
? (gWindows[gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_YESNO_OPTIONS].width / 2;
gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].pos.y = -70;
gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].width = 164;
gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].height = 62;
gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].pos.x = ((gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].parent != -1)
? (gWindows[gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_YESNO_PROMPT].width / 2;
newMenu2 = filemenu_menus[1];
filemenu_currentMenu = 1;
newMenu2->page = 2;
filemenu_set_selected(newMenu2, 0, 0);
}
}
static const f32 padding[2] = { 0.0f, 0.0f }; // not sure why this is needed
void filemenu_choose_name_update(MenuPanel* menu) {
}
void filemenu_choose_name_cleanup(MenuPanel* menu) {
s32 i;
for (i = 0; i < 3; i++) {
hud_element_free(filemenu_createfile_hudElems[i]);
}
}

View File

@ -0,0 +1,47 @@
#include "common.h"
#include "filemenu/copyarrow.png.inc.c"
#include "filemenu/corners_yellow.png.inc.c"
#include "filemenu/corners_gray.png.inc.c"
Gfx filemenu_dl_copyarrow[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCycleType(G_CYC_2CYCLE),
gsDPSetTexturePersp(G_TP_NONE),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureLUT(G_TT_NONE),
gsDPSetTextureFilter(G_TF_BILERP),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetRenderMode(G_RM_PASS, G_RM_CLD_SURF2),
gsDPSetCombineLERP(0, 0, 0, TEXEL0, 0, 0, 0, TEXEL0, ENVIRONMENT, PRIMITIVE, COMBINED, PRIMITIVE, COMBINED, 0, PRIMITIVE, 0),
gsDPSetTextureLUT(G_TT_NONE),
gsDPLoadTextureTile_4b(D_8024A200, G_IM_FMT_IA, 64, 16, 0, 0, 63, 15, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_MIRROR | G_TX_WRAP, 6, 4, G_TX_NOLOD, G_TX_NOLOD),
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH | G_CLIPPING | 0x0040F9FA),
gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH),
gsSPEndDisplayList(),
};
Vtx D_8024B6B0[] = {
{{{ -8, -16, 0 }, 0, { 0, 0 }, { 0, 0, 0, 0 }}},
{{{ -8, 16, 0 }, 0, { 0, 2048 }, { 0, 0, 0, 0 }}},
};
Vtx D_8024B6D0[] = {
{{{ 56, 16, 0 }, 0, { 4096, 2048 }, { 0, 0, 0, 255 }}},
{{{ 56, -16, 0 }, 0, { 4096, 0 }, { 0, 0, 0, 255 }}},
};
Gfx D_8024B6F0[] = {
gsSPVertex(D_8024B6B0, 2, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};
Gfx D_8024B708[] = {
gsSPVertex(D_8024B6D0, 2, 2),
gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
gsDPPipeSync(),
gsSPEndDisplayList(),
};

View File

@ -0,0 +1,123 @@
#include "common.h"
#include "filemenu.h"
#include "hud_element.h"
u8 filemenu_info_gridData[] = {
0, 0, 0, 0
};
MenuWindowBP filemenu_info_windowBPs[] = {
{
.windowID = WINDOW_ID_FILEMENU_INFO,
.unk_01 = 0,
.pos = { .x = 0, .y = 0 },
.width = 0,
.height = 0,
.priority = 64,
.fpDrawContents = &filemenu_info_draw_message_contents,
.tab = NULL,
.parentID = -1,
.fpUpdate = { WINDOW_UPDATE_HIDE },
.extraFlags = 0,
.style = { .customStyle = &filemenu_windowStyles[20] }
},
};
MenuPanel filemenu_info_menuBP = {
.initialized = FALSE,
.col = 0,
.row = 0,
.selected = 0,
.page = 0,
.numCols = 1,
.numRows = 1,
.numPages = 0,
.gridData = filemenu_info_gridData,
.fpInit = &filemenu_info_init,
.fpHandleInput = &filemenu_info_handle_input,
.fpUpdate = &filemenu_info_update,
.fpCleanup = &filemenu_info_cleanup
};
void filemenu_info_draw_message_contents(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
switch (menu->page) {
case 0:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 10, baseY + 4, 255, 0, 0);
draw_number(filemenu_menus[0]->selected + 1, baseX + 48, baseY + 6, 0, 0, 255, 3);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_HAS_BEEN_DELETED), baseX + 49, baseY + 4, 255, 0, 0);
break;
case 2:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_COPY_FROM), baseX + 10, baseY + 4, 255, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 84, baseY + 4, 255, 0, 0);
draw_number(filemenu_loadedFileIdx + 1, baseX + 122, baseY + 6, 0, 0, 255, 3);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_TO), baseX + 10, baseY + 18, 255, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 30, baseY + 18, 255, 0, 0);
draw_number(filemenu_iterFileIdx + 1, baseX + 68, baseY + 20, 0, 0, 255, 3);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_PERIOD_34), baseX + 65, baseY + 18, 255, 0, 0);
break;
case 1:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_28), baseX + 10, baseY + 4, 255, 0, 0);
break;
case 3:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 10, baseY + 4, 255, 0, 0);
draw_number(filemenu_menus[0]->selected + 1, baseX + 48, baseY + 6, 0, 0, 255, 3);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_HAS_BEEN_CREATED), baseX + 49, baseY + 4, 255, 0, 0);
break;
}
filemenu_set_cursor_alpha(0);
}
void filemenu_info_init(MenuPanel* tab) {
s32 i;
for (i = 0; i < ARRAY_COUNT(filemenu_info_windowBPs); i++) {
filemenu_info_windowBPs[i].tab = tab;
}
setup_pause_menu_tab(filemenu_info_windowBPs, ARRAY_COUNT(filemenu_info_windowBPs));
tab->initialized = TRUE;
}
void filemenu_info_handle_input(MenuPanel* menu) {
if (filemenu_pressedButtons & (BUTTON_A | BUTTON_B)) {
MenuPanel* menu = filemenu_menus[0];
filemenu_currentMenu = 0;
switch (menu->page) {
case 1:
menu->page = 0;
set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_show_options_left);
set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_show_options_right);
set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_show_options_bottom);
set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_show_options_bottom);
filemenu_set_selected(menu, 0, 2);
break;
case 4:
menu->page = 0;
set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_show_options_left);
set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_show_options_right);
set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_show_options_bottom);
set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_show_options_bottom);
filemenu_set_selected(menu, 1, 2);
break;
case 2:
menu->page = 2;
filemenu_set_selected(menu, 1, 2);
break;
}
set_window_update(WINDOW_ID_FILEMENU_INFO, WINDOW_UPDATE_HIDE);
}
}
void filemenu_info_update(MenuPanel* menu) {
}
void filemenu_info_cleanup(MenuPanel* menu) {
}

1104
src/filemenu/filemenu_main.c Normal file

File diff suppressed because it is too large Load Diff

222
src/filemenu/filemenu_msg.c Normal file
View File

@ -0,0 +1,222 @@
#include "common.h"
#include "filemenu.h"
extern MessageCharset* gMsgCharsets[5];
extern UnkMsgStruct8 D_802F4560[];
u8 filemenu_msg_C6[] = { 0x33, 0x30, 0x21, 0x23, 0x25, 0xFD }; // SPACE[End]
u8 filemenu_msg_C7[] = { 0xFD }; // [End]
u8 filemenu_msg_C8[] = { 0xFD }; // [End]
u8 filemenu_msg_C9[] = { 0x22, 0x21, 0x23, 0x2B, 0xFD }; // BACK[End]
u8 filemenu_msg_CA[] = { 0x25, 0x2E, 0x24, 0xFD }; // END[End]
s32 filemenu_specialSymbols[] = { (s32)filemenu_msg_C6, (s32)filemenu_msg_C7, (s32)filemenu_msg_C8, (s32)filemenu_msg_C9, (s32)filemenu_msg_CA };
Gfx filemenu_dl_draw_char_init[] = {
gsDPPipeSync(),
gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
gsDPSetCycleType(G_CYC_1CYCLE),
gsDPSetTexturePersp(G_TP_NONE),
gsDPSetTextureDetail(G_TD_CLAMP),
gsDPSetTextureLOD(G_TL_TILE),
gsDPSetTextureFilter(G_TF_POINT),
gsDPSetTextureLUT(G_TT_RGBA16),
gsDPSetTextureConvert(G_TC_FILT),
gsDPSetRenderMode(G_RM_TEX_EDGE, G_RM_TEX_EDGE2),
gsDPSetCombineMode(G_CC_DECALRGBA, G_CC_DECALRGBA),
gsDPSetPrimColor(0, 0, 40, 40, 40, 72),
gsSPEndDisplayList(),
};
Gfx* filemenu_savedGfxPos = NULL;
s32 filemenu_charset = 0;
s32 filemenu_charset_raster_id = 0;
s32 filemenu_char_color = -1;
u8 filemenu_msg_01[] = { 0x33, 0x45, 0x4C, 0x45, 0x43, 0x54, 0xF7, 0x46, 0x49, 0x4C, 0x45, 0xF7, 0x54, 0x4F, 0xF7, 0x53,
0x54, 0x41, 0x52, 0x54, 0x1A, 0xFD };
u8 filemenu_msg_02[] = { 0x33, 0x45, 0x4C, 0x45, 0x43, 0x54, 0xF7, 0x46, 0x49, 0x4C, 0x45, 0xF7, 0x54, 0x4F, 0xF7, 0x44,
0x45, 0x4C, 0x45, 0x54, 0x45, 0x1A, 0xFD };
u8 filemenu_msg_03[] = { 0x33, 0x45, 0x4C, 0x45, 0x43, 0x54, 0xF7, 0x46, 0x49, 0x4C, 0x45, 0xF7, 0x54, 0x4F, 0xF7, 0x53,
0x41, 0x56, 0x45, 0xFD };
u8 filemenu_msg_04[] = { 0x23, 0x4F, 0x50, 0x59, 0xF7, 0x57, 0x48, 0x49, 0x43, 0x48, 0xF7, 0x46, 0x49, 0x4C, 0x45, 0x1F,
0xFD };
u8 filemenu_msg_05[] = { 0x23, 0x4F, 0x50, 0x59, 0xF7, 0x54, 0x4F, 0xF7, 0x57, 0x48, 0x49, 0x43, 0x48, 0xF7, 0x46, 0x49,
0x4C, 0x45, 0x1F, 0xFD };
u8 filemenu_msg_06[] = { 0x2E, 0x25, 0x37, 0xFD };
u8 filemenu_msg_07[] = { 0x2C, 0x45, 0x56, 0x45, 0x4C, 0xFD };
u8 filemenu_msg_08[] = { 0x30, 0x4C, 0x41, 0x59, 0xF7, 0x34, 0x49, 0x4D, 0x45, 0xFD };
u8 filemenu_msg_09[] = { 0x24, 0x45, 0x4C, 0x45, 0x54, 0x45, 0xF7, 0x26, 0x49, 0x4C, 0x45, 0xFD };
u8 filemenu_msg_10[] = { 0x23, 0x41, 0x4E, 0x43, 0x45, 0x4C, 0xFD };
u8 filemenu_msg_11[] = { 0x23, 0x4F, 0x50, 0x59, 0xF7, 0x26, 0x49, 0x4C, 0x45, 0xFD };
u8 filemenu_msg_12[] = { 0x26, 0x49, 0x52, 0x53, 0x54, 0xF7, 0x30, 0x4C, 0x41, 0x59, 0xFD };
u8 filemenu_msg_13[] = { 0x0E, 0xFD };
u8 filemenu_msg_14[] = { 0x39, 0x45, 0x53, 0xFD };
u8 filemenu_msg_15[] = { 0x2E, 0x4F, 0xFD };
u8 filemenu_msg_16[] = { 0x24, 0x45, 0x4C, 0x45, 0x54, 0x45, 0xFD };
u8 filemenu_msg_17[] = { 0x2F, 0x56, 0x45, 0x52, 0x52, 0x49, 0x44, 0x45, 0xF7, 0x54, 0x4F, 0xF7, 0x2E, 0x45, 0x57, 0xF7,
0x24, 0x41, 0x54, 0x41, 0xFD };
u8 filemenu_msg_18[] = { 0x33, 0x41, 0x56, 0x45, 0xF7, 0x2F, 0x2B, 0x1F, 0xFD };
u8 filemenu_msg_19[] = { 0x26, 0x49, 0x4C, 0x45, 0xF7, 0x4E, 0x41, 0x4D, 0x45, 0xF7, 0x49, 0x53, 0xF7, 0x1A, 0xFD };
u8 filemenu_msg_20[] = { 0x0E, 0xFD };
u8 filemenu_msg_21[] = { 0x2F, 0x2B, 0x1F, 0xFD };
u8 filemenu_msg_22[] = { 0x26, 0x49, 0x4C, 0x45, 0xFD };
u8 filemenu_msg_23[] = { 0x57, 0x49, 0x4C, 0x4C, 0xF7, 0x42, 0x45, 0xF7, 0x44, 0x45, 0x4C, 0x45, 0x54, 0x45, 0x44, 0x0E,
0xFD };
u8 filemenu_msg_24[] = { 0x2F, 0x2B, 0xF7, 0x54, 0x4F, 0xF7, 0x43, 0x4F, 0x50, 0x59, 0xF7, 0x54, 0x4F, 0xF7, 0x54, 0x48,
0x49, 0x53, 0xF7, 0x46, 0x49, 0x4C, 0x45, 0x1F, 0xFD };
u8 filemenu_msg_25[] = { 0x33, 0x54, 0x41, 0x52, 0x54, 0xF7, 0x47, 0x41, 0x4D, 0x45, 0xF7, 0x57, 0x49, 0x54, 0x48, 0xFD };
u8 filemenu_msg_26[] = { 0x26, 0x49, 0x4C, 0x45, 0xFD };
u8 filemenu_msg_27[] = { 0x48, 0x41, 0x53, 0xF7, 0x42, 0x45, 0x45, 0x4E, 0xF7, 0x44, 0x45, 0x4C, 0x45, 0x54, 0x45, 0x44,
0x0E, 0xFD };
u8 filemenu_msg_28[] = { 0xFD };
u8 filemenu_msg_29[] = { 0x23, 0x4F, 0x50, 0x59, 0xF7, 0x46, 0x52, 0x4F, 0x4D, 0xFD };
u8 filemenu_msg_30[] = { 0x54, 0x4F, 0xFD };
u8 filemenu_msg_31[] = { 0x48, 0x41, 0x53, 0xF7, 0x42, 0x45, 0x45, 0x4E, 0xF7, 0x43, 0x52, 0x45, 0x41, 0x54, 0x45, 0x44,
0x0E, 0xFD };
u8 filemenu_msg_32[] = { 0x25, 0x4E, 0x54, 0x45, 0x52, 0xF7, 0x41, 0xF7, 0x46, 0x49, 0x4C, 0x45, 0xF7, 0x4E, 0x41, 0x4D,
0x45, 0x01, 0xFD };
u8 filemenu_createfile_gridData[] = { 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D,
0x2E, 0x2F, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3A,
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D,
0x4E, 0x4F, 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5A,
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x10, 0x0E, 0x0D, 0xF7,
0x00, 0x90, 0x91, 0x20, 0xC6, 0xF7, 0xF7, 0xC9, 0xF7, 0xF7, 0xCA, 0xF7, 0xF7
};
u8 filemenu_msg_33[] = { 0x1F, 0xFD };
u8 filemenu_msg_34[] = { 0x0E, 0xFD };
s32 gFileMenuMessages[] = {
0x00000000, (s32)filemenu_msg_01, (s32)filemenu_msg_02, (s32)filemenu_msg_03, (s32)filemenu_msg_04,
(s32)filemenu_msg_05, (s32)filemenu_msg_06, (s32)filemenu_msg_07, (s32)filemenu_msg_08, (s32)filemenu_msg_09,
(s32)filemenu_msg_10, (s32)filemenu_msg_11, (s32)filemenu_msg_12, (s32)filemenu_msg_13, (s32)filemenu_msg_14,
(s32)filemenu_msg_15, (s32)filemenu_msg_16, (s32)filemenu_msg_17, (s32)filemenu_msg_18, (s32)filemenu_msg_19,
(s32)filemenu_msg_20, (s32)filemenu_msg_21, (s32)filemenu_msg_22, (s32)filemenu_msg_23, (s32)filemenu_msg_24,
(s32)filemenu_msg_25, (s32)filemenu_msg_26, (s32)filemenu_msg_27, (s32)filemenu_msg_28, (s32)filemenu_msg_29,
(s32)filemenu_msg_30, (s32)filemenu_msg_31, (s32)filemenu_msg_32, (s32)filemenu_msg_33, (s32)filemenu_msg_34
};
s32 filemenu_draw_char(s32 c, s32 x, s32 y, s32 flag1, s32 color, s32 flag2) {
MessageCharset* charset;
s32 texSizeX;
s32 texSizeY;
s32 charRasterSize;
MessageCharData* charData;
u8* raster;
s32 charWidth;
if (flag1 != filemenu_charset) {
filemenu_charset = flag1;
filemenu_charset_raster_id = 0;
}
charset = gMsgCharsets[filemenu_charset];
texSizeX = charset->texSize.x;
texSizeY = charset->texSize.y;
charRasterSize = charset->charRasterSize;
charData = &charset->rasters[filemenu_charset_raster_id];
charWidth = charData->monospaceWidth;
raster = charData->raster;
if (c < 0xA2) {
charWidth = charData->charWidthTable[c];
if (gMasterGfxPos != filemenu_savedGfxPos) {
gSPDisplayList(gMasterGfxPos++, filemenu_dl_draw_char_init);
filemenu_char_color = -1;
}
if (filemenu_char_color != color) {
filemenu_char_color = color;
gDPLoadTLUT_pal16(gMasterGfxPos++, 0, &D_802F4560[color]);
}
if (texSizeX >= 16 && texSizeX % 16 == 0) {
gDPLoadTextureBlock_4b(gMasterGfxPos++, &raster[charRasterSize * c], G_IM_FMT_CI,
texSizeX, texSizeY, 0,
G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
} else {
gDPLoadTextureTile_4b(gMasterGfxPos++, &raster[charRasterSize * c], G_IM_FMT_CI,
texSizeX, texSizeY,
0, 0, texSizeX - 1, texSizeY - 1, 0,
G_TX_WRAP, G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
}
if (flag2) {
gDPSetCombineLERP(gMasterGfxPos++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0);
gDPSetRenderMode(gMasterGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
filemenu_draw_rect((x + 2) * 4, (y + 2) * 4, (2 + x + texSizeX) * 4, (2 + y + texSizeY) * 4, 0, 0, 0, 0x400, 0x400);
gDPPipeSync(gMasterGfxPos++);
gDPSetCombineMode(gMasterGfxPos++, G_CC_DECALRGBA, G_CC_DECALRGBA);
gDPSetRenderMode(gMasterGfxPos++, G_RM_TEX_EDGE, G_RM_TEX_EDGE2);
}
filemenu_draw_rect(x * 4, y * 4, (x + texSizeX) * 4, (y + texSizeY) * 4, 0, 0, 0, 0x400, 0x400);
filemenu_savedGfxPos = gMasterGfxPos;
return charWidth;
}
if (c == 0xF7) {
return charWidth - 6;
}
switch (c) {
case 0xF3:
filemenu_charset_raster_id = 0;
break;
case 0xF4:
filemenu_charset_raster_id = 1;
break;
case 0xF5:
filemenu_charset_raster_id = 2;
break;
case 0xF6:
filemenu_charset_raster_id = 3;
break;
}
return 0;
}
void filemenu_draw_message(u8* message, s32 x, s32 y, s32 alpha, s32 color, u32 flags) {
s32 flag1 = flags & 1;
s32 flag2 = flags >> 3;
flag2 &= 1;
if (flag1 == 1) {
y -= 2;
}
if ((u32)message < 0x100) {
if ((u32)message - 0xA2 >= 0x4E) {
filemenu_draw_char((s32)message, x, y, flag1, color, flag2);
return;
}
if ((s32) message >= 0xC6) {
message = (u8*)filemenu_specialSymbols[(s32) message - 0xC6];
}
}
if ((s32) message < 0) {
u8* tmp;
filemenu_draw_char(0xF3, x, y, flag1, color, flag2);
tmp = message;
while (*tmp != 0xFD) {
x += filemenu_draw_char(*tmp, x, y, flag1, color, flag2);
tmp++;
}
}
}
u8* filemenu_get_menu_message(s32 idx) {
return (u8*)gFileMenuMessages[idx];
}
void filemenu_draw_file_name(u8* filename, s32 length, s32 x, s32 y, s32 alpha, s32 arg5, s32 arg6, s32 charWidth) {
s32 i;
for (i = 0; i < length; i++) {
u32 c = filename[i];
if (c != 0xF7) {
filemenu_draw_message((u8*)c, x + (i * charWidth), y, alpha, arg5, arg6);
}
}
}

View File

@ -0,0 +1,559 @@
#include "common.h"
extern u8 D_8024A400[];
extern u8 D_8024B400[];
WindowStyleCustom filemenu_windowStyles[] = {
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = NULL,
.packedTileFormat = 0,
.size1 = { .x = 0, .y = 0},
.size2 = { .x = 0, .y = 0},
.size3 = { .x = 0, .y = 0},
.size4 = { .x = 0, .y = 0},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, 1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, 0, 0, 0, PRIMITIVE, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 64, 92, 246, 255 },
.color2 = { 0, 0, 0, 0 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0x40,
.width = 16,
.height = 16,
.unk_07 = { 0, 0, 0, 0},
.size = 128
},
.corners = {
.imgData = NULL,
.packedTileFormat = 0x31,
.size1 = { .x = 8, .y = 8},
.size2 = { .x = 8, .y = 8},
.size3 = { .x = 8, .y = 8},
.size4 = { .x = 8, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPNoOp(),
.transparentCombineMode = gsDPNoOp(),
.color1 = { 0, 255, 0, 0 },
.color2 = { 0, 0, 0, 0 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = NULL,
.packedTileFormat = 0,
.size1 = { .x = 0, .y = 0},
.size2 = { .x = 0, .y = 0},
.size3 = { .x = 0, .y = 0},
.size4 = { .x = 0, .y = 0},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPNoOp(),
.transparentCombineMode = gsDPNoOp(),
.color1 = { 0, 0, 0, 0 },
.color2 = { 0, 0, 0, 0 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024A400,
.packedTileFormat = 0x03,
.size1 = { .x = 16, .y = 16},
.size2 = { .x = 16, .y = 16},
.size3 = { .x = 16, .y = 16},
.size4 = { .x = 16, .y = 16},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(0, 0, 0, TEXEL1, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(0, 0, 0, TEXEL1, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 0, 0, 0, 255 },
.color2 = { 0, 0, 0, 0 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 215, 140, 150, 255 },
.color2 = { 125, 45, 35, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 215, 140, 150, 255 },
.color2 = { 125, 45, 35, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 215, 140, 150, 255 },
.color2 = { 125, 45, 35, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 200, 200, 200, 255 },
.color2 = { 130, 130, 101, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 200, 200, 200, 255 },
.color2 = { 130, 130, 101, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 200, 200, 200, 255 },
.color2 = { 130, 130, 101, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 200, 200, 200, 255 },
.color2 = { 130, 130, 101, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 88, 92, 68, 255 },
.color2 = { 152, 143, 130, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 88, 92, 68, 255 },
.color2 = { 152, 143, 130, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 88, 92, 68, 255 },
.color2 = { 152, 143, 130, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 88, 92, 68, 255 },
.color2 = { 152, 143, 130, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 200, 200, 200, 255 },
.color2 = { 130, 130, 101, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 255, 255, 255, 255 },
.color2 = { 200, 200, 170, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 88, 92, 68, 255 },
.color2 = { 152, 143, 130, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 255, 238, 106, 255 },
.color2 = { 146, 100, 26, 255 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024A400,
.packedTileFormat = 0x03,
.size1 = { .x = 16, .y = 16},
.size2 = { .x = 16, .y = 16},
.size3 = { .x = 16, .y = 16},
.size4 = { .x = 16, .y = 16},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(0, 0, 0, TEXEL1, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(0, 0, 0, TEXEL1, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 0, 0, 0, 255 },
.color2 = { 0, 0, 0, 0 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024A400,
.packedTileFormat = 0x03,
.size1 = { .x = 16, .y = 16},
.size2 = { .x = 16, .y = 16},
.size3 = { .x = 16, .y = 16},
.size4 = { .x = 16, .y = 16},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(0, 0, 0, TEXEL1, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(0, 0, 0, TEXEL1, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 0, 0, 0, 255 },
.color2 = { 0, 0, 0, 0 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024A400,
.packedTileFormat = 0x03,
.size1 = { .x = 16, .y = 16},
.size2 = { .x = 16, .y = 16},
.size3 = { .x = 16, .y = 16},
.size4 = { .x = 16, .y = 16},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(0, 0, 0, TEXEL1, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(0, 0, 0, TEXEL1, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 0, 0, 0, 255 },
.color2 = { 0, 0, 0, 0 },
},
{
.background = {
.imgData = NULL,
.packedTileFormat = 0,
.width = 0,
.height = 0,
.unk_07 = { 0, 0, 0, 0},
.size = 0
},
.corners = {
.imgData = D_8024B400,
.packedTileFormat = 0x31,
.size1 = { .x = 16, .y = 8},
.size2 = { .x = 16, .y = 8},
.size3 = { .x = 16, .y = 8},
.size4 = { .x = 16, .y = 8},
.unk_0D = { 0, 0, 0}
},
.unk_1C = { 0, 0, 0, 0},
.opaqueCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, 0, 0, 0, TEXEL1, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.transparentCombineMode = gsDPSetCombineLERP(PRIMITIVE, ENVIRONMENT, TEXEL1, ENVIRONMENT, PRIMITIVE, 0, TEXEL1, 0, 0, 0, 0, COMBINED, 0, 0, 0, COMBINED),
.color1 = { 255, 255, 255, 255 },
.color2 = { 200, 200, 170, 255 },
},
};

View File

@ -0,0 +1,411 @@
#include "common.h"
#include "filemenu.h"
#include "fio.h"
u8 filemenu_yesno_gridData[] = {
0, 1,
0, 1,
0, 1,
0, 1,
0, 1
};
MenuWindowBP filemenu_yesno_windowBPs[] = {
{
.windowID = WINDOW_ID_FILEMENU_YESNO_OPTIONS,
.unk_01 = 0,
.pos = { .x = 0, .y = 0 },
.width = 0,
.height = 0,
.priority = 0x40,
.fpDrawContents = &filemenu_yesno_draw_options_contents,
.tab = NULL,
.parentID = -1,
.fpUpdate = { WINDOW_UPDATE_HIDE },
.extraFlags = 0,
.style = { .customStyle = &filemenu_windowStyles[19] }
},
{
.windowID = WINDOW_ID_FILEMENU_YESNO_PROMPT,
.unk_01 = 0,
.pos = { .x = 0, .y = 0 },
.width = 0,
.height = 0,
.priority = 0,
.fpDrawContents = &filemenu_yesno_draw_prompt_contents,
.tab = NULL,
.parentID = WINDOW_ID_FILEMENU_YESNO_OPTIONS,
.fpUpdate = { WINDOW_UPDATE_SHOW },
.extraFlags = 0,
.style = { .customStyle = &filemenu_windowStyles[19] }
},
};
MenuPanel filemenu_yesno_menuBP = {
.initialized = FALSE,
.col = 0,
.row = 0,
.selected = 0,
.page = 0,
.numCols = 1,
.numRows = 2,
.numPages = 0,
.gridData = filemenu_yesno_gridData,
.fpInit = &filemenu_yesno_init,
.fpHandleInput = &filemenu_yesno_handle_input,
.fpUpdate = &filemenu_yesno_update,
.fpCleanup = &filemenu_yesno_cleanup
};
void filemenu_yesno_draw_options_contents(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
s32 xOffset1;
s32 yOffset1;
s32 xOffset2;
s32 yOffset2;
s32 cursorGoalXOffset;
s32 cursorGoalYOffset;
switch (menu->page) {
case 0:
xOffset1 = 28;
yOffset1 = 4;
xOffset2 = 28;
yOffset2 = 21;
break;
case 1:
xOffset1 = 28;
yOffset1 = 4;
xOffset2 = 28;
yOffset2 = 21;
break;
case 2:
xOffset1 = 28;
yOffset1 = 4;
xOffset2 = 28;
yOffset2 = 21;
break;
case 3:
xOffset1 = 28;
yOffset1 = 4;
xOffset2 = 28;
yOffset2 = 21;
break;
case 4:
xOffset1 = 28;
yOffset1 = 4;
xOffset2 = 28;
yOffset2 = 21;
break;
}
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_YES), baseX + xOffset1, baseY + yOffset1, 0xFF, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_NO), baseX + xOffset2, baseY + yOffset2, 0xFF, 0, 0);
if (filemenu_currentMenu == 1) {
if (menu->selected == 0) {
cursorGoalXOffset = xOffset1 - 10;
cursorGoalYOffset = yOffset1 + 8;
} else {
cursorGoalXOffset = xOffset2 - 10;
cursorGoalYOffset = yOffset2 + 8;
}
filemenu_set_cursor_goal_pos(WINDOW_ID_FILEMENU_YESNO_OPTIONS, baseX + cursorGoalXOffset, baseY + cursorGoalYOffset);
}
}
void filemenu_yesno_draw_prompt_contents(
MenuPanel* menu,
s32 baseX, s32 baseY,
s32 width, s32 height,
s32 opacity, s32 darkening
) {
s32 xOffset;
s32 i;
switch (menu->page) {
case 0:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_DELETE), baseX + 10, baseY + 4, 0xFF, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_22), baseX + 60, baseY + 4, 0xFF, 0, 0);
draw_number(filemenu_menus[0]->selected + 1, baseX + 98, baseY + 6, 0, 0, 0xFF, 3);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_QUESTION), baseX + 99, baseY + 4, 0xFF, 0, 0);
break;
case 3:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_22), baseX + 10, baseY + 4, 0xFF, 0, 0);
draw_number(filemenu_menus[0]->selected + 1, baseX + 48, baseY + 6, 0, 0, 0xFF, 3);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_WILL_BE_DELETED), baseX + 49, baseY + 4, 0xFF, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_OK_TO_COPY_TO_THIS_FILE), baseX + 10, baseY + 18, 0xFF, 0, 0);
break;
case 1:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_OVERRIDE_TO_NEW_DATA), baseX + 10, baseY + 4, 0xFF, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_SAVE_OK), baseX + 10, baseY + 18, 0xFF, 0, 0);
break;
case 2:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_NAME_IS), baseX + 10, baseY + 6, 0xFF, 0, 0);
for (i = ARRAY_COUNT(filemenu_filename) - 1; i >= 0; i--) {
if (filemenu_filename[i] != 0xF7) {
break;
}
}
xOffset = (147 - (i * 11)) / 2;
filemenu_draw_file_name(filemenu_filename, i + 1, baseX + xOffset, baseY + 22, 0xFF, 0, 8, 0xB);
xOffset += (i + 1) * 11;
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_PERIOD_20), baseX + xOffset, baseY + 22, 0xFF, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_OK), baseX + 70, baseY + 38, 0xFF, 0, 0);
break;
case 4:
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_START_GAME_WITH), baseX + 10, baseY + 4, 0xFF, 0, 0);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_22), baseX + 127, baseY + 4, 0xFF, 0, 0);
draw_number(filemenu_menus[0]->selected + 1, baseX + 165, baseY + 6, 0, 0, 0xFF, 3);
filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_QUESTION), baseX + 162, baseY + 4, 0xFF, 0, 0);
break;
}
}
void filemenu_yesno_init(MenuPanel* tab) {
s32 i;
for (i = 0; i < ARRAY_COUNT(filemenu_yesno_windowBPs); i++) {
filemenu_yesno_windowBPs[i].tab = tab;
}
setup_pause_menu_tab(filemenu_yesno_windowBPs, ARRAY_COUNT(filemenu_yesno_windowBPs));
tab->initialized = TRUE;
}
void filemenu_yesno_handle_input(MenuPanel* menu) {
s32 oldSelected = menu->selected;
if (filemenu_heldButtons & BUTTON_STICK_UP) {
menu->row--;
if (menu->row < 0) {
menu->row = 0;
}
}
if (filemenu_heldButtons & BUTTON_STICK_DOWN) {
menu->row++;
if (menu->row >= menu->numRows) {
menu->row = menu->numRows - 1;
}
}
menu->selected = MENU_PANEL_SELECTED_GRID_DATA(menu);
if (oldSelected != menu->selected) {
sfx_play_sound(SOUND_MENU_CHANGE_SELECTION);
}
if ((filemenu_pressedButtons & BUTTON_START) && menu->page == 4) {
filemenu_set_selected(menu, 0, 0);
filemenu_pressedButtons = BUTTON_A;
}
if (filemenu_pressedButtons & BUTTON_A) {
u32 slot;
u32 slot2;
u32 slot3;
u32 slot4;
s32 i;
sfx_play_sound(SOUND_MENU_NEXT);
switch (menu->selected) {
case 0:
switch (menu->page) {
case 0:
filemenu_currentMenu = 2;
filemenu_menus[filemenu_currentMenu]->page = 0;
gWindows[WINDOW_ID_FILEMENU_INFO].width = 182;
gWindows[WINDOW_ID_FILEMENU_INFO].height = 25;
gWindows[WINDOW_ID_FILEMENU_INFO].pos.x = ((gWindows[WINDOW_ID_FILEMENU_INFO].parent != -1)
? (gWindows[gWindows[WINDOW_ID_FILEMENU_INFO].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_INFO].width / 2;
gWindows[WINDOW_ID_FILEMENU_INFO].pos.y = ((gWindows[WINDOW_ID_FILEMENU_INFO].parent != -1)
? (gWindows[gWindows[WINDOW_ID_FILEMENU_INFO].parent].height / 2)
: SCREEN_HEIGHT / 2) - gWindows[WINDOW_ID_FILEMENU_INFO].height / 2;
set_window_update(WINDOW_ID_FILEMENU_INFO, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, (s32)filemenu_update_hidden_name_confirm);
slot = filemenu_menus[0]->selected;
for (i = 0; i < ARRAY_COUNT(gSaveSlotMetadata->filename); i++) {
gSaveSlotMetadata[slot].filename[i] = 0xF7;
}
gSaveSlotMetadata[slot].level = 0;
gSaveSlotMetadata[slot].timePlayed = 0;
gSaveSlotMetadata[slot].spiritsRescued = 0;
fio_erase_game(slot);
gSaveSlotHasData[slot] = FALSE;
break;
case 3:
filemenu_currentMenu = 2;
filemenu_menus[filemenu_currentMenu]->page = 2;
gWindows[WINDOW_ID_FILEMENU_INFO].width = 154;
gWindows[WINDOW_ID_FILEMENU_INFO].height = 39;
gWindows[WINDOW_ID_FILEMENU_INFO].pos.x = ((gWindows[WINDOW_ID_FILEMENU_INFO].parent != -1)
? (gWindows[gWindows[WINDOW_ID_FILEMENU_INFO].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_INFO].width / 2;
gWindows[WINDOW_ID_FILEMENU_INFO].pos.y = ((gWindows[WINDOW_ID_FILEMENU_INFO].parent != -1)
? (gWindows[gWindows[WINDOW_ID_FILEMENU_INFO].parent].height / 2)
: SCREEN_HEIGHT / 2) - gWindows[WINDOW_ID_FILEMENU_INFO].height / 2;
set_window_update(WINDOW_ID_FILEMENU_INFO, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, (s32)filemenu_update_hidden_name_confirm);
fio_load_game(filemenu_loadedFileIdx);
gSaveSlotMetadata[filemenu_iterFileIdx] = gSaveSlotMetadata[filemenu_loadedFileIdx];
fio_save_game(filemenu_iterFileIdx);
gSaveSlotHasData[filemenu_iterFileIdx] = TRUE;
break;
case 1:
filemenu_currentMenu = 2;
filemenu_menus[filemenu_currentMenu]->page = 1;
gWindows[WINDOW_ID_FILEMENU_INFO].width = 153;
gWindows[WINDOW_ID_FILEMENU_INFO].height = 25;
gWindows[WINDOW_ID_FILEMENU_INFO].pos.x = ((gWindows[WINDOW_ID_FILEMENU_INFO].parent != -1)
? (gWindows[gWindows[WINDOW_ID_FILEMENU_INFO].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_INFO].width / 2;
gWindows[WINDOW_ID_FILEMENU_INFO].pos.y = ((gWindows[WINDOW_ID_FILEMENU_INFO].parent != -1)
? (gWindows[gWindows[WINDOW_ID_FILEMENU_INFO].parent].height / 2)
: SCREEN_HEIGHT / 2) - gWindows[WINDOW_ID_FILEMENU_INFO].height / 2;
set_window_update(WINDOW_ID_FILEMENU_INFO, WINDOW_UPDATE_SHOW);
set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, (s32)filemenu_update_hidden_name_confirm);
gSaveSlotMetadata[filemenu_menus[0]->selected] = gSaveSlotMetadata[gGameStatusPtr->saveSlot];
fio_save_game(filemenu_menus[0]->selected);
gSaveSlotHasData[filemenu_menus[0]->selected] = TRUE;
break;
case 2:
clear_player_data();
clear_saved_variables();
gGameStatusPtr->areaID = 0;
gGameStatusPtr->mapID = 0xB;
gGameStatusPtr->entryID = 0;
evt_set_variable(NULL, GB_StoryProgress, STORY_INTRO);
slot2 = filemenu_menus[0]->selected;
for (i = 0; i < ARRAY_COUNT(gSaveSlotMetadata->filename); i++) {
gSaveSlotMetadata[slot2].filename[i] = filemenu_filename[i];
}
fio_save_game(slot2);
gSaveSlotHasData[slot2] = TRUE;
set_window_update(WINDOW_ID_FILEMENU_CREATEFILE_HEADER, (s32)filemenu_update_hidden_name_input);
set_window_update(WINDOW_ID_FILEMENU_KEYBOARD, (s32)filemenu_update_hidden_name_input);
set_window_update(WINDOW_ID_FILEMENU_TITLE, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_CENTER, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE0_INFO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE1_INFO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE2_INFO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE3_INFO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, (s32)filemenu_update_hidden_name_confirm);
filemenu_currentMenu = 2;
filemenu_menus[2]->page = 3;
gWindows[WINDOW_ID_FILEMENU_INFO].width = 184;
gWindows[WINDOW_ID_FILEMENU_INFO].height = 25;
gWindows[WINDOW_ID_FILEMENU_INFO].pos.x = ((gWindows[WINDOW_ID_FILEMENU_INFO].parent != -1)
? (gWindows[gWindows[WINDOW_ID_FILEMENU_INFO].parent].width / 2)
: SCREEN_WIDTH / 2) - gWindows[WINDOW_ID_FILEMENU_INFO].width / 2;
gWindows[WINDOW_ID_FILEMENU_INFO].pos.y = ((gWindows[WINDOW_ID_FILEMENU_INFO].parent != -1)
? (gWindows[gWindows[WINDOW_ID_FILEMENU_INFO].parent].height / 2)
: SCREEN_HEIGHT / 2) - gWindows[WINDOW_ID_FILEMENU_INFO].height / 2;
set_window_update(WINDOW_ID_FILEMENU_INFO, WINDOW_UPDATE_SHOW);
break;
case 4:
slot3 = filemenu_menus[0]->selected;
if (gGameStatusPtr->soundOutputMode != 1 - D_800D95E8.saveSlot ||
slot3 != (u8)D_800D95E8.saveCount)
{
D_800D95E8.saveSlot = 1 - gGameStatusPtr->soundOutputMode;
D_800D95E8.saveCount = slot3;
fio_flush_backups();
}
fio_load_game(slot3);
set_game_mode(GAME_MODE_END_FILE_SELECT);
break;
}
break;
case 1:
switch (menu->page) {
case 0:
case 1:
case 3:
filemenu_currentMenu = 0;
set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, (s32)filemenu_update_hidden_name_confirm);
break;
case 2:
filemenu_currentMenu = 3;
set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, (s32)filemenu_update_hidden_name_confirm);
break;
case 4:
filemenu_currentMenu = 0;
slot4 = filemenu_menus[0]->selected;
set_window_update(WINDOW_ID_FILEMENU_TITLE, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_CENTER, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE0_INFO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE1_INFO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE2_INFO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE3_INFO, (s32)filemenu_update_show_with_rotation);
set_window_update(slot4 + WINDOW_ID_FILEMENU_FILE0_INFO, (s32)filemenu_update_deselect_file);
set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, WINDOW_UPDATE_HIDE);
break;
}
break;
}
}
if (filemenu_pressedButtons & BUTTON_B) {
u32 slot;
sfx_play_sound(SOUND_MENU_BACK);
filemenu_set_selected(menu, 0, 1);
switch (menu->page) {
case 0:
case 1:
case 3:
filemenu_currentMenu = 0;
set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, (s32)filemenu_update_hidden_name_confirm);
break;
case 2:
filemenu_currentMenu = 3;
set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, (s32)filemenu_update_hidden_name_confirm);
break;
case 4:
filemenu_currentMenu = 0;
slot = filemenu_menus[0]->selected;
set_window_update(WINDOW_ID_FILEMENU_TITLE, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_STEREO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_MONO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_CENTER, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_RIGHT, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_OPTION_LEFT, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE0_INFO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE1_INFO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE2_INFO, (s32)filemenu_update_show_with_rotation);
set_window_update(WINDOW_ID_FILEMENU_FILE3_INFO, (s32)filemenu_update_show_with_rotation);
set_window_update(slot + WINDOW_ID_FILEMENU_FILE0_INFO, (s32)filemenu_update_deselect_file);
set_window_update(WINDOW_ID_FILEMENU_YESNO_OPTIONS, WINDOW_UPDATE_HIDE);
break;
}
}
}
void filemenu_yesno_update(MenuPanel* menu) {
}
void filemenu_yesno_cleanup(MenuPanel* menu) {
}

View File

@ -112,10 +112,10 @@ u8 gWindowDisappearFlags[] = { DRAW_FLAGS_ROTSCALE, DRAW_FLAGS_ROTSCALE, DRAW_FL
DRAW_FLAGS_ROTSCALE, DRAW_FLAGS_ROTSCALE, 0 }; DRAW_FLAGS_ROTSCALE, DRAW_FLAGS_ROTSCALE, 0 };
WindowGroup gWindowGroups[] = { WindowGroup gWindowGroups[] = {
{ WINDOW_ID_0, WINDOW_ID_63 }, // all windows { WINDOW_ID_0, WINDOW_ID_FILEMENU_FILE3_TITLE }, // all windows
{ WINDOW_ID_8, WINDOW_ID_9 }, // battle ? { WINDOW_ID_8, WINDOW_ID_9 }, // battle ?
{ WINDOW_ID_PAUSE_MAIN, WINDOW_ID_PAUSE_TAB_INVIS }, // pause menu { WINDOW_ID_PAUSE_MAIN, WINDOW_ID_PAUSE_TAB_INVIS }, // pause menu
{ WINDOW_ID_PAUSE_CURSOR, WINDOW_ID_63 } // file menu { WINDOW_ID_PAUSE_CURSOR, WINDOW_ID_FILEMENU_FILE3_TITLE } // file menu
}; };
void clear_windows(void) { void clear_windows(void) {

File diff suppressed because one or more lines are too long

View File

@ -1,516 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel filemenu_draw_contents_choose_name
/* 168B6C 8024830C 27BDFF78 */ addiu $sp, $sp, -0x88
/* 168B70 80248310 AFBE0078 */ sw $fp, 0x78($sp)
/* 168B74 80248314 0080F02D */ daddu $fp, $a0, $zero
/* 168B78 80248318 3C048016 */ lui $a0, %hi(D_8015A370)
/* 168B7C 8024831C 2484A370 */ addiu $a0, $a0, %lo(D_8015A370)
/* 168B80 80248320 AFBF007C */ sw $ra, 0x7c($sp)
/* 168B84 80248324 AFB70074 */ sw $s7, 0x74($sp)
/* 168B88 80248328 AFB60070 */ sw $s6, 0x70($sp)
/* 168B8C 8024832C AFB5006C */ sw $s5, 0x6c($sp)
/* 168B90 80248330 AFB40068 */ sw $s4, 0x68($sp)
/* 168B94 80248334 AFB30064 */ sw $s3, 0x64($sp)
/* 168B98 80248338 AFB20060 */ sw $s2, 0x60($sp)
/* 168B9C 8024833C AFB1005C */ sw $s1, 0x5c($sp)
/* 168BA0 80248340 AFB00058 */ sw $s0, 0x58($sp)
/* 168BA4 80248344 F7B40080 */ sdc1 $f20, 0x80($sp)
/* 168BA8 80248348 AFA60090 */ sw $a2, 0x90($sp)
/* 168BAC 8024834C AFA70094 */ sw $a3, 0x94($sp)
/* 168BB0 80248350 90820000 */ lbu $v0, ($a0)
/* 168BB4 80248354 30420008 */ andi $v0, $v0, 8
/* 168BB8 80248358 10400130 */ beqz $v0, .L8024881C
/* 168BBC 8024835C 00A0482D */ daddu $t1, $a1, $zero
/* 168BC0 80248360 8C830004 */ lw $v1, 4($a0)
/* 168BC4 80248364 3C028025 */ lui $v0, %hi(func_80248170)
/* 168BC8 80248368 24428170 */ addiu $v0, $v0, %lo(func_80248170)
/* 168BCC 8024836C 1462012B */ bne $v1, $v0, .L8024881C
/* 168BD0 80248370 00000000 */ nop
/* 168BD4 80248374 9082001C */ lbu $v0, 0x1c($a0)
/* 168BD8 80248378 83CB0004 */ lb $t3, 4($fp)
/* 168BDC 8024837C 00021040 */ sll $v0, $v0, 1
/* 168BE0 80248380 AFA20018 */ sw $v0, 0x18($sp)
/* 168BE4 80248384 39620001 */ xori $v0, $t3, 1
/* 168BE8 80248388 AFAB001C */ sw $t3, 0x1c($sp)
/* 168BEC 8024838C 8FAB0018 */ lw $t3, 0x18($sp)
/* 168BF0 80248390 0002102B */ sltu $v0, $zero, $v0
/* 168BF4 80248394 AFA20020 */ sw $v0, 0x20($sp)
/* 168BF8 80248398 29620011 */ slti $v0, $t3, 0x11
/* 168BFC 8024839C 14400002 */ bnez $v0, .L802483A8
/* 168C00 802483A0 240B0010 */ addiu $t3, $zero, 0x10
/* 168C04 802483A4 AFAB0018 */ sw $t3, 0x18($sp)
.L802483A8:
/* 168C08 802483A8 83C20006 */ lb $v0, 6($fp)
/* 168C0C 802483AC 184000E2 */ blez $v0, .L80248738
/* 168C10 802483B0 0000B02D */ daddu $s6, $zero, $zero
/* 168C14 802483B4 3C014080 */ lui $at, 0x4080
/* 168C18 802483B8 4481A000 */ mtc1 $at, $f20
/* 168C1C 802483BC 8FAB0094 */ lw $t3, 0x94($sp)
/* 168C20 802483C0 3C0A800A */ lui $t2, %hi(gMasterGfxPos)
/* 168C24 802483C4 254AA66C */ addiu $t2, $t2, %lo(gMasterGfxPos)
/* 168C28 802483C8 AFA0003C */ sw $zero, 0x3c($sp)
/* 168C2C 802483CC AFA00040 */ sw $zero, 0x40($sp)
/* 168C30 802483D0 012B5821 */ addu $t3, $t1, $t3
/* 168C34 802483D4 AFAB002C */ sw $t3, 0x2c($sp)
.L802483D8:
/* 168C38 802483D8 8FAB0040 */ lw $t3, 0x40($sp)
/* 168C3C 802483DC AFAB0028 */ sw $t3, 0x28($sp)
/* 168C40 802483E0 8FAB003C */ lw $t3, 0x3c($sp)
/* 168C44 802483E4 0000402D */ daddu $t0, $zero, $zero
/* 168C48 802483E8 AFAB0030 */ sw $t3, 0x30($sp)
.L802483EC:
/* 168C4C 802483EC 8FAB0028 */ lw $t3, 0x28($sp)
/* 168C50 802483F0 15000026 */ bnez $t0, .L8024848C
/* 168C54 802483F4 25720004 */ addiu $s2, $t3, 4
/* 168C58 802483F8 44891000 */ mtc1 $t1, $f2
/* 168C5C 802483FC 00000000 */ nop
/* 168C60 80248400 468010A0 */ cvt.s.w $f2, $f2
/* 168C64 80248404 8FAB001C */ lw $t3, 0x1c($sp)
/* 168C68 80248408 46141082 */ mul.s $f2, $f2, $f20
/* 168C6C 8024840C 00000000 */ nop
/* 168C70 80248410 AFAB0024 */ sw $t3, 0x24($sp)
/* 168C74 80248414 8D420000 */ lw $v0, ($t2)
/* 168C78 80248418 8FAB0090 */ lw $t3, 0x90($sp)
/* 168C7C 8024841C 0040282D */ daddu $a1, $v0, $zero
/* 168C80 80248420 24420008 */ addiu $v0, $v0, 8
/* 168C84 80248424 01722021 */ addu $a0, $t3, $s2
/* 168C88 80248428 44840000 */ mtc1 $a0, $f0
/* 168C8C 8024842C 00000000 */ nop
/* 168C90 80248430 46800020 */ cvt.s.w $f0, $f0
/* 168C94 80248434 46140002 */ mul.s $f0, $f0, $f20
/* 168C98 80248438 00000000 */ nop
/* 168C9C 8024843C AD420000 */ sw $v0, ($t2)
/* 168CA0 80248440 4600118D */ trunc.w.s $f6, $f2
/* 168CA4 80248444 44033000 */ mfc1 $v1, $f6
/* 168CA8 80248448 00000000 */ nop
/* 168CAC 8024844C 30630FFF */ andi $v1, $v1, 0xfff
/* 168CB0 80248450 00031B00 */ sll $v1, $v1, 0xc
/* 168CB4 80248454 C7A2002C */ lwc1 $f2, 0x2c($sp)
/* 168CB8 80248458 468010A0 */ cvt.s.w $f2, $f2
/* 168CBC 8024845C 46141082 */ mul.s $f2, $f2, $f20
/* 168CC0 80248460 00000000 */ nop
/* 168CC4 80248464 4600018D */ trunc.w.s $f6, $f0
/* 168CC8 80248468 44023000 */ mfc1 $v0, $f6
/* 168CCC 8024846C 00000000 */ nop
/* 168CD0 80248470 30420FFF */ andi $v0, $v0, 0xfff
/* 168CD4 80248474 3C0BED00 */ lui $t3, 0xed00
/* 168CD8 80248478 004B1025 */ or $v0, $v0, $t3
/* 168CDC 8024847C 8FAB0018 */ lw $t3, 0x18($sp)
/* 168CE0 80248480 00621825 */ or $v1, $v1, $v0
/* 168CE4 80248484 08092148 */ j .L80248520
/* 168CE8 80248488 008B2021 */ addu $a0, $a0, $t3
.L8024848C:
/* 168CEC 8024848C 44891000 */ mtc1 $t1, $f2
/* 168CF0 80248490 00000000 */ nop
/* 168CF4 80248494 468010A0 */ cvt.s.w $f2, $f2
/* 168CF8 80248498 8D430000 */ lw $v1, ($t2)
/* 168CFC 8024849C 8FAB0020 */ lw $t3, 0x20($sp)
/* 168D00 802484A0 46141082 */ mul.s $f2, $f2, $f20
/* 168D04 802484A4 00000000 */ nop
/* 168D08 802484A8 AFAB0024 */ sw $t3, 0x24($sp)
/* 168D0C 802484AC 8FAB0090 */ lw $t3, 0x90($sp)
/* 168D10 802484B0 0060282D */ daddu $a1, $v1, $zero
/* 168D14 802484B4 01722021 */ addu $a0, $t3, $s2
/* 168D18 802484B8 8FAB0018 */ lw $t3, 0x18($sp)
/* 168D1C 802484BC 24630008 */ addiu $v1, $v1, 8
/* 168D20 802484C0 AD430000 */ sw $v1, ($t2)
/* 168D24 802484C4 008B1021 */ addu $v0, $a0, $t3
/* 168D28 802484C8 44820000 */ mtc1 $v0, $f0
/* 168D2C 802484CC 00000000 */ nop
/* 168D30 802484D0 46800020 */ cvt.s.w $f0, $f0
/* 168D34 802484D4 24840010 */ addiu $a0, $a0, 0x10
/* 168D38 802484D8 46140002 */ mul.s $f0, $f0, $f20
/* 168D3C 802484DC 00000000 */ nop
/* 168D40 802484E0 4600118D */ trunc.w.s $f6, $f2
/* 168D44 802484E4 44033000 */ mfc1 $v1, $f6
/* 168D48 802484E8 00000000 */ nop
/* 168D4C 802484EC 30630FFF */ andi $v1, $v1, 0xfff
/* 168D50 802484F0 00031B00 */ sll $v1, $v1, 0xc
/* 168D54 802484F4 C7A2002C */ lwc1 $f2, 0x2c($sp)
/* 168D58 802484F8 468010A0 */ cvt.s.w $f2, $f2
/* 168D5C 802484FC 46141082 */ mul.s $f2, $f2, $f20
/* 168D60 80248500 00000000 */ nop
/* 168D64 80248504 4600018D */ trunc.w.s $f6, $f0
/* 168D68 80248508 44023000 */ mfc1 $v0, $f6
/* 168D6C 8024850C 00000000 */ nop
/* 168D70 80248510 30420FFF */ andi $v0, $v0, 0xfff
/* 168D74 80248514 3C0BED00 */ lui $t3, 0xed00
/* 168D78 80248518 004B1025 */ or $v0, $v0, $t3
/* 168D7C 8024851C 00621825 */ or $v1, $v1, $v0
.L80248520:
/* 168D80 80248520 44840000 */ mtc1 $a0, $f0
/* 168D84 80248524 00000000 */ nop
/* 168D88 80248528 46800020 */ cvt.s.w $f0, $f0
/* 168D8C 8024852C 46140002 */ mul.s $f0, $f0, $f20
/* 168D90 80248530 00000000 */ nop
/* 168D94 80248534 ACA30000 */ sw $v1, ($a1)
/* 168D98 80248538 4600118D */ trunc.w.s $f6, $f2
/* 168D9C 8024853C 44033000 */ mfc1 $v1, $f6
/* 168DA0 80248540 00000000 */ nop
/* 168DA4 80248544 30630FFF */ andi $v1, $v1, 0xfff
/* 168DA8 80248548 00031B00 */ sll $v1, $v1, 0xc
/* 168DAC 8024854C 4600018D */ trunc.w.s $f6, $f0
/* 168DB0 80248550 44023000 */ mfc1 $v0, $f6
/* 168DB4 80248554 00000000 */ nop
/* 168DB8 80248558 30420FFF */ andi $v0, $v0, 0xfff
/* 168DBC 8024855C 00621825 */ or $v1, $v1, $v0
/* 168DC0 80248560 ACA30004 */ sw $v1, 4($a1)
/* 168DC4 80248564 83C20005 */ lb $v0, 5($fp)
/* 168DC8 80248568 93C30005 */ lbu $v1, 5($fp)
/* 168DCC 8024856C 18400063 */ blez $v0, .L802486FC
/* 168DD0 80248570 0000A02D */ daddu $s4, $zero, $zero
/* 168DD4 80248574 0280B82D */ daddu $s7, $s4, $zero
.L80248578:
/* 168DD8 80248578 00031E00 */ sll $v1, $v1, 0x18
/* 168DDC 8024857C 8FAB0024 */ lw $t3, 0x24($sp)
/* 168DE0 80248580 00031E03 */ sra $v1, $v1, 0x18
/* 168DE4 80248584 01630018 */ mult $t3, $v1
/* 168DE8 80248588 00006012 */ mflo $t4
/* 168DEC 8024858C 83C20006 */ lb $v0, 6($fp)
/* 168DF0 80248590 00000000 */ nop
/* 168DF4 80248594 01820018 */ mult $t4, $v0
/* 168DF8 80248598 00001012 */ mflo $v0
/* 168DFC 8024859C 00000000 */ nop
/* 168E00 802485A0 00000000 */ nop
/* 168E04 802485A4 00760018 */ mult $v1, $s6
/* 168E08 802485A8 00001812 */ mflo $v1
/* 168E0C 802485AC 00431021 */ addu $v0, $v0, $v1
/* 168E10 802485B0 8FC30008 */ lw $v1, 8($fp)
/* 168E14 802485B4 00541021 */ addu $v0, $v0, $s4
/* 168E18 802485B8 00621821 */ addu $v1, $v1, $v0
/* 168E1C 802485BC 90730000 */ lbu $s3, ($v1)
/* 168E20 802485C0 240200F7 */ addiu $v0, $zero, 0xf7
/* 168E24 802485C4 52620048 */ beql $s3, $v0, .L802486E8
/* 168E28 802485C8 26940001 */ addiu $s4, $s4, 1
/* 168E2C 802485CC 83C20001 */ lb $v0, 1($fp)
/* 168E30 802485D0 16820007 */ bne $s4, $v0, .L802485F0
/* 168E34 802485D4 0000182D */ daddu $v1, $zero, $zero
/* 168E38 802485D8 83C20002 */ lb $v0, 2($fp)
/* 168E3C 802485DC 16C20005 */ bne $s6, $v0, .L802485F4
/* 168E40 802485E0 2415000A */ addiu $s5, $zero, 0xa
/* 168E44 802485E4 24030008 */ addiu $v1, $zero, 8
/* 168E48 802485E8 0809217D */ j .L802485F4
/* 168E4C 802485EC 0000A82D */ daddu $s5, $zero, $zero
.L802485F0:
/* 168E50 802485F0 2415000A */ addiu $s5, $zero, 0xa
.L802485F4:
/* 168E54 802485F4 26F0000C */ addiu $s0, $s7, 0xc
/* 168E58 802485F8 8FAB0030 */ lw $t3, 0x30($sp)
/* 168E5C 802485FC 0260882D */ daddu $s1, $s3, $zero
/* 168E60 80248600 2662FF5E */ addiu $v0, $s3, -0xa2
/* 168E64 80248604 2C42004E */ sltiu $v0, $v0, 0x4e
/* 168E68 80248608 10400017 */ beqz $v0, .L80248668
/* 168E6C 8024860C 25720005 */ addiu $s2, $t3, 5
/* 168E70 80248610 2A6200C6 */ slti $v0, $s3, 0xc6
/* 168E74 80248614 14400015 */ bnez $v0, .L8024866C
/* 168E78 80248618 240B00C6 */ addiu $t3, $zero, 0xc6
/* 168E7C 8024861C 01302821 */ addu $a1, $t1, $s0
/* 168E80 80248620 3C048025 */ lui $a0, %hi(D_8024C108)
/* 168E84 80248624 8C84C108 */ lw $a0, %lo(D_8024C108)($a0)
/* 168E88 80248628 8FAB0090 */ lw $t3, 0x90($sp)
/* 168E8C 8024862C 24A50016 */ addiu $a1, $a1, 0x16
/* 168E90 80248630 AFA80048 */ sw $t0, 0x48($sp)
/* 168E94 80248634 AFA9004C */ sw $t1, 0x4c($sp)
/* 168E98 80248638 AFAA0050 */ sw $t2, 0x50($sp)
/* 168E9C 8024863C 01723021 */ addu $a2, $t3, $s2
/* 168EA0 80248640 0C051261 */ jal hud_element_set_render_pos
/* 168EA4 80248644 24C60008 */ addiu $a2, $a2, 8
/* 168EA8 80248648 3C048025 */ lui $a0, %hi(D_8024C108)
/* 168EAC 8024864C 8C84C108 */ lw $a0, %lo(D_8024C108)($a0)
/* 168EB0 80248650 0C0511F8 */ jal hud_element_draw_without_clipping
/* 168EB4 80248654 00000000 */ nop
/* 168EB8 80248658 0000182D */ daddu $v1, $zero, $zero
/* 168EBC 8024865C 8FAA0050 */ lw $t2, 0x50($sp)
/* 168EC0 80248660 8FA9004C */ lw $t1, 0x4c($sp)
/* 168EC4 80248664 8FA80048 */ lw $t0, 0x48($sp)
.L80248668:
/* 168EC8 80248668 240B00C6 */ addiu $t3, $zero, 0xc6
.L8024866C:
/* 168ECC 8024866C 522B0001 */ beql $s1, $t3, .L80248674
/* 168ED0 80248670 2610FFFF */ addiu $s0, $s0, -1
.L80248674:
/* 168ED4 80248674 240B00C9 */ addiu $t3, $zero, 0xc9
/* 168ED8 80248678 522B0001 */ beql $s1, $t3, .L80248680
/* 168EDC 8024867C 26100005 */ addiu $s0, $s0, 5
.L80248680:
/* 168EE0 80248680 240B00CA */ addiu $t3, $zero, 0xca
/* 168EE4 80248684 522B0001 */ beql $s1, $t3, .L8024868C
/* 168EE8 80248688 26100008 */ addiu $s0, $s0, 8
.L8024868C:
/* 168EEC 8024868C 240B00C6 */ addiu $t3, $zero, 0xc6
/* 168EF0 80248690 122B0005 */ beq $s1, $t3, .L802486A8
/* 168EF4 80248694 240B00CA */ addiu $t3, $zero, 0xca
/* 168EF8 80248698 122B0003 */ beq $s1, $t3, .L802486A8
/* 168EFC 8024869C 240B00C9 */ addiu $t3, $zero, 0xc9
/* 168F00 802486A0 162B0003 */ bne $s1, $t3, .L802486B0
/* 168F04 802486A4 0260202D */ daddu $a0, $s3, $zero
.L802486A8:
/* 168F08 802486A8 2652FFFF */ addiu $s2, $s2, -1
/* 168F0C 802486AC 0260202D */ daddu $a0, $s3, $zero
.L802486B0:
/* 168F10 802486B0 01302821 */ addu $a1, $t1, $s0
/* 168F14 802486B4 8FAB0090 */ lw $t3, 0x90($sp)
/* 168F18 802486B8 240700FF */ addiu $a3, $zero, 0xff
/* 168F1C 802486BC AFB50010 */ sw $s5, 0x10($sp)
/* 168F20 802486C0 AFA30014 */ sw $v1, 0x14($sp)
/* 168F24 802486C4 AFA80048 */ sw $t0, 0x48($sp)
/* 168F28 802486C8 AFA9004C */ sw $t1, 0x4c($sp)
/* 168F2C 802486CC AFAA0050 */ sw $t2, 0x50($sp)
/* 168F30 802486D0 0C09265F */ jal filemenu_draw_message
/* 168F34 802486D4 01723021 */ addu $a2, $t3, $s2
/* 168F38 802486D8 8FAA0050 */ lw $t2, 0x50($sp)
/* 168F3C 802486DC 8FA9004C */ lw $t1, 0x4c($sp)
/* 168F40 802486E0 8FA80048 */ lw $t0, 0x48($sp)
/* 168F44 802486E4 26940001 */ addiu $s4, $s4, 1
.L802486E8:
/* 168F48 802486E8 83C20005 */ lb $v0, 5($fp)
/* 168F4C 802486EC 93C30005 */ lbu $v1, 5($fp)
/* 168F50 802486F0 0282102A */ slt $v0, $s4, $v0
/* 168F54 802486F4 1440FFA0 */ bnez $v0, .L80248578
/* 168F58 802486F8 26F70013 */ addiu $s7, $s7, 0x13
.L802486FC:
/* 168F5C 802486FC 25080001 */ addiu $t0, $t0, 1
/* 168F60 80248700 29020002 */ slti $v0, $t0, 2
/* 168F64 80248704 1440FF39 */ bnez $v0, .L802483EC
/* 168F68 80248708 00000000 */ nop
/* 168F6C 8024870C 8FAB003C */ lw $t3, 0x3c($sp)
/* 168F70 80248710 256B0011 */ addiu $t3, $t3, 0x11
/* 168F74 80248714 AFAB003C */ sw $t3, 0x3c($sp)
/* 168F78 80248718 8FAB0040 */ lw $t3, 0x40($sp)
/* 168F7C 8024871C 256B000F */ addiu $t3, $t3, 0xf
/* 168F80 80248720 AFAB0040 */ sw $t3, 0x40($sp)
/* 168F84 80248724 83C20006 */ lb $v0, 6($fp)
/* 168F88 80248728 26D60001 */ addiu $s6, $s6, 1
/* 168F8C 8024872C 02C2102A */ slt $v0, $s6, $v0
/* 168F90 80248730 1440FF29 */ bnez $v0, .L802483D8
/* 168F94 80248734 00000000 */ nop
.L80248738:
/* 168F98 80248738 3C03800A */ lui $v1, %hi(gMasterGfxPos)
/* 168F9C 8024873C 2463A66C */ addiu $v1, $v1, %lo(gMasterGfxPos)
/* 168FA0 80248740 44891000 */ mtc1 $t1, $f2
/* 168FA4 80248744 00000000 */ nop
/* 168FA8 80248748 468010A0 */ cvt.s.w $f2, $f2
/* 168FAC 8024874C 3C014080 */ lui $at, 0x4080
/* 168FB0 80248750 44812000 */ mtc1 $at, $f4
/* 168FB4 80248754 C7A00090 */ lwc1 $f0, 0x90($sp)
/* 168FB8 80248758 46800020 */ cvt.s.w $f0, $f0
/* 168FBC 8024875C 46041082 */ mul.s $f2, $f2, $f4
/* 168FC0 80248760 00000000 */ nop
/* 168FC4 80248764 8C620000 */ lw $v0, ($v1)
/* 168FC8 80248768 3C05ED00 */ lui $a1, 0xed00
/* 168FCC 8024876C 0040302D */ daddu $a2, $v0, $zero
/* 168FD0 80248770 24420008 */ addiu $v0, $v0, 8
/* 168FD4 80248774 46040002 */ mul.s $f0, $f0, $f4
/* 168FD8 80248778 00000000 */ nop
/* 168FDC 8024877C AC620000 */ sw $v0, ($v1)
/* 168FE0 80248780 4600118D */ trunc.w.s $f6, $f2
/* 168FE4 80248784 44043000 */ mfc1 $a0, $f6
/* 168FE8 80248788 00000000 */ nop
/* 168FEC 8024878C 30840FFF */ andi $a0, $a0, 0xfff
/* 168FF0 80248790 00042300 */ sll $a0, $a0, 0xc
/* 168FF4 80248794 4600018D */ trunc.w.s $f6, $f0
/* 168FF8 80248798 44033000 */ mfc1 $v1, $f6
/* 168FFC 8024879C 00000000 */ nop
/* 169000 802487A0 30630FFF */ andi $v1, $v1, 0xfff
/* 169004 802487A4 8FAB0094 */ lw $t3, 0x94($sp)
/* 169008 802487A8 00651825 */ or $v1, $v1, $a1
/* 16900C 802487AC 012B1021 */ addu $v0, $t1, $t3
/* 169010 802487B0 44821000 */ mtc1 $v0, $f2
/* 169014 802487B4 00000000 */ nop
/* 169018 802487B8 468010A0 */ cvt.s.w $f2, $f2
/* 16901C 802487BC 46041082 */ mul.s $f2, $f2, $f4
/* 169020 802487C0 00000000 */ nop
/* 169024 802487C4 8FA20098 */ lw $v0, 0x98($sp)
/* 169028 802487C8 8FAB0090 */ lw $t3, 0x90($sp)
/* 16902C 802487CC 00832025 */ or $a0, $a0, $v1
/* 169030 802487D0 01621021 */ addu $v0, $t3, $v0
/* 169034 802487D4 44820000 */ mtc1 $v0, $f0
/* 169038 802487D8 00000000 */ nop
/* 16903C 802487DC 46800020 */ cvt.s.w $f0, $f0
/* 169040 802487E0 46040002 */ mul.s $f0, $f0, $f4
/* 169044 802487E4 00000000 */ nop
/* 169048 802487E8 ACC40000 */ sw $a0, ($a2)
/* 16904C 802487EC 4600118D */ trunc.w.s $f6, $f2
/* 169050 802487F0 44023000 */ mfc1 $v0, $f6
/* 169054 802487F4 00000000 */ nop
/* 169058 802487F8 30420FFF */ andi $v0, $v0, 0xfff
/* 16905C 802487FC 00021300 */ sll $v0, $v0, 0xc
/* 169060 80248800 4600018D */ trunc.w.s $f6, $f0
/* 169064 80248804 44033000 */ mfc1 $v1, $f6
/* 169068 80248808 00000000 */ nop
/* 16906C 8024880C 30630FFF */ andi $v1, $v1, 0xfff
/* 169070 80248810 00431025 */ or $v0, $v0, $v1
/* 169074 80248814 08092272 */ j .L802489C8
/* 169078 80248818 ACC20004 */ sw $v0, 4($a2)
.L8024881C:
/* 16907C 8024881C 83C20005 */ lb $v0, 5($fp)
/* 169080 80248820 18400069 */ blez $v0, .L802489C8
/* 169084 80248824 0000A02D */ daddu $s4, $zero, $zero
/* 169088 80248828 AFA00038 */ sw $zero, 0x38($sp)
.L8024882C:
/* 16908C 8024882C 83C20006 */ lb $v0, 6($fp)
/* 169090 80248830 93C40006 */ lbu $a0, 6($fp)
/* 169094 80248834 1840005C */ blez $v0, .L802489A8
/* 169098 80248838 0000B02D */ daddu $s6, $zero, $zero
/* 16909C 8024883C 8FAB0038 */ lw $t3, 0x38($sp)
/* 1690A0 80248840 02C0B82D */ daddu $s7, $s6, $zero
/* 1690A4 80248844 AFAB0034 */ sw $t3, 0x34($sp)
.L80248848:
/* 1690A8 80248848 83C20004 */ lb $v0, 4($fp)
/* 1690AC 8024884C 83C30005 */ lb $v1, 5($fp)
/* 1690B0 80248850 00430018 */ mult $v0, $v1
/* 1690B4 80248854 00004012 */ mflo $t0
/* 1690B8 80248858 00041600 */ sll $v0, $a0, 0x18
/* 1690BC 8024885C 00021603 */ sra $v0, $v0, 0x18
/* 1690C0 80248860 01020018 */ mult $t0, $v0
/* 1690C4 80248864 00001012 */ mflo $v0
/* 1690C8 80248868 00000000 */ nop
/* 1690CC 8024886C 00000000 */ nop
/* 1690D0 80248870 00760018 */ mult $v1, $s6
/* 1690D4 80248874 00001812 */ mflo $v1
/* 1690D8 80248878 00431021 */ addu $v0, $v0, $v1
/* 1690DC 8024887C 8FC30008 */ lw $v1, 8($fp)
/* 1690E0 80248880 00541021 */ addu $v0, $v0, $s4
/* 1690E4 80248884 00621821 */ addu $v1, $v1, $v0
/* 1690E8 80248888 90730000 */ lbu $s3, ($v1)
/* 1690EC 8024888C 240200F7 */ addiu $v0, $zero, 0xf7
/* 1690F0 80248890 52620040 */ beql $s3, $v0, .L80248994
/* 1690F4 80248894 26D60001 */ addiu $s6, $s6, 1
/* 1690F8 80248898 83C20001 */ lb $v0, 1($fp)
/* 1690FC 8024889C 16820007 */ bne $s4, $v0, .L802488BC
/* 169100 802488A0 0000182D */ daddu $v1, $zero, $zero
/* 169104 802488A4 83C20002 */ lb $v0, 2($fp)
/* 169108 802488A8 16C20005 */ bne $s6, $v0, .L802488C0
/* 16910C 802488AC 2415000A */ addiu $s5, $zero, 0xa
/* 169110 802488B0 24030008 */ addiu $v1, $zero, 8
/* 169114 802488B4 08092230 */ j .L802488C0
/* 169118 802488B8 0000A82D */ daddu $s5, $zero, $zero
.L802488BC:
/* 16911C 802488BC 2415000A */ addiu $s5, $zero, 0xa
.L802488C0:
/* 169120 802488C0 8FAB0034 */ lw $t3, 0x34($sp)
/* 169124 802488C4 26F20005 */ addiu $s2, $s7, 5
/* 169128 802488C8 0260882D */ daddu $s1, $s3, $zero
/* 16912C 802488CC 2662FF5E */ addiu $v0, $s3, -0xa2
/* 169130 802488D0 2C42004E */ sltiu $v0, $v0, 0x4e
/* 169134 802488D4 10400013 */ beqz $v0, .L80248924
/* 169138 802488D8 2570000C */ addiu $s0, $t3, 0xc
/* 16913C 802488DC 2A6200C6 */ slti $v0, $s3, 0xc6
/* 169140 802488E0 14400011 */ bnez $v0, .L80248928
/* 169144 802488E4 240B00C6 */ addiu $t3, $zero, 0xc6
/* 169148 802488E8 01302821 */ addu $a1, $t1, $s0
/* 16914C 802488EC 3C048025 */ lui $a0, %hi(D_8024C108)
/* 169150 802488F0 8C84C108 */ lw $a0, %lo(D_8024C108)($a0)
/* 169154 802488F4 8FAB0090 */ lw $t3, 0x90($sp)
/* 169158 802488F8 24A50016 */ addiu $a1, $a1, 0x16
/* 16915C 802488FC AFA9004C */ sw $t1, 0x4c($sp)
/* 169160 80248900 01723021 */ addu $a2, $t3, $s2
/* 169164 80248904 0C051261 */ jal hud_element_set_render_pos
/* 169168 80248908 24C60008 */ addiu $a2, $a2, 8
/* 16916C 8024890C 3C048025 */ lui $a0, %hi(D_8024C108)
/* 169170 80248910 8C84C108 */ lw $a0, %lo(D_8024C108)($a0)
/* 169174 80248914 0C0511F8 */ jal hud_element_draw_without_clipping
/* 169178 80248918 00000000 */ nop
/* 16917C 8024891C 0000182D */ daddu $v1, $zero, $zero
/* 169180 80248920 8FA9004C */ lw $t1, 0x4c($sp)
.L80248924:
/* 169184 80248924 240B00C6 */ addiu $t3, $zero, 0xc6
.L80248928:
/* 169188 80248928 522B0001 */ beql $s1, $t3, .L80248930
/* 16918C 8024892C 2610FFFF */ addiu $s0, $s0, -1
.L80248930:
/* 169190 80248930 240B00C9 */ addiu $t3, $zero, 0xc9
/* 169194 80248934 522B0001 */ beql $s1, $t3, .L8024893C
/* 169198 80248938 26100005 */ addiu $s0, $s0, 5
.L8024893C:
/* 16919C 8024893C 240B00CA */ addiu $t3, $zero, 0xca
/* 1691A0 80248940 522B0001 */ beql $s1, $t3, .L80248948
/* 1691A4 80248944 26100008 */ addiu $s0, $s0, 8
.L80248948:
/* 1691A8 80248948 240B00C6 */ addiu $t3, $zero, 0xc6
/* 1691AC 8024894C 122B0005 */ beq $s1, $t3, .L80248964
/* 1691B0 80248950 240B00CA */ addiu $t3, $zero, 0xca
/* 1691B4 80248954 122B0003 */ beq $s1, $t3, .L80248964
/* 1691B8 80248958 240B00C9 */ addiu $t3, $zero, 0xc9
/* 1691BC 8024895C 162B0003 */ bne $s1, $t3, .L8024896C
/* 1691C0 80248960 0260202D */ daddu $a0, $s3, $zero
.L80248964:
/* 1691C4 80248964 2652FFFF */ addiu $s2, $s2, -1
/* 1691C8 80248968 0260202D */ daddu $a0, $s3, $zero
.L8024896C:
/* 1691CC 8024896C 01302821 */ addu $a1, $t1, $s0
/* 1691D0 80248970 8FAB0090 */ lw $t3, 0x90($sp)
/* 1691D4 80248974 240700FF */ addiu $a3, $zero, 0xff
/* 1691D8 80248978 AFB50010 */ sw $s5, 0x10($sp)
/* 1691DC 8024897C AFA30014 */ sw $v1, 0x14($sp)
/* 1691E0 80248980 AFA9004C */ sw $t1, 0x4c($sp)
/* 1691E4 80248984 0C09265F */ jal filemenu_draw_message
/* 1691E8 80248988 01723021 */ addu $a2, $t3, $s2
/* 1691EC 8024898C 8FA9004C */ lw $t1, 0x4c($sp)
/* 1691F0 80248990 26D60001 */ addiu $s6, $s6, 1
.L80248994:
/* 1691F4 80248994 83C20006 */ lb $v0, 6($fp)
/* 1691F8 80248998 93C40006 */ lbu $a0, 6($fp)
/* 1691FC 8024899C 02C2102A */ slt $v0, $s6, $v0
/* 169200 802489A0 1440FFA9 */ bnez $v0, .L80248848
/* 169204 802489A4 26F70011 */ addiu $s7, $s7, 0x11
.L802489A8:
/* 169208 802489A8 8FAB0038 */ lw $t3, 0x38($sp)
/* 16920C 802489AC 256B0013 */ addiu $t3, $t3, 0x13
/* 169210 802489B0 AFAB0038 */ sw $t3, 0x38($sp)
/* 169214 802489B4 83C20005 */ lb $v0, 5($fp)
/* 169218 802489B8 26940001 */ addiu $s4, $s4, 1
/* 16921C 802489BC 0282102A */ slt $v0, $s4, $v0
/* 169220 802489C0 1440FF9A */ bnez $v0, .L8024882C
/* 169224 802489C4 00000000 */ nop
.L802489C8:
/* 169228 802489C8 3C038025 */ lui $v1, %hi(filemenu_8024C098)
/* 16922C 802489CC 8063C098 */ lb $v1, %lo(filemenu_8024C098)($v1)
/* 169230 802489D0 24020003 */ addiu $v0, $zero, 3
/* 169234 802489D4 1462001D */ bne $v1, $v0, .L80248A4C
/* 169238 802489D8 00000000 */ nop
/* 16923C 802489DC 3C028025 */ lui $v0, %hi(filemenu_heldButtons)
/* 169240 802489E0 8C42C08C */ lw $v0, %lo(filemenu_heldButtons)($v0)
/* 169244 802489E4 3C03000F */ lui $v1, 0xf
/* 169248 802489E8 00431024 */ and $v0, $v0, $v1
/* 16924C 802489EC 10400003 */ beqz $v0, .L802489FC
/* 169250 802489F0 2402FFFC */ addiu $v0, $zero, -4
/* 169254 802489F4 3C018025 */ lui $at, %hi(D_8024A18C)
/* 169258 802489F8 AC22A18C */ sw $v0, %lo(D_8024A18C)($at)
.L802489FC:
/* 16925C 802489FC 3C038025 */ lui $v1, %hi(D_8024A18C)
/* 169260 80248A00 2463A18C */ addiu $v1, $v1, %lo(D_8024A18C)
/* 169264 80248A04 8C620000 */ lw $v0, ($v1)
/* 169268 80248A08 24040031 */ addiu $a0, $zero, 0x31
/* 16926C 80248A0C 24420001 */ addiu $v0, $v0, 1
/* 169270 80248A10 AC620000 */ sw $v0, ($v1)
/* 169274 80248A14 83C20001 */ lb $v0, 1($fp)
/* 169278 80248A18 8FAB0090 */ lw $t3, 0x90($sp)
/* 16927C 80248A1C 00022880 */ sll $a1, $v0, 2
/* 169280 80248A20 00A22821 */ addu $a1, $a1, $v0
/* 169284 80248A24 00052880 */ sll $a1, $a1, 2
/* 169288 80248A28 00A22823 */ subu $a1, $a1, $v0
/* 16928C 80248A2C 24A50002 */ addiu $a1, $a1, 2
/* 169290 80248A30 83C20002 */ lb $v0, 2($fp)
/* 169294 80248A34 01252821 */ addu $a1, $t1, $a1
/* 169298 80248A38 00023100 */ sll $a2, $v0, 4
/* 16929C 80248A3C 00C23021 */ addu $a2, $a2, $v0
/* 1692A0 80248A40 24C6000D */ addiu $a2, $a2, 0xd
/* 1692A4 80248A44 0C090B80 */ jal filemenu_set_cursor_goal_pos
/* 1692A8 80248A48 01663021 */ addu $a2, $t3, $a2
.L80248A4C:
/* 1692AC 80248A4C 8FBF007C */ lw $ra, 0x7c($sp)
/* 1692B0 80248A50 8FBE0078 */ lw $fp, 0x78($sp)
/* 1692B4 80248A54 8FB70074 */ lw $s7, 0x74($sp)
/* 1692B8 80248A58 8FB60070 */ lw $s6, 0x70($sp)
/* 1692BC 80248A5C 8FB5006C */ lw $s5, 0x6c($sp)
/* 1692C0 80248A60 8FB40068 */ lw $s4, 0x68($sp)
/* 1692C4 80248A64 8FB30064 */ lw $s3, 0x64($sp)
/* 1692C8 80248A68 8FB20060 */ lw $s2, 0x60($sp)
/* 1692CC 80248A6C 8FB1005C */ lw $s1, 0x5c($sp)
/* 1692D0 80248A70 8FB00058 */ lw $s0, 0x58($sp)
/* 1692D4 80248A74 D7B40080 */ ldc1 $f20, 0x80($sp)
/* 1692D8 80248A78 03E00008 */ jr $ra
/* 1692DC 80248A7C 27BD0088 */ addiu $sp, $sp, 0x88

View File

@ -1,83 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel filemenu_draw_message
/* 16A1DC 8024997C 27BDFFC8 */ addiu $sp, $sp, -0x38
/* 16A1E0 80249980 8FA2004C */ lw $v0, 0x4c($sp)
/* 16A1E4 80249984 AFB5002C */ sw $s5, 0x2c($sp)
/* 16A1E8 80249988 8FB50048 */ lw $s5, 0x48($sp)
/* 16A1EC 8024998C AFB00018 */ sw $s0, 0x18($sp)
/* 16A1F0 80249990 0080802D */ daddu $s0, $a0, $zero
/* 16A1F4 80249994 AFB1001C */ sw $s1, 0x1c($sp)
/* 16A1F8 80249998 00A0882D */ daddu $s1, $a1, $zero
/* 16A1FC 8024999C AFB20020 */ sw $s2, 0x20($sp)
/* 16A200 802499A0 00C0902D */ daddu $s2, $a2, $zero
/* 16A204 802499A4 AFBF0034 */ sw $ra, 0x34($sp)
/* 16A208 802499A8 AFB60030 */ sw $s6, 0x30($sp)
/* 16A20C 802499AC AFB40028 */ sw $s4, 0x28($sp)
/* 16A210 802499B0 AFB30024 */ sw $s3, 0x24($sp)
/* 16A214 802499B4 000298C2 */ srl $s3, $v0, 3
/* 16A218 802499B8 30540001 */ andi $s4, $v0, 1
/* 16A21C 802499BC 24020001 */ addiu $v0, $zero, 1
/* 16A220 802499C0 16820002 */ bne $s4, $v0, .L802499CC
/* 16A224 802499C4 32730001 */ andi $s3, $s3, 1
/* 16A228 802499C8 2652FFFE */ addiu $s2, $s2, -2
.L802499CC:
/* 16A22C 802499CC 2E020100 */ sltiu $v0, $s0, 0x100
/* 16A230 802499D0 10400013 */ beqz $v0, .L80249A20
/* 16A234 802499D4 2602FF5E */ addiu $v0, $s0, -0xa2
/* 16A238 802499D8 2C42004E */ sltiu $v0, $v0, 0x4e
/* 16A23C 802499DC 1440000A */ bnez $v0, .L80249A08
/* 16A240 802499E0 2A0200C6 */ slti $v0, $s0, 0xc6
/* 16A244 802499E4 0200202D */ daddu $a0, $s0, $zero
/* 16A248 802499E8 0220282D */ daddu $a1, $s1, $zero
/* 16A24C 802499EC 0240302D */ daddu $a2, $s2, $zero
/* 16A250 802499F0 0280382D */ daddu $a3, $s4, $zero
/* 16A254 802499F4 AFB50010 */ sw $s5, 0x10($sp)
/* 16A258 802499F8 0C0924E0 */ jal filemenu_draw_char
/* 16A25C 802499FC AFB30014 */ sw $s3, 0x14($sp)
/* 16A260 80249A00 0809269F */ j .L80249A7C
/* 16A264 80249A04 00000000 */ nop
.L80249A08:
/* 16A268 80249A08 14400005 */ bnez $v0, .L80249A20
/* 16A26C 80249A0C 2602FF3A */ addiu $v0, $s0, -0xc6
/* 16A270 80249A10 00021080 */ sll $v0, $v0, 2
/* 16A274 80249A14 3C108025 */ lui $s0, %hi(D_8024B74C)
/* 16A278 80249A18 02028021 */ addu $s0, $s0, $v0
/* 16A27C 80249A1C 8E10B74C */ lw $s0, %lo(D_8024B74C)($s0)
.L80249A20:
/* 16A280 80249A20 06010016 */ bgez $s0, .L80249A7C
/* 16A284 80249A24 240400F3 */ addiu $a0, $zero, 0xf3
/* 16A288 80249A28 0220282D */ daddu $a1, $s1, $zero
/* 16A28C 80249A2C 0240302D */ daddu $a2, $s2, $zero
/* 16A290 80249A30 0280382D */ daddu $a3, $s4, $zero
/* 16A294 80249A34 AFB50010 */ sw $s5, 0x10($sp)
/* 16A298 80249A38 0C0924E0 */ jal filemenu_draw_char
/* 16A29C 80249A3C AFB30014 */ sw $s3, 0x14($sp)
/* 16A2A0 80249A40 92030000 */ lbu $v1, ($s0)
/* 16A2A4 80249A44 240200FD */ addiu $v0, $zero, 0xfd
/* 16A2A8 80249A48 1062000C */ beq $v1, $v0, .L80249A7C
/* 16A2AC 80249A4C 0040B02D */ daddu $s6, $v0, $zero
.L80249A50:
/* 16A2B0 80249A50 0220282D */ daddu $a1, $s1, $zero
/* 16A2B4 80249A54 0240302D */ daddu $a2, $s2, $zero
/* 16A2B8 80249A58 0280382D */ daddu $a3, $s4, $zero
/* 16A2BC 80249A5C 92040000 */ lbu $a0, ($s0)
/* 16A2C0 80249A60 26100001 */ addiu $s0, $s0, 1
/* 16A2C4 80249A64 AFB50010 */ sw $s5, 0x10($sp)
/* 16A2C8 80249A68 0C0924E0 */ jal filemenu_draw_char
/* 16A2CC 80249A6C AFB30014 */ sw $s3, 0x14($sp)
/* 16A2D0 80249A70 92030000 */ lbu $v1, ($s0)
/* 16A2D4 80249A74 1476FFF6 */ bne $v1, $s6, .L80249A50
/* 16A2D8 80249A78 02228821 */ addu $s1, $s1, $v0
.L80249A7C:
/* 16A2DC 80249A7C 8FBF0034 */ lw $ra, 0x34($sp)
/* 16A2E0 80249A80 8FB60030 */ lw $s6, 0x30($sp)
/* 16A2E4 80249A84 8FB5002C */ lw $s5, 0x2c($sp)
/* 16A2E8 80249A88 8FB40028 */ lw $s4, 0x28($sp)
/* 16A2EC 80249A8C 8FB30024 */ lw $s3, 0x24($sp)
/* 16A2F0 80249A90 8FB20020 */ lw $s2, 0x20($sp)
/* 16A2F4 80249A94 8FB1001C */ lw $s1, 0x1c($sp)
/* 16A2F8 80249A98 8FB00018 */ lw $s0, 0x18($sp)
/* 16A2FC 80249A9C 03E00008 */ jr $ra
/* 16A300 80249AA0 27BD0038 */ addiu $sp, $sp, 0x38

View File

@ -1,9 +0,0 @@
.set noat # allow manual use of $at
.set noreorder # don't insert nops after branches
glabel filemenu_get_menu_message
/* 16A304 80249AA4 00042080 */ sll $a0, $a0, 2
/* 16A308 80249AA8 3C028025 */ lui $v0, %hi(gFileMenuMessages)
/* 16A30C 80249AAC 00441021 */ addu $v0, $v0, $a0
/* 16A310 80249AB0 03E00008 */ jr $ra
/* 16A314 80249AB4 8C42B9D0 */ lw $v0, %lo(gFileMenuMessages)($v0)

View File

@ -1163,19 +1163,33 @@ segments:
- [0x161E70, .data, pause_gfx] - [0x161E70, .data, pause_gfx]
- [0x162D30, .data, pause_styles] - [0x162D30, .data, pause_styles]
- [0x1632A0] - [0x1632A0]
- name: filemenu - type: code
type: code dir: filemenu
start: 0x163400 start: 0x163400
vram: 0x80242BA0 vram: 0x80242BA0
follows_vram: ui_images follows_vram: ui_images
subsegments: subsegments:
- [0x163400, c, 163400] - [0x163400, c, filemenu_common]
- [0x165490, c, 165490] - [0x165490, c, filemenu_main]
- [0x167570, c, 167570] - [0x167570, c, filemenu_yesno]
- [0x168590, c, 168590] - [0x168590, c, filemenu_info]
- [0x169BE0, c] - [0x1689D0, c, filemenu_createfile]
- [0x16A3E0, .data, 163400] - [0x169BE0, c, filemenu_msg]
- [0x16A680, data] - [0x16A3E0, .data, filemenu_common]
- [0x16A680, .data, filemenu_main]
- [0x16A920, .data, filemenu_yesno]
- [0x16A990, .data, filemenu_info]
- [0x16A9E0, .data, filemenu_createfile]
- start: 0x16AA60
type: .data
name: filemenu_gfx
subsegments:
- [0x16AA60, ia4, copyarrow, 64, 16]
- [0x16AC60, rgba32, corners_yellow, 16, 64]
- [0x16BC60, ia8, corners_gray, 16, 32]
- [0x16BE60, .data, filemenu_gfx]
- [0x16BF90, .data, filemenu_msg]
- [0x16C2C0, .data, filemenu_styles]
- [0x16C7D0] - [0x16C7D0]
- type: code - type: code
start: 0x16C8E0 start: 0x16C8E0

View File

@ -5298,7 +5298,6 @@ D_8015A2BE = 0x8015A2BE; // type:data rom:0xF09BE
D_8015A2C0 = 0x8015A2C0; // type:data rom:0xF09C0 D_8015A2C0 = 0x8015A2C0; // type:data rom:0xF09C0
D_8015A2D0 = 0x8015A2D0; // type:data rom:0xF09D0 D_8015A2D0 = 0x8015A2D0; // type:data rom:0xF09D0
GetCamDistance = 0x802CC084; // type:func rom:0xF0A34 GetCamDistance = 0x802CC084; // type:func rom:0xF0A34
D_8015A370 = 0x8015A370; // type:data rom:0xF0A70
GetCamPosA = 0x802CC0F4; // type:func rom:0xF0AA4 GetCamPosA = 0x802CC0F4; // type:func rom:0xF0AA4
GetCamPosB = 0x802CC184; // type:func rom:0xF0B34 GetCamPosB = 0x802CC184; // type:func rom:0xF0B34
GetCamPosC = 0x802CC214; // type:func rom:0xF0BC4 GetCamPosC = 0x802CC214; // type:func rom:0xF0BC4
@ -6331,7 +6330,7 @@ D_80270058 = 0x80270058; // type:data rom:0x163398
D_80270060 = 0x80270060; // type:data rom:0x1633A0 D_80270060 = 0x80270060; // type:data rom:0x1633A0
D_80270068 = 0x80270068; // type:data rom:0x1633A8 D_80270068 = 0x80270068; // type:data rom:0x1633A8
D_80270070 = 0x80270070; // type:data rom:0x1633B0 D_80270070 = 0x80270070; // type:data rom:0x1633B0
mainmenu_draw_rect = 0x80242BA0; // type:func rom:0x163400 filemenu_draw_rect = 0x80242BA0; // type:func rom:0x163400
gPausePressedButtons = 0x802700C4; // type:data rom:0x163404 gPausePressedButtons = 0x802700C4; // type:data rom:0x163404
gPauseCurrentDescMsg = 0x802700C8; // type:data rom:0x163408 gPauseCurrentDescMsg = 0x802700C8; // type:data rom:0x163408
gPauseCurrentDescIconScript = 0x802700CC; // type:data rom:0x16340C gPauseCurrentDescIconScript = 0x802700CC; // type:data rom:0x16340C
@ -6401,7 +6400,7 @@ filemenu_info_init = 0x80247FD0; // type:func rom:0x168830
filemenu_info_handle_input = 0x80248024; // type:func rom:0x168884 filemenu_info_handle_input = 0x80248024; // type:func rom:0x168884
filemenu_info_update = 0x80248160; // type:func rom:0x1689C0 filemenu_info_update = 0x80248160; // type:func rom:0x1689C0
filemenu_info_cleanup = 0x80248168; // type:func rom:0x1689C8 filemenu_info_cleanup = 0x80248168; // type:func rom:0x1689C8
func_80248170 = 0x80248170; // type:func rom:0x1689D0 filemenu_update_change_layout = 0x80248170; // type:func rom:0x1689D0
filemenu_draw_contents_file_create_header = 0x802481B8; // type:func rom:0x168A18 filemenu_draw_contents_file_create_header = 0x802481B8; // type:func rom:0x168A18
filemenu_draw_contents_choose_name = 0x8024830C; // type:func rom:0x168B6C filemenu_draw_contents_choose_name = 0x8024830C; // type:func rom:0x168B6C
filemenu_choose_name_init = 0x80248A80; // type:func rom:0x1692E0 filemenu_choose_name_init = 0x80248A80; // type:func rom:0x1692E0
@ -6412,13 +6411,13 @@ filemenu_draw_char = 0x80249380; // type:func rom:0x169BE0
filemenu_draw_message = 0x8024997C; // type:func rom:0x16A1DC filemenu_draw_message = 0x8024997C; // type:func rom:0x16A1DC
filemenu_get_menu_message = 0x80249AA4; // type:func rom:0x16A304 filemenu_get_menu_message = 0x80249AA4; // type:func rom:0x16A304
filemenu_draw_file_name = 0x80249AB8; // type:func rom:0x16A318 filemenu_draw_file_name = 0x80249AB8; // type:func rom:0x16A318
D_80249B80 = 0x80249B80; // type:data rom:0x16A3E0 filemenu_cursor_hudElemScripts = 0x80249B80; // type:data rom:0x16A3E0
filemenu_menus = 0x80249B84; // type:data rom:0x16A3E4 filemenu_menus = 0x80249B84; // type:data rom:0x16A3E4
D_80249B94 = 0x80249B94; // type:data rom:0x16A3F4 filemenu_cursor_posX = 0x80249B94; // type:data rom:0x16A3F4
D_80249B98 = 0x80249B98; // type:data rom:0x16A3F8 filemenu_cursor_posY = 0x80249B98; // type:data rom:0x16A3F8
D_80249B9C = 0x80249B9C; // type:data rom:0x16A3FC filemenu_cursor_alpha = 0x80249B9C; // type:data rom:0x16A3FC
D_80249BA0 = 0x80249BA0; // type:data rom:0x16A400 filemenu_cursor_targetX = 0x80249BA0; // type:data rom:0x16A400
D_80249BA4 = 0x80249BA4; // type:data rom:0x16A404 filemenu_cursor_targetY = 0x80249BA4; // type:data rom:0x16A404
filemenu_cursorGoalAlpha = 0x80249BA8; // type:data rom:0x16A408 filemenu_cursorGoalAlpha = 0x80249BA8; // type:data rom:0x16A408
filemenu_cursorGoalAlpha2 = 0x80249BAC; // type:data rom:0x16A40C filemenu_cursorGoalAlpha2 = 0x80249BAC; // type:data rom:0x16A40C
D_80249BB0 = 0x80249BB0; // type:data rom:0x16A410 D_80249BB0 = 0x80249BB0; // type:data rom:0x16A410
@ -6442,22 +6441,22 @@ D_80249D48 = 0x80249D48; // type:data rom:0x16A5A8
D_80249D4C = 0x80249D5C; // type:data rom:0x16A5BC D_80249D4C = 0x80249D5C; // type:data rom:0x16A5BC
D_80249D60 = 0x80249D60; // type:data rom:0x16A5C0 D_80249D60 = 0x80249D60; // type:data rom:0x16A5C0
D_80249D70 = 0x80249D70; // type:data rom:0x16A5D0 D_80249D70 = 0x80249D70; // type:data rom:0x16A5D0
D_80249DAC = 0x80249DAC; // type:data rom:0x16A60C filemenu_common_windowBPs = 0x80249DAC; // type:data rom:0x16A60C
D_80249DCC = 0x80249DCC; // type:data rom:0x16A62C D_80249DCC = 0x80249DCC; // type:data rom:0x16A62C
D_80249DD0 = 0x80249DD0; // type:data rom:0x16A630 D_80249DD0 = 0x80249DD0; // type:data rom:0x16A630
get_dpad_input_radial = 0x8023E000; // type:func rom:0x16C8E0 get_dpad_input_radial = 0x8023E000; // type:func rom:0x16C8E0
filemenu_pressedButtons = 0x8024C084; // type:data rom:0x16C8E4 filemenu_pressedButtons = 0x8024C084; // type:data rom:0x16C8E4
filemenu_8024C088 = 0x8024C088; // type:data rom:0x16C8E8 filemenu_cursorHudElem = 0x8024C088; // type:data rom:0x16C8E8
filemenu_heldButtons = 0x8024C08C; // type:data rom:0x16C8EC filemenu_heldButtons = 0x8024C08C; // type:data rom:0x16C8EC
filemenu_8024C090 = 0x8024C090; // type:data rom:0x16C8F0 filemenu_filename_pos = 0x8024C090; // type:data rom:0x16C8F0
filemenu_loadedFileIdx = 0x8024C094; // type:data rom:0x16C8F4 filemenu_loadedFileIdx = 0x8024C094; // type:data rom:0x16C8F4
filemenu_8024C098 = 0x8024C098; // type:data rom:0x16C8F8 filemenu_currentMenu = 0x8024C098; // type:data rom:0x16C8F8
filemenu_8024C09C = 0x8024C09C; // type:data rom:0x16C8FC filemenu_8024C09C = 0x8024C09C; // type:data rom:0x16C8FC
filemenu_cursorHudElemID = 0x8024C0A0; // type:data rom:0x16C900 filemenu_cursorHudElemID = 0x8024C0A0; // type:data rom:0x16C900
filemenu_8024C0A4 = 0x8024C0A4; // type:data rom:0x16C904 filemenu_8024C0A4 = 0x8024C0A4; // type:data rom:0x16C904
filemenu_hudElemIDs = 0x8024C0B0; // type:data rom:0x16C910 filemenu_hudElemIDs = 0x8024C0B0; // type:data rom:0x16C910
filemenu_8024C100 = 0x8024C100; // type:data rom:0x16C960 filemenu_createfile_hudElems = 0x8024C100; // type:data rom:0x16C960
filemenu_8024C110 = 0x8024C110; // type:data rom:0x16C970 filemenu_filename = 0x8024C110; // type:data rom:0x16C970
func_8023E104 = 0x8023E104; // type:func rom:0x16C9E4 func_8023E104 = 0x8023E104; // type:func rom:0x16C9E4
func_8023E11C = 0x8023E11C; // type:func rom:0x16C9FC func_8023E11C = 0x8023E11C; // type:func rom:0x16C9FC
initialize_battle = 0x8023E130; // type:func rom:0x16CA10 initialize_battle = 0x8023E130; // type:func rom:0x16CA10
@ -26329,12 +26328,8 @@ D_8024BEA0 = 0x8024BEA0; // type:data
D_8024C068 = 0x8024C068; // type:data D_8024C068 = 0x8024C068; // type:data
filemenu_iterFileIdx = 0x8024C080; // type:data filemenu_iterFileIdx = 0x8024C080; // type:data
D_8024C088 = 0x8024C088; // type:data D_8024C088 = 0x8024C088; // type:data
D_8024C090 = 0x8024C090; // type:data
filemenu_8024C098 = 0x8024C098; // type:data
D_8024C100 = 0x8024C100; // type:data D_8024C100 = 0x8024C100; // type:data
D_8024C108 = 0x8024C108; // type:data
D_8024C110 = 0x8024C110; // type:data D_8024C110 = 0x8024C110; // type:data
D_8024C117 = 0x8024C117; // type:data
D_8024C1D8 = 0x8024C1D8; // type:data D_8024C1D8 = 0x8024C1D8; // type:data
sam_06_LetterDelivery_SavedNpcAnim = 0x8024C1D8; // type:data sam_06_LetterDelivery_SavedNpcAnim = 0x8024C1D8; // type:data
D_8024C5E0 = 0x8024C5E0; // type:data D_8024C5E0 = 0x8024C5E0; // type:data

View File

@ -649,10 +649,7 @@ hos_03_Quizmo_VannaTEffect = 0x8024BDF8;
D_8024BEA0 = 0x8024BEA0; D_8024BEA0 = 0x8024BEA0;
D_8024C068 = 0x8024C068; D_8024C068 = 0x8024C068;
D_8024C088 = 0x8024C088; D_8024C088 = 0x8024C088;
D_8024C090 = 0x8024C090;
D_8024C108 = 0x8024C108;
D_8024C110 = 0x8024C110; D_8024C110 = 0x8024C110;
D_8024C117 = 0x8024C117;
D_8024C1D8 = 0x8024C1D8; D_8024C1D8 = 0x8024C1D8;
D_8024C5E0 = 0x8024C5E0; D_8024C5E0 = 0x8024C5E0;
D_8024DBC0 = 0x8024DBC0; D_8024DBC0 = 0x8024DBC0;