cli: re-add ability to set frameskip

the command line option existed once, but was turned off when a
new generic commandline parser class was introduced. the entire
array in main.cpp using custom commandline options is currently
unused.
This commit is contained in:
rofl0r 2021-10-25 01:58:31 +00:00
parent d07bdedbd6
commit 7e0336d57d
3 changed files with 6 additions and 3 deletions

View File

@ -80,6 +80,7 @@ CommandLine::CommandLine()
, disable_sound(0)
, disable_limiter(0)
, windowed_fullscreen(0)
, frameskip(0)
, _rtc_day(-1)
, _rtc_hour(-1)
{
@ -128,6 +129,7 @@ static const char* help_string = \
" --disable-limiter Disables the 60fps limiter" ENDL
" --rtc-day D Override RTC day, 0=Sunday, 6=Saturday" ENDL
" --rtc-hour H Override RTC hour, 0=midnight, 23=an hour before" ENDL
" --frameskip N Set frameskip to N; default 0" ENDL
ENDL
"Arguments affecting overall emulation parameters (`sync settings`): " ENDL
#ifdef HAVE_JIT
@ -195,6 +197,7 @@ ENDL
#define OPT_3D_RENDER 3
#define OPT_3D_TEXTURE_UPSCALE 81
#define OPT_GPU_RESOLUTION_MULTIPLIER 82
#define OPT_FRAMESKIP 83
#define OPT_JIT_SIZE 100
#define OPT_CONSOLE_TYPE 200
@ -259,6 +262,7 @@ bool CommandLine::parse(int argc,char **argv)
#else
{ "nojoy", no_argument, &_commandline_linux_nojoy, 1},
#endif
{ "frameskip", required_argument, NULL, OPT_FRAMESKIP},
{ "disable-sound", no_argument, &disable_sound, 1},
{ "disable-limiter", no_argument, &disable_limiter, 1},
{ "rtc-day", required_argument, NULL, OPT_RTC_DAY},
@ -335,6 +339,7 @@ bool CommandLine::parse(int argc,char **argv)
case OPT_3D_RENDER: _render3d = optarg; break;
case OPT_3D_TEXTURE_UPSCALE: texture_upscale = atoi(optarg); break;
case OPT_GPU_RESOLUTION_MULTIPLIER: gpu_resolution_multiplier = atoi(optarg); break;
case OPT_FRAMESKIP: frameskip = atoi(optarg); break;
//RTC settings
case OPT_RTC_DAY: _rtc_day = atoi(optarg); break;

View File

@ -65,6 +65,7 @@ public:
int disable_sound;
int disable_limiter;
int windowed_fullscreen;
int frameskip;
bool parse(int argc,char **argv);

View File

@ -136,7 +136,6 @@ class configured_features : public CommandLine
{
public:
int auto_pause;
int frameskip;
int engine_3d;
int savetype;
@ -148,7 +147,6 @@ static void
init_config( class configured_features *config) {
config->auto_pause = 0;
config->frameskip = 0;
config->engine_3d = 1;
config->savetype = 0;
@ -163,7 +161,6 @@ fill_config( class configured_features *config,
int argc, char ** argv) {
GOptionEntry options[] = {
{ "auto-pause", 0, 0, G_OPTION_ARG_NONE, &config->auto_pause, "Pause emulation if focus is lost", NULL},
{ "frameskip", 0, 0, G_OPTION_ARG_INT, &config->frameskip, "Set frameskip", "FRAMESKIP"},
{ "3d-engine", 0, 0, G_OPTION_ARG_INT, &config->engine_3d, "Select 3d rendering engine. Available engines:\n"
"\t\t\t\t\t\t 0 = 3d disabled\n"
"\t\t\t\t\t\t 1 = internal rasterizer (default)\n"