Some changes and fixes

Added Button combo to skip intro and go to level select

Fixed "Continue, don't exit" on N64

Better Non-N64 diffs for options_menu

Better clipopts diffs
This commit is contained in:
AloXado320 2021-05-11 02:06:25 -05:00
parent 82f805778a
commit 4ed8c56984
12 changed files with 98 additions and 35 deletions

View file

@ -43,9 +43,10 @@
#define N64_USE_EXTENDED_RAM TRUE
// Enables crash screen on N64
#define N64_CRASH_SCREEN TRUE
// Ignores checks and fully defines if intro should be skipped
#define SKIP_PEACH_CUTSCENE FALSE
// Sets a key combo to skip Peach cutscene
#define SET_KEY_COMBO_SKIP_PEACH_CUTSCENE TRUE
// Sets a key combo to get to the debug level select on Mario Head
#define SET_KEY_COMBO_LEVEL_SELECT TRUE
// Test End Cutscene without beating Bowser 3
#define DEBUG_TEST_ENDCUTSCENE 0
// Test Credits without beating Bowser 3 (Recommended to use with TEST_ENDCUTSCENE)

View file

@ -52,16 +52,26 @@
#include "options_menu.h"
#include "cheats.h"
#ifndef TARGET_N64
#ifdef COMMAND_LINE_OPTIONS
#include "pc/cliopts.h"
#endif
// Ifdef hell but it does the job
#define SM64_KEY_COMBO (Z_TRIG | START_BUTTON | L_CBUTTONS | R_CBUTTONS)
s16 gSkipIntroKeyCombo = FALSE;
u8 game_key_combo_triggered(void) {
if (gPlayer1Controller->buttonDown == SM64_KEY_COMBO) {
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
return TRUE;
}
return FALSE;
}
// ifdef hell but it does the job
u8 should_intro_be_skipped(void) {
#if SKIP_PEACH_CUTSCENE
return TRUE;
#else
return save_file_exists(gCurrSaveFileNum - 1)
return save_file_exists(gCurrSaveFileNum - 1) || gSkipIntroKeyCombo == TRUE
#ifndef TARGET_N64
#ifdef COMMAND_LINE_OPTIONS
|| gCLIOpts.SkipIntro == TRUE
@ -69,5 +79,4 @@ u8 should_intro_be_skipped(void) {
|| configSkipIntro == TRUE
#endif
;
#endif
}

View file

@ -1,6 +1,9 @@
#ifndef EXTRAS_MISC_FUNCTIONS_H
#define EXTRAS_MISC_FUNCTIONS_H
extern s16 gSkipIntroKeyCombo;
u8 game_key_combo_triggered(void);
u8 should_intro_be_skipped(void);
#endif // EXTRAS_MISC_FUNCTIONS_H

View file

@ -22,7 +22,6 @@
#ifndef TARGET_N64
#include "pc/pc_main.h"
#include "pc/cliopts.h"
#include "pc/controller/controller_api.h"
#include <stdbool.h>
@ -37,8 +36,10 @@
u8 optmenu_open = 0;
#if !defined(TARGET_N64) && !defined(TARGET_PORT_CONSOLE)
static u8 optmenu_binding = 0;
static u8 optmenu_bind_idx = 0;
#endif
/* Keeps track of how many times the user has pressed L while in the options menu, so cheats can be unlocked */
static s32 l_counter = 0;
@ -71,18 +72,6 @@ static const u8 optMainStr[][32] = {
{ TEXT_EXIT_GAME },
};
static const u8 optsVideoStr[][32] = {
{ TEXT_OPT_FSCREEN },
{ TEXT_OPT_TEXFILTER },
{ TEXT_OPT_NEAREST },
{ TEXT_OPT_LINEAR },
{ TEXT_OPT_RESETWND },
{ TEXT_OPT_VSYNC },
{ TEXT_OPT_AUTO },
{ TEXT_OPT_THREEPT },
{ TEXT_OPT_APPLY },
};
static const u8 optsAudioStr[][32] = {
{ TEXT_OPT_MVOLUME },
{ TEXT_OPT_MUSVOLUME },
@ -95,6 +84,19 @@ static const u8 optsSettingsStr[][32] = {
{ TEXT_OPT_MOUSE },
};
#if !defined(TARGET_N64) && !defined(TARGET_PORT_CONSOLE)
static const u8 optsVideoStr[][32] = {
{ TEXT_OPT_FSCREEN },
{ TEXT_OPT_TEXFILTER },
{ TEXT_OPT_NEAREST },
{ TEXT_OPT_LINEAR },
{ TEXT_OPT_RESETWND },
{ TEXT_OPT_VSYNC },
{ TEXT_OPT_AUTO },
{ TEXT_OPT_THREEPT },
{ TEXT_OPT_APPLY },
};
static const u8 optBindStr[][32] = {
{ TEXT_OPT_UNBOUND },
{ TEXT_OPT_PRESSKEY },
@ -131,6 +133,7 @@ static const u8 *vsyncChoices[] = {
toggleStr[1],
optsVideoStr[6],
};
#endif
/* button action functions */
@ -138,7 +141,6 @@ static const u8 *vsyncChoices[] = {
static void optmenu_act_exit(UNUSED struct Option *self, s32 arg) {
if (!arg) game_exit(); // only exit on A press and not directions
}
#endif
static void optvideo_reset_window(UNUSED struct Option *self, s32 arg) {
if (!arg) {
@ -151,6 +153,7 @@ static void optvideo_reset_window(UNUSED struct Option *self, s32 arg) {
static void optvideo_apply(UNUSED struct Option *self, s32 arg) {
if (!arg) configWindow.settings_changed = true;
}
#endif
/* submenu option lists */

View file

@ -35,7 +35,15 @@
#endif
// TODO: put this elsewhere
enum SaveOption { SAVE_OPT_SAVE_AND_CONTINUE = 1, SAVE_OPT_SAVE_AND_QUIT, SAVE_OPT_SAVE_EXIT_GAME, SAVE_OPT_CONTINUE_DONT_SAVE };
enum SaveOption
{
SAVE_OPT_SAVE_AND_CONTINUE = 1,
SAVE_OPT_SAVE_AND_QUIT,
#if !defined(TARGET_N64) && !defined(TARGET_PORT_CONSOLE)
SAVE_OPT_SAVE_EXIT_GAME,
#endif
SAVE_OPT_CONTINUE_DONT_SAVE,
};
static struct Object *sIntroWarpPipeObj;
static struct Object *sEndPeachObj;
@ -258,22 +266,26 @@ void handle_save_menu(struct MarioState *m) {
// wait for the menu to show up
if (is_anim_past_end(m) && gSaveOptSelectIndex != 0) {
// save and continue / save and quit
if (gSaveOptSelectIndex == SAVE_OPT_SAVE_AND_CONTINUE || gSaveOptSelectIndex == SAVE_OPT_SAVE_EXIT_GAME || gSaveOptSelectIndex == SAVE_OPT_SAVE_AND_QUIT) {
if (gSaveOptSelectIndex == SAVE_OPT_SAVE_AND_CONTINUE
#if !defined(TARGET_N64) && !defined(TARGET_PORT_CONSOLE)
|| gSaveOptSelectIndex == SAVE_OPT_SAVE_EXIT_GAME
#endif
|| gSaveOptSelectIndex == SAVE_OPT_SAVE_AND_QUIT) {
save_file_do_save(gCurrSaveFileNum - 1);
if (gSaveOptSelectIndex == SAVE_OPT_SAVE_AND_QUIT) {
fade_into_special_warp(-2, 0); // reset game
} else if (gSaveOptSelectIndex == SAVE_OPT_SAVE_EXIT_GAME) {
//initiate_warp(LEVEL_CASTLE, 1, 0x1F, 0);
fade_into_special_warp(0, 0);
#ifndef TARGET_N64
game_exit();
#endif
}
#if !defined(TARGET_N64) && !defined(TARGET_PORT_CONSOLE)
if (gSaveOptSelectIndex == SAVE_OPT_SAVE_EXIT_GAME) {
fade_into_special_warp(0, 0);
game_exit();
}
#endif
}
// not quitting
if (gSaveOptSelectIndex != SAVE_OPT_SAVE_EXIT_GAME) {
if (gSaveOptSelectIndex != SAVE_OPT_SAVE_AND_QUIT) {
disable_time_stop();
m->faceAngle[1] += 0x8000;
// figure out what dialog to show, if we should

View file

@ -34,6 +34,8 @@
#define LANGUAGE_FUNCTION sLanguageMode
#endif
#include "extras/misc_functions.h"
/**
* @file file_select.c
* This file implements how the file select and it's menus render and function.
@ -3043,7 +3045,13 @@ static void print_file_select_strings(void) {
#ifdef WIDESCREEN
file_select_fit_screen();
#endif
#endif
#if SET_KEY_COMBO_SKIP_PEACH_CUTSCENE
if (game_key_combo_triggered()) {
gSkipIntroKeyCombo = TRUE;
}
#endif
}
/**
@ -3122,6 +3130,10 @@ s32 lvl_init_menu_values_and_cursor_pos(UNUSED s32 arg, UNUSED s32 unused) {
}
}
#endif
#if SET_KEY_COMBO_SKIP_PEACH_CUTSCENE
gSkipIntroKeyCombo = FALSE;
#endif
//! no return value
#ifdef AVOID_UB
return 0;

View file

@ -15,6 +15,8 @@
#include "seq_ids.h"
#include "sm64.h"
#include "extras/misc_functions.h"
#define PRESS_START_DEMO_TIMER 800
#define STUB_LEVEL(textname, _1, _2, _3, _4, _5, _6, _7, _8) textname,
@ -151,6 +153,14 @@ s32 intro_default(void) {
#endif
print_intro_text();
#if SET_KEY_COMBO_LEVEL_SELECT
if (game_key_combo_triggered()) {
gDebugLevelSelect = 1;
} else {
gDebugLevelSelect = 0;
}
#endif
if (gPlayer1Controller->buttonPressed & START_BUTTON) {
play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource);
#ifdef RUMBLE_FEEDBACK

View file

@ -10,7 +10,11 @@
#include "platform.h"
#include "configfile.h"
#ifdef COMMAND_LINE_OPTIONS
#include "cliopts.h"
#endif
#include "gfx/gfx_screen_config.h"
#include "gfx/gfx_window_manager_api.h"
#include "controller/controller_api.h"

View file

@ -15,7 +15,6 @@
#include "gfx_screen_config.h"
#include "../pc_main.h"
#include "../configfile.h"
#include "../cliopts.h"
#include "../platform.h"
#include "src/pc/controller/controller_keyboard.h"

View file

@ -32,7 +32,10 @@
#include "gfx_screen_config.h"
#include "../pc_main.h"
#include "../configfile.h"
#ifdef COMMAND_LINE_OPTIONS
#include "../cliopts.h"
#endif
#include "src/pc/controller/controller_keyboard.h"

View file

@ -30,7 +30,11 @@
#include "audio/audio_3ds_threading.h"
#include "pc_main.h"
#ifdef COMMAND_LINE_OPTIONS
#include "cliopts.h"
#endif
#include "configfile.h"
#include "controller/controller_api.h"
#include "controller/controller_keyboard.h"

View file

@ -10,7 +10,10 @@
#include <whb/log.h>
#endif
#ifdef COMMAND_LINE_OPTIONS
#include "cliopts.h"
#endif
#include "fs/fs.h"
#include "configfile.h"