Added SECAM support internally and to the user-defined palette.

Added '-channels' commandline argument, which allows setting the 'Cartridge.Sound'
property (the property was already present; this just adds a way to set it
from the commandline).

Added ability to change the locations for state saves, cheatfile, palette file
and properties file.  These are now changable from within the application
(Options -> Files & Snapshots -> Config Files.  They're also changable from the
commandline with '-statedir', '-cheatfile', '-palettefile', and '-propsfile'.

Fixed issues in commandline handling; maybe I should just use GNU getopts.

Updated the documentation.  I guess that means a new release is close ...


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1332 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2007-07-27 13:49:16 +00:00
parent c399392dfe
commit 821dcf9bc0
20 changed files with 543 additions and 470 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -23,13 +23,13 @@
<li><a href="#Games">Games</a></li> <li><a href="#Games">Games</a></li>
<li><a href="#Starting">Starting A Game</a></li> <li><a href="#Starting">Starting A Game</a></li>
<li><a href="#Options">Changing Options</a></li> <li><a href="#Options">Changing Options</a></li>
<li><a href="#Settings">Settings File</a></li>
<li><a href="#Keyboard">Keyboard Layout</a></li> <li><a href="#Keyboard">Keyboard Layout</a></li>
<li><a href="#Remapping">Event Remapping</a></li> <li><a href="#Remapping">Event Remapping</a></li>
<li><a href="#Cheats">Cheatcode Manager</a></li>
<li><a href="#Debugger">Integrated Debugger</a></li>
<li><a href="#Properties">Game Properties</a></li>
<li><a href="#Adaptor">Stelladaptor Support</a></li> <li><a href="#Adaptor">Stelladaptor Support</a></li>
<li><a href="#Debugger">Integrated Debugger</a></li>
<li><a href="#Settings">Settings File</a></li>
<li><a href="#Cheats">Cheatcode Manager</a></li>
<li><a href="#Properties">Game Properties</a></li>
<li><a href="#Palette">Palette Support</a></li> <li><a href="#Palette">Palette Support</a></li>
<li><a href="#Acknowledgments">Acknowledgments</a></li> <li><a href="#Acknowledgments">Acknowledgments</a></li>
<li><a href="#License">License and Disclaimer</a></li> <li><a href="#License">License and Disclaimer</a></li>
@ -37,7 +37,7 @@
<br><br><br> <br><br><br>
<center><b>February 1999 - January 2007</b></center> <center><b>February 1999 - August 2007</b></center>
<center><b>The Stella Team</b></center> <center><b>The Stella Team</b></center>
<center><b><a href="http://stella.sourceforge.net">Stella Homepage</a></b></center> <center><b><a href="http://stella.sourceforge.net">Stella Homepage</a></b></center>
@ -201,6 +201,8 @@
<p><i>Alexander Bilstein<br>February 1999</i></p> <p><i>Alexander Bilstein<br>February 1999</i></p>
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br> <br><br>
<p><h1> <p><h1>
<a name="Introduction">1. Introduction</a></h1> <a name="Introduction">1. Introduction</a></h1>
@ -311,12 +313,14 @@ a ROM.</li>
<li>Supports Supercharger single-load and multi-load games</li> <li>Supports Supercharger single-load and multi-load games</li>
<li>Supports property file for setting the properties associated with games</li> <li>Supports property file for setting the properties associated with games</li>
<li>Supports user specified frame rate</li> <li>Supports user specified frame rate</li>
<li>Supports the NTSC, PAL and PAL60 television standards</li> <li>Supports the NTSC, PAL, PAL60 and SECAM television standards</li>
<li>Supports several "undocumented features" of the TIA graphics chip used by <li>Supports several "undocumented features" of the TIA graphics chip used by
some games</li> some games</li>
<li>TIA emulation supports full collision checking</li> <li>TIA emulation supports full collision checking</li>
</ul> </ul>
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br> <br><br>
<p><h1> <p><h1>
<a name="Requirements">2. What You Will Need</a></h1> <a name="Requirements">2. What You Will Need</a></h1>
@ -339,7 +343,7 @@ a ROM.</li>
<li>Latest version of the zlib library</li> <li>Latest version of the zlib library</li>
<li>Joysticks or gamepads are highly recommended</li> <li>Joysticks or gamepads are highly recommended</li>
<li>Mouse or Stelladaptor with real paddles required for paddle emulation</li> <li>Mouse or Stelladaptor with real paddles required for paddle emulation</li>
<li>Some ROM images (no, we won't tell you where to find them)</li> <li>Some ROM images (See <a href="http://www.atariage.com">AtariAge</a> for more information)</li>
</ul> </ul>
<p> <p>
@ -351,9 +355,7 @@ a ROM.</li>
<li>GNU C++ compiler version 2.95 and the make utility are required for compiling <li>GNU C++ compiler version 2.95 and the make utility are required for compiling
the Stella source code; GNU C++ compiler version 3.2.x/4.x or later is highly the Stella source code; GNU C++ compiler version 3.2.x/4.x or later is highly
recommended</li> recommended</li>
<li>Pentium class machine required (in general, Stella will compile on other <li>x86 or PowerPC class machine required, in either 32 or 64-bit mode</li>
architectures, both 32 and 64-bit, but it hasn't been extensively
tested)</li>
</ul> </ul>
<p> <p>
@ -372,18 +374,20 @@ a ROM.</li>
<p> <p>
<h2><b>Windows</b></h2> <h2><b>Windows</b></h2>
<p>The Windows version of Stella is designed to work on Windows 98/ME/2000/XP with <p>The Windows version of Stella is designed to work on Windows 98/ME/2000/XP/Vista
the following:</p> with the following:</p>
<ul> <ul>
<li>Visual C++ 7 or MinGW compiler is required to compile the Stella <li>Visual C++ 7 or MinGW compiler is required to compile the Stella
source code</li> source code</li>
<li>Pentium class machine required; OpenGL accelerated video card highly <li>Pentium class machine required; OpenGL accelerated video card highly
recommended</li> recommended</li>
<li>SDL version 1.2.8 or greater (or included SDL.dll) required for <li>SDL version 1.2.8 or greater (included in release versions) required for
Stelladaptor support</li> Stelladaptor support</li>
</ul> </ul>
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br> <br><br>
<p><h1> <p><h1>
<a name="Installation">3. Installation</a></h1> <a name="Installation">3. Installation</a></h1>
@ -451,8 +455,7 @@ a ROM.</li>
<li>Open the <b>stella-<i>release</i>/src/win32/Stella.sln</b> <li>Open the <b>stella-<i>release</i>/src/win32/Stella.sln</b>
file using Visual C++ 7</li> file using Visual C++ 7</li>
<li>Build the 'Stella' solution</li> <li>Build the 'Stella' solution</li>
<li>Copy the <b>Stella.exe</b> and <b>stella.pro</b> files <li>Copy the <b>Stella.exe</b> file to some directory</li>
to some directory</li>
</ul> </ul>
</ol> </ol>
<li><b>Binary ZIP file</b> (stella-<i>release</i>-win32.zip)</li> <li><b>Binary ZIP file</b> (stella-<i>release</i>-win32.zip)</li>
@ -466,6 +469,8 @@ a ROM.</li>
</ol> </ol>
</ul> </ul>
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br> <br><br>
<p><h1> <p><h1>
<a name="Games">4. Games</a></h1> <a name="Games">4. Games</a></h1>
@ -531,6 +536,8 @@ a ROM.</li>
<p>Once you have the multi-load ROM image file, survivl.bin in this case, you <p>Once you have the multi-load ROM image file, survivl.bin in this case, you
can play the game using it.</p> can play the game using it.</p>
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br> <br><br>
<p><h1> <p><h1>
<a name="Starting">5. Starting A Game</a></h1> <a name="Starting">5. Starting A Game</a></h1>
@ -550,28 +557,29 @@ a ROM.</li>
'ROM Launcher' mode:<br><br> 'ROM Launcher' mode:<br><br>
<img src="graphics/launcher.png"></p> <img src="graphics/launcher.png"></p>
<p>The ROM and snapshot settings may be changed by clicking the <p>The ROM browser, snapshot, and external file settings may be changed by
'Options / Files &amp; Snapshots' button:<br><br> clicking the 'Options / Files &amp; Snapshots' button:<br><br>
<img src="graphics/launcher_options_rom.png">&nbsp;&nbsp; <img src="graphics/launcher_options_rom.png">&nbsp;&nbsp;
<img src="graphics/launcher_options_snap.png"></p> <img src="graphics/launcher_options_files.png"></p>
<p>Selecting a new path for ROM or snapshots is done by clicking the 'Path' <p>Selecting a new path for an item is done by clicking the 'Path' button(s):<br><br>
button(s):<br><br>
<img src="graphics/rom_browser.png"></p> <img src="graphics/rom_browser.png"></p>
<p>Once a ROM directory has been selected, clicking 'Reload' will update the <p>Once a ROM directory has been selected, clicking 'Reload' will update the
ROM listing. You can start emulation by selecting a ROM and pressing 'Enter' ROM listing (assuming you're not in 'rombrowse' mode). You can start
or clicking 'Play', or double-clicking a ROM.</p> emulation by selecting a ROM and pressing 'Enter' or clicking 'Play', or
double-clicking a ROM.</p>
<p> <p>
<h2><b>Command Line</b></h2> <h2><b>Command Line</b></h2>
<p>Stella can also be used from the commandline (assuming your operating system <p>Stella can also be used from the commandline (assuming your operating system
has a commandline). When using this mode, the ROM launcher is disabled.</p> has a commandline). When using this mode and specifying a ROM, the ROM launcher
is disabled.</p>
<p>To run Stella from the commandline, use the following format:</p> <p>To run Stella from the commandline, use the following format:</p>
<pre> stella [options ...] filename.bin</pre> <pre> stella [options ...] ROM_FILENAME</pre>
<p><b>Options</b> ('0' or 'false' indicates false, '1' or 'true' indicates true, <p><b>Options</b> ('0' or 'false' indicates false, '1' or 'true' indicates true,
others are self-explanatory):</p> others are self-explanatory):</p>
@ -601,6 +609,7 @@ a ROM.</li>
GL_LINEAR introduces blurring.</td> GL_LINEAR introduces blurring.</td>
</tr> </tr>
<!--
<tr> <tr>
<td><pre>-gl_aspect &lt;number&gt;</pre></td> <td><pre>-gl_aspect &lt;number&gt;</pre></td>
<td>OpenGL mode only. Specify the aspect ratio of the window. Normal <td>OpenGL mode only. Specify the aspect ratio of the window. Normal
@ -608,12 +617,10 @@ a ROM.</li>
many video modes do not use square pixels, you may have to try many video modes do not use square pixels, you may have to try
different values. I find 1.6 or 1.7 gives the most authentic look.</td> different values. I find 1.6 or 1.7 gives the most authentic look.</td>
</tr> </tr>
-->
<tr> <tr>
<td><pre>-gl_fsmax &lt;0|1&gt;</pre></td> <td><pre>-gl_fsmax &lt;never|always|ui|tia&gt;</pre></td>
<td>OpenGL mode only. Use the current desktop resolution when switching <td>OpenGL mode only. Stretch fullscreen image while in the given mode.</td>
to fullscreen OpenGL mode (so a video-mode switch can be avoided).
If not supported, then use the maximum possible resolution available.</td>
</tr> </tr>
<tr> <tr>
@ -623,15 +630,14 @@ a ROM.</li>
</tr> </tr>
<tr> <tr>
<td><pre>-scale_tia &lt;scaler&gt;</pre></td> <td><pre>-zoom_tia &lt;scaler&gt;</pre></td>
<td>Use the specified scaler while in TIA/emulation mode. Possible <td>Use the specified zoom level while in TIA/emulation mode.</td>
scalers are 'zoom1x, ..., zoom6x'.</td>
</tr> </tr>
<tr> <tr>
<td><pre>-scale_ui &lt;scaler&gt;</pre></td> <td><pre>-zoom_ui &lt;scaler&gt;</pre></td>
<td>Use the specified scaler while in UI mode (currently, the ROM <td>Use the specified scaler while in non-emulation mode (currently, the ROM
launcher and debugger). Possible scalers are 'zoom1x, ..., zoom6x'.</td> launcher and debugger).</td>
</tr> </tr>
<tr> <tr>
@ -639,6 +645,11 @@ a ROM.</li>
<td>Play the game in fullscreen mode.</td> <td>Play the game in fullscreen mode.</td>
</tr> </tr>
<tr>
<td><pre>-fullres &lt;WxH&gt;</pre></td>
<td>Use this resolution in fullscreen mode.</td>
</tr>
<tr> <tr>
<td><pre>-center &lt;0|1&gt;</pre></td> <td><pre>-center &lt;0|1&gt;</pre></td>
<td>Centers game window (if possible).</td> <td>Centers game window (if possible).</td>
@ -650,9 +661,9 @@ a ROM.</li>
</tr> </tr>
<tr> <tr>
<td><pre>-palette &lt;original|standard|z26|user&gt;</pre></td> <td><pre>-palette &lt;standard|z26|user&gt;</pre></td>
<td>Set the palette to either pre-Stella 1.4, Stella 1.4 and above, <td>Set the palette to either normal Stella, the one used in the z26
the palette used in the z26 emulator, or a user-defined palette.</td> emulator, or a user-defined palette.</td>
</tr> </tr>
<tr> <tr>
@ -754,13 +765,6 @@ a ROM.</li>
<td>Set threshold for eliminating paddle jitter.</td> <td>Set threshold for eliminating paddle jitter.</td>
</tr> </tr>
<tr>
<td><pre>-tiadefaults &lt;1|0&gt;</pre></td>
<td>Use TIA positioning defaults instead of enhanced values. The
default values result in the image appearing as it does on
a real 2600 system (in most cases).</td>
</tr>
<tr> <tr>
<td><pre>-rombrowse &lt;1|0&gt;</pre></td> <td><pre>-rombrowse &lt;1|0&gt;</pre></td>
<td>The ROM listing is treated as a filesystem, where one can traverse <td>The ROM listing is treated as a filesystem, where one can traverse
@ -773,18 +777,6 @@ a ROM.</li>
saving a ROM state file.</td> saving a ROM state file.</td>
</tr> </tr>
<tr>
<td><pre>-fastscbios &lt;1|0&gt;</pre></td>
<td>Set loading of Supercharger BIOS bars to maximum speed (8x normal).</td>
</tr>
<tr>
<td><pre>-accurate &lt;1|0&gt;</pre></td>
<td>Linux only, may be removed in future versions. Use this when
running under the Linux 2.4 kernel. Otherwise, this should probably
not be used.</td>
</tr>
<tr> <tr>
<td><pre>-ssdir &lt;path&gt;</pre></td> <td><pre>-ssdir &lt;path&gt;</pre></td>
<td>The directory to save snapshot files to.</td> <td>The directory to save snapshot files to.</td>
@ -808,8 +800,8 @@ a ROM.</li>
</tr> </tr>
<tr> <tr>
<td><pre>-launchersize &lt;1|2|3&gt;</pre></td> <td><pre>-launcherres &lt;WxH&gt;</pre></td>
<td>Set the size of the ROM launcher. This isn't yet complete.</td> <td>Set the size of the ROM launcher.</td>
</tr> </tr>
<tr> <tr>
@ -818,6 +810,26 @@ a ROM.</li>
complete.</td> complete.</td>
</tr> </tr>
<tr>
<td><pre>-statdir &lt;dir&gt;</pre></td>
<td>Set the directory in which to save state files.</td>
</tr>
<tr>
<td><pre>-cheatfile &lt;file&gt;</pre></td>
<td>Set the full pathname of the cheatfile database.</td>
</tr>
<tr>
<td><pre>-palettefile &lt;file&gt;</pre></td>
<td>Set the full pathname of the user-defined palette file.</td>
</tr>
<tr>
<td><pre>-propsfile &lt;file&gt;</pre></td>
<td>Set the full pathname of the ROM properties file.</td>
</tr>
<tr> <tr>
<td><pre>-help</pre></td> <td><pre>-help</pre></td>
<td>Prints a help message describing these options, and then <td>Prints a help message describing these options, and then
@ -864,11 +876,6 @@ a ROM.</li>
<td><pre>-holdbutton0</pre></td> <td><pre>-holdbutton0</pre></td>
<td>Start the emulator with the left joystick button held down.</td> <td>Start the emulator with the left joystick button held down.</td>
</tr> </tr>
<tr>
<td><pre>-pro &lt;props file&gt;</pre></td>
<td>Use the given properties file instead of stella.pro.</td>
</tr>
<tr> <tr>
<td><pre>-type &lt;type&gt;</pre></td> <td><pre>-type &lt;type&gt;</pre></td>
@ -876,6 +883,11 @@ a ROM.</li>
for valid types.</td> for valid types.</td>
</tr> </tr>
<tr>
<td><pre>-channels &lt;Mono|Stereo&gt;</pre></td>
<td>Set "Cartridge.Sound" property.</td>
</tr>
<tr> <tr>
<td><pre>-ld &lt;A|B&gt;</pre></td> <td><pre>-ld &lt;A|B&gt;</pre></td>
<td>Set "Console.LeftDifficulty" property.</td> <td>Set "Console.LeftDifficulty" property.</td>
@ -920,7 +932,7 @@ a ROM.</li>
</tr> </tr>
<tr> <tr>
<td><pre>-format &lt;NTSC|PAL|PAL60&gt;</pre></td> <td><pre>-format &lt;NTSC|PAL|PAL60|SECAM&gt;</pre></td>
<td>Set "Display.Format" property.</td> <td>Set "Display.Format" property.</td>
</tr> </tr>
@ -951,6 +963,8 @@ a ROM.</li>
</tr> </tr>
</table> </table>
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br> <br><br>
<p><h1> <p><h1>
<a name="Options">6. Changing Options</a></h1> <a name="Options">6. Changing Options</a></h1>
@ -980,84 +994,17 @@ a ROM.</li>
<p><b>About</b> dialog:<br><br> <p><b>About</b> dialog:<br><br>
<img src="graphics/options_about.png"> <img src="graphics/options_about.png">
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br> <br><br>
<p><h1> <p><h1>
<a name="Settings">7. Settings File</a></h1> <a name="Keyboard">7. Keyboard Layout</a></h1>
<hr>
<p>Stella will remember when you change a setting either at the command line
or while the emulation is running, and use the settings the next time
you start the emulator. The settings are saved in a text file which can
be edited outside of Stella. This file can contain your default options,
and eliminates the need to specify them on the command line. Any
options specified on the command line will override those in the settings file.</p>
<p>The syntax for the settings file is very straightforward. Any line starting with
a ';' character is considered a comment and is ignored. Other lines must be of
the form: <b>command = value</b>, where <i>command</i> is the same as that
specified on the command line (without the '-' character), and <i>value</i>
is dependent on the command.</p>
<p>For example, the following table illustrates how command line and settings entries
are similar:</p>
<table BORDER=2>
<tr>
<th>Command Line</th>
<th>Settings File</th>
</tr>
<tr>
<td>-video gl</td>
<td>video = gl</td>
</tr>
<tr>
<td>-volume 75</td>
<td>volume = 75</td>
</tr>
<tr>
<td>-showinfo 1</td>
<td>showinfo = 1 (or showinfo = true)</td>
</tr>
</table>
<p>The settings file has a special name/location depending on which version of Stella
you use. Note that if the environment variable 'STELLA_BASEDIR' is set, the
location of the settings file will change accordingly:</p>
<p>
<h2><b>Linux/UNIX</b></h2>
<p>The Linux and UNIX version of Stella searches for the <i>stellarc</i> file in
your $HOME/.stella directory, or in $STELLA_BASEDIR if that environment
variable is set.</p>
<p>
<h2><b>Macintosh</b></h2>
<p>The Macintosh version does not use an INI file, but stores it
preferences in the expected location for application preferences, in
the Users home directory, in the Library/Preferences/StellaOSX.plist
file. The STELLA_BASEDIR environment variable has no effect for
the settings file in OSX.<br>
<p>
<h2><b>Windows</b></h2>
<p>The Windows version of Stella looks for the <i>stella.ini</i> file in the same
directory containing the application, or in $STELLA_BASEDIR if that environment
variable is set. Future versions of Stella for Windows may look in
user-specific locations (C:\Documents and Settings\...).</p>
<br><br>
<p><h1>
<a name="Keyboard">8. Keyboard Layout</a></h1>
<hr> <hr>
<p>The Atari 2600 console controls and controllers are mapped to the computer's <p>The Atari 2600 console controls and controllers are mapped to the computer's
keyboard as shown in the following tables.</p> keyboard as shown in the following tables.</p>
<p>As of Stella 1.4, most of these events can be remapped to other keys on your keyboard <p>As of Stella 1.4, most of these events can be remapped to other keys on your keyboard
or buttons on your joystick (see <b>Section 9 - or buttons on your joystick (see <b>Section 8 -
<a href="#Remapping">Event Remapping</a></b>). The tables below show the default <a href="#Remapping">Event Remapping</a></b>). The tables below show the default
settings.</p> settings.</p>
@ -1610,13 +1557,13 @@ a ROM.</li>
</tr> </tr>
<tr> <tr>
<td>Switch to next <i>larger</i> scaler</td> <td>Switch to next <i>larger</i> zoom level</td>
<td>Alt + =</td> <td>Alt + =</td>
<td>Cmd + =</td> <td>Cmd + =</td>
</tr> </tr>
<tr> <tr>
<td>Switch to next <i>smaller</i> scaler</td> <td>Switch to next <i>smaller</i> zoom level</td>
<td>Alt + -</td> <td>Alt + -</td>
<td>Cmd + -</td> <td>Cmd + -</td>
</tr> </tr>
@ -1653,7 +1600,7 @@ a ROM.</li>
</tr> </tr>
<tr> <tr>
<td>Toggle display format between <i>NTSC, PAL, PAL60</i></td> <td>Toggle display format between <i>NTSC/PAL/PAL60/SECAM</i></td>
<td>Control + f</td> <td>Control + f</td>
<td>Cmd + f</td> <td>Cmd + f</td>
</tr> </tr>
@ -1719,14 +1666,15 @@ a ROM.</li>
</tr> </tr>
</table> </table>
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br><br> <br><br><br>
<p><h1> <p><h1>
<a name="Remapping">9. Event Remapping</a></h1> <a name="Remapping">8. Event Remapping</a></h1>
<hr> <hr>
<p>This version of Stella has event remapping. Almost every event in the emulator <p>This version of Stella has event remapping. Almost every event in the emulator
can be remapped to another key on the keyboard or to buttons on up to eight can be remapped to another key on the keyboard or to buttons on up to eight
joysticks/gamepads (see <b>Section 8 - <a href="#Keyboard">Keyboard Layout</a></b> joysticks/gamepads (see <b>Section 7 - <a href="#Keyboard">Keyboard Layout</a></b>
for those event which can/cannot be remapped).</p> for those event which can/cannot be remapped).</p>
<p>Note that there are currently two separate event modes in Stella; emulation <p>Note that there are currently two separate event modes in Stella; emulation
@ -1782,10 +1730,115 @@ a ROM.</li>
each frame. These speeds specify how much movement will occur.</p> each frame. These speeds specify how much movement will occur.</p>
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br><br> <br><br>
<p><h1> <p><h1>
<a name="Cheats">10. Cheatcode Manager</a></h1> <a name="Adaptor">9. Stelladaptor Support</a></h1>
<hr>
<p>Stella supports real Atari 2600 joysticks, paddles and driving controllers
using the <a href="http://www.pixelspast.com/products">Stelladaptor</a> device.</p>
<p>Stella can use up to <b>two</b> Stelladaptors; any extra ones are ignored.
Stelladaptor devices will be automatically detected and configured. Devices
can be plugged/unplugged while the emulation is running; Stella will detect the
change and act accordingly.</p>
<p>The detection and configuration is as follows:
<ul>
<li>The first Stelladaptor found will act as the <b>left game port</b>
on a real Atari. Depending on the device, Stella will detect it as
either the left joystick, paddles 0 & 1, or the left driving controller.</li>
<li>The second Stelladaptor found will act as the <b>right game port</b>
on a real Atari. Depending on the device, Stella will detect it as
either the right joystick, paddles 2 & 3, or the right driving controller.</li>
<li>Any other Stelladaptors will be ignored.</li>
<li>The assignment ordering of Stelladaptor to port can be redefined with
'sa1' and 'sa2' (see description in 'Starting a Game').</li>
</ul>
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br>
<p><h1>
<a name="Debugger">10. Integrated Debugger</a></h1>
<hr>
<p>Have a look at <a href="debugger.html">this page</a> for integrated debugger
documentation.
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br>
<p><h1>
<a name="Settings">11. Settings File</a></h1>
<hr>
<p>Stella will remember when you change a setting either at the command line
or while the emulation is running, and use the settings the next time
you start the emulator. The settings are saved in a text file which can
be edited outside of Stella. This file can contain your default options,
and eliminates the need to specify them on the command line. Any
options specified on the command line will override those in the settings file.</p>
<p>The syntax for the settings file is very straightforward. Any line starting with
a ';' character is considered a comment and is ignored. Other lines must be of
the form: <b>command = value</b>, where <i>command</i> is the same as that
specified on the command line (without the '-' character), and <i>value</i>
is dependent on the command.</p>
<p>For example, the following table illustrates how command line and settings entries
are similar:</p>
<table BORDER=2>
<tr>
<th>Command Line</th>
<th>Settings File</th>
</tr>
<tr>
<td>-video gl</td>
<td>video = gl</td>
</tr>
<tr>
<td>-volume 75</td>
<td>volume = 75</td>
</tr>
<tr>
<td>-showinfo 1</td>
<td>showinfo = 1 (or showinfo = true)</td>
</tr>
</table>
<p>The settings file has a special name/location depending on which version of Stella
you use, which is currently not configurable:</p>
<p><table cellpadding="5" border="1">
<tr>
<td><b>Linux/Unix</b></td>
<td><i>$HOME/.stella/stellarc</i></td>
</tr>
<tr>
<td><b>Macintosh</b></td>
<td>Not applicable; settings are saved in <i>$HOME/Library/Preferences/StellaOSX.plist</i></td>
</tr>
<tr>
<td><b>Windows</b></td>
<td><i>stella.ini (in same directory as the application)</i></td>
</tr>
</table>
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br>
<p><h1>
<a name="Cheats">12. Cheatcode Manager</a></h1>
<hr> <hr>
<p>Stella 2.0 contains support for Bob Colbert's Cheetah cheat codes, as <p>Stella 2.0 contains support for Bob Colbert's Cheetah cheat codes, as
@ -1857,17 +1910,33 @@ Ms Pac-Man (Stella extended codes):
108fea1 - infinite lives 108fea1 - infinite lives
</pre> </pre>
<br> <p>The name of the cheat database file is configurable through the
<p><h1> '<i>-cheatfile</i>' commandline argument and within the application itself
<a name="Debugger">11. Integrated Debugger</a></h1> (see <b>Section 5 - <a href="#Starting">Starting a Game</a></b>). If the
<hr> path for this file hasn't been set, the default filename will depend on the
version of Stella, as follows:</p>
<p>Have a look at <a href="debugger.html">this page</a> for integrated debugger <p><table cellpadding="5" border="1">
documentation. <tr>
<td><b>Linux/Unix</b></td>
<td><i>$HOME/.stella/stella.cht</i></td>
</tr>
<tr>
<td><b>Macintosh</b></td>
<td><i>$HOME/.stella/stella.cht</i></td>
</tr>
<tr>
<td><b>Windows</b></td>
<td><i>stella.cht</i> (in same directory as the application)</td>
</tr>
</table>
<p>Stella will require a restart for changes to this file to take effect.</p>
<br><br><br>
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br>
<p><h1> <p><h1>
<a name="Properties">12. Game Properties</a></h1> <a name="Properties">13. Game Properties</a></h1>
<hr> <hr>
<p>Stella uses game properties to specify the "best" emulator settings for a <p>Stella uses game properties to specify the "best" emulator settings for a
@ -1877,26 +1946,6 @@ Ms Pac-Man (Stella extended codes):
means that when you upgrade Stella, your personal properties settings are means that when you upgrade Stella, your personal properties settings are
preserved.</p> preserved.</p>
<p>
<h2><b>Linux/Unix</b></h2>
<p>The Linux and Unix versions of Stella looks for your personal properties
file in <i>$HOME/.stella/stella.pro</i>, or if the STELLA_BASEDIR environment
variable is set, in <i>$STELLA_BASEDIR/stella.pro</i>.
<p>
<h2><b>Macintosh</b></h2>
<p>The Mac version of Stella looks for your personal properties file in
<i>$HOME/.stella/stella.pro</i>, or if the STELLA_BASEDIR environment
variable is set, in <i>$STELLA_BASEDIR/stella.pro</i>.
<p>
<h2><b>Windows</b></h2>
<p>The Windows version of Stella looks for the properties file in the directory
containing the application, or if the STELLA_BASEDIR environment
variable is set, in <i>$STELLA_BASEDIR/stella.pro</i>.
Future versions of Stella for Windows may look in
user-specific locations (C:\Documents and Settings\...).</p>
<p> <p>
<h2><b>Property File</b></h2> <h2><b>Property File</b></h2>
@ -1907,24 +1956,24 @@ Ms Pac-Man (Stella extended codes):
<p> <p>
<pre> <pre>
; Comments ; Comments
"Cartridge.Name" "Value" "Cartridge.MD5" "Value"
"Property" "Value" "Property" "Value"
"" ""
; Comments ; Comments
"Cartridge.Name" "Value" "Cartridge.MD5" "Value"
"Property" "Value" "Property" "Value"
"" ""
. . . . . .
; Comments ; Comments
"Cartridge.Name" "Value" "Cartridge.MD5" "Value"
"Property" "Value" "Property" "Value"
""</pre> ""</pre>
<p>Every block in the property file must have a unique value for the <p>Every block in the property file must have a unique value for the
<i>Cartridge.Name</i> and <i>Cartridge.MD5</i> properties.</p> <i>Cartridge.MD5</i> property.</p>
<p> <p>
<h2><b>Properties</b></h2> <h2><b>Properties</b></h2>
@ -2086,54 +2135,44 @@ Ms Pac-Man (Stella extended codes):
<p><b>Note:</b> Items marked as '*' are deprecated, and will probably be <p><b>Note:</b> Items marked as '*' are deprecated, and will probably be
removed in a future release.</p> removed in a future release.</p>
<br><br> <p>The name of the properties file is configurable through the
<p><h1> '<i>-propsfile</i>' commandline argument and within the application itself
<a name="Adaptor">13. Stelladaptor Support</a></h1> (see <b>Section 5 - <a href="#Starting">Starting a Game</a></b>). If the
<hr> path for this file hasn't been set, the default filename will depend on the
version of Stella, as follows:</p>
<p>Stella supports real Atari 2600 joysticks, paddles and driving controllers <p><table cellpadding="5" border="1">
using the <a href="http://www.pixelspast.com/products">Stelladaptor</a> device.</p> <tr>
<td><b>Linux/Unix</b></td>
<td><i>$HOME/.stella/stella.pro</i></td>
</tr>
<tr>
<td><b>Macintosh</b></td>
<td><i>$HOME/.stella/stella.pro</i></td>
</tr>
<tr>
<td><b>Windows</b></td>
<td><i>stella.pro</i> (in same directory as the application)</td>
</tr>
</table>
<p>Stella will require a restart for changes to this file to take effect.</p>
<p>Stella can use up to <b>two</b> Stelladaptors; any extra ones are ignored.
Stelladaptor devices will be automatically detected and configured. Devices
can be plugged/unplugged while the emulation is running; Stella will detect the
change and act accordingly.</p>
<p>The detection and configuration is as follows:
<ul>
<li>The first Stelladaptor found will act as the <b>left game port</b>
on a real Atari. Depending on the device, Stella will detect it as
either the left joystick, paddles 0 & 1, or the left driving controller.</li>
<li>The second Stelladaptor found will act as the <b>right game port</b>
on a real Atari. Depending on the device, Stella will detect it as
either the right joystick, paddles 2 & 3, or the right driving controller.</li>
<li>Any other Stelladaptors will be ignored.</li>
<li>The assignment ordering of Stelladaptor to port can be redefined with
'sa1' and 'sa2' (see description in 'Starting a Game').</li>
</ul>
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br> <br><br>
<p><h1> <p><h1>
<a name="Palette">14. Palette Support</a></h1> <a name="Palette">14. Palette Support</a></h1>
<hr> <hr>
<p>An Atari 2600 palette consists of 128 colours, which are different <p>An Atari 2600 palette consists of 128 colours, which are different
for the two major television standards (NTSC and PAL/PAL60). Stella supports for the three major television standards (NTSC, PAL/PAL60, SECAM).
three built-in palettes and one user-defined palette for each format. Stella supports two built-in palettes and one user-defined palette for each format.
These are set using the '-palette' option, and are described as follows:</p> These are set using the '-palette' option, and are described as follows:</p>
<p><table cellpadding="5" border="1"> <p><table cellpadding="5" border="1">
<tr> <tr>
<td><b>standard</b></td> <td><b>standard</b></td>
<td>The default palette from Stella 1.4 onwards.</td> <td>The default palette from Stella 1.4 onwards.</td>
</tr> </tr>
<tr>
<td><b>original</b></td>
<td>The palette used in the original StellaX emulator.</td>
</tr>
<tr> <tr>
<td><b>z26</b></td> <td><b>z26</b></td>
<td>The palette from the z26 emulator.</td> <td>The palette from the z26 emulator.</td>
@ -2147,20 +2186,45 @@ Ms Pac-Man (Stella extended codes):
<p>Support for a user-defined palette is a new feature for Stella 2.3, and <p>Support for a user-defined palette is a new feature for Stella 2.3, and
is further described as follows: is further described as follows:
<ul> <ul>
<li>The palette file must be called 'stella.pal', and will be located <li>The palette file must be at least 792 bytes long. Colours are stored
in the base folder, in the same place as the stella properties file.</li>
<li>The palette file must be at least 768 bytes long. Colours are stored
in 24-bit RGB, with the first byte for red, the second for green, the in 24-bit RGB, with the first byte for red, the second for green, the
third for blue, for a total of 3 bytes per colour.</li> third for blue, for a total of 3 bytes per colour.</li>
<li>The first 384 bytes of the file (128 * 3) will be used for the NTSC <li>The first 384 bytes of the file (128 * 3) will be used for the NTSC
palette. The second 384 bytes will be for the PAL/PAL60 palette. palette. The next 384 bytes (128 * 3) will be for the PAL/PAL60 palette.
Any extra data in the file will be ignored.</li> The next 24 bytes (8 * 3) will be for the SECAM palette, which
consists of eight distinct colours. Any extra data in the file
will be ignored.</li>
<li>The PAL colour-loss effect is calculated within Stella. You do not <li>The PAL colour-loss effect is calculated within Stella. You do not
need to specify those colours in the palette file. need to specify those colours in the palette file.
</ul> </ul>
<p>In the future, support may be added for specifying a palette for each ROM.</p>
<p>The name of the palette file is configurable through the
'<i>-palettefile</i>' commandline argument and within the application itself
(see <b>Section 5 - <a href="#Starting">Starting a Game</a></b>). If the
path for this file hasn't been set, the default filename will depend on the
version of Stella, as follows:</p>
<p><table cellpadding="5" border="1">
<tr>
<td><b>Linux/Unix</b></td>
<td><i>$HOME/.stella/stella.pal</i></td>
</tr>
<tr>
<td><b>Macintosh</b></td>
<td><i>$HOME/.stella/stella.pal</i></td>
</tr>
<tr>
<td><b>Windows</b></td>
<td><i>stella.pal</i> (in same directory as the application)</td>
</tr>
</table>
<p>Note that to actually use the external palette, the palette file must
exist and be valid, <b>and</b> the palette should be set to <i>user</i>.
The current ROM will have to be reloaded for changes to this file to take
effect.</p>
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br> <br><br>
<p><h1> <p><h1>
<a name="Acknowledgments">15. Acknowledgments</a></h1> <a name="Acknowledgments">15. Acknowledgments</a></h1>
@ -2410,6 +2474,8 @@ Ms Pac-Man (Stella extended codes):
</table> </table>
<!-- ///////////////////////////////////////////////////////////////////////// -->
<br><br> <br><br>
<p><h1> <p><h1>
<a name="License">16. License and Disclaimer</a></h1> <a name="License">16. License and Disclaimer</a></h1>

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: SoundSDL.cxx,v 1.37 2007-07-19 16:21:39 stephena Exp $ // $Id: SoundSDL.cxx,v 1.38 2007-07-27 13:49:16 stephena Exp $
//============================================================================ //============================================================================
#ifdef SOUND_SUPPORT #ifdef SOUND_SUPPORT
@ -271,10 +271,7 @@ void SoundSDL::adjustCycleCounter(Int32 amount)
void SoundSDL::setChannels(uInt32 channels) void SoundSDL::setChannels(uInt32 channels)
{ {
if(channels == 1 || channels == 2) if(channels == 1 || channels == 2)
{
myNumChannels = channels; myNumChannels = channels;
myOSystem->settings().setInt("channels", myNumChannels);
}
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: mainSDL.cxx,v 1.73 2007-07-19 16:21:39 stephena Exp $ // $Id: mainSDL.cxx,v 1.74 2007-07-27 13:49:16 stephena Exp $
//============================================================================ //============================================================================
#include <SDL.h> #include <SDL.h>
@ -98,11 +98,7 @@ int main(int argc, char* argv[])
theOSystem->settings().loadConfig(); theOSystem->settings().loadConfig();
// Take care of commandline arguments // Take care of commandline arguments
if(!theOSystem->settings().loadCommandLine(argc, argv)) string romfile = theOSystem->settings().loadCommandLine(argc, argv);
{
Cleanup();
return 0;
}
// Finally, make sure the settings are valid // Finally, make sure the settings are valid
// We do it once here, so the rest of the program can assume valid settings // We do it once here, so the rest of the program can assume valid settings
@ -123,15 +119,20 @@ int main(int argc, char* argv[])
} }
else if(theOSystem->settings().getBool("rominfo")) else if(theOSystem->settings().getBool("rominfo"))
{ {
string romfile = argv[argc - 1];
if(argc > 1 && FilesystemNode::fileExists(romfile)) if(argc > 1 && FilesystemNode::fileExists(romfile))
cout << theOSystem->getROMInfo(romfile); cout << theOSystem->getROMInfo(romfile);
else else
cout << "Error: Can't find " << romfile << endl; cout << "Error: ROM doesn't exist" << endl;
Cleanup(); Cleanup();
return 0; return 0;
} }
else if(theOSystem->settings().getBool("help"))
{
theOSystem->settings().usage();
Cleanup();
return 0;
}
// Request that the SDL window be centered, if possible // Request that the SDL window be centered, if possible
if(theOSystem->settings().getBool("center")) if(theOSystem->settings().getBool("center"))
@ -142,8 +143,7 @@ int main(int argc, char* argv[])
// the ROM actually exists, use it to create a new console. // the ROM actually exists, use it to create a new console.
// If not, use the built-in ROM launcher. In this case, we enter 'launcher' // If not, use the built-in ROM launcher. In this case, we enter 'launcher'
// mode and let the main event loop take care of opening a new console/ROM. // mode and let the main event loop take care of opening a new console/ROM.
string romfile = argv[argc - 1]; if(argc == 1 || romfile == "" || !FilesystemNode::fileExists(romfile))
if(argc == 1 || !FilesystemNode::fileExists(romfile))
theOSystem->createLauncher(); theOSystem->createLauncher();
else if(theOSystem->createConsole(romfile)) else if(theOSystem->createConsole(romfile))
{ {

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: Console.cxx,v 1.127 2007-07-19 16:21:39 stephena Exp $ // $Id: Console.cxx,v 1.128 2007-07-27 13:49:16 stephena Exp $
//============================================================================ //============================================================================
#include <cassert> #include <cassert>
@ -209,7 +209,8 @@ Console::Console(OSystem* osystem, Cartridge* cart, const Properties& props)
buf << endl << cart->about(); buf << endl << cart->about();
// Make sure height is set properly for PAL ROM // Make sure height is set properly for PAL ROM
if(myDisplayFormat == "PAL" && myProperties.get(Display_Height) == "210") if((myDisplayFormat == "PAL" || myDisplayFormat == "SECAM") &&
myProperties.get(Display_Height) == "210")
myProperties.set(Display_Height, "250"); myProperties.set(Display_Height, "250");
// Reset, the system to its power-on state // Reset, the system to its power-on state
@ -254,6 +255,14 @@ void Console::toggleFormat()
framerate = 60; framerate = 60;
} }
else if(myDisplayFormat == "PAL60") else if(myDisplayFormat == "PAL60")
{
myDisplayFormat = "SECAM";
myProperties.set(Display_Format, myDisplayFormat);
mySystem->reset();
myOSystem->frameBuffer().showMessage("SECAM Mode");
framerate = 50;
}
else if(myDisplayFormat == "SECAM")
{ {
myDisplayFormat = "NTSC"; myDisplayFormat = "NTSC";
myProperties.set(Display_Format, myDisplayFormat); myProperties.set(Display_Format, myDisplayFormat);
@ -286,12 +295,7 @@ void Console::togglePalette()
string palette, message; string palette, message;
palette = myOSystem->settings().getString("palette"); palette = myOSystem->settings().getString("palette");
if(palette == "standard") // switch to original if(palette == "standard") // switch to z26
{
palette = "original";
message = "Original Stella palette";
}
else if(palette == "original") // switch to z26
{ {
palette = "z26"; palette = "z26";
message = "Z26 palette"; message = "Z26 palette";
@ -331,22 +335,36 @@ void Console::togglePalette()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::setPalette(const string& type) void Console::setPalette(const string& type)
{ {
// Look at all the palettes, since we don't know which one is
// currently active
uInt32* palettes[3][3] = {
{ &ourNTSCPalette[0], &ourPALPalette[0], &ourSECAMPalette[0] },
{ &ourNTSCPaletteZ26[0], &ourPALPaletteZ26[0], &ourSECAMPaletteZ26[0] },
{ 0, 0, 0 }
};
if(myUserPaletteDefined)
{
palettes[2][0] = &ourUserNTSCPalette[0];
palettes[2][1] = &ourUserPALPalette[0];
palettes[2][2] = &ourUserSECAMPalette[0];
}
// See which format we should be using // See which format we should be using
const uInt32* palette = NULL; int paletteNum = 0;
if(type == "standard") if(type == "standard")
palette = (myDisplayFormat.compare(0, 3, "PAL") == 0) ? ourPALPalette : ourNTSCPalette; paletteNum = 0;
else if(type == "original")
palette = (myDisplayFormat.compare(0, 3, "PAL") == 0) ? ourPALPalette11 : ourNTSCPalette11;
else if(type == "z26") else if(type == "z26")
palette = (myDisplayFormat.compare(0, 3, "PAL") == 0) ? ourPALPaletteZ26 : ourNTSCPaletteZ26; paletteNum = 1;
else if(type == "user" && myUserPaletteDefined) else if(type == "user" && myUserPaletteDefined)
palette = (myDisplayFormat.compare(0, 3, "PAL") == 0) ? ourUserPALPalette : ourUserNTSCPalette; paletteNum = 2;
else // return normal palette by default
palette = (myDisplayFormat.compare(0, 3, "PAL") == 0) ? ourPALPalette : ourNTSCPalette; // Now consider the current display format
const uInt32* palette =
(myDisplayFormat.compare(0, 3, "PAL") == 0) ? palettes[paletteNum][1] :
(myDisplayFormat.compare(0, 5, "SECAM") == 0) ? palettes[paletteNum][2] :
palettes[paletteNum][0];
myOSystem->frameBuffer().setTIAPalette(palette); myOSystem->frameBuffer().setTIAPalette(palette);
// FIXME - maybe add an error message that requested palette not available?
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -404,14 +422,8 @@ void Console::initializeAudio()
// Initialize the sound interface. // Initialize the sound interface.
// The # of channels can be overridden in the AudioDialog box or on // The # of channels can be overridden in the AudioDialog box or on
// the commandline, but it can't be saved. // the commandline, but it can't be saved.
uInt32 channels;
const string& sound = myProperties.get(Cartridge_Sound); const string& sound = myProperties.get(Cartridge_Sound);
if(sound == "STEREO") uInt32 channels = (sound == "STEREO" ? 2 : 1);
channels = 2;
else if(sound == "MONO")
channels = 1;
else
channels = 1;
myOSystem->sound().close(); myOSystem->sound().close();
myOSystem->sound().setChannels(channels); myOSystem->sound().setChannels(channels);
@ -545,12 +557,13 @@ void Console::loadUserPalette()
if(!in) if(!in)
return; return;
// Make sure the contains enough data for both the NTSC and PAL palettes // Make sure the contains enough data for the NTSC, PAL and SECAM palettes
// This means 128 colours each, at 3 bytes per pixel = 768 bytes // This means 128 colours each for NTSC and PAL, at 3 bytes per pixel
// and 8 colours for SECAM at 3 bytes per pixel
in.seekg(0, ios::end); in.seekg(0, ios::end);
streampos length = in.tellg(); streampos length = in.tellg();
in.seekg(0, ios::beg); in.seekg(0, ios::beg);
if(length < 128 * 3 * 2) if(length < 128 * 3 * 2 + 8 * 3)
{ {
in.close(); in.close();
cerr << "ERROR: invalid palette file " << palette << endl; cerr << "ERROR: invalid palette file " << palette << endl;
@ -573,6 +586,22 @@ void Console::loadUserPalette()
ourUserPALPalette[(i<<1)] = pixel; ourUserPALPalette[(i<<1)] = pixel;
} }
uInt32 secam[16]; // All 8 24-bit pixels, plus 8 colorloss pixels
for(int i = 0; i < 8; i++) // SECAM palette
{
in.read((char*)pixbuf, 3);
uInt32 pixel = ((int)pixbuf[0] << 16) + ((int)pixbuf[1] << 8) + (int)pixbuf[2];
secam[(i<<1)] = pixel;
secam[(i<<1)+1] = 0;
}
uInt32* ptr = ourUserSECAMPalette;
for(int i = 0; i < 16; ++i)
{
uInt32* s = secam;
for(int j = 0; j < 16; ++j)
*ptr++ = *s++;
}
in.close(); in.close();
myUserPaletteDefined = true; myUserPaletteDefined = true;
} }
@ -582,19 +611,19 @@ void Console::setColorLossPalette(bool loss)
{ {
// Look at all the palettes, since we don't know which one is // Look at all the palettes, since we don't know which one is
// currently active // currently active
uInt32* palette[8] = { uInt32* palette[9] = {
&ourNTSCPalette[0], &ourPALPalette[0], &ourNTSCPalette[0], &ourPALPalette[0], &ourSECAMPalette[0],
&ourNTSCPalette11[0], &ourPALPalette11[0], &ourNTSCPaletteZ26[0], &ourPALPaletteZ26[0], &ourSECAMPaletteZ26[0],
&ourNTSCPaletteZ26[0], &ourPALPaletteZ26[0], 0, 0, 0
0, 0
}; };
if(myUserPaletteDefined) if(myUserPaletteDefined)
{ {
palette[6] = &ourUserNTSCPalette[0]; palette[6] = &ourUserNTSCPalette[0];
palette[7] = &ourUserPALPalette[0]; palette[7] = &ourUserPALPalette[0];
palette[8] = &ourUserSECAMPalette[0];
} }
for(int i = 0; i < 8; ++i) for(int i = 0; i < 9; ++i)
{ {
if(palette[i] == 0) if(palette[i] == 0)
continue; continue;
@ -632,7 +661,7 @@ uInt32 Console::getFrameRate() const
{ {
if(myDisplayFormat == "NTSC" || myDisplayFormat == "PAL60") if(myDisplayFormat == "NTSC" || myDisplayFormat == "PAL60")
framerate = 60; framerate = 60;
else if(myDisplayFormat == "PAL") else if(myDisplayFormat == "PAL" || myDisplayFormat == "SECAM")
framerate = 50; framerate = 50;
else else
framerate = 60; framerate = 60;
@ -714,75 +743,39 @@ uInt32 Console::ourPALPalette[256] = {
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Console::ourNTSCPalette11[256] = { uInt32 Console::ourSECAMPalette[256] = {
0x000000, 0, 0x393939, 0, 0x797979, 0, 0xababab, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0xcdcdcd, 0, 0xe6e6e6, 0, 0xf2f2f2, 0, 0xffffff, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x391701, 0, 0x833008, 0, 0xc85f24, 0, 0xff911d, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0xffc51d, 0, 0xffd84c, 0, 0xfff456, 0, 0xffff98, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x451904, 0, 0x9f241e, 0, 0xc85122, 0, 0xff811e, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0xff982c, 0, 0xffc545, 0, 0xffc66d, 0, 0xffe4a1, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x4a1704, 0, 0xb21d17, 0, 0xdf251c, 0, 0xfa5255, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0xff706e, 0, 0xff8f8f, 0, 0xffabad, 0, 0xffc7ce, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x050568, 0, 0x712272, 0, 0xa532a6, 0, 0xcd3ecf, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0xea51eb, 0, 0xfe6dff, 0, 0xff87fb, 0, 0xffa4ff, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x280479, 0, 0x590f90, 0, 0x8839aa, 0, 0xc04adc, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0xe05eff, 0, 0xf27cff, 0, 0xff98ff, 0, 0xfeabff, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x35088a, 0, 0x500cd0, 0, 0x7945d0, 0, 0xa251d9, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0xbe60ff, 0, 0xcc77ff, 0, 0xd790ff, 0, 0xdfaaff, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x051e81, 0, 0x082fca, 0, 0x444cde, 0, 0x5a68ff, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0x7183ff, 0, 0x90a0ff, 0, 0x9fb2ff, 0, 0xc0cbff, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x0c048b, 0, 0x382db5, 0, 0x584fda, 0, 0x6b64ff, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0x8a84ff, 0, 0x9998ff, 0, 0xb1aeff, 0, 0xc0c2ff, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x1d295a, 0, 0x1d4892, 0, 0x1c71c6, 0, 0x489bd9, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0x55b6ff, 0, 0x8cd8ff, 0, 0x9bdfff, 0, 0xc3e9ff, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x2f4302, 0, 0x446103, 0, 0x3e9421, 0, 0x57ab3b, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0x61d070, 0, 0x72f584, 0, 0x87ff97, 0, 0xadffb6, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x0a4108, 0, 0x10680d, 0, 0x169212, 0, 0x1cb917, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0x21d91b, 0, 0x6ef040, 0, 0x83ff5b, 0, 0xb2ff9a, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x04410b, 0, 0x066611, 0, 0x088817, 0, 0x0baf1d, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0x86d922, 0, 0x99f927, 0, 0xb7ff5b, 0, 0xdcff81, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x02350f, 0, 0x0c4a1c, 0, 0x4f7420, 0, 0x649228, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0xa1b034, 0, 0xb2d241, 0, 0xd6e149, 0, 0xf2ff53, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x263001, 0, 0x234005, 0, 0x806931, 0, 0xaf993a, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0xd5b543, 0, 0xe1cb38, 0, 0xe3e534, 0, 0xfbff7d, 0, 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x401a02, 0, 0x702408, 0, 0xab511f, 0, 0xbf7730, 0, 0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff50ff, 0,
0xe19344, 0, 0xf9ad58, 0, 0xffc160, 0, 0xffcb83, 0 0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Console::ourPALPalette11[256] = {
0x000000, 0, 0x242424, 0, 0x484848, 0, 0x6d6d6d, 0,
0x919191, 0, 0xb6b6b6, 0, 0xdadada, 0, 0xffffff, 0,
0x000000, 0, 0x242424, 0, 0x484848, 0, 0x6d6d6d, 0,
0x919191, 0, 0xb6b6b6, 0, 0xdadada, 0, 0xffffff, 0,
0x4a3700, 0, 0x705813, 0, 0x8c732a, 0, 0xa68d46, 0,
0xbea767, 0, 0xd4c18b, 0, 0xeadcb3, 0, 0xfff6de, 0,
0x284a00, 0, 0x44700f, 0, 0x5c8c21, 0, 0x74a638, 0,
0x8cbe51, 0, 0xa6d46e, 0, 0xc0ea8e, 0, 0xdbffb0, 0,
0x4a1300, 0, 0x70280f, 0, 0x8c3d21, 0, 0xa65438, 0,
0xbe6d51, 0, 0xd4886e, 0, 0xeaa58e, 0, 0xffc4b0, 0,
0x004a22, 0, 0x0f703b, 0, 0x218c52, 0, 0x38a66a, 0,
0x51be83, 0, 0x6ed49d, 0, 0x8eeab8, 0, 0xb0ffd4, 0,
0x4a0028, 0, 0x700f44, 0, 0x8c215c, 0, 0xa63874, 0,
0xbe518c, 0, 0xd46ea6, 0, 0xea8ec0, 0, 0xffb0db, 0,
0x00404a, 0, 0x0f6370, 0, 0x217e8c, 0, 0x3897a6, 0,
0x51afbe, 0, 0x6ec7d4, 0, 0x8edeea, 0, 0xb0f4ff, 0,
0x43002c, 0, 0x650f4b, 0, 0x7e2165, 0, 0x953880, 0,
0xa6519a, 0, 0xbf6eb7, 0, 0xd38ed3, 0, 0xe5b0f1, 0,
0x001d4a, 0, 0x0f3870, 0, 0x21538c, 0, 0x386ea6, 0,
0x518dbe, 0, 0x6ea8d4, 0, 0x8ec8ea, 0, 0xb0e9ff, 0,
0x37004a, 0, 0x570f70, 0, 0x70218c, 0, 0x8938a6, 0,
0xa151be, 0, 0xba6ed4, 0, 0xd28eea, 0, 0xeab0ff, 0,
0x00184a, 0, 0x0f2e70, 0, 0x21448c, 0, 0x385ba6, 0,
0x5174be, 0, 0x6e8fd4, 0, 0x8eabea, 0, 0xb0c9ff, 0,
0x13004a, 0, 0x280f70, 0, 0x3d218c, 0, 0x5438a6, 0,
0x6d51be, 0, 0x886ed4, 0, 0xa58eea, 0, 0xc4b0ff, 0,
0x00014a, 0, 0x0f1170, 0, 0x21248c, 0, 0x383aa6, 0,
0x5153be, 0, 0x6e70d4, 0, 0x8e8fea, 0, 0xb0b2ff, 0,
0x000000, 0, 0x242424, 0, 0x484848, 0, 0x6d6d6d, 0,
0x919191, 0, 0xb6b6b6, 0, 0xdadada, 0, 0xffffff, 0,
0x000000, 0, 0x242424, 0, 0x484848, 0, 0x6d6d6d, 0,
0x919191, 0, 0xb6b6b6, 0, 0xdadada, 0, 0xffffff, 0
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -858,10 +851,49 @@ uInt32 Console::ourPALPaletteZ26[256] = {
}; };
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Console::ourUserNTSCPalette[256] = { 0 }; // filled from external file uInt32 Console::ourSECAMPaletteZ26[256] = {
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0,
0x000000, 0, 0x2121ff, 0, 0xf03c79, 0, 0xff3cff, 0,
0x7fff00, 0, 0x7fffff, 0, 0xffff3f, 0, 0xffffff, 0
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Console::ourUserPALPalette[256] = { 0 }; // filled from external file uInt32 Console::ourUserNTSCPalette[256] = { 0 }; // filled from external file
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Console::ourUserPALPalette[256] = { 0 }; // filled from external file
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
uInt32 Console::ourUserSECAMPalette[256] = { 0 }; // filled from external file
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Console::Console(const Console& console) Console::Console(const Console& console)

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: Console.hxx,v 1.60 2007-07-19 16:21:39 stephena Exp $ // $Id: Console.hxx,v 1.61 2007-07-27 13:49:16 stephena Exp $
//============================================================================ //============================================================================
#ifndef CONSOLE_HXX #ifndef CONSOLE_HXX
@ -38,7 +38,7 @@ class System;
This class represents the entire game console. This class represents the entire game console.
@author Bradford W. Mott @author Bradford W. Mott
@version $Id: Console.hxx,v 1.60 2007-07-19 16:21:39 stephena Exp $ @version $Id: Console.hxx,v 1.61 2007-07-27 13:49:16 stephena Exp $
*/ */
class Console class Console
{ {
@ -291,21 +291,20 @@ class Console
// Contains info about this console in string format // Contains info about this console in string format
string myAboutString; string myAboutString;
// Table of RGB values for NTSC and PAL // Table of RGB values for NTSC, PAL and SECAM
static uInt32 ourNTSCPalette[256]; static uInt32 ourNTSCPalette[256];
static uInt32 ourPALPalette[256]; static uInt32 ourPALPalette[256];
static uInt32 ourSECAMPalette[256];
// Table of RGB values for NTSC and PAL - Stella 1.1 version // Table of RGB values for NTSC, PAL and SECAM - Z26 version
static uInt32 ourNTSCPalette11[256];
static uInt32 ourPALPalette11[256];
// Table of RGB values for NTSC and PAL - Z26 version
static uInt32 ourNTSCPaletteZ26[256]; static uInt32 ourNTSCPaletteZ26[256];
static uInt32 ourPALPaletteZ26[256]; static uInt32 ourPALPaletteZ26[256];
static uInt32 ourSECAMPaletteZ26[256];
// Table of RGB values for NTSC and PAL - user-defined // Table of RGB values for NTSC, PAL and SECAM - user-defined
static uInt32 ourUserNTSCPalette[256]; static uInt32 ourUserNTSCPalette[256];
static uInt32 ourUserPALPalette[256]; static uInt32 ourUserPALPalette[256];
static uInt32 ourUserSECAMPalette[256];
}; };
#endif #endif

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: OSystem.cxx,v 1.99 2007-07-24 12:43:14 stephena Exp $ // $Id: OSystem.cxx,v 1.100 2007-07-27 13:49:16 stephena Exp $
//============================================================================ //============================================================================
#include <cassert> #include <cassert>
@ -592,8 +592,11 @@ bool OSystem::queryConsoleInfo(const uInt8* image, uInt32 size,
string s; string s;
myPropSet->getMD5(md5, props); myPropSet->getMD5(md5, props);
s = mySettings->getString("type"); s = mySettings->getString("type");
if(s != "") props.set(Cartridge_Type, s); if(s != "") props.set(Cartridge_Type, s);
s = mySettings->getString("channels");
if(s != "") props.set(Cartridge_Sound, s);
s = mySettings->getString("ld"); s = mySettings->getString("ld");
if(s != "") props.set(Console_LeftDifficulty, s); if(s != "") props.set(Console_LeftDifficulty, s);
s = mySettings->getString("rd"); s = mySettings->getString("rd");

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: Settings.cxx,v 1.119 2007-07-19 16:21:39 stephena Exp $ // $Id: Settings.cxx,v 1.120 2007-07-27 13:49:16 stephena Exp $
//============================================================================ //============================================================================
#include <cassert> #include <cassert>
@ -143,71 +143,51 @@ void Settings::loadConfig()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
bool Settings::loadCommandLine(int argc, char** argv) string Settings::loadCommandLine(int argc, char** argv)
{ {
for(int i = 1; i < argc; ++i) for(int i = 1; i < argc; ++i)
{ {
// strip off the '-' character // strip off the '-' character
string key = argv[i]; string key = argv[i];
if(key[0] != '-') if(key[0] == '-')
return true; // stop processing here, ignore the remaining items {
key = key.substr(1, key.length());
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 the arguments which are meant to be executed immediately // Take care of arguments without an option
// (and then Stella should exit) if(key == "rominfo" || key == "debug" || key == "holdreset" ||
if(key == "help") key == "holdselect" || key == "holdbutton0")
{ {
usage(); setExternal(key, "true");
return false; continue;
} }
else if(key == "listrominfo")
{
setExternal(key, "true");
return true;
}
else if(key == "rominfo")
{
setExternal(key, "true");
return true;
}
else if(key == "debug") // this doesn't make Stella exit
{
setExternal(key, "true");
return true;
}
else if(key == "holdreset") // this doesn't make Stella exit
{
setExternal(key, "true");
return true;
}
else if(key == "holdselect") // this doesn't make Stella exit
{
setExternal(key, "true");
return true;
}
else if(key == "holdbutton0") // this doesn't make Stella exit
{
setExternal(key, "true");
return true;
}
if(++i >= argc) if(++i >= argc)
{ {
cerr << "Missing argument for '" << key << "'" << endl; cerr << "Missing argument for '" << key << "'" << endl;
return false; return "";
} }
string value = argv[i]; string value = argv[i];
// Settings read from the commandline must not be saved to // Settings read from the commandline must not be saved to
// the rc-file, unless they were previously set // the rc-file, unless they were previously set
if(int idx = getInternalPos(key) != -1) if(int idx = getInternalPos(key) != -1)
setInternal(key, value, idx); // don't set initialValue here setInternal(key, value, idx); // don't set initialValue here
else
setExternal(key, value);
}
else else
setExternal(key, value); return key;
} }
return true; return "";
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -261,7 +241,7 @@ void Settings::validate()
setInternal("pthresh", "800"); setInternal("pthresh", "800");
s = getString("palette"); s = getString("palette");
if(s != "standard" && s != "original" && s != "z26" && s != "user") if(s != "standard" && s != "z26" && s != "user")
setInternal("palette", "standard"); setInternal("palette", "standard");
} }
@ -294,11 +274,10 @@ void Settings::usage()
<< " -zoom_tia <zoom> Use the specified zoom level in emulation mode\n" << " -zoom_tia <zoom> Use the specified zoom level in emulation mode\n"
<< " -zoom_ui <zoom> Use the specified zoom level in non-emulation mode (ROM browser/debugger)\n" << " -zoom_ui <zoom> Use the specified zoom level in non-emulation mode (ROM browser/debugger)\n"
<< " -fullscreen <1|0> Play the game in fullscreen mode\n" << " -fullscreen <1|0> Play the game in fullscreen mode\n"
<< " -fullres <res> The resolution to use in fullscreen mode\n" << " -fullres <WxH> The resolution to use in fullscreen mode\n"
<< " -center <1|0> Centers game window (if possible)\n" << " -center <1|0> Centers game window (if possible)\n"
<< " -grabmouse <1|0> Keeps the mouse in the game window\n" << " -grabmouse <1|0> Keeps the mouse in the game window\n"
<< " -palette <original| Use the specified color palette\n" << " -palette <standard| Use the specified color palette\n"
<< " standard|\n"
<< " z26|\n" << " z26|\n"
<< " user>\n" << " user>\n"
<< " -colorloss <1|0> Enable PAL color-loss effect\n" << " -colorloss <1|0> Enable PAL color-loss effect\n"
@ -325,15 +304,12 @@ void Settings::usage()
<< " -pthresh <number> Set threshold for eliminating paddle jitter\n" << " -pthresh <number> Set threshold for eliminating paddle jitter\n"
<< " -rombrowse <1|0> Use ROM browser mode (shows files and folders)\n" << " -rombrowse <1|0> Use ROM browser mode (shows files and folders)\n"
<< " -autoslot <1|0> Automatically switch to next save slot when state saving\n" << " -autoslot <1|0> Automatically switch to next save slot when state saving\n"
#ifdef UNIX
<< " -accurate <1|0> Accurate game timing (uses more CPU)\n"
#endif
<< " -ssdir <path> The directory to save snapshot files to\n" << " -ssdir <path> The directory to save snapshot files to\n"
<< " -sssingle <1|0> Generate single snapshot instead of many\n" << " -sssingle <1|0> Generate single snapshot instead of many\n"
<< endl << endl
<< " -listrominfo Display contents of stella.pro, one line per ROM entry\n" << " -listrominfo Display contents of stella.pro, one line per ROM entry\n"
<< " -rominfo <rom> Display detailed information for the given ROM\n" << " -rominfo <rom> Display detailed information for the given ROM\n"
<< " -launcherres <res> The resolution to use in ROM launcher mode\n" << " -launcherres <WxH> The resolution to use in ROM launcher mode\n"
<< " -uipalette <1|2> Used the specified palette for UI elements\n" << " -uipalette <1|2> Used the specified palette for UI elements\n"
<< " -statedir <dir> Directory in which to save state files\n" << " -statedir <dir> Directory in which to save state files\n"
<< " -cheatfile <file> Full pathname of cheatfile database\n" << " -cheatfile <file> Full pathname of cheatfile database\n"
@ -353,6 +329,7 @@ void Settings::usage()
<< " -holdbutton0 Start the emulator with the left joystick button held down\n" << " -holdbutton0 Start the emulator with the left joystick button held down\n"
<< endl << endl
<< " -type <arg> Sets the 'Cartridge.Type' property\n" << " -type <arg> Sets the 'Cartridge.Type' property\n"
<< " -channels <arg> Sets the 'Cartridge.Sound' property\n"
<< " -ld <arg> Sets the 'Console.LeftDifficulty' property\n" << " -ld <arg> Sets the 'Console.LeftDifficulty' property\n"
<< " -rd <arg> Sets the 'Console.RightDifficulty' property\n" << " -rd <arg> Sets the 'Console.RightDifficulty' property\n"
<< " -tv <arg> Sets the 'Console.TelevisionType' property\n" << " -tv <arg> Sets the 'Console.TelevisionType' property\n"

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: Settings.hxx,v 1.32 2007-06-20 16:33:22 stephena Exp $ // $Id: Settings.hxx,v 1.33 2007-07-27 13:49:16 stephena Exp $
//============================================================================ //============================================================================
#ifndef SETTINGS_HXX #ifndef SETTINGS_HXX
@ -28,7 +28,7 @@ class OSystem;
This class provides an interface for accessing frontend specific settings. This class provides an interface for accessing frontend specific settings.
@author Stephen Anthony @author Stephen Anthony
@version $Id: Settings.hxx,v 1.32 2007-06-20 16:33:22 stephena Exp $ @version $Id: Settings.hxx,v 1.33 2007-07-27 13:49:16 stephena Exp $
*/ */
class Settings class Settings
{ {
@ -57,9 +57,9 @@ class Settings
/** /**
This method should be called to load the arguments from the commandline. This method should be called to load the arguments from the commandline.
@return False on any errors, otherwise true @return Name of the ROM to load, otherwise empty string
*/ */
bool loadCommandLine(int argc, char** argv); string loadCommandLine(int argc, char** argv);
/** /**
This method should be called *after* settings have been read, This method should be called *after* settings have been read,

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: FileSnapDialog.cxx,v 1.8 2007-07-20 13:31:11 stephena Exp $ // $Id: FileSnapDialog.cxx,v 1.9 2007-07-27 13:49:16 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -22,6 +22,7 @@
#include "FSNode.hxx" #include "FSNode.hxx"
#include "DialogContainer.hxx" #include "DialogContainer.hxx"
#include "BrowserDialog.hxx" #include "BrowserDialog.hxx"
#include "EditTextWidget.hxx"
#include "TabWidget.hxx" #include "TabWidget.hxx"
#include "bspf.hxx" #include "bspf.hxx"
#include "LauncherDialog.hxx" #include "LauncherDialog.hxx"
@ -62,9 +63,9 @@ FileSnapDialog::FileSnapDialog(
kChooseRomDirCmd); kChooseRomDirCmd);
wid.push_back(b); wid.push_back(b);
xpos += bwidth + 10; xpos += bwidth + 10;
myRomPath = new StaticTextWidget(myTab, font, xpos, ypos + 3, myRomPath = new EditTextWidget(myTab, font, xpos, ypos + 2,
_w - xpos - 10, font.getLineHeight(), _w - xpos - 10, font.getLineHeight(), "");
"", kTextAlignLeft); wid.push_back(myRomPath);
// Use ROM browse mode // Use ROM browse mode
xpos = 30; ypos += myRomPath->getHeight() + 8; xpos = 30; ypos += myRomPath->getHeight() + 8;
@ -106,9 +107,9 @@ FileSnapDialog::FileSnapDialog(
kChooseStateDirCmd); kChooseStateDirCmd);
wid.push_back(b); wid.push_back(b);
xpos += bwidth + 10; xpos += bwidth + 10;
myStatePath = new StaticTextWidget(myTab, font, xpos, ypos + 3, myStatePath = new EditTextWidget(myTab, font, xpos, ypos + 2,
_w - xpos - 10, font.getLineHeight(), _w - xpos - 10, font.getLineHeight(), "");
"", kTextAlignLeft); wid.push_back(myStatePath);
// Cheat file // Cheat file
xpos = 15; ypos += b->getHeight() + 3; xpos = 15; ypos += b->getHeight() + 3;
@ -116,9 +117,9 @@ FileSnapDialog::FileSnapDialog(
kChooseCheatFileCmd); kChooseCheatFileCmd);
wid.push_back(b); wid.push_back(b);
xpos += bwidth + 10; xpos += bwidth + 10;
myCheatFile = new StaticTextWidget(myTab, font, xpos, ypos + 3, myCheatFile = new EditTextWidget(myTab, font, xpos, ypos + 2,
_w - xpos - 10, font.getLineHeight(), _w - xpos - 10, font.getLineHeight(), "");
"", kTextAlignLeft); wid.push_back(myCheatFile);
// Palette file // Palette file
xpos = 15; ypos += b->getHeight() + 3; xpos = 15; ypos += b->getHeight() + 3;
@ -126,9 +127,9 @@ FileSnapDialog::FileSnapDialog(
kChoosePaletteFileCmd); kChoosePaletteFileCmd);
wid.push_back(b); wid.push_back(b);
xpos += bwidth + 10; xpos += bwidth + 10;
myPaletteFile = new StaticTextWidget(myTab, font, xpos, ypos + 3, myPaletteFile = new EditTextWidget(myTab, font, xpos, ypos + 2,
_w - xpos - 10, font.getLineHeight(), _w - xpos - 10, font.getLineHeight(), "");
"", kTextAlignLeft); wid.push_back(myPaletteFile);
// Properties file // Properties file
xpos = 15; ypos += b->getHeight() + 3; xpos = 15; ypos += b->getHeight() + 3;
@ -136,9 +137,9 @@ FileSnapDialog::FileSnapDialog(
kChoosePropsFileCmd); kChoosePropsFileCmd);
wid.push_back(b); wid.push_back(b);
xpos += bwidth + 10; xpos += bwidth + 10;
myPropsFile = new StaticTextWidget(myTab, font, xpos, ypos + 3, myPropsFile = new EditTextWidget(myTab, font, xpos, ypos + 2,
_w - xpos - 10, font.getLineHeight(), _w - xpos - 10, font.getLineHeight(), "");
"", kTextAlignLeft); wid.push_back(myPropsFile);
// Snapshot path // Snapshot path
xpos = 15; ypos += b->getHeight() + 3; xpos = 15; ypos += b->getHeight() + 3;
@ -146,9 +147,9 @@ FileSnapDialog::FileSnapDialog(
kChooseSnapDirCmd); kChooseSnapDirCmd);
wid.push_back(b); wid.push_back(b);
xpos += bwidth + 10; xpos += bwidth + 10;
mySnapPath = new StaticTextWidget(myTab, font, xpos, ypos + 3, mySnapPath = new EditTextWidget(myTab, font, xpos, ypos + 2,
_w - xpos - 10, font.getLineHeight(), _w - xpos - 10, font.getLineHeight(), "");
"", kTextAlignLeft); wid.push_back(mySnapPath);
// Snapshot single or multiple saves // Snapshot single or multiple saves
xpos = 30; ypos += mySnapPath->getHeight() + 8; xpos = 30; ypos += mySnapPath->getHeight() + 8;
@ -194,17 +195,17 @@ FileSnapDialog::~FileSnapDialog()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FileSnapDialog::loadConfig() void FileSnapDialog::loadConfig()
{ {
myRomPath->setLabel(instance()->settings().getString("romdir")); myRomPath->setEditString(instance()->settings().getString("romdir"));
bool b = instance()->settings().getBool("rombrowse"); bool b = instance()->settings().getBool("rombrowse");
myBrowseCheckbox->setState(b); myBrowseCheckbox->setState(b);
myReloadButton->setEnabled(myIsGlobal && !b); myReloadButton->setEnabled(myIsGlobal && !b);
myStatePath->setLabel(instance()->stateDir()); myStatePath->setEditString(instance()->stateDir());
myCheatFile->setLabel(instance()->cheatFile()); myCheatFile->setEditString(instance()->cheatFile());
myPaletteFile->setLabel(instance()->paletteFile()); myPaletteFile->setEditString(instance()->paletteFile());
myPropsFile->setLabel(instance()->propertiesFile()); myPropsFile->setEditString(instance()->propertiesFile());
mySnapPath->setLabel(instance()->settings().getString("ssdir")); mySnapPath->setEditString(instance()->settings().getString("ssdir"));
mySnapSingleCheckbox->setState(!instance()->settings().getBool("sssingle")); mySnapSingleCheckbox->setState(!instance()->settings().getBool("sssingle"));
myTab->loadConfig(); myTab->loadConfig();
@ -213,15 +214,15 @@ void FileSnapDialog::loadConfig()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FileSnapDialog::saveConfig() void FileSnapDialog::saveConfig()
{ {
instance()->settings().setString("romdir", myRomPath->getLabel()); instance()->settings().setString("romdir", myRomPath->getEditString());
instance()->settings().setBool("rombrowse", myBrowseCheckbox->getState()); instance()->settings().setBool("rombrowse", myBrowseCheckbox->getState());
instance()->settings().setString("statedir", myStatePath->getLabel()); instance()->settings().setString("statedir", myStatePath->getEditString());
instance()->settings().setString("cheatfile", myCheatFile->getLabel()); instance()->settings().setString("cheatfile", myCheatFile->getEditString());
instance()->settings().setString("palettefile", myPaletteFile->getLabel()); instance()->settings().setString("palettefile", myPaletteFile->getEditString());
instance()->settings().setString("propsfile", myPropsFile->getLabel()); instance()->settings().setString("propsfile", myPropsFile->getEditString());
instance()->settings().setString("ssdir", mySnapPath->getLabel()); instance()->settings().setString("ssdir", mySnapPath->getEditString());
instance()->settings().setBool("sssingle", !mySnapSingleCheckbox->getState()); instance()->settings().setBool("sssingle", !mySnapSingleCheckbox->getState());
// Flush changes to disk and inform the OSystem // Flush changes to disk and inform the OSystem
@ -257,74 +258,74 @@ void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
break; break;
case kChooseRomDirCmd: case kChooseRomDirCmd:
openBrowser("Select ROM directory:", myRomPath->getLabel(), openBrowser("Select ROM directory:", myRomPath->getEditString(),
FilesystemNode::kListDirectoriesOnly, kRomDirChosenCmd); FilesystemNode::kListDirectoriesOnly, kRomDirChosenCmd);
break; break;
case kChooseStateDirCmd: case kChooseStateDirCmd:
openBrowser("Select state directory:", myStatePath->getLabel(), openBrowser("Select state directory:", myStatePath->getEditString(),
FilesystemNode::kListDirectoriesOnly, kStateDirChosenCmd); FilesystemNode::kListDirectoriesOnly, kStateDirChosenCmd);
break; break;
case kChooseCheatFileCmd: case kChooseCheatFileCmd:
openBrowser("Select cheat file:", myCheatFile->getLabel(), openBrowser("Select cheat file:", myCheatFile->getEditString(),
FilesystemNode::kListAll, kCheatFileChosenCmd); FilesystemNode::kListAll, kCheatFileChosenCmd);
break; break;
case kChoosePaletteFileCmd: case kChoosePaletteFileCmd:
openBrowser("Select palette file:", myPaletteFile->getLabel(), openBrowser("Select palette file:", myPaletteFile->getEditString(),
FilesystemNode::kListAll, kPaletteFileChosenCmd); FilesystemNode::kListAll, kPaletteFileChosenCmd);
break; break;
case kChoosePropsFileCmd: case kChoosePropsFileCmd:
openBrowser("Select properties file:", myPropsFile->getLabel(), openBrowser("Select properties file:", myPropsFile->getEditString(),
FilesystemNode::kListAll, kPropsFileChosenCmd); FilesystemNode::kListAll, kPropsFileChosenCmd);
break; break;
case kChooseSnapDirCmd: case kChooseSnapDirCmd:
openBrowser("Select snapshot directory:", mySnapPath->getLabel(), openBrowser("Select snapshot directory:", mySnapPath->getEditString(),
FilesystemNode::kListDirectoriesOnly, kSnapDirChosenCmd); FilesystemNode::kListDirectoriesOnly, kSnapDirChosenCmd);
break; break;
case kRomDirChosenCmd: case kRomDirChosenCmd:
{ {
FilesystemNode dir(myBrowser->getResult()); FilesystemNode dir(myBrowser->getResult());
myRomPath->setLabel(dir.path()); myRomPath->setEditString(dir.path());
break; break;
} }
case kStateDirChosenCmd: case kStateDirChosenCmd:
{ {
FilesystemNode dir(myBrowser->getResult()); FilesystemNode dir(myBrowser->getResult());
myStatePath->setLabel(dir.path()); myStatePath->setEditString(dir.path());
break; break;
} }
case kCheatFileChosenCmd: case kCheatFileChosenCmd:
{ {
FilesystemNode dir(myBrowser->getResult()); FilesystemNode dir(myBrowser->getResult());
myCheatFile->setLabel(dir.path()); myCheatFile->setEditString(dir.path());
break; break;
} }
case kPaletteFileChosenCmd: case kPaletteFileChosenCmd:
{ {
FilesystemNode dir(myBrowser->getResult()); FilesystemNode dir(myBrowser->getResult());
myPaletteFile->setLabel(dir.path()); myPaletteFile->setEditString(dir.path());
break; break;
} }
case kPropsFileChosenCmd: case kPropsFileChosenCmd:
{ {
FilesystemNode dir(myBrowser->getResult()); FilesystemNode dir(myBrowser->getResult());
myPropsFile->setLabel(dir.path()); myPropsFile->setEditString(dir.path());
break; break;
} }
case kSnapDirChosenCmd: case kSnapDirChosenCmd:
{ {
FilesystemNode dir(myBrowser->getResult()); FilesystemNode dir(myBrowser->getResult());
mySnapPath->setLabel(dir.path()); mySnapPath->setEditString(dir.path());
break; break;
} }

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: FileSnapDialog.hxx,v 1.4 2007-07-20 13:31:11 stephena Exp $ // $Id: FileSnapDialog.hxx,v 1.5 2007-07-27 13:49:16 stephena Exp $
// //
// Based on code from ScummVM - Scumm Interpreter // Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project // Copyright (C) 2002-2004 The ScummVM project
@ -28,7 +28,7 @@ class DialogContainer;
class BrowserDialog; class BrowserDialog;
class CheckboxWidget; class CheckboxWidget;
class PopUpWidget; class PopUpWidget;
class StaticTextWidget; class EditTextWidget;
class TabWidget; class TabWidget;
#include "Dialog.hxx" #include "Dialog.hxx"
@ -72,17 +72,17 @@ class FileSnapDialog : public Dialog, public CommandSender
TabWidget* myTab; TabWidget* myTab;
// Rom path controls // Rom path controls
StaticTextWidget* myRomPath; EditTextWidget* myRomPath;
CheckboxWidget* myBrowseCheckbox; CheckboxWidget* myBrowseCheckbox;
ButtonWidget* myReloadButton; ButtonWidget* myReloadButton;
// Config paths // Config paths
StaticTextWidget* myStatePath; EditTextWidget* myStatePath;
StaticTextWidget* myCheatFile; EditTextWidget* myCheatFile;
StaticTextWidget* myPaletteFile; EditTextWidget* myPaletteFile;
StaticTextWidget* myPropsFile; EditTextWidget* myPropsFile;
StaticTextWidget* mySnapPath; EditTextWidget* mySnapPath;
CheckboxWidget* mySnapSingleCheckbox; CheckboxWidget* mySnapSingleCheckbox;
// Indicates if this dialog is used for global (vs. in-game) settings // Indicates if this dialog is used for global (vs. in-game) settings
bool myIsGlobal; bool myIsGlobal;

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // this file, and for a DISCLAIMER OF ALL WARRANTIES.
// //
// $Id: SettingsUNIX.cxx,v 1.22 2007-07-19 16:21:39 stephena Exp $ // $Id: SettingsUNIX.cxx,v 1.23 2007-07-27 13:49:16 stephena Exp $
//============================================================================ //============================================================================
#include "bspf.hxx" #include "bspf.hxx"
@ -24,8 +24,6 @@
SettingsUNIX::SettingsUNIX(OSystem* osystem) SettingsUNIX::SettingsUNIX(OSystem* osystem)
: Settings(osystem) : Settings(osystem)
{ {
// This argument is only valid for Linux/UNIX, and will eventually be removed
setInternal("accurate", "false");
setInternal("gl_lib", "libGL.so"); setInternal("gl_lib", "libGL.so");
// Most Linux GL implementations don't support this yet // Most Linux GL implementations don't support this yet
setInternal("gl_vsync", "false"); setInternal("gl_vsync", "false");