2002-03-21 22:47:00 +00:00
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// SSSS tt lll lll
|
|
|
|
// SS SS tt ll ll
|
|
|
|
// SS tttttt eeee ll ll aaaa
|
|
|
|
// SSSS tt ee ee ll ll aa
|
|
|
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
|
|
|
// SS SS tt ee ll ll aa aa
|
|
|
|
// SSSS ttt eeeee llll llll aaaaa
|
|
|
|
//
|
|
|
|
// Copyright (c) 1995-1999 by Bradford W. Mott
|
|
|
|
//
|
|
|
|
// See the file "license" for information on usage and redistribution of
|
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//
|
Huge changes across the map. Lets see if I can remember it all ...
There is now an SDL OpenGL port with filtering and alpha-blending.
It's a work in progress right now, but is already quite stable.
It's not as optimized as the software version yet, but this will
change as well. For now, you have to compile the SDL version in
either normal software mode or OpenGL mode. This will change
before the 1.4 release.
When entering menu mode, the emulation is now suspended. And when
pause is pressed, you can't enter menu mode. Because of these changes,
CPU use has dropped dramatically when viewing menus. This will benefit
all ports, since menus are now redrawn only when necessary, instead of
at the current framerate.
For a reference, on a Pentium-IV 2.4GHz, the software SDL version
maxes CPU usage at 9%, and the SDL OpenGL version at 13.5%. This is
at 60 fps and a zoomlevel of 4. While some small improvements can
(possibly) be made to the OpenGL version, I think we'll soon be hitting
the glass ceiling.
Work on the Porting.txt document is progressing, and I estimate it to
be 45% complete.
The Windows version still doesn't compile, and I still haven't looked
at it. Rest assured that it will be done before 1.4. There will be
a simultaneous release, even if the Linux versions are finished.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@200 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-06 22:22:33 +00:00
|
|
|
// $Id: Settings.hxx,v 1.9 2003-11-06 22:22:32 stephena Exp $
|
2002-03-21 22:47:00 +00:00
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
#ifndef SETTINGS_HXX
|
|
|
|
#define SETTINGS_HXX
|
|
|
|
|
2002-11-10 00:27:26 +00:00
|
|
|
#ifdef DEVELOPER_SUPPORT
|
|
|
|
#include "Props.hxx"
|
|
|
|
#endif
|
|
|
|
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
#include "bspf.hxx"
|
|
|
|
|
2003-09-04 16:50:48 +00:00
|
|
|
class Console;
|
|
|
|
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
This class provides an interface for accessing frontend specific settings.
|
|
|
|
|
|
|
|
@author Stephen Anthony
|
Huge changes across the map. Lets see if I can remember it all ...
There is now an SDL OpenGL port with filtering and alpha-blending.
It's a work in progress right now, but is already quite stable.
It's not as optimized as the software version yet, but this will
change as well. For now, you have to compile the SDL version in
either normal software mode or OpenGL mode. This will change
before the 1.4 release.
When entering menu mode, the emulation is now suspended. And when
pause is pressed, you can't enter menu mode. Because of these changes,
CPU use has dropped dramatically when viewing menus. This will benefit
all ports, since menus are now redrawn only when necessary, instead of
at the current framerate.
For a reference, on a Pentium-IV 2.4GHz, the software SDL version
maxes CPU usage at 9%, and the SDL OpenGL version at 13.5%. This is
at 60 fps and a zoomlevel of 4. While some small improvements can
(possibly) be made to the OpenGL version, I think we'll soon be hitting
the glass ceiling.
Work on the Porting.txt document is progressing, and I estimate it to
be 45% complete.
The Windows version still doesn't compile, and I still haven't looked
at it. Rest assured that it will be done before 1.4. There will be
a simultaneous release, even if the Linux versions are finished.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@200 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-06 22:22:33 +00:00
|
|
|
@version $Id: Settings.hxx,v 1.9 2003-11-06 22:22:32 stephena Exp $
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
*/
|
2002-03-21 22:47:00 +00:00
|
|
|
class Settings
|
|
|
|
{
|
|
|
|
public:
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
/**
|
|
|
|
Create a new settings abstract class
|
|
|
|
*/
|
|
|
|
Settings();
|
2002-03-21 22:47:00 +00:00
|
|
|
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
/**
|
|
|
|
Destructor
|
|
|
|
*/
|
|
|
|
virtual ~Settings();
|
2002-03-21 22:47:00 +00:00
|
|
|
|
|
|
|
public:
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
/**
|
2003-09-19 15:45:01 +00:00
|
|
|
This method should be called to load the current settings from an rc file.
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
*/
|
2003-09-19 15:45:01 +00:00
|
|
|
void loadConfig();
|
2002-03-21 22:47:00 +00:00
|
|
|
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
/**
|
|
|
|
This method should be called to save the current settings to an rc file.
|
|
|
|
*/
|
2003-09-19 15:45:01 +00:00
|
|
|
void saveConfig();
|
|
|
|
|
|
|
|
/**
|
|
|
|
This method should be called to load the arguments from the commandline.
|
|
|
|
*/
|
|
|
|
bool loadCommandLine(Int32 argc, char** argv);
|
|
|
|
|
2003-09-23 00:58:31 +00:00
|
|
|
/**
|
|
|
|
Get the value assigned to the specified key. If the key does
|
|
|
|
not exist then -1 is returned.
|
|
|
|
|
|
|
|
@param key The key of the setting to lookup
|
|
|
|
@return The integer value of the setting
|
|
|
|
*/
|
|
|
|
Int32 getInt(const string& key) const;
|
2003-09-19 15:45:01 +00:00
|
|
|
|
|
|
|
/**
|
2003-09-23 00:58:31 +00:00
|
|
|
Get the value assigned to the specified key. If the key does
|
|
|
|
not exist then false is returned.
|
2003-09-19 15:45:01 +00:00
|
|
|
|
2003-09-23 00:58:31 +00:00
|
|
|
@param key The key of the setting to lookup
|
|
|
|
@return The boolean value of the setting
|
2003-09-19 15:45:01 +00:00
|
|
|
*/
|
2003-09-23 00:58:31 +00:00
|
|
|
bool getBool(const string& key) const;
|
2003-09-19 15:45:01 +00:00
|
|
|
|
|
|
|
/**
|
2003-09-23 00:58:31 +00:00
|
|
|
Get the value assigned to the specified key. If the key does
|
|
|
|
not exist then the empty string is returned.
|
2003-09-19 15:45:01 +00:00
|
|
|
|
2003-09-23 00:58:31 +00:00
|
|
|
@param key The key of the setting to lookup
|
|
|
|
@return The string value of the setting
|
2003-09-19 15:45:01 +00:00
|
|
|
*/
|
2003-09-23 00:58:31 +00:00
|
|
|
string getString(const string& key) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
Set the value associated with key to the given value.
|
|
|
|
|
2003-09-23 17:27:11 +00:00
|
|
|
@param key The key of the setting
|
2003-09-23 00:58:31 +00:00
|
|
|
@param value The value to assign to the setting
|
2003-09-23 17:27:11 +00:00
|
|
|
@param save Whether this setting should be saved to the rc-file.
|
2003-09-23 00:58:31 +00:00
|
|
|
*/
|
2003-09-23 17:27:11 +00:00
|
|
|
void set(const string& key, const string& value, bool save = true);
|
2003-09-23 00:58:31 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
// The following methods are system-specific and must be implemented
|
|
|
|
// in derived classes.
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
2003-09-19 15:45:01 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
This method should be called to get the filename of a state file
|
|
|
|
given the state number.
|
|
|
|
|
|
|
|
@return String representing the full path of the state filename.
|
|
|
|
*/
|
|
|
|
virtual string stateFilename(uInt32 state) = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
This method should be called to get the filename of a snapshot.
|
|
|
|
|
|
|
|
@return String representing the full path of the snapshot filename.
|
|
|
|
*/
|
|
|
|
virtual string snapshotFilename() = 0;
|
2002-03-21 22:47:00 +00:00
|
|
|
|
2003-09-23 00:58:31 +00:00
|
|
|
/**
|
|
|
|
This method should be called to display usage information.
|
|
|
|
|
|
|
|
@param message A short message about this version of Stella
|
|
|
|
*/
|
|
|
|
virtual void usage(string& message) = 0;
|
|
|
|
|
2003-09-19 15:45:01 +00:00
|
|
|
public:
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
/**
|
|
|
|
This method should be called when the emulation core sets
|
|
|
|
the console object.
|
|
|
|
*/
|
2003-09-19 15:45:01 +00:00
|
|
|
void setConsole(Console* console) { myConsole = console; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
This method should be called to get the filename of the users'
|
|
|
|
properties (stella.pro) file.
|
|
|
|
|
|
|
|
@return String representing the full path of the user properties filename.
|
|
|
|
*/
|
|
|
|
string userPropertiesFilename() { return myUserPropertiesFile; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
This method should be called to get the filename of the system
|
|
|
|
properties (stella.pro) file.
|
|
|
|
|
|
|
|
@return String representing the full path of the system properties filename.
|
|
|
|
*/
|
|
|
|
string systemPropertiesFilename() { return mySystemPropertiesFile; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
This method should be called to get the filename of the users'
|
|
|
|
config (stellarc) file.
|
|
|
|
|
|
|
|
@return String representing the full path of the user config filename.
|
|
|
|
*/
|
|
|
|
string userConfigFilename() { return myUserConfigFile; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
This method should be called to get the filename of the system
|
|
|
|
config (stellarc) file.
|
|
|
|
|
|
|
|
@return String representing the full path of the system config filename.
|
|
|
|
*/
|
|
|
|
string systemConfigFilename() { return mySystemConfigFile; }
|
2002-03-21 22:47:00 +00:00
|
|
|
|
2003-09-23 00:58:31 +00:00
|
|
|
/**
|
|
|
|
Return the default directory for storing data.
|
|
|
|
*/
|
|
|
|
string baseDir() { return myBaseDir; }
|
2003-09-12 18:08:54 +00:00
|
|
|
|
2003-09-23 00:58:31 +00:00
|
|
|
public:
|
2002-11-10 00:27:26 +00:00
|
|
|
#ifdef DEVELOPER_SUPPORT
|
|
|
|
// User-modified properties
|
|
|
|
Properties userDefinedProperties;
|
|
|
|
#endif
|
2003-09-04 16:50:48 +00:00
|
|
|
|
2003-09-19 15:45:01 +00:00
|
|
|
protected:
|
2003-09-23 00:58:31 +00:00
|
|
|
string myBaseDir;
|
2003-09-19 15:45:01 +00:00
|
|
|
string myStateDir;
|
|
|
|
string myStateFile;
|
|
|
|
string mySnapshotFile;
|
|
|
|
string myUserPropertiesFile;
|
|
|
|
string mySystemPropertiesFile;
|
|
|
|
string myUserConfigFile;
|
|
|
|
string mySystemConfigFile;
|
|
|
|
|
|
|
|
// The global Console object
|
|
|
|
Console* myConsole;
|
|
|
|
|
|
|
|
// The full pathname of the settings file for input
|
|
|
|
string mySettingsInputFilename;
|
|
|
|
|
|
|
|
// The full pathname of the settings file for output
|
|
|
|
string mySettingsOutputFilename;
|
|
|
|
|
2003-09-04 16:50:48 +00:00
|
|
|
private:
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
// Copy constructor isn't supported by this class so make it private
|
|
|
|
Settings(const Settings&);
|
2003-09-04 16:50:48 +00:00
|
|
|
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
// Assignment operator isn't supported by this class so make it private
|
|
|
|
Settings& operator = (const Settings&);
|
2003-09-19 15:45:01 +00:00
|
|
|
|
2003-09-23 17:27:11 +00:00
|
|
|
// Test whether the given setting is present in the array
|
|
|
|
bool contains(const string& key);
|
|
|
|
|
|
|
|
// Structure used for storing settings
|
2003-09-23 00:58:31 +00:00
|
|
|
struct Setting
|
|
|
|
{
|
|
|
|
string key;
|
|
|
|
string value;
|
2003-09-23 17:27:11 +00:00
|
|
|
bool save;
|
2003-09-23 00:58:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Pointer to a dynamically allocated array of settings
|
|
|
|
Setting* mySettings;
|
|
|
|
|
|
|
|
// Current capacity of the settings array
|
|
|
|
unsigned int myCapacity;
|
|
|
|
|
|
|
|
// Size of the settings array (i.e. the number of <key,value> pairs)
|
|
|
|
unsigned int mySize;
|
2002-03-21 22:47:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|