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
|
|
|
|
//
|
2011-12-31 21:56:36 +00:00
|
|
|
// Copyright (c) 1995-2012 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;
|
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
|
|
|
|
2007-09-03 18:37:24 +00:00
|
|
|
namespace GUI {
|
|
|
|
class Font;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
#include "Array.hxx"
|
2005-05-02 19:36:05 +00:00
|
|
|
#include "FrameBuffer.hxx"
|
2005-02-21 02:23:57 +00:00
|
|
|
#include "bspf.hxx"
|
|
|
|
|
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
|
|
|
struct Resolution {
|
|
|
|
uInt32 width;
|
|
|
|
uInt32 height;
|
|
|
|
string name;
|
|
|
|
};
|
|
|
|
typedef Common::Array<Resolution> ResolutionList;
|
2005-02-21 02:23:57 +00:00
|
|
|
|
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:
|
2005-02-21 20:43:53 +00:00
|
|
|
/**
|
|
|
|
Adds the specified settings object to the system.
|
|
|
|
|
|
|
|
@param settings The settings object to add
|
|
|
|
*/
|
|
|
|
void attach(Settings* settings) { mySettings = settings; }
|
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
/**
|
|
|
|
Get the event handler of the system
|
|
|
|
|
|
|
|
@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
|
|
|
|
|
|
|
/**
|
|
|
|
Get the frame buffer of the system
|
|
|
|
|
|
|
|
@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
|
|
|
|
|
|
|
/**
|
|
|
|
Get the sound object of the system
|
|
|
|
|
|
|
|
@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
|
|
|
|
|
|
|
/**
|
|
|
|
Get the settings object of the system
|
|
|
|
|
|
|
|
@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
|
|
|
|
|
|
|
/**
|
|
|
|
Get the set of game properties for the system
|
|
|
|
|
|
|
|
@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
|
|
|
|
|
|
|
/**
|
|
|
|
Get the console of the system.
|
|
|
|
|
|
|
|
@return The console object
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
Console& console() const { return *myConsole; }
|
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
|
|
|
|
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
|
2012-01-17 22:20:20 +00:00
|
|
|
/**
|
|
|
|
Create all child objects which belong to this OSystem
|
|
|
|
*/
|
|
|
|
void createDebugger(Console& console);
|
|
|
|
|
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
|
|
|
|
|
2009-01-04 22:27:44 +00:00
|
|
|
/**
|
2010-08-14 01:01:27 +00:00
|
|
|
Get the font object of the system
|
2009-01-04 22:27:44 +00:00
|
|
|
|
|
|
|
@return The font reference
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
const GUI::Font& font() const { return *myFont; }
|
2009-01-04 22:27:44 +00:00
|
|
|
|
2005-06-08 18:45:09 +00:00
|
|
|
/**
|
2010-08-14 01:01:27 +00:00
|
|
|
Get the info font object of the system
|
2005-06-08 18:45:09 +00:00
|
|
|
|
|
|
|
@return The font reference
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
const GUI::Font& infoFont() const { return *myInfoFont; }
|
2010-08-14 01:01:27 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Get the small font object of the system
|
|
|
|
|
|
|
|
@return The font reference
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
const GUI::Font& smallFont() const { return *mySmallFont; }
|
2005-06-08 18:45:09 +00:00
|
|
|
|
2006-02-22 17:38:04 +00:00
|
|
|
/**
|
|
|
|
Get the launcher font object of the system
|
|
|
|
|
|
|
|
@return The font reference
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
const GUI::Font& launcherFont() const { return *myLauncherFont; }
|
2006-02-22 17:38:04 +00:00
|
|
|
|
2005-06-08 18:45:09 +00:00
|
|
|
/**
|
|
|
|
Get the console font object of the system
|
|
|
|
|
|
|
|
@return The console font reference
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
const GUI::Font& consoleFont() const { return *myConsoleFont; }
|
2005-06-08 18:45:09 +00:00
|
|
|
|
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();
|
|
|
|
|
2007-08-10 18:27:12 +00:00
|
|
|
/**
|
|
|
|
Set the user-interface palette which is specified in current settings.
|
|
|
|
*/
|
|
|
|
void setUIPalette();
|
|
|
|
|
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
|
|
|
|
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
|
|
|
/**
|
|
|
|
Get the maximum dimensions of a window for the video hardware.
|
|
|
|
*/
|
2011-05-10 15:04:19 +00:00
|
|
|
uInt32 desktopWidth() const { return myDesktopWidth; }
|
|
|
|
uInt32 desktopHeight() const { return myDesktopHeight; }
|
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
|
|
|
|
|
|
|
/**
|
|
|
|
Get the supported fullscreen resolutions for the video hardware.
|
|
|
|
|
|
|
|
@return An array of supported resolutions
|
|
|
|
*/
|
|
|
|
const ResolutionList& supportedResolutions() const { return myResolutions; }
|
|
|
|
|
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
|
|
|
/**
|
2009-01-16 16:38:06 +00:00
|
|
|
Return the full/complete directory name for storing PNG snapshots.
|
2007-07-19 16:21:39 +00:00
|
|
|
*/
|
2008-03-30 15:01:38 +00:00
|
|
|
const string& snapshotDir() const { return mySnapshotDir; }
|
2007-07-19 16:21:39 +00:00
|
|
|
|
2009-01-21 12:03:17 +00:00
|
|
|
/**
|
|
|
|
Return the full/complete directory name for storing EEPROM files.
|
|
|
|
*/
|
|
|
|
const string& eepromDir() const { return myEEPROMDir; }
|
|
|
|
|
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
|
|
|
|
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 ROM file.
|
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
|
|
|
const string& 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
|
|
|
|
2005-05-05 19:00:48 +00:00
|
|
|
@param romfile The full pathname of the ROM to use
|
2007-09-01 23:31:18 +00:00
|
|
|
@param md5 The MD5sum of the ROM
|
|
|
|
|
2005-05-05 19:00:48 +00:00
|
|
|
@return True on successful creation, otherwise false
|
2005-05-05 00:10:49 +00:00
|
|
|
*/
|
2007-09-01 23:31:18 +00:00
|
|
|
bool createConsole(const string& romfile = "", const string& md5 = "");
|
2005-05-05 00:10:49 +00:00
|
|
|
|
2006-12-28 18:31:27 +00:00
|
|
|
/**
|
|
|
|
Deletes the currently defined console, if it exists.
|
|
|
|
Also prints some statistics (fps, total frames, etc).
|
|
|
|
*/
|
|
|
|
void deleteConsole();
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
@return True on success, otherwise false
|
|
|
|
*/
|
|
|
|
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.
|
|
|
|
|
|
|
|
@param romfile The full pathname of the ROM to use
|
|
|
|
@return Some information about this ROM
|
|
|
|
*/
|
|
|
|
string getROMInfo(const string& romfile);
|
|
|
|
|
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
|
|
|
/**
|
|
|
|
The build information for Stella (SDL version, architecture, etc).
|
|
|
|
|
|
|
|
@return The build info
|
|
|
|
*/
|
|
|
|
const string& buildInfo() const { return myBuildInfo; }
|
|
|
|
|
2008-03-14 19:34:57 +00:00
|
|
|
/**
|
|
|
|
Calculate the MD5sum of the given file.
|
|
|
|
|
|
|
|
@param filename Filename of potential ROM file
|
2010-04-29 12:46:07 +00:00
|
|
|
*/
|
2008-03-14 19:34:57 +00:00
|
|
|
string MD5FromFile(const string& filename);
|
|
|
|
|
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-01-05 18:53:23 +00:00
|
|
|
/**
|
2011-11-29 22:12:13 +00:00
|
|
|
This method determines the default mapping of joystick actions to
|
2006-01-05 18:53:23 +00:00
|
|
|
Stella events for a specific system/platform.
|
2010-08-03 21:04:58 +00:00
|
|
|
|
|
|
|
@param event The event which to (re)set (Event::NoType resets all)
|
|
|
|
@param mode The mode for which the defaults are set
|
2006-01-05 18:53:23 +00:00
|
|
|
*/
|
2010-08-03 21:04:58 +00:00
|
|
|
virtual void setDefaultJoymap(Event::Type event, EventMode mode);
|
2006-01-05 18:53:23 +00:00
|
|
|
|
2006-01-30 01:01:44 +00:00
|
|
|
/**
|
|
|
|
This method creates events from platform-specific hardware.
|
|
|
|
*/
|
|
|
|
virtual void pollEvent();
|
|
|
|
|
2006-03-27 12:52:19 +00:00
|
|
|
/**
|
|
|
|
Informs the OSystem of a change in EventHandler state.
|
|
|
|
*/
|
|
|
|
virtual void stateChanged(EventHandler::State state);
|
|
|
|
|
2011-11-25 14:17:05 +00:00
|
|
|
/**
|
|
|
|
Returns the default path for the snapshot directory.
|
|
|
|
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.
|
|
|
|
*/
|
|
|
|
virtual string defaultSnapDir() { return "~"; }
|
|
|
|
|
2010-08-11 21:53:19 +00:00
|
|
|
/**
|
|
|
|
Set the position of the application window, generally using
|
2010-08-11 22:51:22 +00:00
|
|
|
platform-specific code. Note that this method is only ever
|
|
|
|
called for windowed mode, so no provisions need be made
|
|
|
|
for fullscreen mode.
|
2010-08-11 21:53:19 +00:00
|
|
|
*/
|
|
|
|
virtual void setAppWindowPos(int x, int y, int w, int h) { };
|
|
|
|
|
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:
|
|
|
|
/**
|
|
|
|
Query the OSystem video hardware for resolution information.
|
|
|
|
*/
|
2009-01-24 17:32:29 +00:00
|
|
|
virtual bool queryVideoHardware();
|
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
|
|
|
|
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
|
|
|
|
EventHandler* myEventHandler;
|
|
|
|
|
2005-02-21 20:43:53 +00:00
|
|
|
// Pointer to the FrameBuffer object
|
|
|
|
FrameBuffer* myFrameBuffer;
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2005-02-21 20:43:53 +00:00
|
|
|
// Pointer to the Sound object
|
|
|
|
Sound* mySound;
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2005-02-21 20:43:53 +00:00
|
|
|
// Pointer to the Settings object
|
|
|
|
Settings* mySettings;
|
2005-02-21 02:23:57 +00:00
|
|
|
|
2005-02-21 20:43:53 +00:00
|
|
|
// Pointer to the PropertiesSet object
|
|
|
|
PropertiesSet* myPropSet;
|
2005-02-21 02:23:57 +00:00
|
|
|
|
|
|
|
// Pointer to the (currently defined) Console object
|
|
|
|
Console* myConsole;
|
|
|
|
|
2008-03-31 00:59:30 +00:00
|
|
|
// Pointer to the serial port object
|
|
|
|
SerialPort* mySerialPort;
|
|
|
|
|
2005-03-10 22:59:40 +00:00
|
|
|
// Pointer to the Menu object
|
|
|
|
Menu* myMenu;
|
|
|
|
|
2005-08-29 18:36:42 +00:00
|
|
|
// Pointer to the CommandMenu object
|
|
|
|
CommandMenu* myCommandMenu;
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
Debugger* myDebugger;
|
|
|
|
|
2005-11-11 21:44:19 +00:00
|
|
|
// Pointer to the CheatManager object
|
|
|
|
CheatManager* myCheatManager;
|
|
|
|
|
2007-09-23 17:04:17 +00:00
|
|
|
// Pointer to the StateManager object
|
|
|
|
StateManager* myStateManager;
|
|
|
|
|
2011-06-02 20:53:01 +00:00
|
|
|
// The list of log messages
|
|
|
|
string myLogMessages;
|
|
|
|
|
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
|
|
|
// Maximum dimensions of the desktop area
|
|
|
|
uInt32 myDesktopWidth, myDesktopHeight;
|
|
|
|
|
|
|
|
// Supported fullscreen resolutions
|
|
|
|
ResolutionList myResolutions;
|
|
|
|
|
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:
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
enum { kNumUIPalettes = 2 };
|
2009-06-18 17:38:42 +00:00
|
|
|
string myBaseDir;
|
2005-02-22 18:41:16 +00:00
|
|
|
string myStateDir;
|
2008-03-30 15:01:38 +00:00
|
|
|
string mySnapshotDir;
|
2009-01-21 12:03:17 +00:00
|
|
|
string myEEPROMDir;
|
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
|
|
|
|
2005-05-05 00:10:49 +00:00
|
|
|
string 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-02-22 17:38:04 +00:00
|
|
|
// The font object to use for the normal in-game GUI
|
2005-06-08 18:45:09 +00:00
|
|
|
GUI::Font* myFont;
|
|
|
|
|
2010-08-14 01:01:27 +00:00
|
|
|
// The info font object to use for the normal in-game GUI
|
|
|
|
GUI::Font* myInfoFont;
|
|
|
|
|
|
|
|
// The font object to use when space is very limited
|
|
|
|
GUI::Font* mySmallFont;
|
|
|
|
|
2006-02-22 17:38:04 +00:00
|
|
|
// The font object to use for the ROM launcher
|
|
|
|
GUI::Font* myLauncherFont;
|
|
|
|
|
|
|
|
// The font object to use for the console/debugger
|
2005-06-08 18:45:09 +00:00
|
|
|
GUI::Font* myConsoleFont;
|
|
|
|
|
2006-12-28 18:31:27 +00:00
|
|
|
// Indicates whether the main processing loop should proceed
|
|
|
|
TimingInfo myTimingInfo;
|
|
|
|
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
// Table of RGB values for GUI elements
|
2009-01-03 22:57:12 +00:00
|
|
|
static uInt32 ourGUIColors[kNumUIPalettes][kNumColors-256];
|
OK, some huge changes across the board, so lets see if I get it all:
After much request, added ability to access the settings menu from the
ROM browser dialog. This menu now contains almost all items that can
be selected in Stella, and can be accessed in-game as before.
Completely removed pause functionality from the core code. It made
sense back when Stella was a single-mode program: there were two modes;
emulation and pause. Now that there are other event modes, the
EventHandler state machine is getting too complicated. If you want to
pause, you can simply enter one of the in-game menus. Related to this,
when the app is minimized, Stella enters the menu dialog state.
Previously, minimizing the app caused a pause, but since there was no
onscreen feedback, many people assumed the app locked up.
Added centering to all Dialog boxes, which is done dynamically, as they're
placed on the dialog stack to be drawn to the screen.
Cleaned up the API of Console/FrameBuffer/OSystem classes wrt to palettes
and timing. Parts of each were being done in different classes; now it
should be more consistent.
Started infrastructure for user-selectable UI palettes. For now, there's
no way to change it in the GUI, and it defaults to the normal palette.
Eventually, there will be several choices selectable from an in-game
menu.
Removed '-channels' commandline argument, since that feature can be
set from the ROM properties.
Added '128' to the choices for fragment size in AudioDialog.
Tweaked the OpenGL dynamic loading code to test both the given GL
lib, and if that fails to use auto-detection. It seems in the OSX port,
the first approach works for some people, and not the other (and vice-versa),
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1255 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2006-12-30 22:26:29 +00:00
|
|
|
|
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
|
|
|
/**
|
|
|
|
Creates the various framebuffers/renderers available in this system
|
2008-12-26 20:05:17 +00:00
|
|
|
(for now, that means either 'software' or 'opengl'). 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
|
|
|
|
Note that if OpenGL mode fails because OpenGL is not
|
|
|
|
available, rendering will attempt to fall back to
|
|
|
|
software mode
|
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
|
|
|
|
(for now, that means either 'SDL' or 'Null').
|
|
|
|
*/
|
|
|
|
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.
|
|
|
|
|
|
|
|
@param romfile The full pathname of the ROM to use
|
|
|
|
@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
|
|
|
|
|
|
|
@return The actual Console object, otherwise NULL
|
|
|
|
(calling method is responsible for deleting it)
|
|
|
|
*/
|
2010-04-09 20:13:12 +00:00
|
|
|
Console* openConsole(const string& 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).
|
|
|
|
|
|
|
|
@param rom The absolute pathname of the ROM file
|
|
|
|
@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)
|
|
|
|
*/
|
2009-06-17 17:04:55 +00:00
|
|
|
uInt8* openROM(string rom, string& md5, uInt32& size);
|
2009-01-01 22:44:14 +00:00
|
|
|
|
2012-05-08 13:24:10 +00:00
|
|
|
/**
|
|
|
|
Open the given ZIP archive, parsing filename for the contents of the
|
|
|
|
desired file to load. If the filename ends in '.zip', use the first
|
|
|
|
file found in the archive, otherwise traverse the archive and use the
|
|
|
|
file specified after '.zip' in the filename.
|
|
|
|
|
|
|
|
@param name The absolute pathname of the file
|
|
|
|
@param image Pointer to the array, with size >=0 indicating valid data
|
|
|
|
@param size The amount of data read into the image array
|
|
|
|
|
|
|
|
@return True if this was a zip file (regardless of whether it
|
|
|
|
actually loaded any valid data, else false
|
|
|
|
*/
|
|
|
|
bool loadFromZIP(const string& filename, uInt8** image, 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
|
|
|
*/
|
2009-01-01 22:44:14 +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
|
|
|
|
2005-02-21 02:23:57 +00:00
|
|
|
// Copy constructor isn't supported by this class so make it private
|
|
|
|
OSystem(const OSystem&);
|
|
|
|
|
|
|
|
// Assignment operator isn't supported by this class so make it private
|
|
|
|
OSystem& operator = (const OSystem&);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|