2005-02-21 02:23:57 +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
|
|
|
|
//
|
2014-01-12 17:23:42 +00:00
|
|
|
// Copyright (c) 1995-2014 by Bradford W. Mott, Stephen Anthony
|
2010-04-10 21:37:23 +00:00
|
|
|
// and the Stella Team
|
2005-02-21 02:23:57 +00:00
|
|
|
//
|
2010-01-10 03:23:32 +00:00
|
|
|
// See the file "License.txt" for information on usage and redistribution of
|
2005-02-21 02:23:57 +00:00
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//
|
2009-05-13 13:55:40 +00:00
|
|
|
// $Id$
|
2005-02-21 02:23:57 +00:00
|
|
|
//============================================================================
|
|
|
|
|
|
|
|
#ifndef OSYSTEM_HXX
|
|
|
|
#define OSYSTEM_HXX
|
|
|
|
|
2007-09-03 18:37:24 +00:00
|
|
|
class Cartridge;
|
|
|
|
class CheatManager;
|
2005-08-29 18:36:42 +00:00
|
|
|
class CommandMenu;
|
2007-09-03 18:37:24 +00:00
|
|
|
class Console;
|
2005-05-27 18:00:49 +00:00
|
|
|
class Debugger;
|
2007-09-03 18:37:24 +00:00
|
|
|
class Launcher;
|
|
|
|
class Menu;
|
|
|
|
class Properties;
|
|
|
|
class PropertiesSet;
|
2014-10-26 15:54:02 +00:00
|
|
|
class Random;
|
2008-03-31 00:59:30 +00:00
|
|
|
class SerialPort;
|
2007-09-03 18:37:24 +00:00
|
|
|
class Settings;
|
|
|
|
class Sound;
|
2007-09-23 17:04:17 +00:00
|
|
|
class StateManager;
|
Some configure work:
- removed TEXTURES_ARE_DIRTY logic, and just recreate the GL textures
when a screenmode changes
- enable checking for machine type and if nasm is available
- logic to enable scaler mode only when in OpenGL mode (still not complete
and defaults to off)
First pass at adding scaler code to OpenGL. Still much work TODO,
but the C version is working correctly (asm is causing crashes,
haven't figured out why). GL quad coordinates aren't properly
set yet, so the image always appears in the upper left corner, and
is not scaled to the window size. CPU usage is also quite high,
but I'm on a 1GHz laptop with i950 GL, so that may explain it.
Fixed long-standing bug in software rendering, where switching to a
lower-res screen while a message is being displayed would cause a
segfault.
Large refactoring of mainSDL. Specifically, OSystem now owns all
the subsystems except for Settings, taking responsibility for creating
and destroying them.
Properties fixes for 'Tomarc the Barbarian' and 'Gyruss'.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1136 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-22 18:58:46 +00:00
|
|
|
class VideoDialog;
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2013-02-12 21:57:14 +00:00
|
|
|
#include "FSNode.hxx"
|
2005-05-02 19:36:05 +00:00
|
|
|
#include "FrameBuffer.hxx"
|
2013-01-28 20:39:50 +00:00
|
|
|
#include "PNGLibrary.hxx"
|
2005-02-21 02:23:57 +00:00
|
|
|
#include "bspf.hxx"
|
|
|
|
|
2012-05-13 18:06:56 +00:00
|
|
|
struct TimingInfo {
|
|
|
|
uInt64 start;
|
|
|
|
uInt64 current;
|
|
|
|
uInt64 virt;
|
|
|
|
uInt64 totalTime;
|
|
|
|
uInt64 totalFrames;
|
|
|
|
};
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
/**
|
|
|
|
This class provides an interface for accessing operating system specific
|
|
|
|
functions. It also comprises an overall parent object, to which all the
|
|
|
|
other objects belong.
|
|
|
|
|
|
|
|
@author Stephen Anthony
|
2009-05-13 13:55:40 +00:00
|
|
|
@version $Id$
|
2005-02-21 02:23:57 +00:00
|
|
|
*/
|
|
|
|
class OSystem
|
|
|
|
{
|
Some configure work:
- removed TEXTURES_ARE_DIRTY logic, and just recreate the GL textures
when a screenmode changes
- enable checking for machine type and if nasm is available
- logic to enable scaler mode only when in OpenGL mode (still not complete
and defaults to off)
First pass at adding scaler code to OpenGL. Still much work TODO,
but the C version is working correctly (asm is causing crashes,
haven't figured out why). GL quad coordinates aren't properly
set yet, so the image always appears in the upper left corner, and
is not scaled to the window size. CPU usage is also quite high,
but I'm on a 1GHz laptop with i950 GL, so that may explain it.
Fixed long-standing bug in software rendering, where switching to a
lower-res screen while a message is being displayed would cause a
segfault.
Large refactoring of mainSDL. Specifically, OSystem now owns all
the subsystems except for Settings, taking responsibility for creating
and destroying them.
Properties fixes for 'Tomarc the Barbarian' and 'Gyruss'.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1136 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-22 18:58:46 +00:00
|
|
|
friend class EventHandler;
|
|
|
|
friend class VideoDialog;
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
Create a new OSystem abstract class
|
|
|
|
*/
|
2005-02-21 20:43:53 +00:00
|
|
|
OSystem();
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Destructor
|
|
|
|
*/
|
|
|
|
virtual ~OSystem();
|
|
|
|
|
2006-01-08 13:55:03 +00:00
|
|
|
/**
|
|
|
|
Create all child objects which belong to this OSystem
|
|
|
|
*/
|
|
|
|
virtual bool create();
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
public:
|
|
|
|
/**
|
2014-10-18 15:57:03 +00:00
|
|
|
Get the event handler of the system.
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
@return The event handler
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
EventHandler& eventHandler() const { return *myEventHandler; }
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
/**
|
2014-10-18 15:57:03 +00:00
|
|
|
Get the frame buffer of the system.
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
@return The frame buffer
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
FrameBuffer& frameBuffer() const { return *myFrameBuffer; }
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
/**
|
2014-10-18 15:57:03 +00:00
|
|
|
Get the sound object of the system.
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
@return The sound object
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
Sound& sound() const { return *mySound; }
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
/**
|
2014-10-18 15:57:03 +00:00
|
|
|
Get the settings object of the system.
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
@return The settings object
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
Settings& settings() const { return *mySettings; }
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2014-10-26 15:54:02 +00:00
|
|
|
/**
|
|
|
|
Get the random object of the system.
|
|
|
|
|
|
|
|
@return The random object
|
|
|
|
*/
|
|
|
|
Random& random() const { return *myRandom; }
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
/**
|
2014-10-18 15:57:03 +00:00
|
|
|
Get the set of game properties for the system.
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
@return The properties set object
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
PropertiesSet& propSet() const { return *myPropSet; }
|
2005-02-21 20:43:53 +00:00
|
|
|
|
|
|
|
/**
|
2014-10-18 15:57:03 +00:00
|
|
|
Get the console of the system. The console won't always exist,
|
|
|
|
so we should test if it's available.
|
2005-02-21 20:43:53 +00:00
|
|
|
|
|
|
|
@return The console object
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
Console& console() const { return *myConsole; }
|
2014-11-09 03:05:19 +00:00
|
|
|
bool hasConsole() const { return myConsole != nullptr; }
|
2008-03-31 00:59:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get the serial port of the system.
|
|
|
|
|
|
|
|
@return The serial port object
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
SerialPort& serialPort() const { return *mySerialPort; }
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2005-03-10 22:59:40 +00:00
|
|
|
/**
|
|
|
|
Get the settings menu of the system.
|
|
|
|
|
|
|
|
@return The settings menu object
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
Menu& menu() const { return *myMenu; }
|
2005-03-10 22:59:40 +00:00
|
|
|
|
2005-08-29 18:36:42 +00:00
|
|
|
/**
|
|
|
|
Get the command menu of the system.
|
|
|
|
|
|
|
|
@return The command menu object
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
CommandMenu& commandMenu() const { return *myCommandMenu; }
|
2005-08-29 18:36:42 +00:00
|
|
|
|
2005-03-10 22:59:40 +00:00
|
|
|
/**
|
Added first pass of the ROM launcher. When you press 'Start' in the ROM
launcher, it launches Frostbite. Then pressing 'Escape' goes back to the
launcher, and you're able to then launch Frostbite again! Success !!!
Still TODO is actually get a ROM listing and use the selected game, but
the fact that it works multiple times for some game means that the
infrastructure is working correctly :)
Changed behaviour of the 'Escape' key. Specifically, it now only acts
as a key to enter ROM launcher mode. In the case where the emulation
was started without the launcher, the key will now do nothing. From now
on, the only way to quit Stella is Ctrl-Q (or equivalent for OSX),
close the window, or from the 'Quit' button.
Also, the 'Enter launcher mode' event will eventually be made remappable,
as will the 'Enter menu mode' event (currently the 'Tab' key).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@412 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-05-06 18:39:00 +00:00
|
|
|
Get the ROM launcher of the system.
|
2005-03-10 22:59:40 +00:00
|
|
|
|
Added first pass of the ROM launcher. When you press 'Start' in the ROM
launcher, it launches Frostbite. Then pressing 'Escape' goes back to the
launcher, and you're able to then launch Frostbite again! Success !!!
Still TODO is actually get a ROM listing and use the selected game, but
the fact that it works multiple times for some game means that the
infrastructure is working correctly :)
Changed behaviour of the 'Escape' key. Specifically, it now only acts
as a key to enter ROM launcher mode. In the case where the emulation
was started without the launcher, the key will now do nothing. From now
on, the only way to quit Stella is Ctrl-Q (or equivalent for OSX),
close the window, or from the 'Quit' button.
Also, the 'Enter launcher mode' event will eventually be made remappable,
as will the 'Enter menu mode' event (currently the 'Tab' key).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@412 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-05-06 18:39:00 +00:00
|
|
|
@return The launcher object
|
2005-03-10 22:59:40 +00:00
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
Launcher& launcher() const { return *myLauncher; }
|
2005-03-10 22:59:40 +00:00
|
|
|
|
2007-09-23 17:04:17 +00:00
|
|
|
/**
|
|
|
|
Get the state manager of the system.
|
|
|
|
|
|
|
|
@return The statemanager object
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
StateManager& state() const { return *myStateManager; }
|
2007-09-23 17:04:17 +00:00
|
|
|
|
2013-01-28 20:39:50 +00:00
|
|
|
/**
|
|
|
|
Get the PNG handler of the system.
|
|
|
|
|
|
|
|
@return The PNGlib object
|
|
|
|
*/
|
|
|
|
PNGLibrary& png() const { return *myPNGLib; }
|
|
|
|
|
2012-05-13 18:06:56 +00:00
|
|
|
/**
|
|
|
|
This method should be called to load the current settings from an rc file.
|
|
|
|
It first loads the settings from the config file, then informs subsystems
|
|
|
|
about the new settings.
|
|
|
|
*/
|
|
|
|
void loadConfig();
|
|
|
|
|
|
|
|
/**
|
|
|
|
This method should be called to save the current settings to an rc file.
|
|
|
|
It first asks each subsystem to update its settings, then it saves all
|
|
|
|
settings to the config file.
|
|
|
|
*/
|
|
|
|
void saveConfig();
|
|
|
|
|
2006-12-15 16:43:12 +00:00
|
|
|
#ifdef DEBUGGER_SUPPORT
|
2005-05-27 18:00:49 +00:00
|
|
|
/**
|
|
|
|
Get the ROM debugger of the system.
|
|
|
|
|
|
|
|
@return The debugger object
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
Debugger& debugger() const { return *myDebugger; }
|
2005-08-24 22:54:30 +00:00
|
|
|
#endif
|
2005-07-07 02:30:48 +00:00
|
|
|
|
2005-11-11 21:44:19 +00:00
|
|
|
#ifdef CHEATCODE_SUPPORT
|
|
|
|
/**
|
|
|
|
Get the cheat manager of the system.
|
|
|
|
|
|
|
|
@return The cheatmanager object
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
CheatManager& cheat() const { return *myCheatManager; }
|
2005-11-11 21:44:19 +00:00
|
|
|
#endif
|
|
|
|
|
2005-05-05 00:10:49 +00:00
|
|
|
/**
|
|
|
|
Set the framerate for the video system. It's placed in this class since
|
|
|
|
the mainLoop() method is defined here.
|
|
|
|
|
|
|
|
@param framerate The video framerate to use
|
|
|
|
*/
|
2008-05-19 21:16:58 +00:00
|
|
|
virtual void setFramerate(float framerate);
|
2005-05-12 18:45:21 +00:00
|
|
|
|
2007-07-19 16:21:39 +00:00
|
|
|
/**
|
|
|
|
Set all config file paths for the OSystem.
|
|
|
|
*/
|
|
|
|
void setConfigPaths();
|
|
|
|
|
2005-05-12 18:45:21 +00:00
|
|
|
/**
|
|
|
|
Get the current framerate for the video system.
|
|
|
|
|
|
|
|
@return The video framerate currently in use
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
float frameRate() const { return myDisplayFrameRate; }
|
2005-05-05 00:10:49 +00:00
|
|
|
|
2005-02-22 18:41:16 +00:00
|
|
|
/**
|
2009-01-16 16:38:06 +00:00
|
|
|
Return the default full/complete directory name for storing data.
|
2005-02-22 18:41:16 +00:00
|
|
|
*/
|
2009-06-18 17:08:09 +00:00
|
|
|
const string& baseDir() const { return myBaseDir; }
|
2005-02-22 18:41:16 +00:00
|
|
|
|
|
|
|
/**
|
2009-01-16 16:38:06 +00:00
|
|
|
Return the full/complete directory name for storing state files.
|
2005-02-22 18:41:16 +00:00
|
|
|
*/
|
Removed all reference to 'user.pro', in favour of the previous (to v/2.0)
functionality. The new scheme is as follows:
- Per-user properties are stored in stella.pro, which is located in
system-specific directories (homedir for UNIX/POSIX systems, currentdir
for Win32 systems).
- Completely removed concept of a global properties file, since that
functionality is now included in Stella directly.
- Retained the ability to use an alternative properties file, in which
case the per-user one isn't used at all, and any entries in it override
the built-in defaults.
Removed all reference to 'system' vs. 'user' config files, for much the
same reasons as above. As above, config files are stored in
user-specific places depending on platform. There is no longer a
system-wide config file. This made sense when Stella didn't have built-in
defaults and relied on such a file, but that's no longer the case.
Sorry for any confusion this causes, but it was causing even more confusion
for users. And now we can distribute Stella has a single binary which
doesn't depend on any external files (but will still use them if they're
present).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1050 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-03-17 19:44:19 +00:00
|
|
|
const string& stateDir() const { return myStateDir; }
|
2005-02-22 18:41:16 +00:00
|
|
|
|
2007-07-19 16:21:39 +00:00
|
|
|
/**
|
2013-02-16 19:56:09 +00:00
|
|
|
Return the full/complete directory name for saving and loading
|
|
|
|
PNG snapshots.
|
2007-07-19 16:21:39 +00:00
|
|
|
*/
|
2013-02-16 19:56:09 +00:00
|
|
|
const string& snapshotSaveDir() const { return mySnapshotSaveDir; }
|
|
|
|
const string& snapshotLoadDir() const { return mySnapshotLoadDir; }
|
2007-07-19 16:21:39 +00:00
|
|
|
|
2009-01-21 12:03:17 +00:00
|
|
|
/**
|
2013-02-17 00:19:14 +00:00
|
|
|
Return the full/complete directory name for storing nvram
|
|
|
|
(flash/EEPROM) files.
|
2009-01-21 12:03:17 +00:00
|
|
|
*/
|
2013-02-17 00:19:14 +00:00
|
|
|
const string& nvramDir() const { return myNVRamDir; }
|
2009-01-21 12:03:17 +00:00
|
|
|
|
2010-09-06 00:17:51 +00:00
|
|
|
/**
|
|
|
|
Return the full/complete directory name for storing Distella cfg files.
|
|
|
|
*/
|
|
|
|
const string& cfgDir() const { return myCfgDir; }
|
|
|
|
|
2007-07-19 16:21:39 +00:00
|
|
|
/**
|
|
|
|
This method should be called to get the full path of the cheat file.
|
|
|
|
|
|
|
|
@return String representing the full path of the cheat filename.
|
|
|
|
*/
|
|
|
|
const string& cheatFile() const { return myCheatFile; }
|
|
|
|
|
2005-02-22 18:41:16 +00:00
|
|
|
/**
|
Removed all reference to 'user.pro', in favour of the previous (to v/2.0)
functionality. The new scheme is as follows:
- Per-user properties are stored in stella.pro, which is located in
system-specific directories (homedir for UNIX/POSIX systems, currentdir
for Win32 systems).
- Completely removed concept of a global properties file, since that
functionality is now included in Stella directly.
- Retained the ability to use an alternative properties file, in which
case the per-user one isn't used at all, and any entries in it override
the built-in defaults.
Removed all reference to 'system' vs. 'user' config files, for much the
same reasons as above. As above, config files are stored in
user-specific places depending on platform. There is no longer a
system-wide config file. This made sense when Stella didn't have built-in
defaults and relied on such a file, but that's no longer the case.
Sorry for any confusion this causes, but it was causing even more confusion
for users. And now we can distribute Stella has a single binary which
doesn't depend on any external files (but will still use them if they're
present).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1050 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-03-17 19:44:19 +00:00
|
|
|
This method should be called to get the full path of the config file.
|
2005-02-22 18:41:16 +00:00
|
|
|
|
Removed all reference to 'user.pro', in favour of the previous (to v/2.0)
functionality. The new scheme is as follows:
- Per-user properties are stored in stella.pro, which is located in
system-specific directories (homedir for UNIX/POSIX systems, currentdir
for Win32 systems).
- Completely removed concept of a global properties file, since that
functionality is now included in Stella directly.
- Retained the ability to use an alternative properties file, in which
case the per-user one isn't used at all, and any entries in it override
the built-in defaults.
Removed all reference to 'system' vs. 'user' config files, for much the
same reasons as above. As above, config files are stored in
user-specific places depending on platform. There is no longer a
system-wide config file. This made sense when Stella didn't have built-in
defaults and relied on such a file, but that's no longer the case.
Sorry for any confusion this causes, but it was causing even more confusion
for users. And now we can distribute Stella has a single binary which
doesn't depend on any external files (but will still use them if they're
present).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1050 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-03-17 19:44:19 +00:00
|
|
|
@return String representing the full path of the config filename.
|
2005-02-22 18:41:16 +00:00
|
|
|
*/
|
Removed all reference to 'user.pro', in favour of the previous (to v/2.0)
functionality. The new scheme is as follows:
- Per-user properties are stored in stella.pro, which is located in
system-specific directories (homedir for UNIX/POSIX systems, currentdir
for Win32 systems).
- Completely removed concept of a global properties file, since that
functionality is now included in Stella directly.
- Retained the ability to use an alternative properties file, in which
case the per-user one isn't used at all, and any entries in it override
the built-in defaults.
Removed all reference to 'system' vs. 'user' config files, for much the
same reasons as above. As above, config files are stored in
user-specific places depending on platform. There is no longer a
system-wide config file. This made sense when Stella didn't have built-in
defaults and relied on such a file, but that's no longer the case.
Sorry for any confusion this causes, but it was causing even more confusion
for users. And now we can distribute Stella has a single binary which
doesn't depend on any external files (but will still use them if they're
present).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1050 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-03-17 19:44:19 +00:00
|
|
|
const string& configFile() const { return myConfigFile; }
|
2005-02-22 18:41:16 +00:00
|
|
|
|
|
|
|
/**
|
Removed all reference to 'user.pro', in favour of the previous (to v/2.0)
functionality. The new scheme is as follows:
- Per-user properties are stored in stella.pro, which is located in
system-specific directories (homedir for UNIX/POSIX systems, currentdir
for Win32 systems).
- Completely removed concept of a global properties file, since that
functionality is now included in Stella directly.
- Retained the ability to use an alternative properties file, in which
case the per-user one isn't used at all, and any entries in it override
the built-in defaults.
Removed all reference to 'system' vs. 'user' config files, for much the
same reasons as above. As above, config files are stored in
user-specific places depending on platform. There is no longer a
system-wide config file. This made sense when Stella didn't have built-in
defaults and relied on such a file, but that's no longer the case.
Sorry for any confusion this causes, but it was causing even more confusion
for users. And now we can distribute Stella has a single binary which
doesn't depend on any external files (but will still use them if they're
present).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1050 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-03-17 19:44:19 +00:00
|
|
|
This method should be called to get the full path of the
|
2007-07-19 16:21:39 +00:00
|
|
|
(optional) palette file.
|
2005-02-22 18:41:16 +00:00
|
|
|
|
|
|
|
@return String representing the full path of the properties filename.
|
|
|
|
*/
|
2007-07-19 16:21:39 +00:00
|
|
|
const string& paletteFile() const { return myPaletteFile; }
|
2005-02-22 18:41:16 +00:00
|
|
|
|
|
|
|
/**
|
2007-07-19 16:21:39 +00:00
|
|
|
This method should be called to get the full path of the
|
|
|
|
properties file (stella.pro).
|
2005-02-22 18:41:16 +00:00
|
|
|
|
2007-07-19 16:21:39 +00:00
|
|
|
@return String representing the full path of the properties filename.
|
2005-02-22 18:41:16 +00:00
|
|
|
*/
|
2007-07-19 16:21:39 +00:00
|
|
|
const string& propertiesFile() const { return myPropertiesFile; }
|
2005-05-11 19:36:00 +00:00
|
|
|
|
|
|
|
/**
|
Removed all reference to 'user.pro', in favour of the previous (to v/2.0)
functionality. The new scheme is as follows:
- Per-user properties are stored in stella.pro, which is located in
system-specific directories (homedir for UNIX/POSIX systems, currentdir
for Win32 systems).
- Completely removed concept of a global properties file, since that
functionality is now included in Stella directly.
- Retained the ability to use an alternative properties file, in which
case the per-user one isn't used at all, and any entries in it override
the built-in defaults.
Removed all reference to 'system' vs. 'user' config files, for much the
same reasons as above. As above, config files are stored in
user-specific places depending on platform. There is no longer a
system-wide config file. This made sense when Stella didn't have built-in
defaults and relied on such a file, but that's no longer the case.
Sorry for any confusion this causes, but it was causing even more confusion
for users. And now we can distribute Stella has a single binary which
doesn't depend on any external files (but will still use them if they're
present).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1050 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-03-17 19:44:19 +00:00
|
|
|
This method should be called to get the full path of the currently
|
|
|
|
loaded ROM.
|
2005-05-11 19:36:00 +00:00
|
|
|
|
2013-06-21 12:15:32 +00:00
|
|
|
@return FSNode object representing the ROM file.
|
2005-05-11 19:36:00 +00:00
|
|
|
*/
|
2013-06-21 12:15:32 +00:00
|
|
|
const FilesystemNode& romFile() const { return myRomFile; }
|
2005-02-22 18:41:16 +00:00
|
|
|
|
2005-05-05 00:10:49 +00:00
|
|
|
/**
|
2009-01-01 22:44:14 +00:00
|
|
|
Creates a new game console from the specified romfile, and correctly
|
|
|
|
initializes the system state to start emulation of the Console.
|
2005-05-05 00:10:49 +00:00
|
|
|
|
2013-03-07 17:41:19 +00:00
|
|
|
@param rom The FSNode of the ROM to use (contains path, etc)
|
|
|
|
@param md5 The MD5sum of the ROM
|
|
|
|
@param newrom Whether this is a new ROM, or a reload of current one
|
2007-09-01 23:31:18 +00:00
|
|
|
|
2013-05-07 14:44:50 +00:00
|
|
|
@return String indicating any error message (EmptyString for no errors)
|
2005-05-05 00:10:49 +00:00
|
|
|
*/
|
2013-05-07 14:44:50 +00:00
|
|
|
string createConsole(const FilesystemNode& rom, const string& md5 = "",
|
|
|
|
bool newrom = true);
|
2005-05-05 00:10:49 +00:00
|
|
|
|
2013-02-12 21:57:14 +00:00
|
|
|
/**
|
|
|
|
Reloads the current console (essentially deletes and re-creates it).
|
|
|
|
This can be thought of as a real console off/on toggle.
|
|
|
|
|
|
|
|
@return True on successful creation, otherwise false
|
|
|
|
*/
|
|
|
|
bool reloadConsole();
|
|
|
|
|
Added first pass of the ROM launcher. When you press 'Start' in the ROM
launcher, it launches Frostbite. Then pressing 'Escape' goes back to the
launcher, and you're able to then launch Frostbite again! Success !!!
Still TODO is actually get a ROM listing and use the selected game, but
the fact that it works multiple times for some game means that the
infrastructure is working correctly :)
Changed behaviour of the 'Escape' key. Specifically, it now only acts
as a key to enter ROM launcher mode. In the case where the emulation
was started without the launcher, the key will now do nothing. From now
on, the only way to quit Stella is Ctrl-Q (or equivalent for OSX),
close the window, or from the 'Quit' button.
Also, the 'Enter launcher mode' event will eventually be made remappable,
as will the 'Enter menu mode' event (currently the 'Tab' key).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@412 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-05-06 18:39:00 +00:00
|
|
|
/**
|
|
|
|
Creates a new ROM launcher, to select a new ROM to emulate.
|
2008-05-30 19:07:55 +00:00
|
|
|
|
2012-01-04 14:54:21 +00:00
|
|
|
@param startdir The directory to use when opening the launcher;
|
|
|
|
if blank, use 'romdir' setting.
|
|
|
|
|
2008-05-30 19:07:55 +00:00
|
|
|
@return True on successful creation, otherwise false
|
Added first pass of the ROM launcher. When you press 'Start' in the ROM
launcher, it launches Frostbite. Then pressing 'Escape' goes back to the
launcher, and you're able to then launch Frostbite again! Success !!!
Still TODO is actually get a ROM listing and use the selected game, but
the fact that it works multiple times for some game means that the
infrastructure is working correctly :)
Changed behaviour of the 'Escape' key. Specifically, it now only acts
as a key to enter ROM launcher mode. In the case where the emulation
was started without the launcher, the key will now do nothing. From now
on, the only way to quit Stella is Ctrl-Q (or equivalent for OSX),
close the window, or from the 'Quit' button.
Also, the 'Enter launcher mode' event will eventually be made remappable,
as will the 'Enter menu mode' event (currently the 'Tab' key).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@412 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-05-06 18:39:00 +00:00
|
|
|
*/
|
2012-01-04 14:54:21 +00:00
|
|
|
bool createLauncher(const string& startdir = "");
|
Added first pass of the ROM launcher. When you press 'Start' in the ROM
launcher, it launches Frostbite. Then pressing 'Escape' goes back to the
launcher, and you're able to then launch Frostbite again! Success !!!
Still TODO is actually get a ROM listing and use the selected game, but
the fact that it works multiple times for some game means that the
infrastructure is working correctly :)
Changed behaviour of the 'Escape' key. Specifically, it now only acts
as a key to enter ROM launcher mode. In the case where the emulation
was started without the launcher, the key will now do nothing. From now
on, the only way to quit Stella is Ctrl-Q (or equivalent for OSX),
close the window, or from the 'Quit' button.
Also, the 'Enter launcher mode' event will eventually be made remappable,
as will the 'Enter menu mode' event (currently the 'Tab' key).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@412 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-05-06 18:39:00 +00:00
|
|
|
|
2012-04-20 20:47:53 +00:00
|
|
|
/**
|
|
|
|
Answers whether the ROM launcher was actually successfully used
|
|
|
|
at some point since the app started.
|
|
|
|
|
2014-10-21 23:02:20 +00:00
|
|
|
@return True if launcher was ever used, otherwise false
|
2012-04-20 20:47:53 +00:00
|
|
|
*/
|
|
|
|
bool launcherUsed() const { return myLauncherUsed; }
|
|
|
|
|
2006-12-26 00:39:44 +00:00
|
|
|
/**
|
|
|
|
Gets all possible info about the ROM by creating a temporary
|
|
|
|
Console object and querying it.
|
|
|
|
|
2013-02-12 21:57:14 +00:00
|
|
|
@param romfile The file node of the ROM to use
|
2006-12-26 00:39:44 +00:00
|
|
|
@return Some information about this ROM
|
|
|
|
*/
|
2013-02-12 21:57:14 +00:00
|
|
|
string getROMInfo(const FilesystemNode& romfile);
|
2006-12-26 00:39:44 +00:00
|
|
|
|
2005-05-16 00:02:32 +00:00
|
|
|
/**
|
|
|
|
The features which are conditionally compiled into Stella.
|
|
|
|
|
|
|
|
@return The supported features
|
|
|
|
*/
|
Removed all reference to 'user.pro', in favour of the previous (to v/2.0)
functionality. The new scheme is as follows:
- Per-user properties are stored in stella.pro, which is located in
system-specific directories (homedir for UNIX/POSIX systems, currentdir
for Win32 systems).
- Completely removed concept of a global properties file, since that
functionality is now included in Stella directly.
- Retained the ability to use an alternative properties file, in which
case the per-user one isn't used at all, and any entries in it override
the built-in defaults.
Removed all reference to 'system' vs. 'user' config files, for much the
same reasons as above. As above, config files are stored in
user-specific places depending on platform. There is no longer a
system-wide config file. This made sense when Stella didn't have built-in
defaults and relied on such a file, but that's no longer the case.
Sorry for any confusion this causes, but it was causing even more confusion
for users. And now we can distribute Stella has a single binary which
doesn't depend on any external files (but will still use them if they're
present).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1050 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-03-17 19:44:19 +00:00
|
|
|
const string& features() const { return myFeatures; }
|
2005-05-16 00:02:32 +00:00
|
|
|
|
2009-10-25 22:34:40 +00:00
|
|
|
/**
|
2014-02-05 22:09:57 +00:00
|
|
|
The build information for Stella (toolkit version, architecture, etc).
|
2009-10-25 22:34:40 +00:00
|
|
|
|
|
|
|
@return The build info
|
|
|
|
*/
|
|
|
|
const string& buildInfo() const { return myBuildInfo; }
|
|
|
|
|
2006-12-28 18:31:27 +00:00
|
|
|
/**
|
|
|
|
Issue a quit event to the OSystem.
|
|
|
|
*/
|
|
|
|
void quit() { myQuitLoop = true; }
|
|
|
|
|
2010-04-29 12:46:07 +00:00
|
|
|
/**
|
2012-12-22 20:17:33 +00:00
|
|
|
Append a message to the internal log
|
|
|
|
(a newline is automatically added).
|
2010-04-29 12:46:07 +00:00
|
|
|
|
Added logging capability and viewer. This is useful for those platforms that
don't normally use the commandline (mostly Windows, but in some cases OSX as
well). The 'showinfo' commandline argument has been renamed 'loglevel', but
it has the same purpose. A new option 'logtoconsole' has been added, which
determines whether log output should also be directed to the commandline/
console (previously, it was always printed to the console). All these items
are now accessible from Options -> System Logs.
For anyone reading this (and that cares), now I can finally move on to the
OpenGL rewrite. The plan is that the new code will use OpenGL ES, which
is a subset of OpenGL 1.5. The main advantages are that you won't need
an advanced OpenGL card, and OpenGL ES is supported on most new 'smaller'
systems (iPhone, Android, etc), making ports much easier.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2264 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2011-08-16 13:38:34 +00:00
|
|
|
@param message The message to be appended
|
|
|
|
@param level If 0, always output the message, only append when
|
|
|
|
level is less than or equal to that in 'loglevel'
|
2010-04-29 12:46:07 +00:00
|
|
|
*/
|
|
|
|
void logMessage(const string& message, uInt8 level);
|
|
|
|
|
2011-06-02 20:53:01 +00:00
|
|
|
/**
|
|
|
|
Get the system messages logged up to this point.
|
|
|
|
|
|
|
|
@return The list of log messages
|
|
|
|
*/
|
|
|
|
const string& logMessages() const { return myLogMessages; }
|
|
|
|
|
2012-05-13 18:06:56 +00:00
|
|
|
/**
|
|
|
|
Return timing information (start time of console, current
|
|
|
|
number of frames rendered, etc.
|
|
|
|
*/
|
|
|
|
const TimingInfo& timingInfo() const { return myTimingInfo; }
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
public:
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
2010-06-16 15:40:57 +00:00
|
|
|
// The following methods are system-specific and can be overrided in
|
|
|
|
// derived classes. Otherwise, the base methods will be used.
|
2005-02-21 02:23:57 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////
|
2005-05-02 19:36:05 +00:00
|
|
|
/**
|
2010-06-16 15:40:57 +00:00
|
|
|
This method returns number of ticks in microseconds since some
|
|
|
|
pre-defined time in the past. *NOTE*: it is necessary that this
|
|
|
|
pre-defined time exists between runs of the application, and must
|
|
|
|
be (relatively) unique. For example, the time since the system
|
|
|
|
started running is not a good choice, since it can be duplicated.
|
|
|
|
The current implementation uses time since the UNIX epoch.
|
2005-05-02 19:36:05 +00:00
|
|
|
|
|
|
|
@return Current time in microseconds.
|
|
|
|
*/
|
2009-07-01 16:04:28 +00:00
|
|
|
virtual uInt64 getTicks() const;
|
2005-05-02 19:36:05 +00:00
|
|
|
|
2006-12-28 18:31:27 +00:00
|
|
|
/**
|
|
|
|
This method runs the main loop. Since different platforms
|
|
|
|
may use different timing methods and/or algorithms, this method can
|
|
|
|
be overrided. However, the port then takes all responsibility for
|
|
|
|
running the emulation and taking care of timing.
|
|
|
|
*/
|
|
|
|
virtual void mainLoop();
|
|
|
|
|
2006-03-27 12:52:19 +00:00
|
|
|
/**
|
|
|
|
Informs the OSystem of a change in EventHandler state.
|
|
|
|
*/
|
2013-04-23 15:57:33 +00:00
|
|
|
virtual void stateChanged(EventHandler::State state) { }
|
2006-03-27 12:52:19 +00:00
|
|
|
|
2011-11-25 14:17:05 +00:00
|
|
|
/**
|
2013-02-16 19:56:09 +00:00
|
|
|
Returns the default save and load paths for the snapshot directory.
|
2011-11-25 14:17:05 +00:00
|
|
|
Since this varies greatly among different systems and is the one
|
|
|
|
directory that most end-users care about (vs. config file stuff
|
|
|
|
that usually isn't user-modifiable), we create a special method
|
|
|
|
for it.
|
|
|
|
*/
|
2013-05-29 16:27:12 +00:00
|
|
|
virtual string defaultSnapSaveDir() { return "~" BSPF_PATH_SEPARATOR; }
|
|
|
|
virtual string defaultSnapLoadDir() { return "~" BSPF_PATH_SEPARATOR; }
|
2011-11-25 14:17:05 +00:00
|
|
|
|
Added 'WINDOWED_SUPPORT' compile-time argument, which can be used for
those systems which don't actually have a windowing environment. When
this is set, toggling from fullscreen will not be possible, and certain
window-related UI functions will not be accessible.
Completely revamped video subsystem. Windowed and fullscreen modes are
now dealt with separately. Windows can be zoomed using the 'zoom_ui'
and 'zoom_tia' arguments. Fullscreen modes are now set by resolution,
not zoom, so you can specify to always use a certain fullscreen
resolution, and the images will be scaled appropriately. This also
fixes the fullscreen issues on widescreen monitors; just select a
widescreen video mode, and the aspect ratio will always be correct.
Removed dirty-rect support for software rendering of the TIA image,
as it ended up being slower than just updating the entire image.
For those resolutions where it will start to slow down (1024x768 or
higher), one should be using OpenGL.
Fixed issue in Windows when returning from fullscreen mode made the
window constantly 'shrink' in size. It was related to auto-detecting
the desktop resolution, which is really the job of SDL. As such, all
further releases of Stella will require SDL 1.2.10, which includes
this auto-detection code internally.
Made ROM launcher resizable, configurable in sizes from 320x240
to 800x600. Updated the UIDialog to change these quantities from the
UI (Stella will need to be restarted for it to take effect).
Removed aspect ratio support, since it was causing problems, and the
new fullscreen mode work has made it obsolete. i *may* consider it
again in the future, if there's sufficient demand.
Added 'fullres' commandline argument, used to set the fullscreen
resolution.
Added 'launcherres' commandline argument, used to set the ROM
launcher resolution. This replaces 'launchersize' argument, which
has been removed.
Changed 'scale_ui' and 'scale_tia' to 'zoom_ui' and 'zoom_tia',
respectively. Their function remains the same.
Changed meaning of 'gl_fsmax' argument to specify what modes to use
fullscreen OpenGL scaling (previously, this was a boolean, and
didn't consider different modes).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1323 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2007-06-20 16:33:23 +00:00
|
|
|
protected:
|
2005-05-18 22:35:37 +00:00
|
|
|
/**
|
2007-07-19 16:21:39 +00:00
|
|
|
Set the base directory for all Stella files (these files may be
|
|
|
|
located in other places through settings).
|
2005-05-18 22:35:37 +00:00
|
|
|
*/
|
|
|
|
void setBaseDir(const string& basedir);
|
|
|
|
|
|
|
|
/**
|
Removed all reference to 'user.pro', in favour of the previous (to v/2.0)
functionality. The new scheme is as follows:
- Per-user properties are stored in stella.pro, which is located in
system-specific directories (homedir for UNIX/POSIX systems, currentdir
for Win32 systems).
- Completely removed concept of a global properties file, since that
functionality is now included in Stella directly.
- Retained the ability to use an alternative properties file, in which
case the per-user one isn't used at all, and any entries in it override
the built-in defaults.
Removed all reference to 'system' vs. 'user' config files, for much the
same reasons as above. As above, config files are stored in
user-specific places depending on platform. There is no longer a
system-wide config file. This made sense when Stella didn't have built-in
defaults and relied on such a file, but that's no longer the case.
Sorry for any confusion this causes, but it was causing even more confusion
for users. And now we can distribute Stella has a single binary which
doesn't depend on any external files (but will still use them if they're
present).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1050 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-03-17 19:44:19 +00:00
|
|
|
Set the locations of config file
|
2005-05-18 22:35:37 +00:00
|
|
|
*/
|
2009-01-16 16:38:06 +00:00
|
|
|
void setConfigFile(const string& file);
|
2005-02-22 18:41:16 +00:00
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
protected:
|
|
|
|
// Pointer to the EventHandler object
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<EventHandler> myEventHandler;
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2005-02-21 20:43:53 +00:00
|
|
|
// Pointer to the FrameBuffer object
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<FrameBuffer> myFrameBuffer;
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2005-02-21 20:43:53 +00:00
|
|
|
// Pointer to the Sound object
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<Sound> mySound;
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2005-02-21 20:43:53 +00:00
|
|
|
// Pointer to the Settings object
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<Settings> mySettings;
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2014-10-26 15:54:02 +00:00
|
|
|
// Pointer to the Random object
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<Random> myRandom;
|
2014-10-26 15:54:02 +00:00
|
|
|
|
2005-02-21 20:43:53 +00:00
|
|
|
// Pointer to the PropertiesSet object
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<PropertiesSet> myPropSet;
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
// Pointer to the (currently defined) Console object
|
2014-11-09 22:03:50 +00:00
|
|
|
unique_ptr<Console> myConsole;
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2008-03-31 00:59:30 +00:00
|
|
|
// Pointer to the serial port object
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<SerialPort> mySerialPort;
|
2008-03-31 00:59:30 +00:00
|
|
|
|
2005-03-10 22:59:40 +00:00
|
|
|
// Pointer to the Menu object
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<Menu> myMenu;
|
2005-03-10 22:59:40 +00:00
|
|
|
|
2005-08-29 18:36:42 +00:00
|
|
|
// Pointer to the CommandMenu object
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<CommandMenu> myCommandMenu;
|
2005-08-29 18:36:42 +00:00
|
|
|
|
Added first pass of the ROM launcher. When you press 'Start' in the ROM
launcher, it launches Frostbite. Then pressing 'Escape' goes back to the
launcher, and you're able to then launch Frostbite again! Success !!!
Still TODO is actually get a ROM listing and use the selected game, but
the fact that it works multiple times for some game means that the
infrastructure is working correctly :)
Changed behaviour of the 'Escape' key. Specifically, it now only acts
as a key to enter ROM launcher mode. In the case where the emulation
was started without the launcher, the key will now do nothing. From now
on, the only way to quit Stella is Ctrl-Q (or equivalent for OSX),
close the window, or from the 'Quit' button.
Also, the 'Enter launcher mode' event will eventually be made remappable,
as will the 'Enter menu mode' event (currently the 'Tab' key).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@412 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-05-06 18:39:00 +00:00
|
|
|
// Pointer to the Launcher object
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<Launcher> myLauncher;
|
2012-04-20 20:47:53 +00:00
|
|
|
bool myLauncherUsed;
|
2005-03-10 22:59:40 +00:00
|
|
|
|
2005-05-27 18:00:49 +00:00
|
|
|
// Pointer to the Debugger object
|
2014-11-09 22:03:50 +00:00
|
|
|
unique_ptr<Debugger> myDebugger;
|
2005-05-27 18:00:49 +00:00
|
|
|
|
2005-11-11 21:44:19 +00:00
|
|
|
// Pointer to the CheatManager object
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<CheatManager> myCheatManager;
|
2005-11-11 21:44:19 +00:00
|
|
|
|
2007-09-23 17:04:17 +00:00
|
|
|
// Pointer to the StateManager object
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<StateManager> myStateManager;
|
2007-09-23 17:04:17 +00:00
|
|
|
|
2013-01-28 20:39:50 +00:00
|
|
|
// PNG object responsible for loading/saving PNG images
|
2014-11-02 23:40:20 +00:00
|
|
|
unique_ptr<PNGLibrary> myPNGLib;
|
2013-01-28 20:39:50 +00:00
|
|
|
|
2011-06-02 20:53:01 +00:00
|
|
|
// The list of log messages
|
|
|
|
string myLogMessages;
|
|
|
|
|
2005-05-12 18:45:21 +00:00
|
|
|
// Number of times per second to iterate through the main loop
|
2008-05-19 21:16:58 +00:00
|
|
|
float myDisplayFrameRate;
|
2005-05-12 18:45:21 +00:00
|
|
|
|
2005-05-05 00:10:49 +00:00
|
|
|
// Time per frame for a video update, based on the current framerate
|
|
|
|
uInt32 myTimePerFrame;
|
|
|
|
|
2010-06-16 15:40:57 +00:00
|
|
|
// The time (in milliseconds) from the UNIX epoch when the application starts
|
|
|
|
uInt32 myMillisAtStart;
|
|
|
|
|
2006-12-28 18:31:27 +00:00
|
|
|
// Indicates whether to stop the main loop
|
|
|
|
bool myQuitLoop;
|
|
|
|
|
2005-02-22 18:41:16 +00:00
|
|
|
private:
|
2009-06-18 17:38:42 +00:00
|
|
|
string myBaseDir;
|
2005-02-22 18:41:16 +00:00
|
|
|
string myStateDir;
|
2013-02-16 19:56:09 +00:00
|
|
|
string mySnapshotSaveDir;
|
|
|
|
string mySnapshotLoadDir;
|
2013-02-17 00:19:14 +00:00
|
|
|
string myNVRamDir;
|
2010-09-06 00:17:51 +00:00
|
|
|
string myCfgDir;
|
2005-02-22 18:41:16 +00:00
|
|
|
|
2007-07-19 16:21:39 +00:00
|
|
|
string myCheatFile;
|
Removed all reference to 'user.pro', in favour of the previous (to v/2.0)
functionality. The new scheme is as follows:
- Per-user properties are stored in stella.pro, which is located in
system-specific directories (homedir for UNIX/POSIX systems, currentdir
for Win32 systems).
- Completely removed concept of a global properties file, since that
functionality is now included in Stella directly.
- Retained the ability to use an alternative properties file, in which
case the per-user one isn't used at all, and any entries in it override
the built-in defaults.
Removed all reference to 'system' vs. 'user' config files, for much the
same reasons as above. As above, config files are stored in
user-specific places depending on platform. There is no longer a
system-wide config file. This made sense when Stella didn't have built-in
defaults and relied on such a file, but that's no longer the case.
Sorry for any confusion this causes, but it was causing even more confusion
for users. And now we can distribute Stella has a single binary which
doesn't depend on any external files (but will still use them if they're
present).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1050 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-03-17 19:44:19 +00:00
|
|
|
string myConfigFile;
|
2007-07-19 16:21:39 +00:00
|
|
|
string myPaletteFile;
|
Removed all reference to 'user.pro', in favour of the previous (to v/2.0)
functionality. The new scheme is as follows:
- Per-user properties are stored in stella.pro, which is located in
system-specific directories (homedir for UNIX/POSIX systems, currentdir
for Win32 systems).
- Completely removed concept of a global properties file, since that
functionality is now included in Stella directly.
- Retained the ability to use an alternative properties file, in which
case the per-user one isn't used at all, and any entries in it override
the built-in defaults.
Removed all reference to 'system' vs. 'user' config files, for much the
same reasons as above. As above, config files are stored in
user-specific places depending on platform. There is no longer a
system-wide config file. This made sense when Stella didn't have built-in
defaults and relied on such a file, but that's no longer the case.
Sorry for any confusion this causes, but it was causing even more confusion
for users. And now we can distribute Stella has a single binary which
doesn't depend on any external files (but will still use them if they're
present).
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1050 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-03-17 19:44:19 +00:00
|
|
|
string myPropertiesFile;
|
2005-02-22 18:41:16 +00:00
|
|
|
|
2013-02-12 21:57:14 +00:00
|
|
|
FilesystemNode myRomFile;
|
2009-01-01 22:44:14 +00:00
|
|
|
string myRomMD5;
|
2005-05-05 00:10:49 +00:00
|
|
|
|
2005-05-16 00:02:32 +00:00
|
|
|
string myFeatures;
|
2009-10-25 22:34:40 +00:00
|
|
|
string myBuildInfo;
|
2005-05-16 00:02:32 +00:00
|
|
|
|
2006-12-28 18:31:27 +00:00
|
|
|
// Indicates whether the main processing loop should proceed
|
|
|
|
TimingInfo myTimingInfo;
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
private:
|
Some configure work:
- removed TEXTURES_ARE_DIRTY logic, and just recreate the GL textures
when a screenmode changes
- enable checking for machine type and if nasm is available
- logic to enable scaler mode only when in OpenGL mode (still not complete
and defaults to off)
First pass at adding scaler code to OpenGL. Still much work TODO,
but the C version is working correctly (asm is causing crashes,
haven't figured out why). GL quad coordinates aren't properly
set yet, so the image always appears in the upper left corner, and
is not scaled to the window size. CPU usage is also quite high,
but I'm on a 1GHz laptop with i950 GL, so that may explain it.
Fixed long-standing bug in software rendering, where switching to a
lower-res screen while a message is being displayed would cause a
segfault.
Large refactoring of mainSDL. Specifically, OSystem now owns all
the subsystems except for Settings, taking responsibility for creating
and destroying them.
Properties fixes for 'Tomarc the Barbarian' and 'Gyruss'.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1136 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-22 18:58:46 +00:00
|
|
|
/**
|
2014-05-07 11:15:00 +00:00
|
|
|
Creates the various framebuffers/renderers available in this system.
|
|
|
|
Note that it will only create one type per run of Stella.
|
Some configure work:
- removed TEXTURES_ARE_DIRTY logic, and just recreate the GL textures
when a screenmode changes
- enable checking for machine type and if nasm is available
- logic to enable scaler mode only when in OpenGL mode (still not complete
and defaults to off)
First pass at adding scaler code to OpenGL. Still much work TODO,
but the C version is working correctly (asm is causing crashes,
haven't figured out why). GL quad coordinates aren't properly
set yet, so the image always appears in the upper left corner, and
is not scaled to the window size. CPU usage is also quite high,
but I'm on a 1GHz laptop with i950 GL, so that may explain it.
Fixed long-standing bug in software rendering, where switching to a
lower-res screen while a message is being displayed would cause a
segfault.
Large refactoring of mainSDL. Specifically, OSystem now owns all
the subsystems except for Settings, taking responsibility for creating
and destroying them.
Properties fixes for 'Tomarc the Barbarian' and 'Gyruss'.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1136 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-22 18:58:46 +00:00
|
|
|
|
2010-07-22 15:41:46 +00:00
|
|
|
@return Success or failure of the framebuffer creation
|
Some configure work:
- removed TEXTURES_ARE_DIRTY logic, and just recreate the GL textures
when a screenmode changes
- enable checking for machine type and if nasm is available
- logic to enable scaler mode only when in OpenGL mode (still not complete
and defaults to off)
First pass at adding scaler code to OpenGL. Still much work TODO,
but the C version is working correctly (asm is causing crashes,
haven't figured out why). GL quad coordinates aren't properly
set yet, so the image always appears in the upper left corner, and
is not scaled to the window size. CPU usage is also quite high,
but I'm on a 1GHz laptop with i950 GL, so that may explain it.
Fixed long-standing bug in software rendering, where switching to a
lower-res screen while a message is being displayed would cause a
segfault.
Large refactoring of mainSDL. Specifically, OSystem now owns all
the subsystems except for Settings, taking responsibility for creating
and destroying them.
Properties fixes for 'Tomarc the Barbarian' and 'Gyruss'.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1136 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-22 18:58:46 +00:00
|
|
|
*/
|
2010-07-22 15:41:46 +00:00
|
|
|
FBInitStatus createFrameBuffer();
|
Some configure work:
- removed TEXTURES_ARE_DIRTY logic, and just recreate the GL textures
when a screenmode changes
- enable checking for machine type and if nasm is available
- logic to enable scaler mode only when in OpenGL mode (still not complete
and defaults to off)
First pass at adding scaler code to OpenGL. Still much work TODO,
but the C version is working correctly (asm is causing crashes,
haven't figured out why). GL quad coordinates aren't properly
set yet, so the image always appears in the upper left corner, and
is not scaled to the window size. CPU usage is also quite high,
but I'm on a 1GHz laptop with i950 GL, so that may explain it.
Fixed long-standing bug in software rendering, where switching to a
lower-res screen while a message is being displayed would cause a
segfault.
Large refactoring of mainSDL. Specifically, OSystem now owns all
the subsystems except for Settings, taking responsibility for creating
and destroying them.
Properties fixes for 'Tomarc the Barbarian' and 'Gyruss'.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1136 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-10-22 18:58:46 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Creates the various sound devices available in this system
|
|
|
|
*/
|
|
|
|
void createSound();
|
|
|
|
|
2006-12-28 18:31:27 +00:00
|
|
|
/**
|
2009-01-01 22:44:14 +00:00
|
|
|
Creates an actual Console object based on the given info.
|
|
|
|
|
2013-02-12 21:57:14 +00:00
|
|
|
@param romfile The file node of the ROM to use (contains path)
|
2009-01-01 22:44:14 +00:00
|
|
|
@param md5 The MD5sum of the ROM
|
2010-04-09 20:13:12 +00:00
|
|
|
@param type The bankswitch type of the ROM
|
|
|
|
@param id The additional id (if any) used by the ROM
|
2009-01-01 22:44:14 +00:00
|
|
|
|
2014-11-09 22:03:50 +00:00
|
|
|
@return The actual Console object, otherwise nullptr.
|
2009-01-01 22:44:14 +00:00
|
|
|
*/
|
2014-11-09 22:03:50 +00:00
|
|
|
unique_ptr<Console> openConsole(const FilesystemNode& romfile, string& md5,
|
|
|
|
string& type, string& id);
|
2009-01-01 22:44:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Open the given ROM and return an array containing its contents.
|
|
|
|
Also, the properties database is updated with a valid ROM name
|
|
|
|
for this ROM (if necessary).
|
|
|
|
|
2013-02-12 21:57:14 +00:00
|
|
|
@param rom The file node of the ROM to open (contains path)
|
2009-01-01 22:44:14 +00:00
|
|
|
@param md5 The md5 calculated from the ROM file
|
|
|
|
(will be recalculated if necessary)
|
|
|
|
@param size The amount of data read into the image array
|
|
|
|
|
|
|
|
@return Pointer to the array, with size >=0 indicating valid data
|
|
|
|
(calling method is responsible for deleting it)
|
|
|
|
*/
|
2013-02-12 21:57:14 +00:00
|
|
|
uInt8* openROM(const FilesystemNode& rom, string& md5, uInt32& size);
|
2009-01-01 22:44:14 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Gets all possible info about the given console.
|
2006-12-28 18:31:27 +00:00
|
|
|
|
2009-01-01 22:44:14 +00:00
|
|
|
@param console The console to use
|
|
|
|
@return Some information about this console
|
2006-12-28 18:31:27 +00:00
|
|
|
*/
|
2014-11-09 22:03:50 +00:00
|
|
|
string getROMInfo(const Console& console);
|
2006-12-28 18:31:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Initializes the timing so that the mainloop is reset to its
|
|
|
|
initial values.
|
|
|
|
*/
|
|
|
|
void resetLoopTiming();
|
|
|
|
|
2010-09-06 00:17:51 +00:00
|
|
|
/**
|
|
|
|
Validate the directory name, and create it if necessary.
|
|
|
|
Also, update the settings with the new name. For now, validation
|
|
|
|
means that the path must always end with the appropriate separator.
|
2011-11-25 14:17:05 +00:00
|
|
|
|
|
|
|
@param path The actual path being accessed and created
|
|
|
|
@param setting The setting corresponding to the path being considered
|
|
|
|
@param defaultpath The default path to use if the settings don't exist
|
2010-09-06 00:17:51 +00:00
|
|
|
*/
|
2011-11-25 14:17:05 +00:00
|
|
|
void validatePath(string& path, const string& setting,
|
|
|
|
const string& defaultpath);
|
2010-09-06 00:17:51 +00:00
|
|
|
|
2014-10-26 19:51:02 +00:00
|
|
|
// Copy constructor and assignment operator not supported
|
2005-02-21 02:23:57 +00:00
|
|
|
OSystem(const OSystem&);
|
|
|
|
OSystem& operator = (const OSystem&);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|