diff --git a/src/game/game_102240.c b/src/game/game_102240.c index 94320ae53..7878d4df5 100644 --- a/src/game/game_102240.c +++ b/src/game/game_102240.c @@ -1888,38 +1888,20 @@ s32 menuhandlerSoloDifficulty(u32 operation, struct menu_item *item, s32 *value) return 0; } -GLOBAL_ASM( -glabel menuhandlerPdMode -/* f103e00: 27bdffe8 */ addiu $sp,$sp,-24 -/* f103e04: 24010006 */ addiu $at,$zero,0x6 -/* f103e08: afbf0014 */ sw $ra,0x14($sp) -/* f103e0c: afa5001c */ sw $a1,0x1c($sp) -/* f103e10: 10810006 */ beq $a0,$at,.L0f103e2c -/* f103e14: afa60020 */ sw $a2,0x20($sp) -/* f103e18: 24010018 */ addiu $at,$zero,0x18 -/* f103e1c: 10810008 */ beq $a0,$at,.L0f103e40 -/* f103e20: 3c0e800a */ lui $t6,0x800a -/* f103e24: 1000000c */ beqz $zero,.L0f103e58 -/* f103e28: 00001025 */ or $v0,$zero,$zero -.L0f103e2c: -/* f103e2c: 3c048007 */ lui $a0,%hi(menudialog_perfectdarkmodesettings) -/* f103e30: 0fc3cbd3 */ jal menuPushDialog -/* f103e34: 24841b48 */ addiu $a0,$a0,%lo(menudialog_perfectdarkmodesettings) -/* f103e38: 10000007 */ beqz $zero,.L0f103e58 -/* f103e3c: 00001025 */ or $v0,$zero,$zero -.L0f103e40: -/* f103e40: 95ce2284 */ lhu $t6,0x2284($t6) -/* f103e44: 55c00004 */ bnezl $t6,.L0f103e58 -/* f103e48: 00001025 */ or $v0,$zero,$zero -/* f103e4c: 10000002 */ beqz $zero,.L0f103e58 -/* f103e50: 24020001 */ addiu $v0,$zero,0x1 -/* f103e54: 00001025 */ or $v0,$zero,$zero -.L0f103e58: -/* f103e58: 8fbf0014 */ lw $ra,0x14($sp) -/* f103e5c: 27bd0018 */ addiu $sp,$sp,0x18 -/* f103e60: 03e00008 */ jr $ra -/* f103e64: 00000000 */ sll $zero,$zero,0x0 -); +s32 menuhandlerPdMode(u32 operation, struct menu_item *item, s32 *value) +{ + switch (operation) { + case MENUOP_SET: + menuPushDialog(&g_PdModeSettingsDialog); + break; + case MENUOP_CHECKHIDDEN: + if (g_SoloSaveFile.besttimes[SOLOSTAGEINDEX_SKEDARRUINS][DIFF_PA] == 0) { + return true; + } + } + + return 0; +} GLOBAL_ASM( glabel func0f103e68 diff --git a/src/include/constants.h b/src/include/constants.h index 3da92e474..8d69688f8 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -736,6 +736,28 @@ #define SCREENSPLIT_HORIZONTAL 0 #define SCREENSPLIT_VERTICAL 1 +#define SOLOSTAGEINDEX_DEFECTION 0 +#define SOLOSTAGEINDEX_INVESTIGATION 1 +#define SOLOSTAGEINDEX_EXTRACTION 2 +#define SOLOSTAGEINDEX_VILLA 3 +#define SOLOSTAGEINDEX_CHICAGO 4 +#define SOLOSTAGEINDEX_G5BUILDING 5 +#define SOLOSTAGEINDEX_INFILTRATION 6 +#define SOLOSTAGEINDEX_RESCUE 7 +#define SOLOSTAGEINDEX_ESCAPE 8 +#define SOLOSTAGEINDEX_AIRBASE 9 +#define SOLOSTAGEINDEX_AIRFORCEONE 10 +#define SOLOSTAGEINDEX_CRASHSITE 11 +#define SOLOSTAGEINDEX_PELAGIC 12 +#define SOLOSTAGEINDEX_DEEPSEA 13 +#define SOLOSTAGEINDEX_DEFENSE 14 +#define SOLOSTAGEINDEX_ATTACKSHIP 15 +#define SOLOSTAGEINDEX_SKEDARRUINS 16 +#define SOLOSTAGEINDEX_MBR 17 +#define SOLOSTAGEINDEX_MAIANSOS 18 +#define SOLOSTAGEINDEX_WAR 19 +#define SOLOSTAGEINDEX_DUEL 20 + #define SOUNDMODE_MONO 0 #define SOUNDMODE_STEREO 1 #define SOUNDMODE_HEADPHONE 2 diff --git a/src/include/game/game_102240.h b/src/include/game/game_102240.h index 5a0871b0d..b5e0788ed 100644 --- a/src/include/game/game_102240.h +++ b/src/include/game/game_102240.h @@ -69,7 +69,7 @@ s32 menuhandlerMainMenuCounterOperative(u32 operation, struct menu_item *item, b s32 menuhandlerMainMenuSoloMissions(u32 operation, struct menu_item *item, bool *enable); s32 menuhandlerMusicVolume(u32 operation, struct menu_item *item, u32 *volume); s32 menuhandlerPaintball(u32 operation, struct menu_item *item, bool *enable); -s32 menuhandlerPdMode(u32 operation, struct menu_item *item, bool *enable); +s32 menuhandlerPdMode(u32 operation, struct menu_item *item, s32 *value); s32 menuhandlerPdModeSetting(u32 operation, struct menu_item *item, bool *enable); s32 menuhandlerReversePitch(u32 operation, struct menu_item *item, bool *enable); s32 menuhandlerScreenRatio(u32 operation, struct menu_item *item, bool *enable); diff --git a/src/include/setup/setup_0160b0.h b/src/include/setup/setup_0160b0.h index 5cf1c228b..846faffa9 100644 --- a/src/include/setup/setup_0160b0.h +++ b/src/include/setup/setup_0160b0.h @@ -181,7 +181,7 @@ extern u16 g_ScreenSizeOptions[]; extern u16 g_ScreenRatioOptions[]; extern u16 g_ScreenSplitOptions[]; extern struct menu_dialog g_ObjectivesMenuDialog; -extern struct menu_dialog menudialog_perfectdarkmodesettings; +extern struct menu_dialog g_PdModeSettingsDialog; extern struct menu_dialog menudialog_selectdifficulty; extern struct menu_dialog menudialog_cooperativeoptions; extern struct menu_dialog menudialog_counteroperativeoptions; diff --git a/src/setup/setup_0160b0.c b/src/setup/setup_0160b0.c index 2aebc1146..9409fa9f5 100644 --- a/src/setup/setup_0160b0.c +++ b/src/setup/setup_0160b0.c @@ -1629,7 +1629,7 @@ struct menu_item menuitems_perfectdarkmodesettings[] = { }; // 17b68 -struct menu_dialog menudialog_perfectdarkmodesettings = { +struct menu_dialog g_PdModeSettingsDialog = { MENUDIALOGTYPE_DEFAULT, 0x54dd, // "Perfect Dark" menuitems_perfectdarkmodesettings,