From a5bbd83c8ea43e4aa5fcbaa9b381fb1a4dfbea0a Mon Sep 17 00:00:00 2001 From: riccardom Date: Tue, 2 Feb 2010 09:14:41 +0000 Subject: [PATCH] Move disable sound and disable limiter switches to common code. --- desmume/src/cli/main.cpp | 5 ----- desmume/src/commandline.cpp | 14 ++++++++++---- desmume/src/commandline.h | 4 ++++ desmume/src/gtk/main.cpp | 8 -------- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/desmume/src/cli/main.cpp b/desmume/src/cli/main.cpp index 1a0ae81fd..9f0efcd68 100644 --- a/desmume/src/cli/main.cpp +++ b/desmume/src/cli/main.cpp @@ -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; diff --git a/desmume/src/commandline.cpp b/desmume/src/commandline.cpp index e0d96bdcb..60bdc950f 100644 --- a/desmume/src/commandline.cpp +++ b/desmume/src/commandline.cpp @@ -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 } }; diff --git a/desmume/src/commandline.h b/desmume/src/commandline.h index 87906fdf4..ea675b743 100644 --- a/desmume/src/commandline.h +++ b/desmume/src/commandline.h @@ -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(); diff --git a/desmume/src/gtk/main.cpp b/desmume/src/gtk/main.cpp index 88b052410..7919bf50c 100644 --- a/desmume/src/gtk/main.cpp +++ b/desmume/src/gtk/main.cpp @@ -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"