2002-03-21 22:47:00 +00:00
|
|
|
//============================================================================
|
|
|
|
//
|
|
|
|
// SSSS tt lll lll
|
|
|
|
// SS SS tt ll ll
|
|
|
|
// SS tttttt eeee ll ll aaaa
|
|
|
|
// SSSS tt ee ee ll ll aa
|
|
|
|
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
|
|
|
// SS SS tt ee ll ll aa aa
|
|
|
|
// SSSS ttt eeeee llll llll aaaaa
|
|
|
|
//
|
2013-01-04 19:49:01 +00:00
|
|
|
// Copyright (c) 1995-2013 by Bradford W. Mott, Stephen Anthony
|
2010-04-10 21:37:23 +00:00
|
|
|
// and the Stella Team
|
2002-03-21 22:47:00 +00:00
|
|
|
//
|
2010-01-10 03:23:32 +00:00
|
|
|
// See the file "License.txt" for information on usage and redistribution of
|
2002-03-21 22:47:00 +00:00
|
|
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
|
//
|
2009-05-13 13:55:40 +00:00
|
|
|
// $Id$
|
2002-03-21 22:47:00 +00:00
|
|
|
//============================================================================
|
|
|
|
|
The first version of a GUI for event remapping is here!
Now for the things that aren't finished yet:
- Only the most basic functions can be remapped. If you
erase the mapping for those that can't yet be remapped,
you'll have to delete the 'keymap' line from stellarc and
start over.
- Core events can only be remapped to other keys on the keyboard.
I haven't got the joystick remapping working yet (but it should
be easy to do).
- The TIA needs to be modified to show 320 pixels horizontally.
Right now, I'm using 8 pixel-width fonts on a framebuffer of
160 pixels, so there's not a lot of horizontal real estate.
So text will probably overwrite other stuff. This is cosmetic,
and WILL be fixed.
- Modification of the TIA will break every frontends rendering
code. It had to be done sometime ...
- I haven't yet added any user feedback mechanism for the user. So when
you go into remap mode and are about to remap a key, you won't
know it :) I'll be adding arrows (like in XMAME) ...
I've added a "Game Information" menu, which shows things like Game name,
manufacturer, rarity, type, etc. Basically stuff from the stella.pro file.
It has no purpose other than for coolness :)
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@193 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-28 21:59:24 +00:00
|
|
|
#include <cassert>
|
2003-09-19 15:45:01 +00:00
|
|
|
#include <sstream>
|
|
|
|
#include <fstream>
|
2007-06-20 20:36:28 +00:00
|
|
|
#include <algorithm>
|
2003-09-19 15:45:01 +00:00
|
|
|
|
2007-09-03 18:37:24 +00:00
|
|
|
#include "bspf.hxx"
|
|
|
|
|
2005-02-21 20:43:53 +00:00
|
|
|
#include "OSystem.hxx"
|
2005-05-11 19:36:00 +00:00
|
|
|
#include "Version.hxx"
|
2007-09-03 18:37:24 +00:00
|
|
|
|
2002-03-21 22:47:00 +00:00
|
|
|
#include "Settings.hxx"
|
|
|
|
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2005-02-21 20:43:53 +00:00
|
|
|
Settings::Settings(OSystem* osystem)
|
2006-03-05 01:18:42 +00:00
|
|
|
: myOSystem(osystem)
|
2002-03-21 22:47:00 +00:00
|
|
|
{
|
2005-02-21 20:43:53 +00:00
|
|
|
// Add this settings object to the OSystem
|
|
|
|
myOSystem->attach(this);
|
|
|
|
|
2006-03-06 02:26:16 +00:00
|
|
|
// Add options that are common to all versions of Stella
|
|
|
|
setInternal("video", "soft");
|
|
|
|
|
2007-09-13 00:48:13 +00:00
|
|
|
// OpenGL specific options
|
2012-05-12 22:21:59 +00:00
|
|
|
setInternal("gl_inter", "false");
|
2011-12-21 17:18:53 +00:00
|
|
|
setInternal("gl_aspectn", "90");
|
2009-01-24 17:32:29 +00:00
|
|
|
setInternal("gl_aspectp", "100");
|
2012-05-06 17:45:48 +00:00
|
|
|
setInternal("gl_fsscale", "false");
|
2007-01-03 12:59:24 +00:00
|
|
|
setInternal("gl_lib", "libGL.so");
|
2011-12-21 17:18:53 +00:00
|
|
|
setInternal("gl_vsync", "true");
|
2011-08-19 14:30:15 +00:00
|
|
|
setInternal("gl_vbo", "true");
|
2006-03-06 02:26:16 +00:00
|
|
|
|
2007-09-13 00:48:13 +00:00
|
|
|
// Framebuffer-related options
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
setInternal("tia_filter", "zoom2x");
|
2009-08-07 11:45:14 +00:00
|
|
|
setInternal("fullscreen", "0");
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
setInternal("fullres", "auto");
|
2010-09-09 13:40:15 +00:00
|
|
|
setInternal("center", "false");
|
2011-06-02 20:53:01 +00:00
|
|
|
setInternal("grabmouse", "true");
|
2006-03-06 02:26:16 +00:00
|
|
|
setInternal("palette", "standard");
|
2011-12-03 23:14:06 +00:00
|
|
|
setInternal("colorloss", "true");
|
2008-05-21 16:49:07 +00:00
|
|
|
setInternal("timing", "sleep");
|
Revamped the result on floating pins for TIA reads. Previously, this was
controlled by 'tiafloat', which has now been removed. Now, all
undriven pins take on the last value on the databus. This fixes a bug
in those reads where bit 6 or bits 6 & 7 are also undriven (previously,
these bits would always be zero, and only bits 0-5 were from lastdatabus.
Added new commandline argument 'tiadriven', which defaults to false.
In this default case, relevant bits take on values from the databus.
If true, relevant bits still take on databus values, but some are
randomly driven high as well. This helps to expose bugs when
developers assume the values for undriven/floating bits.
Added 'uimessages' commandline argument and associated UI item. When
disabled, messages which are normally shown in-game are disabled.
Certain messages which indicate a serious error are still shown, however.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1900 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-11-10 20:12:50 +00:00
|
|
|
setInternal("uimessages", "true");
|
2006-03-06 02:26:16 +00:00
|
|
|
|
2012-05-06 17:45:48 +00:00
|
|
|
// TV filtering options
|
|
|
|
setInternal("tv_filter", "0");
|
2012-10-17 13:49:33 +00:00
|
|
|
setInternal("tv_scanlines", "25");
|
2012-05-08 19:37:04 +00:00
|
|
|
setInternal("tv_scaninter", "true");
|
2012-05-10 15:36:20 +00:00
|
|
|
// TV options when using 'custom' mode
|
2012-05-12 22:21:59 +00:00
|
|
|
setInternal("tv_contrast", "0.0");
|
|
|
|
setInternal("tv_brightness", "0.0");
|
|
|
|
setInternal("tv_hue", "0.0");
|
|
|
|
setInternal("tv_saturation", "0.0");
|
|
|
|
setInternal("tv_gamma", "0.0");
|
2012-05-10 15:36:20 +00:00
|
|
|
setInternal("tv_sharpness", "0.0");
|
|
|
|
setInternal("tv_resolution", "0.0");
|
|
|
|
setInternal("tv_artifacts", "0.0");
|
|
|
|
setInternal("tv_fringing", "0.0");
|
|
|
|
setInternal("tv_bleed", "0.0");
|
2012-03-25 17:51:13 +00:00
|
|
|
|
2007-09-13 00:48:13 +00:00
|
|
|
// Sound options
|
2006-03-06 02:26:16 +00:00
|
|
|
setInternal("sound", "true");
|
|
|
|
setInternal("fragsize", "512");
|
|
|
|
setInternal("freq", "31400");
|
|
|
|
setInternal("tiafreq", "31400");
|
|
|
|
setInternal("volume", "100");
|
|
|
|
|
2007-09-13 00:48:13 +00:00
|
|
|
// Input event options
|
2006-03-06 02:26:16 +00:00
|
|
|
setInternal("keymap", "");
|
|
|
|
setInternal("joymap", "");
|
2010-07-21 17:05:34 +00:00
|
|
|
setInternal("combomap", "");
|
2010-08-21 23:08:44 +00:00
|
|
|
setInternal("joydeadzone", "13");
|
2009-08-05 20:33:40 +00:00
|
|
|
setInternal("joyallow4", "false");
|
2012-04-19 13:00:02 +00:00
|
|
|
setInternal("usemouse", "true");
|
2011-05-06 14:29:39 +00:00
|
|
|
setInternal("dsense", "5");
|
|
|
|
setInternal("msense", "7");
|
2012-03-03 00:56:31 +00:00
|
|
|
setInternal("saport", "lr");
|
2010-03-05 22:02:12 +00:00
|
|
|
setInternal("ctrlcombo", "true");
|
2006-03-06 02:26:16 +00:00
|
|
|
|
2007-09-13 00:48:13 +00:00
|
|
|
// Snapshot options
|
2011-11-25 14:17:05 +00:00
|
|
|
setInternal("snapdir", "");
|
2006-03-06 02:26:16 +00:00
|
|
|
setInternal("sssingle", "false");
|
2009-01-03 22:57:12 +00:00
|
|
|
setInternal("ss1x", "false");
|
2010-04-14 20:27:59 +00:00
|
|
|
setInternal("ssinterval", "2");
|
2006-03-06 02:26:16 +00:00
|
|
|
|
2007-09-13 00:48:13 +00:00
|
|
|
// Config files and paths
|
2010-07-06 15:08:35 +00:00
|
|
|
setInternal("romdir", "");
|
2007-07-19 16:21:39 +00:00
|
|
|
setInternal("statedir", "");
|
|
|
|
setInternal("cheatfile", "");
|
|
|
|
setInternal("palettefile", "");
|
|
|
|
setInternal("propsfile", "");
|
2009-01-21 12:03:17 +00:00
|
|
|
setInternal("eepromdir", "");
|
2010-09-06 00:17:51 +00:00
|
|
|
setInternal("cfgdir", "");
|
2007-08-07 14:38:52 +00:00
|
|
|
|
2007-09-13 00:48:13 +00:00
|
|
|
// ROM browser options
|
2012-04-20 20:47:53 +00:00
|
|
|
setInternal("exitlauncher", "false");
|
2008-03-26 00:52:05 +00:00
|
|
|
setInternal("launcherres", "640x480");
|
2009-01-04 22:27:44 +00:00
|
|
|
setInternal("launcherfont", "medium");
|
2011-12-21 17:18:53 +00:00
|
|
|
setInternal("launcherexts", "allroms");
|
2008-12-29 20:42:15 +00:00
|
|
|
setInternal("romviewer", "0");
|
2008-03-30 15:47:10 +00:00
|
|
|
setInternal("lastrom", "");
|
2007-08-22 13:55:40 +00:00
|
|
|
|
2007-09-13 00:48:13 +00:00
|
|
|
// UI-related options
|
2007-08-10 18:27:12 +00:00
|
|
|
setInternal("debuggerres", "1030x690");
|
2007-08-07 14:38:52 +00:00
|
|
|
setInternal("uipalette", "0");
|
2009-01-05 22:05:35 +00:00
|
|
|
setInternal("listdelay", "300");
|
2007-08-15 17:43:51 +00:00
|
|
|
setInternal("mwheel", "4");
|
2007-09-13 00:48:13 +00:00
|
|
|
|
|
|
|
// Misc options
|
2007-08-07 14:38:52 +00:00
|
|
|
setInternal("autoslot", "false");
|
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
|
|
|
setInternal("loglevel", "1");
|
|
|
|
setInternal("logtoconsole", "0");
|
Revamped the result on floating pins for TIA reads. Previously, this was
controlled by 'tiafloat', which has now been removed. Now, all
undriven pins take on the last value on the databus. This fixes a bug
in those reads where bit 6 or bits 6 & 7 are also undriven (previously,
these bits would always be zero, and only bits 0-5 were from lastdatabus.
Added new commandline argument 'tiadriven', which defaults to false.
In this default case, relevant bits take on values from the databus.
If true, relevant bits still take on databus values, but some are
randomly driven high as well. This helps to expose bugs when
developers assume the values for undriven/floating bits.
Added 'uimessages' commandline argument and associated UI item. When
disabled, messages which are normally shown in-game are disabled.
Certain messages which indicate a serious error are still shown, however.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1900 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-11-10 20:12:50 +00:00
|
|
|
setInternal("tiadriven", "false");
|
2010-08-20 01:02:32 +00:00
|
|
|
setInternal("ramrandom", "true");
|
2008-04-11 17:56:35 +00:00
|
|
|
setInternal("avoxport", "");
|
2008-05-20 13:42:50 +00:00
|
|
|
setInternal("stats", "false");
|
2009-06-09 14:27:21 +00:00
|
|
|
setInternal("fastscbios", "false");
|
2009-06-12 18:44:32 +00:00
|
|
|
setExternal("romloadcount", "0");
|
2010-07-22 15:41:46 +00:00
|
|
|
setExternal("maxres", "");
|
OK, I've finally gotten back to Stella development and fixing the
disassembler. Hopefully this will lead to a new release very soon.
Added 'autocode' commandline argument and associated UI item (in the
RomWidget debugger area), which controls how Distella will use the
'automatic code determination' option. If set to 0/never, this is
completely disabled. If set to 1/always, it is always enabled.
The default is 2/automatic, whereby it is first turned on, and then
turned off if the disassembly doesn't contain the current PC address.
RomListWidget has now been completely reworked, so that it informs
RomWidget of its intent to change breakpoints and patch ROM. If
either of these fail, the action won't be performed, and more
importantly, it won't appear onscreen as if the action has succeeded.
This fixes an old bug whereby patching could fail, yet the onscreen
ROM data was actually changed. Related to this, the list has been
made as efficient as possible, and its contents are never un-necessarily
copied. Also, lines in the disassembly that cannot be modified no
longer show an edit area.
Due to the way the new disassembly works, you can no longer switch between
banks in the RomWidget (Distella would probably fail to disassemble in
such as case).
EditTextWidget can now indicate its contents have changed when adding
text to it.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1966 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2010-03-18 16:36:12 +00:00
|
|
|
|
2012-05-27 19:27:55 +00:00
|
|
|
// Debugger disassembly options
|
|
|
|
setInternal("dis.resolvedata", "auto");
|
|
|
|
setInternal("dis.gfxformat", "2");
|
|
|
|
setInternal("dis.showaddr", "true");
|
|
|
|
setInternal("dis.relocate", "false");
|
2011-11-07 22:50:23 +00:00
|
|
|
|
|
|
|
// Thumb ARM emulation options
|
|
|
|
setInternal("thumb.trapfatal", "true");
|
2002-03-21 22:47:00 +00:00
|
|
|
}
|
|
|
|
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2003-09-19 15:45:01 +00:00
|
|
|
Settings::~Settings()
|
2002-03-21 22:47:00 +00:00
|
|
|
{
|
2006-03-06 02:26:16 +00:00
|
|
|
myInternalSettings.clear();
|
|
|
|
myExternalSettings.clear();
|
2002-03-21 22:47:00 +00:00
|
|
|
}
|
|
|
|
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2003-09-19 15:45:01 +00:00
|
|
|
void Settings::loadConfig()
|
|
|
|
{
|
|
|
|
string line, key, value;
|
2005-05-12 18:45:21 +00:00
|
|
|
string::size_type equalPos, garbage;
|
2003-09-19 15:45:01 +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
|
|
|
ifstream in(myOSystem->configFile().c_str());
|
2003-09-19 15:45:01 +00:00
|
|
|
if(!in || !in.is_open())
|
|
|
|
{
|
2012-12-22 20:17:33 +00:00
|
|
|
myOSystem->logMessage("ERROR: Couldn't load settings file", 0);
|
2003-09-19 15:45:01 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
while(getline(in, line))
|
|
|
|
{
|
|
|
|
// Strip all whitespace and tabs from the line
|
|
|
|
while((garbage = line.find("\t")) != string::npos)
|
|
|
|
line.erase(garbage, 1);
|
|
|
|
|
|
|
|
// Ignore commented and empty lines
|
|
|
|
if((line.length() == 0) || (line[0] == ';'))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
// Search for the equal sign and discard the line if its not found
|
|
|
|
if((equalPos = line.find("=")) == string::npos)
|
|
|
|
continue;
|
|
|
|
|
2004-07-09 00:27:39 +00:00
|
|
|
// Split the line into key/value pairs and trim any whitespace
|
2003-09-19 15:45:01 +00:00
|
|
|
key = line.substr(0, equalPos);
|
|
|
|
value = line.substr(equalPos + 1, line.length() - key.length() - 1);
|
2004-07-09 00:27:39 +00:00
|
|
|
key = trim(key);
|
|
|
|
value = trim(value);
|
2003-09-19 15:45:01 +00:00
|
|
|
|
|
|
|
// Check for absent key or value
|
|
|
|
if((key.length() == 0) || (value.length() == 0))
|
|
|
|
continue;
|
|
|
|
|
2003-09-23 17:27:11 +00:00
|
|
|
// Only settings which have been previously set are valid
|
2006-03-06 02:26:16 +00:00
|
|
|
if(int idx = getInternalPos(key) != -1)
|
|
|
|
setInternal(key, value, idx, true);
|
2003-09-19 15:45:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
in.close();
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2007-07-27 13:49:16 +00:00
|
|
|
string Settings::loadCommandLine(int argc, char** argv)
|
2003-09-19 15:45:01 +00:00
|
|
|
{
|
2005-05-12 18:45:21 +00:00
|
|
|
for(int i = 1; i < argc; ++i)
|
2003-09-19 15:45:01 +00:00
|
|
|
{
|
|
|
|
// strip off the '-' character
|
|
|
|
string key = argv[i];
|
2007-07-27 13:49:16 +00:00
|
|
|
if(key[0] == '-')
|
2005-06-28 04:40:21 +00:00
|
|
|
{
|
2007-07-27 13:49:16 +00:00
|
|
|
key = key.substr(1, key.length());
|
|
|
|
|
|
|
|
// Take care of the arguments which are meant to be executed immediately
|
|
|
|
// (and then Stella should exit)
|
|
|
|
if(key == "help" || key == "listrominfo")
|
|
|
|
{
|
|
|
|
setExternal(key, "true");
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
// Take care of arguments without an option
|
|
|
|
if(key == "rominfo" || key == "debug" || key == "holdreset" ||
|
2007-09-03 18:37:24 +00:00
|
|
|
key == "holdselect" || key == "holdbutton0" || key == "takesnapshot")
|
2007-07-27 13:49:16 +00:00
|
|
|
{
|
|
|
|
setExternal(key, "true");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2010-05-03 12:01:43 +00:00
|
|
|
ostringstream buf;
|
2007-07-27 13:49:16 +00:00
|
|
|
if(++i >= argc)
|
|
|
|
{
|
2010-04-29 12:46:07 +00:00
|
|
|
buf << "Missing argument for '" << key << "'" << endl;
|
|
|
|
myOSystem->logMessage(buf.str(), 0);
|
2007-07-27 13:49:16 +00:00
|
|
|
return "";
|
|
|
|
}
|
|
|
|
string value = argv[i];
|
|
|
|
|
2010-05-03 12:01:43 +00:00
|
|
|
buf.str("");
|
|
|
|
buf << " key = '" << key << "', value = '" << value << "'";
|
|
|
|
|
2007-07-27 13:49:16 +00:00
|
|
|
// Settings read from the commandline must not be saved to
|
|
|
|
// the rc-file, unless they were previously set
|
|
|
|
if(int idx = getInternalPos(key) != -1)
|
2010-05-03 12:01:43 +00:00
|
|
|
{
|
2007-07-27 13:49:16 +00:00
|
|
|
setInternal(key, value, idx); // don't set initialValue here
|
2010-05-03 12:01:43 +00:00
|
|
|
buf << "(I)\n";
|
|
|
|
}
|
2007-07-27 13:49:16 +00:00
|
|
|
else
|
2010-05-03 12:01:43 +00:00
|
|
|
{
|
2007-07-27 13:49:16 +00:00
|
|
|
setExternal(key, value);
|
2010-05-03 12:01:43 +00:00
|
|
|
buf << "(E)\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
myOSystem->logMessage(buf.str(), 2);
|
2005-06-28 04:40:21 +00:00
|
|
|
}
|
2006-03-06 02:26:16 +00:00
|
|
|
else
|
2007-07-27 13:49:16 +00:00
|
|
|
return key;
|
2003-09-19 15:45:01 +00:00
|
|
|
}
|
|
|
|
|
2007-07-27 13:49:16 +00:00
|
|
|
return "";
|
2003-09-19 15:45:01 +00:00
|
|
|
}
|
|
|
|
|
2005-05-02 19:36:05 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void Settings::validate()
|
|
|
|
{
|
|
|
|
string s;
|
2005-05-13 18:28:06 +00:00
|
|
|
int i;
|
2005-05-02 19:36:05 +00:00
|
|
|
|
|
|
|
s = getString("video");
|
2009-05-25 17:51:52 +00:00
|
|
|
if(s != "soft" && s != "gl") setInternal("video", "soft");
|
2005-05-02 19:36:05 +00:00
|
|
|
|
2008-05-21 16:49:07 +00:00
|
|
|
s = getString("timing");
|
2009-05-25 17:51:52 +00:00
|
|
|
if(s != "sleep" && s != "busy") setInternal("timing", "sleep");
|
2008-05-21 16:49:07 +00:00
|
|
|
|
2005-05-02 19:36:05 +00:00
|
|
|
#ifdef DISPLAY_OPENGL
|
2009-01-24 17:32:29 +00:00
|
|
|
i = getInt("gl_aspectn");
|
2009-05-25 17:51:52 +00:00
|
|
|
if(i < 80 || i > 120) setInternal("gl_aspectn", "100");
|
2009-01-24 17:32:29 +00:00
|
|
|
i = getInt("gl_aspectp");
|
2009-05-25 17:51:52 +00:00
|
|
|
if(i < 80 || i > 120) setInternal("gl_aspectp", "100");
|
2012-05-06 17:45:48 +00:00
|
|
|
|
|
|
|
i = getInt("tv_filter");
|
|
|
|
if(i < 0 || i > 5) setInternal("tv_filter", "0");
|
|
|
|
|
2005-05-02 19:36:05 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef SOUND_SUPPORT
|
|
|
|
i = getInt("volume");
|
2009-05-25 17:51:52 +00:00
|
|
|
if(i < 0 || i > 100) setInternal("volume", "100");
|
2006-01-06 00:31:56 +00:00
|
|
|
i = getInt("freq");
|
2009-05-25 17:51:52 +00:00
|
|
|
if(i < 0 || i > 48000) setInternal("freq", "31400");
|
2006-01-06 00:31:56 +00:00
|
|
|
i = getInt("tiafreq");
|
2009-05-25 17:51:52 +00:00
|
|
|
if(i < 0 || i > 48000) setInternal("tiafreq", "31400");
|
2005-05-02 19:36:05 +00:00
|
|
|
#endif
|
|
|
|
|
2008-05-11 21:18:35 +00:00
|
|
|
i = getInt("joydeadzone");
|
2009-05-25 17:51:52 +00:00
|
|
|
if(i < 0) setInternal("joydeadzone", "0");
|
|
|
|
else if(i > 29) setInternal("joydeadzone", "29");
|
2008-05-11 21:18:35 +00:00
|
|
|
|
2011-12-26 21:40:28 +00:00
|
|
|
if(i < 1) setInternal("dsense", "1");
|
|
|
|
else if(i > 10) setInternal("dsense", "10");
|
|
|
|
|
2011-05-06 14:29:39 +00:00
|
|
|
i = getInt("dsense");
|
|
|
|
if(i < 1) setInternal("dsense", "1");
|
|
|
|
else if(i > 10) setInternal("dsense", "10");
|
|
|
|
|
|
|
|
i = getInt("msense");
|
|
|
|
if(i < 1) setInternal("msense", "1");
|
|
|
|
else if(i > 15) setInternal("msense", "15");
|
2006-04-05 12:28:39 +00:00
|
|
|
|
2010-04-14 20:27:59 +00:00
|
|
|
i = getInt("ssinterval");
|
|
|
|
if(i < 1) setInternal("ssinterval", "2");
|
|
|
|
else if(i > 10) setInternal("ssinterval", "10");
|
2010-04-14 15:41:42 +00:00
|
|
|
|
2005-05-02 19:36:05 +00:00
|
|
|
s = getString("palette");
|
2007-07-27 13:49:16 +00:00
|
|
|
if(s != "standard" && s != "z26" && s != "user")
|
2006-03-06 02:26:16 +00:00
|
|
|
setInternal("palette", "standard");
|
2008-03-23 16:22:46 +00:00
|
|
|
|
|
|
|
s = getString("launcherfont");
|
2009-01-04 22:27:44 +00:00
|
|
|
if(s != "small" && s != "medium" && s != "large")
|
|
|
|
setInternal("launcherfont", "medium");
|
2008-12-29 20:42:15 +00:00
|
|
|
|
|
|
|
i = getInt("romviewer");
|
2009-05-25 17:51:52 +00:00
|
|
|
if(i < 0) setInternal("romviewer", "0");
|
|
|
|
else if(i > 2) setInternal("romviewer", "2");
|
|
|
|
|
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
|
|
|
i = getInt("loglevel");
|
2010-04-29 12:46:07 +00:00
|
|
|
if(i < 0 || i > 2)
|
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
|
|
|
setInternal("loglevel", "1");
|
2005-05-02 19:36:05 +00:00
|
|
|
}
|
|
|
|
|
2004-07-05 00:53:48 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void Settings::usage()
|
|
|
|
{
|
|
|
|
cout << endl
|
2005-05-11 19:36:00 +00:00
|
|
|
<< "Stella version " << STELLA_VERSION << endl
|
2005-05-05 19:00:48 +00:00
|
|
|
<< endl
|
|
|
|
<< "Usage: stella [options ...] romfile" << endl
|
|
|
|
<< " Run without any options or romfile to use the ROM launcher" << endl
|
2009-01-13 14:45:34 +00:00
|
|
|
<< " Consult the manual for more in-depth information" << endl
|
2004-07-05 00:53:48 +00:00
|
|
|
<< endl
|
|
|
|
<< "Valid options are:" << endl
|
|
|
|
<< endl
|
2004-09-14 16:10:28 +00:00
|
|
|
<< " -video <type> Type is one of the following:\n"
|
|
|
|
<< " soft SDL software mode\n"
|
2004-07-05 00:53:48 +00:00
|
|
|
#ifdef DISPLAY_OPENGL
|
2004-09-14 16:10:28 +00:00
|
|
|
<< " gl SDL OpenGL mode\n"
|
2004-07-05 00:53:48 +00:00
|
|
|
<< endl
|
2006-12-13 00:05:46 +00:00
|
|
|
<< " -gl_lib <name> Specify the OpenGL library\n"
|
2012-05-08 19:37:04 +00:00
|
|
|
<< " -gl_inter <1|0> Enable interpolated (smooth) scaling\n"
|
2009-01-24 17:32:29 +00:00
|
|
|
<< " -gl_aspectn <number> Scale the TIA width by the given percentage in NTSC mode\n"
|
|
|
|
<< " -gl_aspectp <number> Scale the TIA width by the given percentage in PAL mode\n"
|
2012-05-06 17:45:48 +00:00
|
|
|
<< " -gl_fsscale <1|0> Stretch GL image in fullscreen emulation mode to max/integer scale\n"
|
2011-08-19 14:30:15 +00:00
|
|
|
<< " -gl_vsync <1|0> Enable 'synchronize to vertical blank interrupt'\n"
|
|
|
|
<< " -gl_vbo <1|0> Enable 'vertex buffer objects'\n"
|
2004-07-05 00:53:48 +00:00
|
|
|
<< endl
|
2012-05-06 17:45:48 +00:00
|
|
|
<< " -tv_filter <0-5> Set TV effects off (0) or to specified mode (1-5)\n"
|
2012-05-08 13:33:36 +00:00
|
|
|
<< " -tv_scanlines <0-100> Set scanline intensity to percentage (0 disables completely)\n"
|
2012-05-08 19:37:04 +00:00
|
|
|
<< " -tv_scaninter <1|0> Enable interpolated (smooth) scanlines\n"
|
2012-05-12 22:21:59 +00:00
|
|
|
<< " -tv_contrast <value> Set TV effects custom contrast to value 1.0 - 1.0\n"
|
|
|
|
<< " -tv_brightness <value> Set TV effects custom brightness to value 1.0 - 1.0\n"
|
|
|
|
<< " -tv_hue <value> Set TV effects custom hue to value 1.0 - 1.0\n"
|
|
|
|
<< " -tv_saturation <value> Set TV effects custom saturation to value 1.0 - 1.0\n"
|
|
|
|
<< " -tv_gamma <value> Set TV effects custom gamma to value 1.0 - 1.0\n"
|
|
|
|
<< " -tv_sharpness <value> Set TV effects custom sharpness to value 1.0 - 1.0\n"
|
|
|
|
<< " -tv_resolution <value> Set TV effects custom resolution to value 1.0 - 1.0\n"
|
|
|
|
<< " -tv_artifacts <value> Set TV effects custom artifacts to value 1.0 - 1.0\n"
|
|
|
|
<< " -tv_fringing <value> Set TV effects custom fringing to value 1.0 - 1.0\n"
|
|
|
|
<< " -tv_bleed <value> Set TV effects custom bleed to value 1.0 - 1.0\n"
|
2012-03-25 17:51:13 +00:00
|
|
|
<< endl
|
2005-05-01 18:57:21 +00:00
|
|
|
#endif
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
<< " -tia_filter <filter> Use the specified filter in emulation mode\n"
|
2009-08-07 11:45:14 +00:00
|
|
|
<< " -fullscreen <1|0|-1> Use fullscreen mode (1 or 0), or disable switching to fullscreen entirely\n"
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
<< " -fullres <auto|WxH> The resolution to use in fullscreen mode\n"
|
2005-06-17 14:42:49 +00:00
|
|
|
<< " -center <1|0> Centers game window (if possible)\n"
|
2011-06-02 20:53:01 +00:00
|
|
|
<< " -grabmouse <1|0> Keeps the mouse in the game window\n"
|
2007-07-27 13:49:16 +00:00
|
|
|
<< " -palette <standard| Use the specified color palette\n"
|
2006-11-25 01:34:35 +00:00
|
|
|
<< " z26|\n"
|
|
|
|
<< " user>\n"
|
2006-12-26 17:06:01 +00:00
|
|
|
<< " -colorloss <1|0> Enable PAL color-loss effect\n"
|
2008-05-21 14:01:31 +00:00
|
|
|
<< " -framerate <number> Display the given number of frames per second (0 to auto-calculate)\n"
|
2008-05-21 16:49:07 +00:00
|
|
|
<< " -timing <sleep|busy> Use the given type of wait between frames\n"
|
Revamped the result on floating pins for TIA reads. Previously, this was
controlled by 'tiafloat', which has now been removed. Now, all
undriven pins take on the last value on the databus. This fixes a bug
in those reads where bit 6 or bits 6 & 7 are also undriven (previously,
these bits would always be zero, and only bits 0-5 were from lastdatabus.
Added new commandline argument 'tiadriven', which defaults to false.
In this default case, relevant bits take on values from the databus.
If true, relevant bits still take on databus values, but some are
randomly driven high as well. This helps to expose bugs when
developers assume the values for undriven/floating bits.
Added 'uimessages' commandline argument and associated UI item. When
disabled, messages which are normally shown in-game are disabled.
Certain messages which indicate a serious error are still shown, however.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1900 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2009-11-10 20:12:50 +00:00
|
|
|
<< " -uimessages <1|0> Show onscreen UI messages for different events\n"
|
2005-09-13 18:27:42 +00:00
|
|
|
<< endl
|
2005-05-12 18:45:21 +00:00
|
|
|
#ifdef SOUND_SUPPORT
|
|
|
|
<< " -sound <1|0> Enable sound generation\n"
|
|
|
|
<< " -fragsize <number> The size of sound fragments (must be a power of two)\n"
|
2006-01-06 00:31:56 +00:00
|
|
|
<< " -freq <number> Set sound sample output frequency (0 - 48000)\n"
|
|
|
|
<< " -tiafreq <number> Set sound sample generation frequency (0 - 48000)\n"
|
2004-09-14 16:10:28 +00:00
|
|
|
<< " -volume <number> Set the volume (0 - 100)\n"
|
2006-01-06 00:31:56 +00:00
|
|
|
<< " -clipvol <1|0> Enable volume clipping (eliminates popping)\n"
|
2005-09-13 18:27:42 +00:00
|
|
|
<< endl
|
2005-05-12 18:45:21 +00:00
|
|
|
#endif
|
2006-01-15 20:46:20 +00:00
|
|
|
<< " -cheat <code> Use the specified cheatcode (see manual for description)\n"
|
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
|
|
|
<< " -loglevel <0|1|2> Set level of logging during application run\n"
|
|
|
|
<< " -logtoconsole <1|0> Log output to console/commandline\n"
|
2008-05-11 21:18:35 +00:00
|
|
|
<< " -joydeadzone <number> Sets 'deadzone' area for analog joysticks (0-29)\n"
|
2009-08-05 20:33:40 +00:00
|
|
|
<< " -joyallow4 <1|0> Allow all 4 directions on a joystick to be pressed simultaneously\n"
|
2012-04-19 13:00:02 +00:00
|
|
|
<< " -usemouse <1|0> Use mouse as a controller as specified by ROM properties (see manual)\n"
|
2011-05-06 14:29:39 +00:00
|
|
|
<< " -dsense <number> Sensitivity of digital emulated paddle movement (1-10)\n"
|
|
|
|
<< " -msense <number> Sensitivity of mouse emulated paddle movement (1-15)\n"
|
2012-03-03 00:56:31 +00:00
|
|
|
<< " -saport <lr|rl> How to assign virtual ports to multiple Stelladaptor/2600-daptors\n"
|
2010-03-05 22:02:12 +00:00
|
|
|
<< " -ctrlcombo <1|0> Use key combos involving the Control key (Control-Q for quit may be disabled!)\n"
|
2006-12-13 00:05:46 +00:00
|
|
|
<< " -autoslot <1|0> Automatically switch to next save slot when state saving\n"
|
2010-04-08 13:11:36 +00:00
|
|
|
<< " -stats <1|0> Overlay console info during emulation\n"
|
2009-06-09 14:27:21 +00:00
|
|
|
<< " -fastscbios <1|0> Disable Supercharger BIOS progress loading bars\n"
|
2011-11-25 14:17:05 +00:00
|
|
|
<< " -snapdir <path> The directory to save snapshot files to\n"
|
2004-09-14 16:10:28 +00:00
|
|
|
<< " -sssingle <1|0> Generate single snapshot instead of many\n"
|
2009-05-25 17:51:52 +00:00
|
|
|
<< " -ss1x <1|0> Generate TIA snapshot in 1x mode (ignore scaling/effects)\n"
|
2010-04-14 20:27:59 +00:00
|
|
|
<< " -ssinterval <number Number of seconds between snapshots in continuous snapshot mode\n"
|
2005-09-13 18:27:42 +00:00
|
|
|
<< endl
|
2006-12-26 00:39:44 +00:00
|
|
|
<< " -rominfo <rom> Display detailed information for the given ROM\n"
|
2009-01-13 14:45:34 +00:00
|
|
|
<< " -listrominfo Display contents of stella.pro, one line per ROM entry\n"
|
2012-04-20 20:47:53 +00:00
|
|
|
<< " -exitlauncher <1|0> On exiting a ROM, go back to the ROM launcher\n"
|
2007-07-27 13:49:16 +00:00
|
|
|
<< " -launcherres <WxH> The resolution to use in ROM launcher mode\n"
|
2009-01-04 22:27:44 +00:00
|
|
|
<< " -launcherfont <small|medium| Use the specified font in the ROM launcher\n"
|
|
|
|
<< " large>\n"
|
2009-01-05 19:44:30 +00:00
|
|
|
<< " -launcherexts <allfiles| Show files with the given extensions in ROM launcher\n"
|
2009-05-25 17:51:52 +00:00
|
|
|
<< " allroms| (exts is a ':' separated list of extensions)\n"
|
2009-01-05 19:44:30 +00:00
|
|
|
<< " exts\n"
|
2009-01-13 14:45:34 +00:00
|
|
|
<< " -romviewer <0|1|2> Show ROM info viewer at given zoom level in ROM launcher (0 for off)\n"
|
2006-12-31 23:20:13 +00:00
|
|
|
<< " -uipalette <1|2> Used the specified palette for UI elements\n"
|
2009-01-05 22:05:35 +00:00
|
|
|
<< " -listdelay <delay> Time to wait between keypresses in list widgets (300-1000)\n"
|
2007-08-15 17:43:51 +00:00
|
|
|
<< " -mwheel <lines> Number of lines the mouse wheel will scroll in UI\n"
|
2007-07-19 16:21:39 +00:00
|
|
|
<< " -statedir <dir> Directory in which to save state files\n"
|
|
|
|
<< " -cheatfile <file> Full pathname of cheatfile database\n"
|
|
|
|
<< " -palettefile <file> Full pathname of user-defined palette file\n"
|
|
|
|
<< " -propsfile <file> Full pathname of ROM properties file\n"
|
2009-01-21 12:03:17 +00:00
|
|
|
<< " -eepromdir <dir> Directory in which to save EEPROM files\n"
|
2010-09-06 00:17:51 +00:00
|
|
|
<< " -cfgdir <dir> Directory in which to save Distella config files\n"
|
2008-05-16 12:04:35 +00:00
|
|
|
<< " -avoxport <name> The name of the serial port where an AtariVox is connected\n"
|
2010-04-08 13:11:36 +00:00
|
|
|
<< " -maxres <WxH> Used by developers to force the maximum size of the application window\n"
|
2010-08-19 21:48:28 +00:00
|
|
|
<< " -holdreset Start the emulator with the Game Reset switch held down\n"
|
|
|
|
<< " -holdselect Start the emulator with the Game Select switch held down\n"
|
|
|
|
<< " -holdbutton0 Start the emulator with the left joystick button held down\n"
|
|
|
|
<< " -tiadriven <1|0> Drive unused TIA pins randomly on a read/peek\n"
|
|
|
|
<< " -ramrandom <1|0> Randomize the contents of RAM on reset\n"
|
2005-05-05 19:00:48 +00:00
|
|
|
<< " -help Show the text you're now reading\n"
|
2006-12-15 16:43:12 +00:00
|
|
|
#ifdef DEBUGGER_SUPPORT
|
2005-05-12 18:45:21 +00:00
|
|
|
<< endl
|
|
|
|
<< " The following options are meant for developers\n"
|
|
|
|
<< " Arguments are more fully explained in the manual\n"
|
|
|
|
<< endl
|
2012-05-27 19:27:55 +00:00
|
|
|
<< " -dis.resolvedata <never| Set automatic code vs. data determination in disassembler\n"
|
|
|
|
<< " always|\n"
|
|
|
|
<< " auto>\n"
|
|
|
|
<< " -dis.gfxformat <2|16> Set base to use for displaying GFX sections in disassembler\n"
|
|
|
|
<< " -dis.showaddr <1|0> Show opcode addresses in disassembler\n"
|
|
|
|
<< " -dis.relocate <1|0> Relocate calls out of address range in disassembler\n"
|
|
|
|
<< endl
|
2007-08-10 18:27:12 +00:00
|
|
|
<< " -debuggerres <WxH> The resolution to use in debugger mode\n"
|
2006-01-15 20:46:20 +00:00
|
|
|
<< " -break <address> Set a breakpoint at 'address'\n"
|
2005-09-13 18:27:42 +00:00
|
|
|
<< " -debug Start in debugger mode\n"
|
|
|
|
<< endl
|
2008-03-03 14:53:34 +00:00
|
|
|
<< " -bs <arg> Sets the 'Cartridge.Type' (bankswitch) property\n"
|
|
|
|
<< " -type <arg> Same as using -bs\n"
|
2007-07-27 13:49:16 +00:00
|
|
|
<< " -channels <arg> Sets the 'Cartridge.Sound' property\n"
|
2005-05-12 18:45:21 +00:00
|
|
|
<< " -ld <arg> Sets the 'Console.LeftDifficulty' property\n"
|
|
|
|
<< " -rd <arg> Sets the 'Console.RightDifficulty' property\n"
|
|
|
|
<< " -tv <arg> Sets the 'Console.TelevisionType' property\n"
|
2006-01-08 02:28:04 +00:00
|
|
|
<< " -sp <arg> Sets the 'Console.SwapPorts' property\n"
|
2005-05-12 18:45:21 +00:00
|
|
|
<< " -lc <arg> Sets the 'Controller.Left' property\n"
|
|
|
|
<< " -rc <arg> Sets the 'Controller.Right' property\n"
|
|
|
|
<< " -bc <arg> Same as using both -lc and -rc\n"
|
2006-12-13 00:05:46 +00:00
|
|
|
<< " -cp <arg> Sets the 'Controller.SwapPaddles' property\n"
|
2005-05-12 18:45:21 +00:00
|
|
|
<< " -format <arg> Sets the 'Display.Format' property\n"
|
|
|
|
<< " -ystart <arg> Sets the 'Display.YStart' property\n"
|
|
|
|
<< " -height <arg> Sets the 'Display.Height' property\n"
|
2006-01-10 20:37:00 +00:00
|
|
|
<< " -pp <arg> Sets the 'Display.Phosphor' property\n"
|
2006-11-04 19:38:25 +00:00
|
|
|
<< " -ppblend <arg> Sets the 'Display.PPBlend' property\n"
|
2005-10-19 00:59:51 +00:00
|
|
|
#endif
|
2011-06-02 20:53:01 +00:00
|
|
|
<< endl << flush;
|
2004-07-05 00:53:48 +00:00
|
|
|
}
|
|
|
|
|
2003-09-19 15:45:01 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void Settings::saveConfig()
|
|
|
|
{
|
2006-03-06 02:26:16 +00:00
|
|
|
// Do a quick scan of the internal settings to see if any have
|
|
|
|
// changed. If not, we don't need to save them at all.
|
|
|
|
bool settingsChanged = false;
|
|
|
|
for(unsigned int i = 0; i < myInternalSettings.size(); ++i)
|
|
|
|
{
|
|
|
|
if(myInternalSettings[i].value != myInternalSettings[i].initialValue)
|
|
|
|
{
|
|
|
|
settingsChanged = true;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(!settingsChanged)
|
|
|
|
return;
|
|
|
|
|
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
|
|
|
ofstream out(myOSystem->configFile().c_str());
|
2003-09-19 15:45:01 +00:00
|
|
|
if(!out || !out.is_open())
|
|
|
|
{
|
2012-12-22 20:17:33 +00:00
|
|
|
myOSystem->logMessage("ERROR: Couldn't save settings file", 0);
|
2003-09-19 15:45:01 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-01-01 18:21:04 +00:00
|
|
|
out << "; Stella configuration file" << endl
|
2003-09-21 14:33:34 +00:00
|
|
|
<< ";" << endl
|
|
|
|
<< "; Lines starting with ';' are comments and are ignored." << endl
|
|
|
|
<< "; Spaces and tabs are ignored." << endl
|
|
|
|
<< ";" << endl
|
|
|
|
<< "; Format MUST be as follows:" << endl
|
|
|
|
<< "; command = value" << endl
|
|
|
|
<< ";" << endl
|
|
|
|
<< "; Commmands are the same as those specified on the commandline," << endl
|
|
|
|
<< "; without the '-' character." << endl
|
|
|
|
<< ";" << endl
|
|
|
|
<< "; Values are the same as those allowed on the commandline." << endl
|
2003-09-23 00:58:31 +00:00
|
|
|
<< "; Boolean values are specified as 1 (or true) and 0 (or false)" << endl
|
|
|
|
<< ";" << endl;
|
|
|
|
|
|
|
|
// Write out each of the key and value pairs
|
2006-03-06 02:26:16 +00:00
|
|
|
for(unsigned int i = 0; i < myInternalSettings.size(); ++i)
|
2003-09-19 15:45:01 +00:00
|
|
|
{
|
2006-03-06 02:26:16 +00:00
|
|
|
out << myInternalSettings[i].key << " = " <<
|
|
|
|
myInternalSettings[i].value << endl;
|
2003-09-19 15:45:01 +00:00
|
|
|
}
|
2003-09-23 00:58:31 +00:00
|
|
|
|
2006-03-06 02:26:16 +00:00
|
|
|
out.close();
|
2003-09-23 00:58:31 +00:00
|
|
|
}
|
|
|
|
|
2003-11-24 01:14:38 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2006-03-06 02:26:16 +00:00
|
|
|
void Settings::setInt(const string& key, const int value)
|
2003-11-24 01:14:38 +00:00
|
|
|
{
|
|
|
|
ostringstream stream;
|
|
|
|
stream << value;
|
|
|
|
|
2006-03-06 02:26:16 +00:00
|
|
|
if(int idx = getInternalPos(key) != -1)
|
|
|
|
setInternal(key, stream.str(), idx);
|
|
|
|
else
|
|
|
|
setExternal(key, stream.str());
|
2003-11-24 01:14:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2006-03-06 02:26:16 +00:00
|
|
|
void Settings::setFloat(const string& key, const float value)
|
2003-11-24 01:14:38 +00:00
|
|
|
{
|
|
|
|
ostringstream stream;
|
|
|
|
stream << value;
|
|
|
|
|
2006-03-06 02:26:16 +00:00
|
|
|
if(int idx = getInternalPos(key) != -1)
|
|
|
|
setInternal(key, stream.str(), idx);
|
|
|
|
else
|
|
|
|
setExternal(key, stream.str());
|
2003-11-24 01:14:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2006-03-06 02:26:16 +00:00
|
|
|
void Settings::setBool(const string& key, const bool value)
|
2003-11-24 01:14:38 +00:00
|
|
|
{
|
|
|
|
ostringstream stream;
|
|
|
|
stream << value;
|
|
|
|
|
2006-03-06 02:26:16 +00:00
|
|
|
if(int idx = getInternalPos(key) != -1)
|
|
|
|
setInternal(key, stream.str(), idx);
|
|
|
|
else
|
|
|
|
setExternal(key, stream.str());
|
2003-11-24 01:14:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2006-03-06 02:26:16 +00:00
|
|
|
void Settings::setString(const string& key, const string& value)
|
2003-11-24 01:14:38 +00:00
|
|
|
{
|
2006-03-06 02:26:16 +00:00
|
|
|
if(int idx = getInternalPos(key) != -1)
|
|
|
|
setInternal(key, value, idx);
|
|
|
|
else
|
|
|
|
setExternal(key, value);
|
2003-11-24 01:14:38 +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
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void Settings::getSize(const string& key, int& x, int& y) const
|
|
|
|
{
|
2011-11-19 18:28:17 +00:00
|
|
|
char c = '\0';
|
|
|
|
x = y = -1;
|
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
|
|
|
string size = getString(key);
|
|
|
|
istringstream buf(size);
|
Reworked 'fullres' argument to also accept the 'auto' option. In this case,
fullscreen resolutions will be automatically chosen based on the required
size for the window. The image will be centered and keep the same aspect
ratio, however, so operation will still work correctly on widescreen
monitors. 'Auto' will be the new default. Otherwise, if a specific
resolution is requested, Stella will try to accomodate it *only* if it fits
into the resolution; otherwise the smallest resolution that fits will be
used.
Removed 'zoom_ui' and 'zoom_tia'. The UI can now only be at 1x mode.
Aded 'tia_filter' commandline argument, which specifies to the filter
to use when rendering the tia image. For now, these accept 'zoom1x',
'zoom2x'..., up to 'zoom10x', and duplicate previous behaviour. Eventually,
Scalexx and HQxx filters may be added. Still TODO is add this to the UI.
First pass at making the standard build use a minimum of zoom2x for the TIA,
so the UI can be larger and use a better looking font. There's still work
to do in this area, especially for those ports with limited hardware that
support zoom1x only.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1544 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2008-07-22 14:54:39 +00:00
|
|
|
buf >> x >> c >> y;
|
|
|
|
if(c != 'x')
|
|
|
|
x = y = -1;
|
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
|
|
|
}
|
|
|
|
|
2003-09-23 00:58:31 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2005-05-13 18:28:06 +00:00
|
|
|
int Settings::getInt(const string& key) const
|
2003-09-23 00:58:31 +00:00
|
|
|
{
|
|
|
|
// Try to find the named setting and answer its value
|
2006-03-06 02:26:16 +00:00
|
|
|
int idx = -1;
|
|
|
|
if((idx = getInternalPos(key)) != -1)
|
|
|
|
return (int) atoi(myInternalSettings[idx].value.c_str());
|
|
|
|
else if((idx = getExternalPos(key)) != -1)
|
|
|
|
return (int) atoi(myExternalSettings[idx].value.c_str());
|
|
|
|
else
|
2006-11-19 00:48:55 +00:00
|
|
|
return -1;
|
2003-09-23 00:58:31 +00:00
|
|
|
}
|
|
|
|
|
Added the ability to change the aspect ratio of the screen in the SDL
OpenGL port. Normally, the window is double the native TIA frame
width, so we always get a ratio of 2.0 (2:1).
Now, if you're using OpenGL mode, the '-gl_aspect' commandline argument
can take a decimal number representing the ratio you want to use.
For example, normal TV mode would be 1.3333 (4:3).
Depending on the resolution you use, you can make the window look much
more like the original Atari. I find that in 1600x1200 mode, an
aspect of 1.6 looks quite authentic.
This is only supported in the SDL OpenGL port for now, since changing
the aspect took only 1 line of code (I love 3D graphics :) It may
never be supported in software SDL, since it is quite a bit harder
to do it in software.
Ditto for the Cyberstella DirectDraw7 code (it will probably never be
implemented, unless hardware scaling is available). If/when I get
around to the Direct3D port, it will be trivial to do there as well.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@211 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-17 17:43:39 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
float Settings::getFloat(const string& key) const
|
|
|
|
{
|
|
|
|
// Try to find the named setting and answer its value
|
2006-03-06 02:26:16 +00:00
|
|
|
int idx = -1;
|
|
|
|
if((idx = getInternalPos(key)) != -1)
|
|
|
|
return (float) atof(myInternalSettings[idx].value.c_str());
|
|
|
|
else if((idx = getExternalPos(key)) != -1)
|
|
|
|
return (float) atof(myExternalSettings[idx].value.c_str());
|
|
|
|
else
|
|
|
|
return -1.0;
|
Added the ability to change the aspect ratio of the screen in the SDL
OpenGL port. Normally, the window is double the native TIA frame
width, so we always get a ratio of 2.0 (2:1).
Now, if you're using OpenGL mode, the '-gl_aspect' commandline argument
can take a decimal number representing the ratio you want to use.
For example, normal TV mode would be 1.3333 (4:3).
Depending on the resolution you use, you can make the window look much
more like the original Atari. I find that in 1600x1200 mode, an
aspect of 1.6 looks quite authentic.
This is only supported in the SDL OpenGL port for now, since changing
the aspect took only 1 line of code (I love 3D graphics :) It may
never be supported in software SDL, since it is quite a bit harder
to do it in software.
Ditto for the Cyberstella DirectDraw7 code (it will probably never be
implemented, unless hardware scaling is available). If/when I get
around to the Direct3D port, it will be trivial to do there as well.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@211 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-11-17 17:43:39 +00:00
|
|
|
}
|
|
|
|
|
2003-09-23 00:58:31 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
bool Settings::getBool(const string& key) const
|
|
|
|
{
|
|
|
|
// Try to find the named setting and answer its value
|
2006-03-06 02:26:16 +00:00
|
|
|
int idx = -1;
|
|
|
|
if((idx = getInternalPos(key)) != -1)
|
2003-09-19 15:45:01 +00:00
|
|
|
{
|
2006-03-19 00:46:04 +00:00
|
|
|
const string& value = myInternalSettings[idx].value;
|
|
|
|
if(value == "1" || value == "true")
|
2006-03-06 02:26:16 +00:00
|
|
|
return true;
|
2006-03-19 00:46:04 +00:00
|
|
|
else if(value == "0" || value == "false")
|
2006-03-06 02:26:16 +00:00
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return false;
|
2003-09-19 15:45:01 +00:00
|
|
|
}
|
2006-03-06 02:26:16 +00:00
|
|
|
else if((idx = getExternalPos(key)) != -1)
|
|
|
|
{
|
2006-03-19 00:46:04 +00:00
|
|
|
const string& value = myExternalSettings[idx].value;
|
|
|
|
if(value == "1" || value == "true")
|
2006-03-06 02:26:16 +00:00
|
|
|
return true;
|
2006-03-19 00:46:04 +00:00
|
|
|
else if(value == "0" || value == "false")
|
2006-03-06 02:26:16 +00:00
|
|
|
return false;
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
return false;
|
2003-09-23 00:58:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
Reworked the mapping of joysticks yet again. After some thought, it
made no sense to restrict Stella to only work with two joysticks, since
there's no reason one couldn't use four devices, with each one emulating
a paddle (once I get paddle remapping done). So I've removed that
restriction, and also removed the 'leftport' and 'rightport' arguments.
The one case where remapping a joystick *does* make sense is for
multiple Stelladaptors. In that case, there might only be one
Stelladaptor installed, but you'd like it to emulate the right virtual
port. Previously this wasn't possible, but now it is with the addition
of the 'sa1' and 'sa2' commandline arguments. These arguments accept
either 'left' or 'right', specifying which virtual port to emulate.
Updated the InputDialog virtual device tab for remapping Stelladaptors.
Shortened some keynames in EventHandler, so that the actual character is
used (for example, ? instead of QUESTION).
Some fixes for the OS/2 port.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@884 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2005-11-19 22:26:14 +00:00
|
|
|
const string& Settings::getString(const string& key) const
|
2003-09-23 00:58:31 +00:00
|
|
|
{
|
|
|
|
// Try to find the named setting and answer its value
|
2006-03-06 02:26:16 +00:00
|
|
|
int idx = -1;
|
|
|
|
if((idx = getInternalPos(key)) != -1)
|
|
|
|
return myInternalSettings[idx].value;
|
|
|
|
else if((idx = getExternalPos(key)) != -1)
|
|
|
|
return myExternalSettings[idx].value;
|
|
|
|
else
|
|
|
|
return EmptyString;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
void Settings::setSize(const string& key, const int value1, const int value2)
|
|
|
|
{
|
|
|
|
ostringstream buf;
|
|
|
|
buf << value1 << "x" << value2;
|
|
|
|
setString(key, buf.str());
|
|
|
|
}
|
|
|
|
|
2006-03-06 02:26:16 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
int Settings::getInternalPos(const string& key) const
|
|
|
|
{
|
|
|
|
for(unsigned int i = 0; i < myInternalSettings.size(); ++i)
|
|
|
|
if(myInternalSettings[i].key == key)
|
|
|
|
return i;
|
2003-09-23 00:58:31 +00:00
|
|
|
|
2006-03-06 02:26:16 +00:00
|
|
|
return -1;
|
2003-09-04 16:50:48 +00:00
|
|
|
}
|
|
|
|
|
2003-09-23 17:27:11 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
2006-03-06 02:26:16 +00:00
|
|
|
int Settings::getExternalPos(const string& key) const
|
2003-09-23 17:27:11 +00:00
|
|
|
{
|
2006-03-06 02:26:16 +00:00
|
|
|
for(unsigned int i = 0; i < myExternalSettings.size(); ++i)
|
|
|
|
if(myExternalSettings[i].key == key)
|
|
|
|
return i;
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
int Settings::setInternal(const string& key, const string& value,
|
|
|
|
int pos, bool useAsInitial)
|
|
|
|
{
|
|
|
|
int idx = -1;
|
|
|
|
|
|
|
|
if(pos != -1 && pos >= 0 && pos < (int)myInternalSettings.size() &&
|
|
|
|
myInternalSettings[pos].key == key)
|
|
|
|
{
|
|
|
|
idx = pos;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for(unsigned int i = 0; i < myInternalSettings.size(); ++i)
|
|
|
|
{
|
|
|
|
if(myInternalSettings[i].key == key)
|
|
|
|
{
|
|
|
|
idx = i;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(idx != -1)
|
|
|
|
{
|
|
|
|
myInternalSettings[idx].key = key;
|
|
|
|
myInternalSettings[idx].value = value;
|
|
|
|
if(useAsInitial) myInternalSettings[idx].initialValue = value;
|
|
|
|
|
|
|
|
/*cerr << "modify internal: key = " << key
|
2006-03-19 00:46:04 +00:00
|
|
|
<< ", value = " << value
|
|
|
|
<< ", ivalue = " << myInternalSettings[idx].initialValue
|
2006-03-06 02:26:16 +00:00
|
|
|
<< " @ index = " << idx
|
|
|
|
<< endl;*/
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Setting setting;
|
|
|
|
setting.key = key;
|
|
|
|
setting.value = value;
|
|
|
|
if(useAsInitial) setting.initialValue = value;
|
|
|
|
|
|
|
|
myInternalSettings.push_back(setting);
|
|
|
|
idx = myInternalSettings.size() - 1;
|
|
|
|
|
|
|
|
/*cerr << "insert internal: key = " << key
|
2006-03-19 00:46:04 +00:00
|
|
|
<< ", value = " << value
|
|
|
|
<< ", ivalue = " << setting.initialValue
|
2006-03-06 02:26:16 +00:00
|
|
|
<< " @ index = " << idx
|
|
|
|
<< endl;*/
|
|
|
|
}
|
|
|
|
|
|
|
|
return idx;
|
|
|
|
}
|
|
|
|
|
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
int Settings::setExternal(const string& key, const string& value,
|
|
|
|
int pos, bool useAsInitial)
|
|
|
|
{
|
|
|
|
int idx = -1;
|
|
|
|
|
|
|
|
if(pos != -1 && pos >= 0 && pos < (int)myExternalSettings.size() &&
|
|
|
|
myExternalSettings[pos].key == key)
|
|
|
|
{
|
|
|
|
idx = pos;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for(unsigned int i = 0; i < myExternalSettings.size(); ++i)
|
|
|
|
{
|
|
|
|
if(myExternalSettings[i].key == key)
|
|
|
|
{
|
|
|
|
idx = i;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(idx != -1)
|
|
|
|
{
|
|
|
|
myExternalSettings[idx].key = key;
|
|
|
|
myExternalSettings[idx].value = value;
|
|
|
|
if(useAsInitial) myExternalSettings[idx].initialValue = value;
|
|
|
|
|
|
|
|
/*cerr << "modify external: key = " << key
|
|
|
|
<< ", value = " << value
|
|
|
|
<< " @ index = " << idx
|
|
|
|
<< endl;*/
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Setting setting;
|
|
|
|
setting.key = key;
|
|
|
|
setting.value = value;
|
|
|
|
if(useAsInitial) setting.initialValue = value;
|
|
|
|
|
|
|
|
myExternalSettings.push_back(setting);
|
|
|
|
idx = myExternalSettings.size() - 1;
|
|
|
|
|
|
|
|
/*cerr << "insert external: key = " << key
|
|
|
|
<< ", value = " << value
|
|
|
|
<< " @ index = " << idx
|
|
|
|
<< endl;*/
|
|
|
|
}
|
2003-09-23 17:27:11 +00:00
|
|
|
|
2006-03-06 02:26:16 +00:00
|
|
|
return idx;
|
2003-09-23 17:27:11 +00:00
|
|
|
}
|
|
|
|
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
Settings::Settings(const Settings&)
|
2002-03-21 22:47:00 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
|
|
Settings& Settings::operator = (const Settings&)
|
2002-03-21 22:47:00 +00:00
|
|
|
{
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
assert(false);
|
2003-09-04 16:50:48 +00:00
|
|
|
|
X11 and SDL versions now fully compile and fully support the new
EventHandler class. All thats left to do there is integrate the
Snapshot code into the core, but that will have to wait until I
rewrite the PNG handler to not need the PNG library ...
Changed the Settings class to a virtual abstract class, and created
a SettingsUNIX class to derive from it and work with the X11 and SDL
versions.
Some notes on updating the DOS and Windows ports (which I will probably
do eventually), and on porting to other toolkits:
A port needs the following:
- a main function which takes native events and converts to the core
format, and generally acts as the dispatcher (mainXXX.cxx)
- a specific frontend, derived from Frontend.hxx, which sets up port
specific filename and locations (FrontendXXX.hxx)
- a specific settings class, derived from Settings.hxx, which deals
with settings/commandline arguments specific to that port (SettingsXXX.hxx)
- probably some other stuff that I've forgotten
The next step is get the DOS port working with the new EventHandler (easy)
and attempt to bring the Windows port into the year 2003 (it hasn't been
touched for almost a year, quite hard).
I also have to write a GUI class that will draw menus, etc. and actually let
you remap keys from the emulator itself. And that may have to wait until
the fabled graphics rewrite that Brad and I will be working on. It never ends ...
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@181 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
2003-09-11 20:53:51 +00:00
|
|
|
return *this;
|
2002-03-21 22:47:00 +00:00
|
|
|
}
|