MenuItem struct names and some rename

This commit is contained in:
AloXado320 2024-10-18 20:03:59 -05:00
parent 8050db3edd
commit d797a978fc
5 changed files with 968 additions and 963 deletions

View File

@ -84,7 +84,7 @@ glabel D_800F15E0
.section .text
glabel add_ui_element
glabel load_menu_item_ui
/* 09F250 8009E650 27BDFF80 */ addiu $sp, $sp, -0x80
/* 09F254 8009E654 AFBF001C */ sw $ra, 0x1c($sp)
/* 09F258 8009E658 AFA7008C */ sw $a3, 0x8c($sp)
@ -167,15 +167,15 @@ glabel add_ui_element
/* 09F370 8009E770 00000000 */ nop
glabel L8009E774
/* 09F374 8009E774 44802000 */ mtc1 $zero, $f4
/* 09F378 8009E778 3C018019 */ lui $at, %hi(s8018ED94) # $at, 0x8019
/* 09F37C 8009E77C AC20ED94 */ sw $zero, %lo(s8018ED94)($at)
/* 09F380 8009E780 3C01800F */ lui $at, %hi(D_800E8530) # $at, 0x800f
/* 09F384 8009E784 E4248530 */ swc1 $f4, %lo(D_800E8530)($at)
/* 09F378 8009E778 3C018019 */ lui $at, %hi(sIntroModelTimer) # $at, 0x8019
/* 09F37C 8009E77C AC20ED94 */ sw $zero, %lo(sIntroModelTimer)($at)
/* 09F380 8009E780 3C01800F */ lui $at, %hi(sIntroModelMotionSpeed) # $at, 0x800f
/* 09F384 8009E784 E4248530 */ swc1 $f4, %lo(sIntroModelMotionSpeed)($at)
/* 09F388 8009E788 3C014040 */ li $at, 0x40400000 # 3.000000
/* 09F38C 8009E78C 44813000 */ mtc1 $at, $f6
/* 09F390 8009E790 3C01800F */ lui $at, %hi(D_800E8534) # $at, 0x800f
/* 09F390 8009E790 3C01800F */ lui $at, %hi(sIntroModelSpeed) # $at, 0x800f
/* 09F394 8009E794 44800000 */ mtc1 $zero, $f0
/* 09F398 8009E798 E4268534 */ swc1 $f6, %lo(D_800E8534)($at)
/* 09F398 8009E798 E4268534 */ swc1 $f6, %lo(sIntroModelSpeed)($at)
/* 09F39C 8009E79C 3C018019 */ lui $at, %hi(gIntroModelZEye) # $at, 0x8019
/* 09F3A0 8009E7A0 241909C4 */ li $t9, 2500
/* 09F3A4 8009E7A4 AC39EDC0 */ sw $t9, %lo(gIntroModelZEye)($at)

View File

@ -122,7 +122,7 @@ glabel D_800F1AFC
.section .text
glabel menu_item_render
glabel render_menus
/* 0A01E0 8009F5E0 27BDFF50 */ addiu $sp, $sp, -0xb0
/* 0A01E4 8009F5E4 AFBF0034 */ sw $ra, 0x34($sp)
/* 0A01E8 8009F5E8 AFB10030 */ sw $s1, 0x30($sp)

File diff suppressed because it is too large Load Diff

View File

@ -22,21 +22,21 @@ it last longer See `func_80096CD8` for the actual drawing of the static
*/
typedef struct {
/* 0x00 */ s32 type; // id maybe?
/* 0x04 */ s32 state; // sound mode, maybe some other stuff
/* 0x08 */ s32 unk8; // This is used but I can't tell what for
/* 0x00 */ s32 type; // id maybe?
/* 0x04 */ s32 state; // sound mode, maybe some other stuff
/* 0x08 */ s32 subState; // This is used but I can't tell what for
/* 0x0C */ s32 column;
/* 0x10 */ s32 row;
/* 0x14 */ u8 priority; // priority/depth/z-level. Higher values are drawn on top of lower values
// If equal, later entries in gMenuItems are on top
/* 0x15 */ bool8 visible; // active? If 1 its displayed, if 0 its not
// These seem to be generic space available for use by the struct, no 1 purpose for any given member
/* 0x16 */ s16 unk16; // Potentially unused
/* 0x16 */ s16 unused; // Unused
/* 0x18 */ s32 D_8018DEE0_index; // Index in D_8018DEE0, an array of some other struct type
/* 0x1C */ s32 unk1C; // Multi use. Sometimes cup selection, sometimes course index.
/* 0x20 */ s32 unk20; // Multi use, hard to tell what for though. Sometimes a random number, sometimes GP points
/* 0x24 */ f32 unk24; // Multi use, x scaling for some things, rotation multiplier for the question box in some
// menus, probably some other things
/* 0x1C */ s32 param1; // Multi use. Sometimes cup selection, sometimes course index.
/* 0x20 */ s32 param2; // Multi use, hard to tell what for though. Sometimes a random number, sometimes GP points
/* 0x24 */ f32 paramf; // Multi use, x scaling for some things, rotation multiplier for the question box in some
// menus, probably some other things
} MenuItem; // size = 0x28
typedef struct {
@ -50,7 +50,7 @@ typedef struct {
typedef struct {
/* 0x0 */ MenuTexture* texture;
/* 0x4 */ s32 unk_4;
/* 0x4 */ s32 texNum;
} struct_8018E060_entry; // size = 0x8
typedef struct {
@ -90,19 +90,23 @@ typedef struct {
} Unk_D_800E70A0; // size = 0x08
enum MENU_ITEMpriority {
MENU_ITEM_PRIORITY_0,
MENU_ITEM_PRIORITY_1,
MENU_ITEM_PRIORITY_2,
MENU_ITEM_PRIORITY_3,
MENU_ITEM_PRIORITY_4,
MENU_ITEM_PRIORITY_5,
MENU_ITEM_PRIORITY_6,
MENU_ITEM_PRIORITY_7,
MENU_ITEM_PRIORITY_8,
MENU_ITEM_PRIORITY_9,
MENU_ITEM_PRIORITY_A,
MENU_ITEM_PRIORITY_B,
MENU_ITEM_PRIORITY_C
MENU_ITEM_UI_PRIO_0,
MENU_ITEM_UI_PRIO_1,
MENU_ITEM_UI_PRIO_2,
MENU_ITEM_UI_PRIO_3,
MENU_ITEM_UI_PRIO_4,
MENU_ITEM_UI_PRIO_5,
MENU_ITEM_UI_PRIO_6,
MENU_ITEM_UI_PRIO_7,
MENU_ITEM_UI_PRIO_8,
MENU_ITEM_UI_PRIO_9,
MENU_ITEM_UI_PRIO_A,
MENU_ITEM_UI_PRIO_B,
MENU_ITEM_UI_PRIO_C,
MENU_ITEM_UI_PRIO_D,
MENU_ITEM_UI_PRIO_E,
MENU_ITEM_UI_PRIO_F,
MENU_ITEM_UI_PRIO_MAX // 0x10
};
enum CenterText { LEFT_TEXT = 1, CENTER_TEXT_MODE_1, RIGHT_TEXT, CENTER_TEXT_MODE_2 };
@ -238,7 +242,7 @@ enum MENU_ITEMtype {
MENU_ITEM_TYPE_0EA,
MENU_ITEM_TYPE_0F0 = 0xF0,
MENU_ITEM_TYPE_0F1,
LOGO_INTRO_MENU_LOGO = 0xFA,
MENU_ITEM_UI_LOGO_INTRO = 0xFA,
START_MENU_FLAG,
MENU_ITEM_TYPE_10E = 0x10E,
MENU_ITEM_TYPE_12B = 0X12B,
@ -384,7 +388,7 @@ void func_800942D0(void);
void func_80094660(struct GfxPool*, s32);
void render_checkered_flag(struct GfxPool*, s32);
void func_80094A64(struct GfxPool*);
void render_menus(void);
void load_menus(void);
void func_80095574(void);
Gfx* draw_flash_select_case(Gfx*, s32, s32, s32, s32, s32);
Gfx* draw_flash_select_case_slow(Gfx*, s32, s32, s32, s32);
@ -482,8 +486,8 @@ void func_8009E2F0(s32);
void func_8009E5BC(void);
void func_8009E5FC(s32);
void func_8009E620(void);
void add_ui_element(s32, s32, s32, s8);
void menu_item_render(MenuItem*);
void load_menu_item_ui(s32, s32, s32, s8);
void render_menus(MenuItem*);
void func_800A08D8(u8, s32, s32);
s32 func_800A095C(char*, s32, s32, s32);
void func_800A09E0(MenuItem*);
@ -546,9 +550,9 @@ void get_time_record_minutes(s32, char*);
void get_time_record_seconds(s32, char*);
void get_time_record_centiseconds(s32, char*);
void func_800A79F4(s32, char*);
void func_800A7A4C(s32);
void func_800A8230(void);
void func_800A8250(void);
void handle_menus_with_pri_arg(s32);
void handle_menus_default(void);
void handle_menus_special(void);
void func_800A8270(s32, MenuItem*);
void func_800A8564(MenuItem*);
void func_800A86E8(MenuItem*);
@ -830,8 +834,8 @@ extern Gfx* D_800E84CC[];
extern Gfx* D_800E84EC[];
extern Gfx* D_800E850C[];
extern s8 D_800E852C;
extern f32 D_800E8530;
extern f32 D_800E8534;
extern f32 sIntroModelMotionSpeed;
extern f32 sIntroModelSpeed;
extern Unk_D_800E70A0 D_800E8538[];
extern Unk_D_800E70A0 D_800E8540[];
extern Unk_D_800E70A0 D_800E85C0[];

View File

@ -264,20 +264,20 @@ void options_menu_act(struct Controller* controller, u16 controllerIdx) {
if ((btnAndStick & D_JPAD) && (gSubMenuSelection < SUB_MENU_OPTION_MAX)) {
gSubMenuSelection += 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp38->unk24 < 4.2) {
sp38->unk24 += 4.0;
if (sp38->paramf < 4.2) {
sp38->paramf += 4.0;
}
sp38->unk8 = 1;
sp38->subState = 1;
tempVar = true;
}
if ((btnAndStick & U_JPAD) && (gSubMenuSelection > SUB_MENU_OPTION_MIN)) {
gSubMenuSelection -= 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp38->unk24 < 4.2) {
sp38->unk24 += 4.0;
if (sp38->paramf < 4.2) {
sp38->paramf += 4.0;
}
tempVar = true;
sp38->unk8 = -1;
sp38->subState = -1;
}
if (tempVar && gSoundMode != sp38->state) {
gSaveData.main.saveInfo.soundMode = gSoundMode;
@ -403,18 +403,18 @@ void options_menu_act(struct Controller* controller, u16 controllerIdx) {
if ((btnAndStick & D_JPAD) && (gSubMenuSelection < SUB_MENU_ERASE_MAX)) {
gSubMenuSelection += 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp38->unk24 < 4.2) {
sp38->unk24 += 4.0;
if (sp38->paramf < 4.2) {
sp38->paramf += 4.0;
}
sp38->unk8 = 1;
sp38->subState = 1;
}
if ((btnAndStick & U_JPAD) && (gSubMenuSelection > SUB_MENU_ERASE_MIN)) {
gSubMenuSelection -= 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp38->unk24 < 4.2) {
sp38->unk24 += 4.0;
if (sp38->paramf < 4.2) {
sp38->paramf += 4.0;
}
sp38->unk8 = -1;
sp38->subState = -1;
}
if (btnAndStick & B_BUTTON) {
gSubMenuSelection = SUB_MENU_OPTION_ERASE_ALL_DATA;
@ -450,19 +450,19 @@ void options_menu_act(struct Controller* controller, u16 controllerIdx) {
(sp30[PLAYER_TWO].ghostDataSaved)) {
gSubMenuSelection += 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp38->unk24 < 4.2) {
sp38->unk24 += 4.0;
if (sp38->paramf < 4.2) {
sp38->paramf += 4.0;
}
sp38->unk8 = 1;
sp38->subState = 1;
}
if ((btnAndStick & U_JPAD) && (gSubMenuSelection > SUB_MENU_COPY_PAK_FROM_GHOST_MIN) &&
sp30[PLAYER_ONE].ghostDataSaved) {
gSubMenuSelection -= 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp38->unk24 < 4.2) {
sp38->unk24 += 4.0;
if (sp38->paramf < 4.2) {
sp38->paramf += 4.0;
}
sp38->unk8 = -1;
sp38->subState = -1;
}
if (btnAndStick & B_BUTTON) {
gSubMenuSelection = SUB_MENU_OPTION_COPY_CONTROLLER_PAK;
@ -470,8 +470,8 @@ void options_menu_act(struct Controller* controller, u16 controllerIdx) {
return;
}
if (btnAndStick & A_BUTTON) {
sp38->unk20 = gSubMenuSelection - SUB_MENU_COPY_PAK_FROM_GHOST_MIN;
if (sp30[sp38->unk20].courseIndex == D_8018EE10[PLAYER_TWO].courseIndex &&
sp38->param2 = gSubMenuSelection - SUB_MENU_COPY_PAK_FROM_GHOST_MIN;
if (sp30[sp38->param2].courseIndex == D_8018EE10[PLAYER_TWO].courseIndex &&
D_8018EE10[PLAYER_TWO].ghostDataSaved) {
gSubMenuSelection = SUB_MENU_COPY_PAK_TO_GHOST2_2P;
} else {
@ -484,32 +484,32 @@ void options_menu_act(struct Controller* controller, u16 controllerIdx) {
case SUB_MENU_COPY_PAK_TO_GHOST1_2P:
case SUB_MENU_COPY_PAK_TO_GHOST2_2P: {
// bit of a fake match, but if it works it works?
if ((sp30[sp38->unk20].courseIndex !=
if ((sp30[sp38->param2].courseIndex !=
((0, (D_8018EE10 + (gSubMenuSelection - SUB_MENU_COPY_PAK_TO_GHOST_MIN))->courseIndex))) ||
((D_8018EE10 + (gSubMenuSelection - SUB_MENU_COPY_PAK_TO_GHOST_MIN))->ghostDataSaved == 0)) {
if ((btnAndStick & D_JPAD) && (gSubMenuSelection < SUB_MENU_COPY_PAK_TO_GHOST_MAX)) {
gSubMenuSelection += 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp38->unk24 < 4.2) {
sp38->unk24 += 4.0;
if (sp38->paramf < 4.2) {
sp38->paramf += 4.0;
}
sp38->unk8 = 1;
sp38->subState = 1;
}
if ((btnAndStick & U_JPAD) && (gSubMenuSelection > SUB_MENU_COPY_PAK_TO_GHOST_MIN)) {
gSubMenuSelection -= 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp38->unk24 < 4.2) {
sp38->unk24 += 4.0;
if (sp38->paramf < 4.2) {
sp38->paramf += 4.0;
}
sp38->unk8 = -1;
sp38->subState = -1;
}
}
if (btnAndStick & B_BUTTON) {
gSubMenuSelection = sp38->unk20 + SUB_MENU_COPY_PAK_FROM_GHOST_MIN;
gSubMenuSelection = sp38->param2 + SUB_MENU_COPY_PAK_FROM_GHOST_MIN;
play_sound2(SOUND_MENU_GO_BACK);
} else if (btnAndStick & A_BUTTON) {
sp38->unk1C = gSubMenuSelection - SUB_MENU_COPY_PAK_TO_GHOST_MIN;
if (D_8018EE10[(sp38->unk1C)].ghostDataSaved) {
sp38->param1 = gSubMenuSelection - SUB_MENU_COPY_PAK_TO_GHOST_MIN;
if (D_8018EE10[(sp38->param1)].ghostDataSaved) {
gSubMenuSelection = SUB_MENU_COPY_PAK_PROMPT_QUIT;
} else {
gSubMenuSelection = SUB_MENU_COPY_PAK_START;
@ -540,21 +540,21 @@ void options_menu_act(struct Controller* controller, u16 controllerIdx) {
if ((btnAndStick & R_JPAD) && gSubMenuSelection < SUB_MENU_COPY_PAK_PROMPT_MAX) {
gSubMenuSelection += 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp38->unk24 < 4.2) {
sp38->unk24 += 4.0;
if (sp38->paramf < 4.2) {
sp38->paramf += 4.0;
}
sp38->unk8 = 1;
sp38->subState = 1;
}
if ((btnAndStick & L_JPAD) && gSubMenuSelection > SUB_MENU_COPY_PAK_PROMPT_MIN) {
gSubMenuSelection -= 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp38->unk24 < 4.2) {
sp38->unk24 += 4.0;
if (sp38->paramf < 4.2) {
sp38->paramf += 4.0;
}
sp38->unk8 = -1;
sp38->subState = -1;
}
if (btnAndStick & B_BUTTON) {
gSubMenuSelection = sp38->unk1C + SUB_MENU_COPY_PAK_TO_GHOST_MIN;
gSubMenuSelection = sp38->param1 + SUB_MENU_COPY_PAK_TO_GHOST_MIN;
play_sound2(SOUND_MENU_GO_BACK);
return;
}
@ -583,7 +583,7 @@ void options_menu_act(struct Controller* controller, u16 controllerIdx) {
case SUB_MENU_COPY_PAK_COPYING: {
res = controller_pak_2_status();
if (res == PFS_NO_ERROR) {
res = func_800B65F4(sp38->unk20, sp38->unk1C);
res = func_800B65F4(sp38->param2, sp38->param1);
}
if (res != 0) {
gSubMenuSelection = SUB_MENU_COPY_PAK_UNABLE_READ_FROM_2P;
@ -593,7 +593,7 @@ void options_menu_act(struct Controller* controller, u16 controllerIdx) {
res = osPfsFindFile(&gControllerPak1FileHandle, gCompanyCode, gGameCode, (u8*) gGameName,
(u8*) gExtCode, &gControllerPak1FileNote);
if (res == PFS_NO_ERROR) {
res = func_800B6178(sp38->unk1C);
res = func_800B6178(sp38->param1);
}
if (res != 0) {
gSubMenuSelection = SUB_MENU_COPY_PAK_UNABLE_COPY_FROM_1P;
@ -601,8 +601,8 @@ void options_menu_act(struct Controller* controller, u16 controllerIdx) {
return;
}
gSubMenuSelection = SUB_MENU_COPY_PAK_COMPLETED;
D_8018EE10[sp38->unk1C].courseIndex = (sp30 + sp38->unk20)->courseIndex;
func_800B6088(sp38->unk1C);
D_8018EE10[sp38->param1].courseIndex = (sp30 + sp38->param2)->courseIndex;
func_800B6088(sp38->param1);
break;
}
case SUB_MENU_COPY_PAK_CREATE_GAME_DATA_INIT: {
@ -740,10 +740,10 @@ void course_data_menu_act(struct Controller* controller, UNUSED u16 controllerId
gCourseRecordsMenuSelection -= 1;
}
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp28->unk24 < 4.2) {
sp28->unk24 += 4.0;
if (sp28->paramf < 4.2) {
sp28->paramf += 4.0;
}
sp28->unk8 = -1;
sp28->subState = -1;
}
if ((btnAndStick & D_JPAD) && (gCourseRecordsMenuSelection < COURSE_RECORDS_MENU_MAX)) {
@ -762,10 +762,10 @@ void course_data_menu_act(struct Controller* controller, UNUSED u16 controllerId
}
} else {
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp28->unk24 < 4.2) {
sp28->unk24 += 4.0;
if (sp28->paramf < 4.2) {
sp28->paramf += 4.0;
}
sp28->unk8 = 1;
sp28->subState = 1;
}
}
@ -773,8 +773,8 @@ void course_data_menu_act(struct Controller* controller, UNUSED u16 controllerId
func_8009E208();
play_sound2(SOUND_MENU_GO_BACK);
} else if (btnAndStick & A_BUTTON) {
if (sp28->unk24 < 4.2) {
sp28->unk24 += 4.0;
if (sp28->paramf < 4.2) {
sp28->paramf += 4.0;
}
if (gCourseRecordsMenuSelection == COURSE_RECORDS_MENU_RETURN_MENU) {
func_8009E208();
@ -792,19 +792,19 @@ void course_data_menu_act(struct Controller* controller, UNUSED u16 controllerId
if ((btnAndStick & U_JPAD) && (gCourseRecordsSubMenuSelection > COURSE_RECORDS_SUB_MENU_MIN)) {
gCourseRecordsSubMenuSelection -= 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp28->unk24 < 4.2) {
sp28->unk24 += 4.0;
if (sp28->paramf < 4.2) {
sp28->paramf += 4.0;
}
sp28->unk8 = -1;
sp28->subState = -1;
}
if ((btnAndStick & D_JPAD) && (gCourseRecordsSubMenuSelection < COURSE_RECORDS_SUB_MENU_MAX)) {
gCourseRecordsSubMenuSelection += 1;
play_sound2(SOUND_MENU_CURSOR_MOVE);
if (sp28->unk24 < 4.2) {
sp28->unk24 += 4.0;
if (sp28->paramf < 4.2) {
sp28->paramf += 4.0;
}
sp28->unk8 = 1;
sp28->subState = 1;
}
if (btnAndStick & B_BUTTON) {