From 781e6d094f9eacce443cf9a36a0d122aae5a21ec Mon Sep 17 00:00:00 2001 From: stephena Date: Sun, 29 Sep 2002 14:11:11 +0000 Subject: [PATCH] Changed how options are specified in the X11 and SDL ports. Those commandline options that were previously booleans now take either a 0 or 1 after them, specifying false or true, respectively. For example, one can now specify window centering be on with "-center 1" and off with "-center 0". The option previously named "-nohog" has been renamed "-accurate", which more accurately describes its function. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@111 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba --- stella/src/stellarc | 28 +++++++-------- stella/src/ui/common/Settings.cxx | 60 +++++++++++++++++++++++-------- stella/src/ui/common/Settings.hxx | 4 +-- stella/src/ui/sdl/mainSDL.cxx | 38 ++++++++++---------- stella/src/ui/x11/mainX11.cxx | 38 ++++++++++---------- 5 files changed, 100 insertions(+), 68 deletions(-) diff --git a/stella/src/stellarc b/stella/src/stellarc index 22eff341b..fdbe8fb9f 100644 --- a/stella/src/stellarc +++ b/stella/src/stellarc @@ -13,18 +13,18 @@ ; Boolean values are specified as 1 (for true) and 0 (for false) ; -;display = -;fps = -;owncmap = <0|1> -;zoom = -;grabmouse <0|1> -;hidecursor <0|1> -;center = <0|1> -;volume = -;paddle = <0|1|2|3|real> -;showinfo = <0|1> +;display = +;fps = +;owncmap = <0|1> +;zoom = +;grabmouse = <0|1> +;hidecursor = <0|1> +;center = <0|1> +;volume = +;paddle = <0|1|2|3|real> +;showinfo = <0|1> ;fullscreen = <0|1> -;ssdir = -;ssname = -;sssingle = <0|1> -;nohog = <0|1> +;ssdir = +;ssname = +;sssingle = <0|1> +;accurate = <0|1> diff --git a/stella/src/ui/common/Settings.cxx b/stella/src/ui/common/Settings.cxx index 5fb77b6d6..1e64a70db 100644 --- a/stella/src/ui/common/Settings.cxx +++ b/stella/src/ui/common/Settings.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Settings.cxx,v 1.2 2002-08-04 00:28:18 stephena Exp $ +// $Id: Settings.cxx,v 1.3 2002-09-29 14:11:10 stephena Exp $ //============================================================================ #include "Settings.hxx" @@ -28,7 +28,7 @@ Settings::Settings() theHideCursorFlag = false; theUsePrivateColormapFlag = false; theMultipleSnapShotFlag = true; - theHogCPUFlag = true; + theAccurateTimingFlag = true; theDesiredVolume = 75; theDesiredFrameRate = 60; thePaddleMode = 0; @@ -85,31 +85,59 @@ bool Settings::handleCommandLineArgs(int argc, char* argv[]) } else if(string(argv[i]) == "-owncmap") { - theUsePrivateColormapFlag = true; + uInt32 option = atoi(argv[++i]); + if(option == 1) + theUsePrivateColormapFlag = true; + else if(option == 0) + theUsePrivateColormapFlag = false; } else if(string(argv[i]) == "-fullscreen") { - theUseFullScreenFlag = true; + uInt32 option = atoi(argv[++i]); + if(option == 1) + theUseFullScreenFlag = true; + else if(option == 0) + theUseFullScreenFlag = false; } else if(string(argv[i]) == "-grabmouse") { - theGrabMouseFlag = true; + uInt32 option = atoi(argv[++i]); + if(option == 1) + theGrabMouseFlag = true; + else if(option == 0) + theGrabMouseFlag = false; } else if(string(argv[i]) == "-hidecursor") { - theHideCursorFlag = true; + uInt32 option = atoi(argv[++i]); + if(option == 1) + theHideCursorFlag = true; + else if(option == 0) + theHideCursorFlag = false; } else if(string(argv[i]) == "-center") { - theCenterWindowFlag = true; + uInt32 option = atoi(argv[++i]); + if(option == 1) + theCenterWindowFlag = true; + else if(option == 0) + theCenterWindowFlag = false; } else if(string(argv[i]) == "-showinfo") { - theShowInfoFlag = true; + uInt32 option = atoi(argv[++i]); + if(option == 1) + theShowInfoFlag = true; + else if(option == 0) + theShowInfoFlag = false; } - else if(string(argv[i]) == "-nohog") + else if(string(argv[i]) == "-accurate") { - theHogCPUFlag = false; + uInt32 option = atoi(argv[++i]); + if(option == 1) + theAccurateTimingFlag = true; + else if(option == 0) + theAccurateTimingFlag = false; } else if(string(argv[i]) == "-zoom") { @@ -137,7 +165,11 @@ bool Settings::handleCommandLineArgs(int argc, char* argv[]) } else if(string(argv[i]) == "-sssingle") { - theMultipleSnapShotFlag = false; + uInt32 option = atoi(argv[++i]); + if(option == 1) + theMultipleSnapShotFlag = false; + else if(option == 0) + theMultipleSnapShotFlag = true; } else if(string(argv[i]) == "-pro") { @@ -256,13 +288,13 @@ void Settings::handleRCFile(istream& in) else if(option == 0) theShowInfoFlag = false; } - else if(key == "nohog") + else if(key == "accurate") { uInt32 option = atoi(value.c_str()); if(option == 1) - theHogCPUFlag = false; + theAccurateTimingFlag = true; else if(option == 0) - theShowInfoFlag = true; + theAccurateTimingFlag = false; } else if(key == "zoom") { diff --git a/stella/src/ui/common/Settings.hxx b/stella/src/ui/common/Settings.hxx index c8fc1e464..db05cd911 100644 --- a/stella/src/ui/common/Settings.hxx +++ b/stella/src/ui/common/Settings.hxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: Settings.hxx,v 1.2 2002-08-04 00:28:18 stephena Exp $ +// $Id: Settings.hxx,v 1.3 2002-09-29 14:11:11 stephena Exp $ //============================================================================ #ifndef SETTINGS_HXX @@ -55,7 +55,7 @@ class Settings // Indicates whether to use more/less accurate emulation, // resulting in more/less CPU usage. - bool theHogCPUFlag; + bool theAccurateTimingFlag; // Indicates what the desired volume is uInt32 theDesiredVolume; diff --git a/stella/src/ui/sdl/mainSDL.cxx b/stella/src/ui/sdl/mainSDL.cxx index 9dffe3a1b..a570a98e3 100644 --- a/stella/src/ui/sdl/mainSDL.cxx +++ b/stella/src/ui/sdl/mainSDL.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: mainSDL.cxx,v 1.27 2002-08-17 16:24:24 stephena Exp $ +// $Id: mainSDL.cxx,v 1.28 2002-09-29 14:11:11 stephena Exp $ //============================================================================ #include @@ -1321,28 +1321,28 @@ void usage() "", "Valid options are:", "", - " -fps Display the given number of frames per second", - " -owncmap Install a private colormap", - " -zoom Makes window be 'size' times normal (1 - 4)", - " -fullscreen Play the game in fullscreen mode", - " -grabmouse Keeps the mouse in the game window", - " -hidecursor Hides the mouse cursor in the game window", - " -center Centers the game window onscreen", - " -volume Set the volume (0 - 100)", + " -fps Display the given number of frames per second", + " -owncmap <0|1> Install a private colormap", + " -zoom Makes window be 'size' times normal (1 - 4)", + " -fullscreen <0|1> Play the game in fullscreen mode", + " -grabmouse <0|1> Keeps the mouse in the game window", + " -hidecursor <0|1> Hides the mouse cursor in the game window", + " -center <0|1> Centers the game window onscreen", + " -volume Set the volume (0 - 100)", #ifdef HAVE_JOYSTICK - " -paddle <0|1|2|3|real> Indicates which paddle the mouse should emulate", - " or that real Atari 2600 paddles are being used", + " -paddle <0|1|2|3|real> Indicates which paddle the mouse should emulate", + " or that real Atari 2600 paddles are being used", #else - " -paddle <0|1|2|3> Indicates which paddle the mouse should emulate", + " -paddle <0|1|2|3> Indicates which paddle the mouse should emulate", #endif - " -showinfo Shows some game info on exit", + " -showinfo <0|1> Shows some game info on exit", #ifdef HAVE_PNG - " -ssdir The directory to save snapshot files to", - " -ssname How to name the snapshot (romname or md5sum)", - " -sssingle Generate single snapshot instead of many", + " -ssdir The directory to save snapshot files to", + " -ssname How to name the snapshot (romname or md5sum)", + " -sssingle <0|1> Generate single snapshot instead of many", #endif - " -pro Use the given properties file instead of stella.pro", - " -nohog Don't take all the CPU (gives less accurate emulation)", + " -pro Use the given properties file instead of stella.pro", + " -accurate <0|1> Accurate game timing (uses more CPU)", "", 0 }; @@ -1594,7 +1594,7 @@ int main(int argc, char* argv[]) // and are needed to calculate the overall frames per second. uInt32 frameTime = 0, numberOfFrames = 0; - if(settings->theHogCPUFlag) // normal, CPU-intensive timing + if(settings->theAccurateTimingFlag) // normal, CPU-intensive timing { // Set up accurate timing stuff uInt32 startTime, delta; diff --git a/stella/src/ui/x11/mainX11.cxx b/stella/src/ui/x11/mainX11.cxx index cf2a28408..49c417377 100644 --- a/stella/src/ui/x11/mainX11.cxx +++ b/stella/src/ui/x11/mainX11.cxx @@ -13,7 +13,7 @@ // See the file "license" for information on usage and redistribution of // this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// $Id: mainX11.cxx,v 1.25 2002-08-04 00:28:18 stephena Exp $ +// $Id: mainX11.cxx,v 1.26 2002-09-29 14:11:11 stephena Exp $ //============================================================================ #include @@ -1201,28 +1201,28 @@ void usage() "", "Valid options are:", "", - " -display Connect to the designated X display", - " -fps Display the given number of frames per second", - " -owncmap Install a private colormap", - " -zoom Makes window be 'size' times normal (1 - 4)", -// " -fullscreen Play the game in fullscreen mode", - " -grabmouse Keeps the mouse in the game window", - " -hidecursor Hides the mouse cursor in the game window", - " -center Centers the game window onscreen", - " -volume Set the volume (0 - 100)", + " -fps Display the given number of frames per second", + " -owncmap <0|1> Install a private colormap", + " -zoom Makes window be 'size' times normal (1 - 4)", +// " -fullscreen <0|1> Play the game in fullscreen mode", + " -grabmouse <0|1> Keeps the mouse in the game window", + " -hidecursor <0|1> Hides the mouse cursor in the game window", + " -center <0|1> Centers the game window onscreen", + " -volume Set the volume (0 - 100)", #ifdef HAVE_JOYSTICK - " -paddle <0|1|2|3|real> Indicates which paddle the mouse should emulate", - " or that real Atari 2600 paddles are being used", + " -paddle <0|1|2|3|real> Indicates which paddle the mouse should emulate", + " or that real Atari 2600 paddles are being used", #else - " -paddle <0|1|2|3> Indicates which paddle the mouse should emulate", + " -paddle <0|1|2|3> Indicates which paddle the mouse should emulate", #endif - " -showinfo Shows some game info on exit", + " -showinfo <0|1> Shows some game info on exit", #ifdef HAVE_PNG - " -ssdir The directory to save snapshot files to", - " -ssname How to name the snapshot (romname or md5sum)", - " -sssingle Generate single snapshot instead of many", + " -ssdir The directory to save snapshot files to", + " -ssname How to name the snapshot (romname or md5sum)", + " -sssingle <0|1> Generate single snapshot instead of many", #endif - " -pro Use the given properties file instead of stella.pro", + " -pro Use the given properties file instead of stella.pro", + " -accurate <0|1> Accurate game timing (uses more CPU)", "", 0 }; @@ -1471,7 +1471,7 @@ int main(int argc, char* argv[]) // and are needed to calculate the overall frames per second. uInt32 frameTime = 0, numberOfFrames = 0; - if(settings->theHogCPUFlag) // normal, CPU-intensive timing + if(settings->theAccurateTimingFlag) // normal, CPU-intensive timing { // Set up timing stuff uInt32 startTime, delta;