Move disable sound and disable limiter switches to common

code.
This commit is contained in:
riccardom 2010-02-02 09:14:41 +00:00
parent 4e7172ac4a
commit a5bbd83c8e
4 changed files with 14 additions and 17 deletions

View File

@ -131,9 +131,7 @@ static BOOL enable_fake_mic;
class configured_features : public CommandLine
{
public:
int disable_sound;
int auto_pause;
int disable_limiter;
int frameskip;
int fps_limiter_frame_period;
@ -151,10 +149,7 @@ public:
static void
init_config( struct configured_features *config) {
config->disable_sound = 0;
config->auto_pause = 0;
config->disable_limiter = 0;
config->frameskip = 0;
config->fps_limiter_frame_period = FPS_LIMITER_FRAME_PERIOD;

View File

@ -51,6 +51,10 @@ CommandLine::CommandLine()
load_slot = 0;
arm9_gdb_port = arm7_gdb_port = 0;
start_paused = FALSE;
#ifndef _MSC_VER
disable_sound = 0;
disable_limiter = 0;
#endif
}
CommandLine::~CommandLine()
@ -80,13 +84,15 @@ void CommandLine::loadCommonOptions()
{ "num-cores", 0, 0, G_OPTION_ARG_INT, &_num_cores, "Override numcores detection and use this many", "NUM_CORES"},
{ "scanline-filter-a", 0, 0, G_OPTION_ARG_INT, &scanline_filter_a, "Intensity of fadeout for scanlines filter (edge) (default 2)", "SCANLINE_FILTER_A"},
{ "scanline-filter-b", 0, 0, G_OPTION_ARG_INT, &scanline_filter_b, "Intensity of fadeout for scanlines filter (corner) (default 4)", "SCANLINE_FILTER_B"},
#ifndef _MSC_VER
#ifndef _MSC_VER
{ "disable-sound", 0, 0, G_OPTION_ARG_NONE, &disable_sound, "Disables the sound emulation", NULL},
{ "disable-limiter", 0, 0, G_OPTION_ARG_NONE, &disable_limiter, "Disables the 60fps limiter", NULL},
{ "nojoy", 0, 0, G_OPTION_ARG_INT, &_commandline_linux_nojoy, "Disables joystick support", "NOJOY"},
#endif
#ifdef GDB_STUB
#endif
#ifdef GDB_STUB
{ "arm9gdb", 0, 0, G_OPTION_ARG_INT, &arm9_gdb_port, "Enable the ARM9 GDB stub on the given port", "PORT_NUM"},
{ "arm7gdb", 0, 0, G_OPTION_ARG_INT, &arm7_gdb_port, "Enable the ARM7 GDB stub on the given port", "PORT_NUM"},
#endif
#endif
{ NULL }
};

View File

@ -48,6 +48,10 @@ public:
std::string cflash_image;
std::string cflash_path;
std::string gbaslot_rom;
#ifndef _MSC_VER
int disable_sound;
int disable_limiter;
#endif
//load up the common commandline options
void loadCommonOptions();

View File

@ -414,9 +414,7 @@ u16 Keypad_Temp[NB_KEYS];
class configured_features : public CommandLine
{
public:
int disable_sound;
int engine_3d;
int disable_limiter;
int savetype;
int firmware_language;
@ -429,12 +427,8 @@ public:
static void
init_configured_features( struct configured_features *config)
{
config->disable_sound = 0;
config->engine_3d = 1;
config->disable_limiter = 0;
config->savetype = 0;
#ifdef HAVE_TIMEOUT
@ -450,8 +444,6 @@ fill_configured_features( struct configured_features *config,
int argc, char ** argv)
{
GOptionEntry options[] = {
{ "disable-sound", 0, 0, G_OPTION_ARG_NONE, &config->disable_sound, "Disables the sound emulation", NULL},
{ "disable-limiter", 0, 0, G_OPTION_ARG_NONE, &config->disable_limiter, "Disables the 60fps limiter", NULL},
{ "3d-engine", 0, 0, G_OPTION_ARG_INT, &config->engine_3d, "Select 3d rendering engine. Available engines:\n"
"\t\t\t\t 0 = 3d disabled\n"
"\t\t\t\t 1 = internal rasterizer (default)\n"