From 88eac1d045c1025e4562f3b646e8d554709b1932 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Tue, 15 Sep 2020 17:48:42 +1000 Subject: [PATCH] Decompile menuRenderItemModel --- src/game/cheats.c | 12 ++-- src/game/data/data_01a3a0.c | 48 ++++++------- src/game/data/data_02a0e0.c | 70 +++++++++--------- src/game/game_0e5ce0.c | 128 +++++++++------------------------ src/game/game_0f09f0.c | 17 ++--- src/game/game_102240.c | 46 ++++++------ src/game/game_107fb0.c | 2 +- src/game/game_177e00.c | 6 +- src/include/constants.h | 1 + src/include/game/game_0e5ce0.h | 2 +- src/include/game/game_177e00.h | 16 ++--- src/include/types.h | 17 ++++- 12 files changed, 159 insertions(+), 206 deletions(-) diff --git a/src/game/cheats.c b/src/game/cheats.c index d916db51a..4163ede70 100644 --- a/src/game/cheats.c +++ b/src/game/cheats.c @@ -870,12 +870,12 @@ struct menudialog g_CheatsBuddiesMenuDialog = { }; struct menuitem g_CheatsMenuItems[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(118), 0x00000000, &g_CheatsFunMenuDialog }, // "Fun" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(119), 0x00000000, &g_CheatsGameplayMenuDialog }, // "Gameplay" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(122), 0x00000000, &g_CheatsSoloWeaponsMenuDialog }, // "Weapons for Jo in Solo" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(123), 0x00000000, &g_CheatsClassicWeaponsMenuDialog }, // "Classic Weapons for Jo in Solo" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(120), 0x00000000, &g_CheatsWeaponsMenuDialog }, // "Weapons" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(121), 0x00000000, &g_CheatsBuddiesMenuDialog }, // "Buddies" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(118), 0x00000000, (void *)&g_CheatsFunMenuDialog }, // "Fun" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(119), 0x00000000, (void *)&g_CheatsGameplayMenuDialog }, // "Gameplay" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(122), 0x00000000, (void *)&g_CheatsSoloWeaponsMenuDialog }, // "Weapons for Jo in Solo" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(123), 0x00000000, (void *)&g_CheatsClassicWeaponsMenuDialog }, // "Classic Weapons for Jo in Solo" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(120), 0x00000000, (void *)&g_CheatsWeaponsMenuDialog }, // "Weapons" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(121), 0x00000000, (void *)&g_CheatsBuddiesMenuDialog }, // "Buddies" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000096, 0x00000000, NULL }, { MENUITEMTYPE_SELECTABLE, 0, 0x00000000, L_MPWEAPONS(217), 0x00000000, cheatMenuHandleTurnOffAllCheats }, // "Turn off all Cheats" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000096, 0x00000000, NULL }, diff --git a/src/game/data/data_01a3a0.c b/src/game/data/data_01a3a0.c index 3d5eb96a4..bc8bf2e61 100644 --- a/src/game/data/data_01a3a0.c +++ b/src/game/data/data_01a3a0.c @@ -32,7 +32,7 @@ struct menuitem menuitems_gamefiles2[] = { { MENUITEMTYPE_SELECTABLE, 1, 0x00000000, L_OPTIONS(104), 0x00000000, menuhandlerOpenDeleteFile }, // "Combat Simulator Settings File" { MENUITEMTYPE_SELECTABLE, 2, 0x00000000, L_OPTIONS(105), 0x00000000, menuhandlerOpenDeleteFile }, // "Combat Simulator Player File" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(102), 0x00000000, &menudialog_controllerpakmenu }, // "Delete Game Notes..." + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(102), 0x00000000, (void *)&menudialog_controllerpakmenu }, // "Delete Game Notes..." { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -87,12 +87,12 @@ struct menudialog menudialog_1b00c = { // 1b024 struct menuitem menuitems_mpplayersetup[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(30), (u32)&mpGetCurrentPlayerName, &menudialog_mpplayername }, // "Name" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(33), 0x00000000, &menudialog_mpcontrol }, // "Control" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(34), 0x00000000, &menudialog_mpoptions }, // "Player Options" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(35), 0x00000000, &menudialog_mpplayerstats }, // "Statistics" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(30), (u32)&mpGetCurrentPlayerName, (void *)&menudialog_mpplayername }, // "Name" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(33), 0x00000000, (void *)&menudialog_mpcontrol }, // "Control" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(34), 0x00000000, (void *)&menudialog_mpoptions }, // "Player Options" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(35), 0x00000000, (void *)&menudialog_mpplayerstats }, // "Statistics" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(29), 0x00000000, &menudialog_mploadplayer }, // "Load Player" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(29), 0x00000000, (void *)&menudialog_mploadplayer }, // "Load Player" { MENUITEMTYPE_SELECTABLE, 0, 0x00000000, (u32)&mpMenuTextSavePlayerOrCopy, 0x00000000, menuhandlerMpSavePlayer }, { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -111,10 +111,10 @@ struct menudialog menudialog_mpdropout; // 1b0dc struct menuitem menuitems_mpquickgo2[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MISC(456), 0x00000000, &g_MpReadyMenuDialog }, // "Start Game" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(29), 0x00000000, &menudialog_mploadplayer }, // "Load Player" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MISC(458), 0x00000000, &menudialog_mpplayersetup }, // "Player Settings" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MISC(457), 0x00000000, &menudialog_mpdropout }, // "Drop Out" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MISC(456), 0x00000000, (void *)&g_MpReadyMenuDialog }, // "Start Game" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(29), 0x00000000, (void *)&menudialog_mploadplayer }, // "Load Player" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MISC(458), 0x00000000, (void *)&menudialog_mpplayersetup }, // "Player Settings" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MISC(457), 0x00000000, (void *)&menudialog_mpdropout }, // "Drop Out" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -165,13 +165,13 @@ struct menudialog menudialog_mpcombatchallenges = { // 1b214 struct menuitem menuitems_smallbutperfectmenu[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_MISC(441), 0x00000000, &menudialog_mpcombatchallenges }, // "Challenges" - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_MISC(442), 0x00000001, &menudialog_mploadgamesettingstype1 }, // "Load/Preset Games" - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_MISC(443), 0x00000002, &menudialog_mpquickteam }, // "Quick Start" + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_MISC(441), 0x00000000, (void *)&menudialog_mpcombatchallenges }, // "Challenges" + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_MISC(442), 0x00000001, (void *)&menudialog_mploadgamesettingstype1 }, // "Load/Preset Games" + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_MISC(443), 0x00000002, (void *)&menudialog_mpquickteam }, // "Quick Start" { MENUITEMTYPE_SELECTABLE, 0, 0x00400000, L_MISC(444), 0x00000003, menuhandler4MbAdvancedSetup }, // "Advanced Setup" - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(305), 0x00000000, &menudialog_1b00c }, // "Audio/Video" + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(305), 0x00000000, (void *)&menudialog_1b00c }, // "Audio/Video" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000082, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(306), 0x00000000, &menudialog_changeagent }, // "Change Agent" + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(306), 0x00000000, (void *)&menudialog_changeagent }, // "Change Agent" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -243,19 +243,19 @@ struct menudialog g_MpEditSimulant4MbMenuDialog = { // 1b42c struct menuitem menuitems_mpgamesetup[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00020004, L_MPMENU(19), (u32)&mpMenuTextScenarioShortName, &menudialog_mpscenario }, // "Scenario" + { MENUITEMTYPE_SELECTABLE, 0, 0x00020004, L_MPMENU(19), (u32)&mpMenuTextScenarioShortName, (void *)&menudialog_mpscenario }, // "Scenario" { MENUITEMTYPE_SELECTABLE, 0, 0x00000000, L_MPMENU(21), 0x00000000, menuhandlerMpOpenOptions }, // "Options" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(20), (u32)&mpMenuTextArenaName, &menudialog_mparena }, // "Arena" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(20), (u32)&mpMenuTextArenaName, (void *)&menudialog_mparena }, // "Arena" { MENUITEMTYPE_DROPDOWN, 0, 0x00020000, L_MPMENU(44), 0x00000000, menuhandlerMpLock }, // "Lock" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000082, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(23), 0x00000000, &menudialog_mpweapons }, // "Weapons" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(24), 0x00000000, &menudialog_mplimits }, // "Limits" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(184), 0x00000000, &menudialog_mpplayerhandicaps }, // "Player Handicaps" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(25), 0x00000000, &menudialog_mpsimulants }, // "Simulants" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(22), 0x00000000, &menudialog_mpteamcontrol }, // "Teams" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(23), 0x00000000, (void *)&menudialog_mpweapons }, // "Weapons" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(24), 0x00000000, (void *)&menudialog_mplimits }, // "Limits" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(184), 0x00000000, (void *)&menudialog_mpplayerhandicaps }, // "Player Handicaps" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(25), 0x00000000, (void *)&menudialog_mpsimulants }, // "Simulants" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(22), 0x00000000, (void *)&menudialog_mpteamcontrol }, // "Teams" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000082, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(36), 0x00000000, &g_MpReadyMenuDialog }, // "Start Game" - { MENUITEMTYPE_SELECTABLE, 0, 0x00060004, L_MPMENU(18), 0x00000000, &menudialog_mploadgamesettingstype0 }, // "Load Settings" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(36), 0x00000000, (void *)&g_MpReadyMenuDialog }, // "Start Game" + { MENUITEMTYPE_SELECTABLE, 0, 0x00060004, L_MPMENU(18), 0x00000000, (void *)&menudialog_mploadgamesettingstype0 }, // "Load Settings" { MENUITEMTYPE_SELECTABLE, 0, 0x00060000, L_MPMENU(26), 0x00000000, menuhandlerMpSaveSettings }, // "Save Settings" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; diff --git a/src/game/data/data_02a0e0.c b/src/game/data/data_02a0e0.c index b6de764cc..d04fe6ad6 100644 --- a/src/game/data/data_02a0e0.c +++ b/src/game/data/data_02a0e0.c @@ -469,7 +469,7 @@ struct menuitem g_MpPauseControlMenuItems[] = { { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000082, 0x00000000, NULL }, { MENUITEMTYPE_LABEL, 0, 0x00000000, L_MPMENU(286), (u32)&menutextMatchTime, NULL }, // "Game Time:" { MENUITEMTYPE_SELECTABLE, 1, 0x00000020, (u32)&menutextPauseOrUnpause, 0x00000000, menuhandlerMpPause }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00000024, L_MPMENU(287), 0x00000000, &g_MpEndGameMenuDialog }, // "End Game" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000024, L_MPMENU(287), 0x00000000, (void *)&g_MpEndGameMenuDialog }, // "End Game" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -698,7 +698,7 @@ struct menudialog g_MpEndscreenConfirmPlayerNameMenuDialog = { // 2aae4 struct menuitem g_MpEndscreenSavePlayerMenuItems[] = { { MENUITEMTYPE_LABEL, 0, 0x00000010, L_MPWEAPONS(247), 0x00000000, NULL }, // "Save new player and statistics?" - { MENUITEMTYPE_SELECTABLE, 0, 0x0000002c, L_MPWEAPONS(248), 0x00000000, &g_MpEndscreenConfirmPlayerNameMenuDialog }, // "Save Now" + { MENUITEMTYPE_SELECTABLE, 0, 0x0000002c, L_MPWEAPONS(248), 0x00000000, (void *)&g_MpEndscreenConfirmPlayerNameMenuDialog }, // "Save Now" { MENUITEMTYPE_SELECTABLE, 0, 0x00000028, L_MPWEAPONS(249), 0x00000000, NULL }, // "No Thanks!" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -1218,7 +1218,7 @@ struct menudialog menudialog_mpsimulantcharacter = { struct menuitem menuitems_mpeditsimulant[] = { { MENUITEMTYPE_DROPDOWN, 0, 0x00020000, L_MPMENU(95), 0x00000000, menuhandlerMpSimulantDifficulty }, // "Difficulty:" { MENUITEMTYPE_SELECTABLE, 0, 0x00000000, L_MPMENU(96), 0x00000000, menuhandlerMpChangeSimulantType }, // "Change Type..." - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(97), 0x00000000, &menudialog_mpsimulantcharacter }, // "Character..." + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(97), 0x00000000, (void *)&menudialog_mpsimulantcharacter }, // "Character..." { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_MPMENU(98), 0x00000000, menuhandlerMpDeleteSimulant }, // "Delete Simulant" { MENUITEMTYPE_SELECTABLE, 0, 0x00000008, L_MPMENU(99), 0x00000000, NULL }, // "Back" @@ -1310,7 +1310,7 @@ struct menuitem menuitems_mpteamcontrol[] = { { MENUITEMTYPE_DROPDOWN, 10, 0x00020000, (u32)&mpMenuTextChrNameForTeamSetup, 0x00000000, menuhandlerMpTeamSlot }, { MENUITEMTYPE_DROPDOWN, 11, 0x00020000, (u32)&mpMenuTextChrNameForTeamSetup, 0x00000000, menuhandlerMpTeamSlot }, { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(73), 0x00000000, &menudialog_mpautoteam }, // "Auto Team..." + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(73), 0x00000000, (void *)&menudialog_mpautoteam }, // "Auto Team..." { MENUITEMTYPE_SELECTABLE, 0, 0x00000008, L_MPMENU(74), 0x00000000, NULL }, // "Back" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -1351,7 +1351,7 @@ struct menuitem menuitems_mpsoundtrack[] = { { MENUITEMTYPE_LABEL, 0, 0x00000000, L_MPMENU(63), 0x00000000, NULL }, // "Current:" { MENUITEMTYPE_LABEL, 0, 0x00000000, L_OPTIONS(3), (u32)&mpMenuTextCurrentTrack, NULL }, // "" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, (u32)&mpMenuTextSelectTuneOrTunes, 0x00000000, &menudialog_2bd40 }, + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, (u32)&mpMenuTextSelectTuneOrTunes, 0x00000000, (void *)&menudialog_2bd40 }, { MENUITEMTYPE_CHECKBOX, 0, 0x00020000, L_MPMENU(64), 0x00000000, menuhandlerMpMultipleTunes }, // "Multiple Tunes" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, { MENUITEMTYPE_SELECTABLE, 0, 0x00000008, L_MPMENU(65), 0x00000000, NULL }, // "Back" @@ -1507,16 +1507,16 @@ struct menudialog menudialog_mpabort2; // 2c12c struct menuitem menuitems_mpstuff[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(41), 0x00000000, &menudialog_mpsoundtrack }, // "Soundtrack" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(42), 0x00000000, &menudialog_mpteamnames }, // "Team Names" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(41), 0x00000000, (void *)&menudialog_mpsoundtrack }, // "Soundtrack" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(42), 0x00000000, (void *)&menudialog_mpteamnames }, // "Team Names" { MENUITEMTYPE_DROPDOWN, 0, 0x00020000, L_MPMENU(44), 0x00000000, menuhandlerMpLock }, // "Lock" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, { MENUITEMTYPE_DROPDOWN, 0, 0x00000000, L_OPTIONS(216), 0x00000000, menuhandlerScreenRatio }, // "Ratio" { MENUITEMTYPE_DROPDOWN, 0, 0x00000000, L_MPWEAPONS(154), 0x00000000, menuhandlerScreenSplit }, // "Split" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(36), 0x00000000, &g_MpReadyMenuDialog }, // "Start Game" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(37), 0x00000000, &menudialog_2aba0 }, // "Drop Out" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(27), 0x00000000, &menudialog_mpabort2 }, // "Abort Game" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(36), 0x00000000, (void *)&g_MpReadyMenuDialog }, // "Start Game" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(37), 0x00000000, (void *)&menudialog_2aba0 }, // "Drop Out" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(27), 0x00000000, (void *)&menudialog_mpabort2 }, // "Abort Game" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -1542,13 +1542,13 @@ struct menudialog menudialog_mpstuff2 = { // 2c238 struct menuitem menuitems_mpplayersetup4[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(30), (u32)&mpGetCurrentPlayerName, &menudialog_mpplayername }, // "Name" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(31), 0x00000000, &menudialog_mpcharacter }, // "Character" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(33), 0x00000000, &menudialog_mpcontrol }, // "Control" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(34), 0x00000000, &menudialog_mpoptions }, // "Player Options" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(35), 0x00000000, &menudialog_mpplayerstats }, // "Statistics" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(30), (u32)&mpGetCurrentPlayerName, (void *)&menudialog_mpplayername }, // "Name" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(31), 0x00000000, (void *)&menudialog_mpcharacter }, // "Character" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(33), 0x00000000, (void *)&menudialog_mpcontrol }, // "Control" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(34), 0x00000000, (void *)&menudialog_mpoptions }, // "Player Options" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(35), 0x00000000, (void *)&menudialog_mpplayerstats }, // "Statistics" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(29), 0x00000000, &menudialog_mploadplayer }, // "Load Player" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(29), 0x00000000, (void *)&menudialog_mploadplayer }, // "Load Player" { MENUITEMTYPE_SELECTABLE, 0, 0x00000000, (u32)&mpMenuTextSavePlayerOrCopy, 0x00000000, menuhandlerMpSavePlayer }, { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -1605,16 +1605,16 @@ struct menudialog menudialog_mpscenario; // 2c39c struct menuitem menuitems_mpgamesetup3[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00020004, L_MPMENU(19), (u32)&mpMenuTextScenarioShortName, &menudialog_mpscenario }, // "Scenario" + { MENUITEMTYPE_SELECTABLE, 0, 0x00020004, L_MPMENU(19), (u32)&mpMenuTextScenarioShortName, (void *)&menudialog_mpscenario }, // "Scenario" { MENUITEMTYPE_SELECTABLE, 0, 0x00000000, L_MPMENU(21), 0x00000000, menuhandlerMpOpenOptions }, // "Options" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(20), (u32)&mpMenuTextArenaName, &menudialog_mparena }, // "Arena" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(23), 0x00000000, &menudialog_mpweapons }, // "Weapons" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(24), 0x00000000, &menudialog_mplimits }, // "Limits" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(184), 0x00000000, &menudialog_mpplayerhandicaps }, // "Player Handicaps" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(25), 0x00000000, &menudialog_mpsimulants }, // "Simulants" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(22), 0x00000000, &menudialog_mpteamcontrol }, // "Teams" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(20), (u32)&mpMenuTextArenaName, (void *)&menudialog_mparena }, // "Arena" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(23), 0x00000000, (void *)&menudialog_mpweapons }, // "Weapons" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(24), 0x00000000, (void *)&menudialog_mplimits }, // "Limits" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPWEAPONS(184), 0x00000000, (void *)&menudialog_mpplayerhandicaps }, // "Player Handicaps" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(25), 0x00000000, (void *)&menudialog_mpsimulants }, // "Simulants" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(22), 0x00000000, (void *)&menudialog_mpteamcontrol }, // "Teams" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000082, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00060004, L_MPMENU(18), 0x00000000, &menudialog_mploadgamesettingstype0 }, // "Load Settings" + { MENUITEMTYPE_SELECTABLE, 0, 0x00060004, L_MPMENU(18), 0x00000000, (void *)&menudialog_mploadgamesettingstype0 }, // "Load Settings" { MENUITEMTYPE_SELECTABLE, 0, 0x00060000, L_MPMENU(26), 0x00000000, menuhandlerMpSaveSettings }, // "Save Settings" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -1641,10 +1641,10 @@ struct menudialog menudialog_mpgamesetup2 = { // 2c4bc struct menuitem menuitems_mpquickgo[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MISC(456), 0x00000000, &g_MpReadyMenuDialog }, // "Start Game" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(29), 0x00000000, &menudialog_mploadplayer }, // "Load Player" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MISC(458), 0x00000000, &menudialog_mpplayersetup3 }, // "Player Settings" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MISC(457), 0x00000000, &menudialog_2aba0 }, // "Drop Out" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MISC(456), 0x00000000, (void *)&g_MpReadyMenuDialog }, // "Start Game" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(29), 0x00000000, (void *)&menudialog_mploadplayer }, // "Load Player" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MISC(458), 0x00000000, (void *)&menudialog_mpplayersetup3 }, // "Player Settings" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MISC(457), 0x00000000, (void *)&menudialog_2aba0 }, // "Drop Out" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -1662,11 +1662,11 @@ struct menudialog menudialog_mpscenario2; // 2c538 struct menuitem menuitems_mpquickteamgamesetup[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00020004, L_MPMENU(19), (u32)&mpMenuTextScenarioShortName, &menudialog_mpscenario2 }, // "Scenario" + { MENUITEMTYPE_SELECTABLE, 0, 0x00020004, L_MPMENU(19), (u32)&mpMenuTextScenarioShortName, (void *)&menudialog_mpscenario2 }, // "Scenario" { MENUITEMTYPE_SELECTABLE, 0, 0x00000000, L_MPMENU(21), 0x00000000, menuhandlerMpOpenOptions }, // "Options" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(20), (u32)&mpMenuTextArenaName, &menudialog_mparena }, // "Arena" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(23), (u32)&mpMenuTextWeaponSetName, &menudialog_mpweapons2 }, // "Weapons" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(24), 0x00000000, &menudialog_mplimits }, // "Limits" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(20), (u32)&mpMenuTextArenaName, (void *)&menudialog_mparena }, // "Arena" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(23), (u32)&mpMenuTextWeaponSetName, (void *)&menudialog_mpweapons2 }, // "Weapons" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_MPMENU(24), 0x00000000, (void *)&menudialog_mplimits }, // "Limits" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000082, 0x00000000, menuhandlerQuickTeamSeparator }, { MENUITEMTYPE_DROPDOWN, 0, 0x00000000, L_MISC(449), 0x00000000, menuhandlerPlayerTeam }, // "Player 1 Team" { MENUITEMTYPE_DROPDOWN, 1, 0x00000000, L_MISC(450), 0x00000000, menuhandlerPlayerTeam }, // "Player 2 Team" @@ -1715,9 +1715,9 @@ struct menudialog menudialog_mpquickteam = { // 2c75c struct menuitem menuitems_mpcombatsimulator[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_MISC(441), 0x00000000, &menudialog_mpcombatchallenges2 }, // "Challenges" - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_MISC(442), 0x00000001, &menudialog_mploadgamesettingstype1 }, // "Load/Preset Games" - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_MISC(443), 0x00000002, &menudialog_mpquickteam }, // "Quick Start" + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_MISC(441), 0x00000000, (void *)&menudialog_mpcombatchallenges2 }, // "Challenges" + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_MISC(442), 0x00000001, (void *)&menudialog_mploadgamesettingstype1 }, // "Load/Preset Games" + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_MISC(443), 0x00000002, (void *)&menudialog_mpquickteam }, // "Quick Start" { MENUITEMTYPE_SELECTABLE, 0, 0x00400000, L_MISC(444), 0x00000003, menuhandlerMpAdvancedSetup }, // "Advanced Setup" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; diff --git a/src/game/game_0e5ce0.c b/src/game/game_0e5ce0.c index a7a95a387..e98372baa 100644 --- a/src/game/game_0e5ce0.c +++ b/src/game/game_0e5ce0.c @@ -8982,98 +8982,40 @@ Gfx *menuRenderItemObjectives(Gfx *gdl, struct menurenderthing *thing) return gdl; } -GLOBAL_ASM( -glabel menuRenderItemModel -/* f0ea3d8: 27bdffc0 */ addiu $sp,$sp,-64 -/* f0ea3dc: afbf0014 */ sw $ra,0x14($sp) -/* f0ea3e0: afa40040 */ sw $a0,0x40($sp) -/* f0ea3e4: 8cae0008 */ lw $t6,0x8($a1) -/* f0ea3e8: 00a03825 */ or $a3,$a1,$zero -/* f0ea3ec: 8dcf0004 */ lw $t7,0x4($t6) -/* f0ea3f0: 000fc280 */ sll $t8,$t7,0xa -/* f0ea3f4: 07030049 */ bgezl $t8,.L0f0ea51c -/* f0ea3f8: 8fbf0014 */ lw $ra,0x14($sp) -/* f0ea3fc: 84b90000 */ lh $t9,0x0($a1) -/* f0ea400: 44803000 */ mtc1 $zero,$f6 -/* f0ea404: afb9002c */ sw $t9,0x2c($sp) -/* f0ea408: 84a90002 */ lh $t1,0x2($a1) -/* f0ea40c: afa90030 */ sw $t1,0x30($sp) -/* f0ea410: 84aa0004 */ lh $t2,0x4($a1) -/* f0ea414: afaa0034 */ sw $t2,0x34($sp) -/* f0ea418: 8ca20010 */ lw $v0,0x10($a1) -/* f0ea41c: c4440040 */ lwc1 $f4,0x40($v0) -/* f0ea420: 4606203c */ c.lt.s $f4,$f6 -/* f0ea424: 00000000 */ nop -/* f0ea428: 4502000c */ bc1fl .L0f0ea45c -/* f0ea42c: 904f003d */ lbu $t7,0x3d($v0) -/* f0ea430: 904b003c */ lbu $t3,0x3c($v0) -/* f0ea434: 2408003c */ addiu $t0,$zero,0x3c -/* f0ea438: 3c037f1b */ lui $v1,%hi(g_MenuColourPalettes) -/* f0ea43c: 01680019 */ multu $t3,$t0 -/* f0ea440: 24631fb0 */ addiu $v1,$v1,%lo(g_MenuColourPalettes) -/* f0ea444: 00006012 */ mflo $t4 -/* f0ea448: 006c6821 */ addu $t5,$v1,$t4 -/* f0ea44c: 8dae0020 */ lw $t6,0x20($t5) -/* f0ea450: 10000013 */ b .L0f0ea4a0 -/* f0ea454: afae0038 */ sw $t6,0x38($sp) -/* f0ea458: 904f003d */ lbu $t7,0x3d($v0) -.L0f0ea45c: -/* f0ea45c: 2408003c */ addiu $t0,$zero,0x3c -/* f0ea460: 9049003c */ lbu $t1,0x3c($v0) -/* f0ea464: 01e80019 */ multu $t7,$t0 -/* f0ea468: 3c037f1b */ lui $v1,%hi(g_MenuColourPalettes) -/* f0ea46c: 24631fb0 */ addiu $v1,$v1,%lo(g_MenuColourPalettes) -/* f0ea470: 8c460044 */ lw $a2,0x44($v0) -/* f0ea474: 0000c012 */ mflo $t8 -/* f0ea478: 0078c821 */ addu $t9,$v1,$t8 -/* f0ea47c: 8f240020 */ lw $a0,0x20($t9) -/* f0ea480: 01280019 */ multu $t1,$t0 -/* f0ea484: 00005012 */ mflo $t2 -/* f0ea488: 006a5821 */ addu $t3,$v1,$t2 -/* f0ea48c: 8d650020 */ lw $a1,0x20($t3) -/* f0ea490: 0fc01a40 */ jal colourBlend -/* f0ea494: afa70044 */ sw $a3,0x44($sp) -/* f0ea498: 8fa70044 */ lw $a3,0x44($sp) -/* f0ea49c: afa20038 */ sw $v0,0x38($sp) -.L0f0ea4a0: -/* f0ea4a0: 8cec0010 */ lw $t4,0x10($a3) -/* f0ea4a4: 8fa40038 */ lw $a0,0x38($sp) -/* f0ea4a8: 00002825 */ or $a1,$zero,$zero -/* f0ea4ac: 8d8d000c */ lw $t5,0xc($t4) -/* f0ea4b0: 2406007f */ addiu $a2,$zero,0x7f -/* f0ea4b4: 51a0000b */ beqzl $t5,.L0f0ea4e4 -/* f0ea4b8: 8faa0040 */ lw $t2,0x40($sp) -/* f0ea4bc: 0fc01a40 */ jal colourBlend -/* f0ea4c0: afa70044 */ sw $a3,0x44($sp) -/* f0ea4c4: 8faf0038 */ lw $t7,0x38($sp) -/* f0ea4c8: 2401ff00 */ addiu $at,$zero,-256 -/* f0ea4cc: 00417024 */ and $t6,$v0,$at -/* f0ea4d0: 31f800ff */ andi $t8,$t7,0xff -/* f0ea4d4: 01d8c825 */ or $t9,$t6,$t8 -/* f0ea4d8: afb90038 */ sw $t9,0x38($sp) -/* f0ea4dc: 8fa70044 */ lw $a3,0x44($sp) -/* f0ea4e0: 8faa0040 */ lw $t2,0x40($sp) -.L0f0ea4e4: -/* f0ea4e4: 27a2002c */ addiu $v0,$sp,0x2c -/* f0ea4e8: 24090001 */ addiu $t1,$zero,0x1 -/* f0ea4ec: a3a9003c */ sb $t1,0x3c($sp) -/* f0ea4f0: afa20020 */ sw $v0,0x20($sp) -/* f0ea4f4: afa20024 */ sw $v0,0x24($sp) -/* f0ea4f8: afaa001c */ sw $t2,0x1c($sp) -/* f0ea4fc: 8ce50008 */ lw $a1,0x8($a3) -/* f0ea500: 24040013 */ addiu $a0,$zero,0x13 -/* f0ea504: 27a6001c */ addiu $a2,$sp,0x1c -/* f0ea508: 8cb90010 */ lw $t9,0x10($a1) -/* f0ea50c: 0320f809 */ jalr $t9 -/* f0ea510: 00000000 */ nop -/* f0ea514: afa20040 */ sw $v0,0x40($sp) -/* f0ea518: 8fbf0014 */ lw $ra,0x14($sp) -.L0f0ea51c: -/* f0ea51c: 8fa20040 */ lw $v0,0x40($sp) -/* f0ea520: 27bd0040 */ addiu $sp,$sp,0x40 -/* f0ea524: 03e00008 */ jr $ra -/* f0ea528: 00000000 */ nop -); +Gfx *menuRenderItemModel(Gfx *gdl, struct menurenderthing *thing) +{ + if (thing->item->param1 & 0x00200000) { + struct menuitemmodelrenderdata renderdata; + union handlerdata data; + + renderdata.x = thing->x; + renderdata.y = thing->y; + renderdata.width = thing->width; + + if (thing->unk10->unk40 < 0) { + renderdata.colour = g_MenuColourPalettes[thing->unk10->colour1index].unk20; + } else { + renderdata.colour = colourBlend( + g_MenuColourPalettes[thing->unk10->colour2index].unk20, + g_MenuColourPalettes[thing->unk10->colour1index].unk20, + thing->unk10->colourweight); + } + + if (thing->unk10->unk0c) { + renderdata.colour = (colourBlend(renderdata.colour, 0, 127) & 0xffffff00) | (renderdata.colour & 0xff); + } + + renderdata.arg10 = true; + + data.type19.gdl = gdl; + data.type19.renderdata1 = &renderdata; + data.type19.renderdata2 = &renderdata; + + gdl = (Gfx *)thing->item->handler(MENUOP_19, thing->item, &data); + } + + return gdl; +} GLOBAL_ASM( glabel menuRenderItemLabel @@ -15629,7 +15571,7 @@ Gfx *menuRenderItem(Gfx *gdl, struct menurenderthing *thing) case MENUITEMTYPE_RANKING: return menuRenderItemRanking(gdl); case MENUITEMTYPE_PLAYERSTATS: return menuRenderItemPlayerStats(gdl); case MENUITEMTYPE_CAROUSEL: return menuRenderItemCarousel(gdl); - case MENUITEMTYPE_MODEL: return menuRenderItemModel(gdl); + case MENUITEMTYPE_MODEL: return menuRenderItemModel(gdl, thing); case MENUITEMTYPE_CONTROLLER: return menuRenderItemController(gdl); } diff --git a/src/game/game_0f09f0.c b/src/game/game_0f09f0.c index b8672406b..a6dd6b002 100644 --- a/src/game/game_0f09f0.c +++ b/src/game/game_0f09f0.c @@ -2791,7 +2791,6 @@ void menuOpenDialog(struct menudialog *dialog, struct menuframe *frame, struct m struct menuitem *item; union handlerdata data1; union handlerdata data2; - s32 (*handler)(u32 operation, struct menuitem *item, union handlerdata *data); frame->dialog = dialog; @@ -2828,11 +2827,9 @@ void menuOpenDialog(struct menudialog *dialog, struct menuframe *frame, struct m item = frame->dialog->items; while (item->type != MENUITEMTYPE_END) { - handler = item->handler; - - if (handler + if (item->handler && (item->param1 & 0x04) == 0 - && handler(MENUOP_CHECKPREFOCUSED, item, &data1)) { + && item->handler(MENUOP_CHECKPREFOCUSED, item, &data1)) { frame->focuseditem = item; } @@ -2840,12 +2837,10 @@ void menuOpenDialog(struct menudialog *dialog, struct menuframe *frame, struct m } // Run focus handler - if (frame->focuseditem) { - handler = frame->focuseditem->handler; - - if (handler && (frame->focuseditem->param1 & 0x04) == 0) { - handler(MENUOP_FOCUS, frame->focuseditem, &data2); - } + if (frame->focuseditem + && frame->focuseditem->handler + && (frame->focuseditem->param1 & 0x04) == 0) { + frame->focuseditem->handler(MENUOP_FOCUS, frame->focuseditem, &data2); } frame->unk0c = 0; diff --git a/src/game/game_102240.c b/src/game/game_102240.c index 5fb64b73b..c8a89cf5d 100644 --- a/src/game/game_102240.c +++ b/src/game/game_102240.c @@ -3023,7 +3023,7 @@ struct menudialog menudialog_controloptions = { }; struct menuitem menuitems_18928[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(194), (u32)&func0f105664, &menudialog_control3 }, // "Control Style" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(194), (u32)&func0f105664, (void *)&menudialog_control3 }, // "Control Style" { MENUITEMTYPE_CHECKBOX, 0, 0x00000000, L_OPTIONS(195), 0x00000004, menuhandlerReversePitch }, // "Reverse Pitch" { MENUITEMTYPE_CHECKBOX, 0, 0x00000000, L_OPTIONS(196), 0x00000004, menuhandlerLookAhead }, // "Look Ahead" { MENUITEMTYPE_CHECKBOX, 0, 0x00000000, L_OPTIONS(197), 0x00000004, menuhandlerHeadRoll }, // "Head Roll" @@ -3044,7 +3044,7 @@ struct menudialog menudialog_189dc = { }; struct menuitem menuitems_189f4[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, 0x000056c2, (u32)&func0f1056a0, &menudialog_control4 }, + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, 0x000056c2, (u32)&func0f1056a0, (void *)&menudialog_control4 }, { MENUITEMTYPE_CHECKBOX, 0, 0x00000000, 0x000056c3, 0x00000005, menuhandlerReversePitch }, { MENUITEMTYPE_CHECKBOX, 0, 0x00000000, 0x000056c4, 0x00000005, menuhandlerLookAhead }, { MENUITEMTYPE_CHECKBOX, 0, 0x00000000, 0x000056c5, 0x00000005, menuhandlerHeadRoll }, @@ -3081,40 +3081,40 @@ struct menudialog menudialog_changeagent = { }; struct menuitem menuitems_18b28[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(181), 0x00000000, &menudialog_audiooptions }, // "Audio" - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(182), 0x00000000, &menudialog_videooptions }, // "Video" - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(183), 0x00000000, &menudialog_controloptions }, // "Control" - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(184), 0x00000000, &menudialog_displayoptions }, // "Display" + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(181), 0x00000000, (void *)&menudialog_audiooptions }, // "Audio" + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(182), 0x00000000, (void *)&menudialog_videooptions }, // "Video" + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(183), 0x00000000, (void *)&menudialog_controloptions }, // "Control" + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(184), 0x00000000, (void *)&menudialog_displayoptions }, // "Display" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; struct menuitem menuitems_18b8c[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(181), 0x00000000, &menudialog_audiooptions }, // "Audio" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(182), 0x00000000, &menudialog_videooptionsshort }, // "Video" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(183), 0x00000000, &menudialog_controloptions }, // "Control" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(184), 0x00000000, &menudialog_displayoptions }, // "Display" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(181), 0x00000000, (void *)&menudialog_audiooptions }, // "Audio" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(182), 0x00000000, (void *)&menudialog_videooptionsshort }, // "Video" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(183), 0x00000000, (void *)&menudialog_controloptions }, // "Control" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(184), 0x00000000, (void *)&menudialog_displayoptions }, // "Display" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000064, 0x00000000, NULL }, { MENUITEMTYPE_SELECTABLE, 0, 0x00000000, (u32)&menutextPauseOrUnpause, 0x00000000, menuhandlerMpPause }, { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; struct menuitem menuitems_18c18[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(181), 0x00000000, &menudialog_audiooptionsshort }, // "Audio" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(182), 0x00000000, &menudialog_videooptionsshort }, // "Video" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(183), 0x00000000, &menudialog_controloptions }, // "Control" - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(184), 0x00000000, &menudialog_displayoptionsshort }, // "Display" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(181), 0x00000000, (void *)&menudialog_audiooptionsshort }, // "Audio" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(182), 0x00000000, (void *)&menudialog_videooptionsshort }, // "Video" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(183), 0x00000000, (void *)&menudialog_controloptions }, // "Control" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(184), 0x00000000, (void *)&menudialog_displayoptionsshort }, // "Display" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000064, 0x00000000, NULL }, { MENUITEMTYPE_SELECTABLE, 0, 0x00000000, (u32)&menutextPauseOrUnpause, 0x00000000, menuhandlerMpPause }, { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; struct menuitem menuitems_18ca4[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, 0x000056b5, 0x00000001, &menudialog_audiooptions }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, 0x000056b6, 0x00000002, &menudialog_videooptions }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, 0x000056b7, 0x00000003, &menudialog_189dc }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, 0x000056b8, 0x00000004, &menudialog_displayoptions_2pplayer1 }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, 0x000056b9, 0x00000005, &g_CheatsMenuDialog }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, 0x00005679, 0x00000006, &g_CinemaMenuDialog }, + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, 0x000056b5, 0x00000001, (void *)&menudialog_audiooptions }, + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, 0x000056b6, 0x00000002, (void *)&menudialog_videooptions }, + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, 0x000056b7, 0x00000003, (void *)&menudialog_189dc }, + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, 0x000056b8, 0x00000004, (void *)&menudialog_displayoptions_2pplayer1 }, + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, 0x000056b9, 0x00000005, (void *)&g_CheatsMenuDialog }, + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, 0x00005679, 0x00000006, (void *)&g_CinemaMenuDialog }, { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -3949,13 +3949,13 @@ char *soloMenuTitlePauseStatus(struct menudialog *dialog) struct menuitem menuitems_status[] = { { MENUITEMTYPE_OBJECTIVES, 2, 0x00000000, 0x00000000, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(173), 0x00000000, &g_SoloAbortShortMenuDialog }, // "Abort!" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(173), 0x00000000, (void *)&g_SoloAbortShortMenuDialog }, // "Abort!" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; struct menuitem menuitems_19674[] = { { MENUITEMTYPE_OBJECTIVES, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(173), 0x00000000, &g_SoloAbortMenuDialog }, // "Abort!" + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(173), 0x00000000, (void *)&g_SoloAbortMenuDialog }, // "Abort!" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; @@ -4282,7 +4282,7 @@ struct menuitem menuitems_mainmenu[] = { { MENUITEMTYPE_SELECTABLE, 1, 0x00400000, (u32)&mainMenuTextLabel, 0x00000003, menuhandlerMainMenuCombatSimulator }, { MENUITEMTYPE_SELECTABLE, 2, 0x00400000, (u32)&mainMenuTextLabel, 0x00000004, menuhandlerMainMenuCooperative }, { MENUITEMTYPE_SELECTABLE, 3, 0x00400000, (u32)&mainMenuTextLabel, 0x00000005, menuhandlerMainMenuCounterOperative }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(187), 0x00000006, &menudialog_changeagent }, // "Change Agent..." + { MENUITEMTYPE_SELECTABLE, 0, 0x00400004, L_OPTIONS(187), 0x00000006, (void *)&menudialog_changeagent }, // "Change Agent..." { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; diff --git a/src/game/game_107fb0.c b/src/game/game_107fb0.c index f80ae4d26..d0f4d8499 100644 --- a/src/game/game_107fb0.c +++ b/src/game/game_107fb0.c @@ -5377,7 +5377,7 @@ struct menuitem menuitems_gamefiles[] = { { MENUITEMTYPE_SELECTABLE, FILETYPE_MPSETUP, 0x00000000, L_OPTIONS(104), 0x00000000, menuhandlerOpenDeleteFile }, // "Combat Simulator Settings File" { MENUITEMTYPE_SELECTABLE, FILETYPE_MPPLAYER, 0x00000000, L_OPTIONS(105), 0x00000000, menuhandlerOpenDeleteFile }, // "Combat Simulator Player File" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, - { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(102), 0x00000000, &menudialog_controllerpakmenu }, // "Delete Game Notes..." + { MENUITEMTYPE_SELECTABLE, 0, 0x00000004, L_OPTIONS(102), 0x00000000, (void *)&menudialog_controllerpakmenu }, // "Delete Game Notes..." { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, }; diff --git a/src/game/game_177e00.c b/src/game/game_177e00.c index c0d11f7e2..9f529315f 100644 --- a/src/game/game_177e00.c +++ b/src/game/game_177e00.c @@ -166,7 +166,7 @@ glabel menuhandler00177e00 /* f177fd4: 00000000 */ nop ); -s32 menuhandlerMpEndGame(u32 operation, struct menuitem *item, s32 *value) +s32 menuhandlerMpEndGame(u32 operation, struct menuitem *item, union handlerdata *data) { if (operation == MENUOP_SET) { g_Vars.currentplayer->aborted = true; @@ -179,7 +179,7 @@ s32 menuhandlerMpEndGame(u32 operation, struct menuitem *item, s32 *value) /** * This is something near the top of the "End Game" dialog during gameplay. */ -s32 menuhandler00178018(u32 operation, struct menuitem *item, s32 *value) +s32 menuhandler00178018(u32 operation, struct menuitem *item, union handlerdata *data) { if (operation == MENUOP_CHECKHIDDEN) { if (g_MpSetupSaveFile.locktype != MPLOCKTYPE_CHALLENGE) { @@ -209,7 +209,7 @@ char *mpMenuTextInGameLimit(struct menuitem *item) return g_StringPointer; } -s32 menuhandlerMpInGameLimitLabel(u32 operation, struct menuitem *item, s32 *value) +s32 menuhandlerMpInGameLimitLabel(u32 operation, struct menuitem *item, union handlerdata *data) { if (operation == MENUOP_CHECKHIDDEN) { switch (item->param) { diff --git a/src/include/constants.h b/src/include/constants.h index 832a97b60..181bf61d1 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -1092,6 +1092,7 @@ #define MENUOP_16 16 #define MENUOP_GETTEXT 17 #define MENUOP_SETTEXT 18 +#define MENUOP_19 19 #define MENUOP_GETCOLOUR 22 #define MENUOP_CHECKHIDDEN 24 #define MENUOP_OPEN 100 diff --git a/src/include/game/game_0e5ce0.h b/src/include/game/game_0e5ce0.h index e9dbf9d2e..8d9a049a1 100644 --- a/src/include/game/game_0e5ce0.h +++ b/src/include/game/game_0e5ce0.h @@ -20,7 +20,7 @@ void func0f0e9744(struct menuitem *item, u16 *arg1); Gfx *menuRenderItemSeparator(Gfx *gdl, struct menurenderthing *thing); Gfx *menuRenderObjective(Gfx *gfx, struct menurenderthing10 *thing10, s32 index, s32 position, s32 x, s32 y, s32 width, s32 height, s32 arg8, s32 arg9); Gfx *menuRenderItemObjectives(Gfx *gdl, struct menurenderthing *thing); -Gfx *menuRenderItemModel(Gfx *gdl); +Gfx *menuRenderItemModel(Gfx *gdl, struct menurenderthing *thing); Gfx *menuRenderItemLabel(Gfx *gdl); Gfx *menuRenderItem15(Gfx *gdl); Gfx *menuRenderItemSelectable(Gfx *gdl); diff --git a/src/include/game/game_177e00.h b/src/include/game/game_177e00.h index 2f9ac88a8..ff5481991 100644 --- a/src/include/game/game_177e00.h +++ b/src/include/game/game_177e00.h @@ -3,7 +3,7 @@ #include #include "types.h" -s32 menuhandler00177e00(u32, u32, u32 *); +s32 menuhandler00177e00(u32 operation, struct menuitem *item, union handlerdata *data); char *mpMenuTextInGameLimit(struct menuitem *item); char *menutextPauseOrUnpause(s32 arg0); char *menutextMatchTime(s32 arg0); @@ -13,16 +13,16 @@ char *mpMenuTextWeaponOfChoiceName(struct menuitem *item); char *mpMenuTextAward1(struct menuitem *item); char *mpMenuTextAward2(struct menuitem *item); char *mpMenuTextPlacementWithSuffix(struct menuitem *item); -s32 menuhandler001785c4(u32, u32, u32 *); -s32 menuhandler001786d8(u32, u32, u32 *); -s32 menuhandler00178a94(u32, u32, u32 *); +s32 menuhandler001785c4(u32 operation, struct menuitem *item, union handlerdata *data); +s32 menuhandler001786d8(u32 operation, struct menuitem *item, union handlerdata *data); +s32 menuhandler00178a94(u32 operation, struct menuitem *item, union handlerdata *data); char *mpMenuTextPlayerTitle(s32 arg0); -s32 menuhandler00178bf4(u32, u32, u32 *); +s32 menuhandler00178bf4(u32 operation, struct menuitem *item, union handlerdata *data); void mpPushPauseDialog(void); void mpPushEndscreenDialog(u32 arg0, u32 playernum); -s32 menuhandlerMpEndGame(u32 operation, struct menuitem *item, s32 *value); -s32 menuhandler00178018(u32 operation, struct menuitem *item, s32 *value); -s32 menuhandlerMpInGameLimitLabel(u32 operation, struct menuitem *item, s32 *value); +s32 menuhandlerMpEndGame(u32 operation, struct menuitem *item, union handlerdata *data); +s32 menuhandler00178018(u32 operation, struct menuitem *item, union handlerdata *data); +s32 menuhandlerMpInGameLimitLabel(u32 operation, struct menuitem *item, union handlerdata *data); s32 menuhandlerMpPause(u32 operation, struct menuitem *item, union handlerdata *data); #endif diff --git a/src/include/types.h b/src/include/types.h index 84ff7d492..5bac113cd 100644 --- a/src/include/types.h +++ b/src/include/types.h @@ -3284,6 +3284,20 @@ struct handlerdata_slider { char *label; }; +struct menuitemmodelrenderdata { + s32 x; + s32 y; + s32 width; + u32 colour; + u8 arg10; +}; + +struct handlerdata_type19 { + Gfx *gdl; + struct menuitemmodelrenderdata *renderdata1; + struct menuitemmodelrenderdata *renderdata2; +}; + struct handlerdata_dialog1 { u32 preventclose; }; @@ -3300,6 +3314,7 @@ union handlerdata { struct handlerdata_keyboard keyboard; struct handlerdata_label label; struct handlerdata_slider slider; + struct handlerdata_type19 type19; struct handlerdata_dialog1 dialog1; struct handlerdata_dialog2 dialog2; @@ -3311,7 +3326,7 @@ struct menuitem { u32 param1; u32 param2; u32 param3; - void *handler; + s32 (*handler)(u32 operation, struct menuitem *item, union handlerdata *data); }; struct menudialog {