Fixed some 32->64 bit bugs; many more fixes are coming (thanks to B. Watson).

Added commandline options to change almost all properties of a ROM.  Very
useful for developers who constantly change these features but don't want
to re-generate a new stella.pro entry each time.  Thanks again to B. Watson
for original idea and partial implementation.

Fixed problem with events getting 'stuck' when changing states.  For
example, one could be playing a game and, while pressing "Left", exit
the game.  Then, when another game is started, the left direction would
still be selected.  This is a side-effect of Stella initially being a
"one game per launch" application.

For similar reasons as the previous step, fixed problem whereby a
messagebox seen just before ending one game was showing up in the next
game as well.  Still TODO is make sure the sound buffer is cleared
before each new game (sometimes you can hear some sounds from a
previous game).

Further tweaked the '-framerate' commandline argument to override the
defaults when used, but never be saved to the settings file.

Renamed '-altpro' commandline argument back to '-pro', and moved it into
the DEVELOPER_SUPPORT area.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@421 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2005-05-12 18:45:21 +00:00
parent bc40ce9ad4
commit 0567bb6d94
16 changed files with 203 additions and 203 deletions

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.38 2005-05-09 18:58:18 stephena Exp $
// $Id: mainSDL.cxx,v 1.39 2005-05-12 18:45:20 stephena Exp $
//============================================================================
#include <fstream>
@ -60,7 +60,7 @@ static OSystem* theOSystem = (OSystem*) NULL;
void SetupProperties(PropertiesSet& set)
{
bool useMemList = true; // It seems we always need the list in memory
string theAltPropertiesFile = theOSystem->settings().getString("altpro");
string theAltPropertiesFile = theOSystem->settings().getString("pro");
string thePropertiesFile = theOSystem->propertiesInputFilename();
stringstream buf;
@ -132,11 +132,6 @@ int main(int argc, char* argv[])
// Finally, make sure the settings are valid
// We do it once here, so the rest of the program can assume valid settings
theOSystem->settings().validate();
bool theShowInfoFlag = theOSystem->settings().getBool("showinfo");
// Make sure the OSystem has a valid framerate set, since it's used for
// more then just emulation mode
theOSystem->setFramerate(theOSystem->settings().getInt("framerate"));
// Create the event handler for the system
EventHandler handler(theOSystem);
@ -179,11 +174,6 @@ int main(int argc, char* argv[])
}
*/
// Print message about the framerate
string framerate = "Framerate: " + theOSystem->settings().getString("framerate");
if(theShowInfoFlag)
cout << framerate << endl;
//// Main loop ////
// First we check if a ROM is specified on the commandline. If so, and if
// the ROM actually exists, use it to create a new console.

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: Console.cxx,v 1.52 2005-05-11 19:36:00 stephena Exp $
// $Id: Console.cxx,v 1.53 2005-05-12 18:45:20 stephena Exp $
//============================================================================
#include <assert.h>
@ -75,6 +75,11 @@ Console::Console(const uInt8* image, uInt32 size, OSystem* osystem)
if(myProperties.get("Cartridge.MD5") == "")
myProperties.set("Cartridge.MD5", md5);
#ifdef DEVELOPER_SUPPORT
// A developer can override properties from the commandline
setDeveloperProperties();
#endif
// Setup the controllers based on properties
string left = myProperties.get("Controller.Left");
string right = myProperties.get("Controller.Right");
@ -157,31 +162,31 @@ Console::Console(const uInt8* image, uInt32 size, OSystem* osystem)
// Set the correct framerate based on the format of the ROM
// This can be overridden by changing the framerate in the
// VideoDialog box, but it can't be saved (ie, framerate is now
// solely determined based on ROM format).
myFrameRate = 60;
if(myProperties.get("Display.Format") == "NTSC")
myFrameRate = 60;
else if(myProperties.get("Display.Format") == "PAL")
myFrameRate = 50;
// Don't save the framerate to the settings file; only use it internally
myOSystem->settings().setInt("framerate", myFrameRate, false);
// VideoDialog box or on the commandline, but it can't be saved
// (ie, framerate is now solely determined based on ROM format).
uInt32 framerate = myOSystem->settings().getInt("framerate");
if(framerate == 0)
{
if(myProperties.get("Display.Format") == "NTSC")
framerate = 60;
else if(myProperties.get("Display.Format") == "PAL")
framerate = 50;
else
framerate = 60;
}
myOSystem->setFramerate(framerate);
// Initialize the framebuffer interface.
// This must be done *after* a reset, since it needs updated values.
initializeVideo();
// Initialize the sound interface.
myOSystem->sound().setFrameRate(myFrameRate);
myOSystem->sound().setFrameRate(framerate);
myOSystem->sound().initialize();
// Initialize the menuing system with updated values from the framebuffer
myOSystem->menu().initialize();
myOSystem->menu().setGameProfile(myProperties);
// Finally, let the main loop know about the framerate
myOSystem->setFramerate(myFrameRate);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -239,9 +244,7 @@ void Console::toggleFormat()
setPalette();
myOSystem->setFramerate(framerate);
// Don't save the framerate to the settings file; only use it internally
myOSystem->settings().setInt("framerate", framerate);
//FIXME - should be change sound rate as well??
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -515,4 +518,71 @@ void Console::enableBits(bool enable)
string message = string("TIA bits") + (enable ? " enabled" : " disabled");
myOSystem->frameBuffer().showMessage(message);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::setDeveloperProperties()
{
Settings& settings = myOSystem->settings();
string s;
s = settings.getString("type");
if(s != "")
myProperties.set("Cartridge.Type", s);
s = settings.getString("ld");
if(s != "")
myProperties.set("Console.LeftDifficulty", s);
s = settings.getString("rd");
if(s != "")
myProperties.set("Console.RightDifficulty", s);
s = settings.getString("tv");
if(s != "")
myProperties.set("Console.TelevisionType", s);
s = settings.getString("lc");
if(s != "")
myProperties.set("Controller.Left", s);
s = settings.getString("rc");
if(s != "")
myProperties.set("Controller.Right", s);
s = settings.getString("bc");
if(s != "")
{
myProperties.set("Controller.Left", s);
myProperties.set("Controller.Right", s);
}
s = settings.getString("format");
if(s != "")
myProperties.set("Display.Format", s);
s = settings.getString("xstart");
if(s != "")
myProperties.set("Display.XStart", s);
s = settings.getString("ystart");
if(s != "")
myProperties.set("Display.YStart", s);
s = settings.getString("width");
if(s != "")
myProperties.set("Display.Width", s);
s = settings.getString("height");
if(s != "")
myProperties.set("Display.Height", s);
s = settings.getString("cpu");
if(s != "")
myProperties.set("Emulation.CPU", s);
s = settings.getString("hmove");
if(s != "")
myProperties.set("Emulation.HmoveBlanks", s);
}
#endif

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: Console.hxx,v 1.30 2005-05-05 00:10:47 stephena Exp $
// $Id: Console.hxx,v 1.31 2005-05-12 18:45:20 stephena Exp $
//============================================================================
#ifndef CONSOLE_HXX
@ -35,7 +35,7 @@ class System;
This class represents the entire game console.
@author Bradford W. Mott
@version $Id: Console.hxx,v 1.30 2005-05-05 00:10:47 stephena Exp $
@version $Id: Console.hxx,v 1.31 2005-05-12 18:45:20 stephena Exp $
*/
class Console
{
@ -87,11 +87,6 @@ class Console
*/
const Properties& properties() const;
/**
Get the frame rate for the emulation
*/
uInt32 frameRate() const;
/**
Get the console switches
@ -203,6 +198,7 @@ class Console
private:
void toggleTIABit(TIA::TIABit bit, const string& bitname, bool show = true);
void setDeveloperProperties();
#endif
private:
@ -226,9 +222,6 @@ class Console
// Pointer to the 6502 based system being emulated
System* mySystem;
// Frame rate being used by the emulator
uInt32 myFrameRate;
};
#endif

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: Event.cxx,v 1.1.1.1 2001-12-27 19:54:21 bwmott Exp $
// $Id: Event.cxx,v 1.2 2005-05-12 18:45:21 stephena Exp $
//============================================================================
#include "Event.hxx"
@ -23,10 +23,7 @@ Event::Event()
: myNumberOfTypes(Event::LastType)
{
// Set all of the events to 0 / false to start with
for(int i = 0; i < myNumberOfTypes; ++i)
{
myValues[i] = 0;
}
clear();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -46,3 +43,11 @@ void Event::set(Type type, Int32 value)
myValues[type] = value;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Event::clear()
{
for(int i = 0; i < myNumberOfTypes; ++i)
{
myValues[i] = 0;
}
}

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: Event.hxx,v 1.8 2005-05-06 22:50:14 stephena Exp $
// $Id: Event.hxx,v 1.9 2005-05-12 18:45:21 stephena Exp $
//============================================================================
#ifndef EVENT_HXX
@ -25,7 +25,7 @@ class Event;
/**
@author Bradford W. Mott
@version $Id: Event.hxx,v 1.8 2005-05-06 22:50:14 stephena Exp $
@version $Id: Event.hxx,v 1.9 2005-05-12 18:45:21 stephena Exp $
*/
class Event
{
@ -99,6 +99,11 @@ class Event
*/
virtual void set(Type type, Int32 value);
/**
Clears the event array (resets to initial state)
*/
virtual void clear();
protected:
// Number of event types there are
const Int32 myNumberOfTypes;

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: EventHandler.cxx,v 1.54 2005-05-08 17:38:23 stephena Exp $
// $Id: EventHandler.cxx,v 1.55 2005-05-12 18:45:21 stephena Exp $
//============================================================================
#include <algorithm>
@ -113,6 +113,7 @@ void EventHandler::reset(State state)
myOSystem->frameBuffer().pause(myPauseFlag);
myOSystem->sound().mute(myPauseFlag);
myEvent->clear();
switch(myState)
{
@ -365,7 +366,7 @@ void EventHandler::handleKeyEvent(SDLKey key, SDLMod mod, uInt8 state)
myOSystem->console().saveProperties(myOSystem->propertiesOutputFilename(), true);
else // Save to file in base directory
{
string newPropertiesFile = myOSystem->baseDir() + "/" + \
string newPropertiesFile = myOSystem->baseDir() + BSPF_PATH_SEPARATOR +
myOSystem->console().properties().get("Cartridge.Name") + ".pro";
myOSystem->console().saveProperties(newPropertiesFile);
}
@ -379,6 +380,7 @@ void EventHandler::handleKeyEvent(SDLKey key, SDLMod mod, uInt8 state)
myOSystem->frameBuffer().refresh();
myOSystem->frameBuffer().setCursorState();
myOSystem->sound().mute(true);
myEvent->clear();
return;
}
else
@ -393,6 +395,7 @@ void EventHandler::handleKeyEvent(SDLKey key, SDLMod mod, uInt8 state)
myOSystem->frameBuffer().refresh();
myOSystem->frameBuffer().setCursorState();
myOSystem->sound().mute(false);
myEvent->clear();
return;
}
myOSystem->menu().handleKeyEvent((uInt16) key, (Int32) mod, state);

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: FrameBuffer.cxx,v 1.34 2005-05-08 17:38:23 stephena Exp $
// $Id: FrameBuffer.cxx,v 1.35 2005-05-12 18:45:21 stephena Exp $
//============================================================================
#include <sstream>
@ -86,7 +86,7 @@ void FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height,
myBaseDim.w = (uInt16) width;
myBaseDim.h = (uInt16) height;
myFrameRate = myOSystem->settings().getInt("framerate");
myFrameRate = myOSystem->frameRate();
// Now (re)initialize the SDL video system
if(!isAlreadyInitialized)
@ -145,6 +145,10 @@ void FrameBuffer::initialize(const string& title, uInt32 width, uInt32 height,
// Initialize video subsystem
initSubsystem();
// Erase any messages from a previous run
myMessageTime = 0;
theRedrawEntireFrameIndicator = true;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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: FrameBuffer.hxx,v 1.31 2005-05-10 19:20:40 stephena Exp $
// $Id: FrameBuffer.hxx,v 1.32 2005-05-12 18:45:21 stephena Exp $
//============================================================================
#ifndef FRAMEBUFFER_HXX
@ -41,7 +41,7 @@ class OSystem;
All GUI elements (ala ScummVM) are drawn here as well.
@author Stephen Anthony
@version $Id: FrameBuffer.hxx,v 1.31 2005-05-10 19:20:40 stephena Exp $
@version $Id: FrameBuffer.hxx,v 1.32 2005-05-12 18:45:21 stephena Exp $
*/
class FrameBuffer
{
@ -378,18 +378,6 @@ class FrameBuffer
*/
virtual void translateCoords(Int32* x, Int32* y) = 0;
#if 0
FIXME
/**
This routine is called when the emulation has received
a pause event.
@param status The received pause status
*/
virtual void pauseEvent(bool status) = 0;
#endif
protected:
// The parent system for the framebuffer
OSystem* myOSystem;
@ -470,97 +458,3 @@ FIXME
};
#endif
/*
// Enumeration representing the different types of user interface widgets
enum Widget { W_NONE, MAIN_MENU, REMAP_MENU, INFO_MENU };
Widget currentSelectedWidget();
Event::Type currentSelectedEvent();
// Add binding between a StellaEvent key and a core event
void addKeyBinding(Event::Type event, StellaEvent::KeyCode key);
// Add binding between a StellaEvent joystick and a core event
void addJoyBinding(Event::Type event, StellaEvent::JoyStick stick,
StellaEvent::JoyCode code);
// Remove all bindings for this core event
void deleteBinding(Event::Type event);
// Draw the main menu
void drawMainMenu();
// Draw the remap menu
void drawRemapMenu();
// Draw the info menu
void drawInfoMenu();
// Move the cursor up 'amt' lines, possibly scrolling the list of items
void moveCursorUp(uInt32 amt);
// Move the cursor down 'amt' lines, possibly scrolling the list of items
void moveCursorDown(uInt32 amt);
// scan the mapping arrays and update the remap menu
void loadRemapMenu();
*/
/*
// Structure used for main menu items
struct MainMenuItem
{
Widget widget;
string action;
};
// Table of strings representing the various StellaEvent codes
static const char* ourEventName[StellaEvent::LastKCODE];
// Type of interface item currently slated for redraw
Widget myCurrentWidget;
// Indicates that an event is currently being remapped
bool myRemapEventSelectedFlag;
// Indicates the current selected event being remapped
Event::Type mySelectedEvent;
// Indicates if we are in menu mode
bool myMenuMode;
// The maximum number of vertical lines of text that can be onscreen
Int32 myMaxRows;
// The maximum number of characters of text in a row
Int32 myMaxColumns;
// Keep track of current selected main menu item
uInt32 myMainMenuIndex, myMainMenuItems;
// Keep track of current selected remap menu item
Int32 myRemapMenuIndex, myRemapMenuLowIndex, myRemapMenuHighIndex;
Int32 myRemapMenuItems, myRemapMenuMaxLines;
// The width of the information menu, determined by the longest string
Int32 myInfoMenuWidth;
// Holds information about the current selected ROM image
string ourPropertiesInfo[9];
// Holds static strings for the main menu
static MainMenuItem ourMainMenu[2];
// Holds the current key mappings
Event::Type* myKeyTable;
// Holds the number of items in the keytable array
uInt32 myKeyTableSize;
// Holds the current joystick mappings
Event::Type* myJoyTable;
// Holds the number of items in the joytable array
uInt32 myJoyTableSize;
*/

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: OSystem.cxx,v 1.13 2005-05-08 17:38:23 stephena Exp $
// $Id: OSystem.cxx,v 1.14 2005-05-12 18:45:21 stephena Exp $
//============================================================================
#include <cassert>
@ -277,6 +277,7 @@ bool OSystem::createConsole(const string& romfile)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void OSystem::createLauncher()
{
setFramerate(20); // We don't need a large framerate for the launcher
myEventHandler->reset(EventHandler::S_LAUNCHER);
// Create the window

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: OSystem.hxx,v 1.12 2005-05-11 19:36:00 stephena Exp $
// $Id: OSystem.hxx,v 1.13 2005-05-12 18:45:21 stephena Exp $
//============================================================================
#ifndef OSYSTEM_HXX
@ -38,7 +38,7 @@ class Launcher;
other objects belong.
@author Stephen Anthony
@version $Id: OSystem.hxx,v 1.12 2005-05-11 19:36:00 stephena Exp $
@version $Id: OSystem.hxx,v 1.13 2005-05-12 18:45:21 stephena Exp $
*/
class OSystem
{
@ -138,7 +138,15 @@ class OSystem
@param framerate The video framerate to use
*/
void setFramerate(uInt32 framerate)
{ myTimePerFrame = (uInt32)(1000000.0 / (double) framerate); }
{ myDisplayFrameRate = framerate;
myTimePerFrame = (uInt32)(1000000.0 / (double)myDisplayFrameRate); }
/**
Get the current framerate for the video system.
@return The video framerate currently in use
*/
uInt32 frameRate() { return myDisplayFrameRate; }
/**
Set the base directory for all configuration files
@ -320,6 +328,9 @@ class OSystem
// Pointer to the Launcher object
Launcher* myLauncher;
// Number of times per second to iterate through the main loop
uInt32 myDisplayFrameRate;
// Time per frame for a video update, based on the current framerate
uInt32 myTimePerFrame;

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: Props.cxx,v 1.8 2004-07-28 23:54:39 stephena Exp $
// $Id: Props.cxx,v 1.9 2005-05-12 18:45:21 stephena Exp $
//============================================================================
#include "Props.hxx"
@ -109,7 +109,7 @@ void Properties::load(istream& in)
mySize = 0;
string line, key, value;
uInt32 one, two, three, four, garbage;
string::size_type one, two, three, four, garbage;
// Loop reading properties
while(getline(in, line))

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.40 2005-05-11 19:36:00 stephena Exp $
// $Id: Settings.cxx,v 1.41 2005-05-12 18:45:21 stephena Exp $
//============================================================================
#include <cassert>
@ -40,25 +40,31 @@ Settings::Settings(OSystem* osystem)
// Now fill it with options that are common to all versions of Stella
set("video", "soft");
set("video_driver", "");
set("gl_filter", "nearest");
set("gl_aspect", "2.0");
set("gl_fsmax", "false");
set("sound", "true");
set("fragsize", "512");
set("zoom", "2");
set("fullscreen", "false");
set("grabmouse", "false");
set("palette", "standard");
set("sound", "true");
set("fragsize", "512");
set("volume", "100");
set("framerate", "60");
set("keymap", "");
set("joymap", "");
set("zoom", "2");
set("paddle", "0");
set("showinfo", "false");
set("mergeprops", "false");
set("paddle", "0");
set("palette", "standard");
set("ssdir", ".");
set("ssname", "romname");
set("sssingle", "false");
set("romdir", "");
}
@ -73,7 +79,7 @@ Settings::~Settings()
void Settings::loadConfig()
{
string line, key, value;
uInt32 equalPos;
string::size_type equalPos, garbage;
ifstream in(myOSystem->configInputFilename().c_str());
if(!in || !in.is_open())
@ -85,7 +91,6 @@ void Settings::loadConfig()
while(getline(in, line))
{
// Strip all whitespace and tabs from the line
uInt32 garbage;
while((garbage = line.find("\t")) != string::npos)
line.erase(garbage, 1);
@ -110,17 +115,15 @@ void Settings::loadConfig()
// Only settings which have been previously set are valid
if(contains(key))
set(key, value);
else
cerr << "Invalid setting: " << key << endl;
}
in.close();
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Settings::loadCommandLine(Int32 argc, char** argv)
bool Settings::loadCommandLine(int argc, char** argv)
{
for(Int32 i = 1; i < argc; ++i)
for(int i = 1; i < argc; ++i)
{
// strip off the '-' character
string key = argv[i];
@ -192,10 +195,6 @@ void Settings::validate()
set("volume", "100");
#endif
i = getInt("framerate");
if(i < 1 || i > 300)
set("framerate", "60");
i = getInt("zoom");
if(i < 1 || i > 6)
set("zoom", "2");
@ -237,28 +236,53 @@ void Settings::usage()
<< " -gl_aspect <number> Scale the width by the given amount\n"
<< " -gl_fsmax <1|0> Use the largest available screenmode in fullscreen OpenGL\n"
<< endl
#endif
#ifdef SOUND_SUPPORT
<< " -sound <1|0> Enable sound generation\n"
<< " -fragsize <number> The size of sound fragments (must be a power of two)\n"
#endif
<< " -zoom <size> Makes window be 'size' times normal\n"
<< " -fullscreen <1|0> Play the game in fullscreen mode\n"
<< " -grabmouse <1|0> Keeps the mouse in the game window\n"
<< " -palette <original| Use the specified color palette\n"
<< " standard|\n"
<< " z26>\n"
#ifdef SOUND_SUPPORT
<< " -sound <1|0> Enable sound generation\n"
<< " -fragsize <number> The size of sound fragments (must be a power of two)\n"
<< " -volume <number> Set the volume (0 - 100)\n"
#endif
<< " -paddle <0|1|2|3> Indicates which paddle the mouse should emulate\n"
<< " -altpro <props file> Use the given properties file instead of stella.pro\n"
<< " -showinfo <1|0> Shows some game info\n"
<< " -mergeprops <1|0> Merge changed properties into properties file,\n"
<< " or save into a separate file\n"
#ifdef UNIX
<< " -accurate <1|0> Accurate game timing (uses more CPU)\n"
#endif
#ifdef SNAPSHOT_SUPPORT
<< " -ssdir <path> The directory to save snapshot files to\n"
<< " -ssname <name> How to name the snapshot (romname or md5sum)\n"
<< " -sssingle <1|0> Generate single snapshot instead of many\n"
#endif
<< " -mergeprops <1|0> Merge changed properties into properties file,\n"
<< " or save into a separate file\n"
<< " -listrominfo Display contents of stella.pro, one line per ROM entry\n"
<< " -help Show the text you're now reading\n"
#ifdef DEVELOPER_SUPPORT
<< endl
<< " The following options are meant for developers\n"
<< " Arguments are more fully explained in the manual\n"
<< endl
<< " -pro <props file> Use the given properties file instead of stella.pro\n"
<< " -type <arg> Sets the 'Cartridge.Type' property\n"
<< " -ld <arg> Sets the 'Console.LeftDifficulty' property\n"
<< " -rd <arg> Sets the 'Console.RightDifficulty' property\n"
<< " -tv <arg> Sets the 'Console.TelevisionType' property\n"
<< " -lc <arg> Sets the 'Controller.Left' property\n"
<< " -rc <arg> Sets the 'Controller.Right' property\n"
<< " -bc <arg> Same as using both -lc and -rc\n"
<< " -format <arg> Sets the 'Display.Format' property\n"
<< " -xstart <arg> Sets the 'Display.XStart' property\n"
<< " -ystart <arg> Sets the 'Display.YStart' property\n"
<< " -width <arg> Sets the 'Display.Width' property\n"
<< " -height <arg> Sets the 'Display.Height' property\n"
<< " -cpu <arg> Sets the 'Emulation.CPU' property\n"
<< " -hmove <arg> Sets the 'Emulation.HmoveBlanks' property\n"
#endif
<< endl;
#endif
}
@ -375,14 +399,14 @@ void Settings::setString(const string& key, const string& value, bool save)
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Int32 Settings::getInt(const string& key) const
uInt32 Settings::getInt(const string& key) const
{
// Try to find the named setting and answer its value
for(uInt32 i = 0; i < mySize; ++i)
if(key == mySettings[i].key)
return atoi(mySettings[i].value.c_str());
return (uInt32) atoi(mySettings[i].value.c_str());
return -1;
return 0;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

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.22 2005-05-02 19:36:05 stephena Exp $
// $Id: Settings.hxx,v 1.23 2005-05-12 18:45:21 stephena Exp $
//============================================================================
#ifndef SETTINGS_HXX
@ -28,7 +28,7 @@ class OSystem;
This class provides an interface for accessing frontend specific settings.
@author Stephen Anthony
@version $Id: Settings.hxx,v 1.22 2005-05-02 19:36:05 stephena Exp $
@version $Id: Settings.hxx,v 1.23 2005-05-12 18:45:21 stephena Exp $
*/
class Settings
{
@ -59,7 +59,7 @@ class Settings
@return False on any errors, otherwise true
*/
bool loadCommandLine(Int32 argc, char** argv);
bool loadCommandLine(int argc, char** argv);
/**
This method should be called *after* settings have been read,
@ -74,12 +74,12 @@ class Settings
/**
Get the value assigned to the specified key. If the key does
not exist then -1 is returned.
not exist then 0 is returned.
@param key The key of the setting to lookup
@return The integer value of the setting
*/
Int32 getInt(const string& key) const;
uInt32 getInt(const string& key) const;
/**
Get the value assigned to the specified key. If the key does

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: AudioDialog.cxx,v 1.4 2005-05-10 19:20:42 stephena Exp $
// $Id: AudioDialog.cxx,v 1.5 2005-05-12 18:45:21 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -141,7 +141,7 @@ void AudioDialog::saveConfig()
// Fragsize (requires a restart to take effect)
i = 1;
i <<= (myFragsizePopup->getSelectedTag() + 7);
if(instance()->settings().getInt("fragsize") != (Int32)i)
if(instance()->settings().getInt("fragsize") != i)
{
instance()->settings().setInt("fragsize", i);
restart = true;

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: LauncherDialog.cxx,v 1.9 2005-05-11 23:06:52 stephena Exp $
// $Id: LauncherDialog.cxx,v 1.10 2005-05-12 18:45:21 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -248,7 +248,7 @@ void LauncherDialog::loadListFromCache()
// instead of strings. Or maybe I don't know the correct way ??
char buf[2048];
string line, rom, name, note;
uInt32 pos1, pos2; // The locations of the two '|' characters
string::size_type pos1, pos2; // The locations of the two '|' characters
// Keep reading until all lines have been inspected
while(!in.eof())

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: ListWidget.cxx,v 1.6 2005-05-10 19:20:44 stephena Exp $
// $Id: ListWidget.cxx,v 1.7 2005-05-12 18:45:21 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -194,7 +194,7 @@ static bool matchingCharsIgnoringCase(string s, string pattern)
transform(pattern.begin(), pattern.end(), pattern.begin(), (int(*)(int)) toupper);
// Make sure that if the pattern is found, it occurs at the start of 's'
return (s.find(pattern, 0) == 0);
return (s.find(pattern, 0) == string::size_type(0));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -