System: Add -exe parameter for overriding boot executable

Lets you re-use a disc image, but boot a different file.
This commit is contained in:
Connor McLaughlin
2023-01-11 19:40:56 +10:00
parent daf1080397
commit 50a616421f
4 changed files with 48 additions and 12 deletions

View File

@ -1883,6 +1883,7 @@ void QtHost::PrintCommandLineHelp(const char* progname)
" a global state will be loaded.\n");
std::fprintf(stderr, " -statefile <filename>: Loads state from the specified filename.\n"
" No boot filename is required with this option.\n");
std::fprintf(stderr, " -exe <filename>: Boot the specified exe instead of loading from disc.\n");
std::fprintf(stderr, " -fullscreen: Enters fullscreen mode immediately after starting.\n");
std::fprintf(stderr, " -nofullscreen: Prevents fullscreen mode from triggering if enabled.\n");
std::fprintf(stderr, " -nogui: Disables main window from being shown, exits on shutdown.\n");
@ -1985,6 +1986,12 @@ bool QtHost::ParseCommandLineParametersAndInitializeConfig(QApplication& app,
Log_InfoPrintf("Command Line: Loading state file: '%s'", autoboot->save_state.c_str());
continue;
}
else if (CHECK_ARG_PARAM("-exe"))
{
AutoBoot(autoboot)->override_exe = args[++i].toStdString();
Log_InfoPrintf("Command Line: Overriding EXE file: '%s'", autoboot->override_exe.c_str());
continue;
}
else if (CHECK_ARG("-fullscreen"))
{
Log_InfoPrintf("Command Line: Using fullscreen.");