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
This commit is contained in:
stephena 2002-09-29 14:11:11 +00:00
parent efcdd80028
commit 781e6d094f
5 changed files with 100 additions and 68 deletions

View File

@ -13,18 +13,18 @@
; Boolean values are specified as 1 (for true) and 0 (for false)
;
;display = <display>
;fps = <number>
;owncmap = <0|1>
;zoom = <size>
;grabmouse <0|1>
;hidecursor <0|1>
;center = <0|1>
;volume = <number>
;paddle = <0|1|2|3|real>
;showinfo = <0|1>
;display = <display>
;fps = <number>
;owncmap = <0|1>
;zoom = <size>
;grabmouse = <0|1>
;hidecursor = <0|1>
;center = <0|1>
;volume = <number>
;paddle = <0|1|2|3|real>
;showinfo = <0|1>
;fullscreen = <0|1>
;ssdir = <pathname>
;ssname = <romname|md5sum>
;sssingle = <0|1>
;nohog = <0|1>
;ssdir = <pathname>
;ssname = <romname|md5sum>
;sssingle = <0|1>
;accurate = <0|1>

View File

@ -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")
{

View File

@ -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;

View File

@ -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 <fstream>
@ -1321,28 +1321,28 @@ void usage()
"",
"Valid options are:",
"",
" -fps <number> Display the given number of frames per second",
" -owncmap Install a private colormap",
" -zoom <size> 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 <number> Set the volume (0 - 100)",
" -fps <number> Display the given number of frames per second",
" -owncmap <0|1> Install a private colormap",
" -zoom <size> 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 <number> 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 <path> The directory to save snapshot files to",
" -ssname <name> How to name the snapshot (romname or md5sum)",
" -sssingle Generate single snapshot instead of many",
" -ssdir <path> The directory to save snapshot files to",
" -ssname <name> How to name the snapshot (romname or md5sum)",
" -sssingle <0|1> Generate single snapshot instead of many",
#endif
" -pro <props file> Use the given properties file instead of stella.pro",
" -nohog Don't take all the CPU (gives less accurate emulation)",
" -pro <props file> 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;

View File

@ -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 <fstream>
@ -1201,28 +1201,28 @@ void usage()
"",
"Valid options are:",
"",
" -display <display> Connect to the designated X display",
" -fps <number> Display the given number of frames per second",
" -owncmap Install a private colormap",
" -zoom <size> 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 <number> Set the volume (0 - 100)",
" -fps <number> Display the given number of frames per second",
" -owncmap <0|1> Install a private colormap",
" -zoom <size> 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 <number> 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 <path> The directory to save snapshot files to",
" -ssname <name> How to name the snapshot (romname or md5sum)",
" -sssingle Generate single snapshot instead of many",
" -ssdir <path> The directory to save snapshot files to",
" -ssname <name> How to name the snapshot (romname or md5sum)",
" -sssingle <0|1> Generate single snapshot instead of many",
#endif
" -pro <props file> Use the given properties file instead of stella.pro",
" -pro <props file> 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;