Changed some things wrt DEVELOPER_SUPPORT. The only extra things which are

now activated when Stella is built with DEVELOPER_SUPPORT is the ability
to change Xstart, Ystart, Width, and Height.  Specifically, the ability
to change NTSC/PAL mode, toggle different palettes, and save/merge changes
into the properties file is now standard in all ports, and is *not* strictly
a developer-only thing.  So that means that people who use a version of
Stella compiled without DEVELOPER_SUPPORT won't really miss much (the above
features are used by very few people).

Removed the commandline arguments -Dxxx, since they haven't worked for quite
some time anyway, and I doubt that many people really use them.  Besides,
there are still keyboard shortcuts to do the same thing.  To any developers
who don't want to see these things disappear; the next version of Stella
will include a debugger, and _that's_ the proper place to put those things.

Removed starting and ending '|' characters from the -listrominfo output,
since parsers have an easier time when those are present only _between_
elements, not at the beginning and end.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@297 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2004-07-07 22:46:01 +00:00
parent 40f77dc03e
commit c64b9a6889
6 changed files with 66 additions and 113 deletions

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: mainSDL.cxx,v 1.10 2004-07-05 00:53:48 stephena Exp $
// $Id: mainSDL.cxx,v 1.11 2004-07-07 22:46:01 stephena Exp $
//============================================================================
#include <fstream>
@ -430,7 +430,6 @@ void handleEvents()
theDisplay->showCursor(!theHideCursorIndicator);
}
}
#ifdef DEVELOPER_SUPPORT
else if(key == SDLK_f) // Ctrl-f toggles NTSC/PAL mode
{
theConsole->toggleFormat();
@ -441,6 +440,7 @@ void handleEvents()
theConsole->togglePalette();
theDisplay->setupPalette();
}
#ifdef DEVELOPER_SUPPORT
else if(key == SDLK_END) // Ctrl-End increases Width
{
theConsole->changeWidth(1);
@ -461,6 +461,7 @@ void handleEvents()
theConsole->changeHeight(0);
theDisplay->resize(0);
}
#endif
else if(key == SDLK_s) // Ctrl-s saves properties to a file
{
if(theConsole->settings().getBool("mergeprops")) // Attempt to merge with propertiesSet
@ -475,7 +476,6 @@ void handleEvents()
theConsole->saveProperties(newPropertiesFile);
}
}
#endif
}
else // check all the other keys
{
@ -715,20 +715,11 @@ void setupProperties(PropertiesSet& set)
string theUserProFile = theSettings->userPropertiesFilename();
string theSystemProFile = theSettings->systemPropertiesFilename();
// When 'listroms' is specified, we need to have the full list in memory
if(theSettings->getBool("listrominfo"))
// When 'listrominfo' or 'mergeprops' is specified, we need to have the
// full list in memory
if(theSettings->getBool("listrominfo") || theSettings->getBool("mergeprops"))
useMemList = true;
#ifdef DEVELOPER_SUPPORT
// If the user wishes to merge any property modifications to the
// PropertiesSet file, then the PropertiesSet file MUST be loaded
// into memory.
// If 'useMemList' is true, do not override it
if(!useMemList)
useMemList = theSettings->getBool("mergeprops");
#endif
if(theAlternateProFile != "")
set.load(theAlternateProFile, &Console::defaultProperties(), useMemList);
else if(theUserProFile != "")

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Console.cxx,v 1.32 2004-06-25 03:50:47 bwmott Exp $
// $Id: Console.cxx,v 1.33 2004-07-07 22:46:01 stephena Exp $
//============================================================================
#include <assert.h>
@ -77,11 +77,6 @@ Console::Console(const uInt8* image, uInt32 size, const char* filename,
// Search for the properties based on MD5
myPropSet.getMD5(md5, myProperties);
#ifdef DEVELOPER_SUPPORT
// Merge any user-defined properties
myProperties.merge(mySettings.userDefinedProperties);
#endif
// Make sure the MD5 value of the cartridge is set in the properties
if(myProperties.get("Cartridge.MD5") == "")
{
@ -276,7 +271,6 @@ const Properties& Console::defaultProperties()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Properties Console::ourDefaultProperties;
#ifdef DEVELOPER_SUPPORT
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::toggleFormat()
{
@ -321,6 +315,35 @@ void Console::togglePalette()
}
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::saveProperties(string filename, bool merge)
{
// Merge the current properties into the PropertiesSet file
if(merge)
{
if(myPropSet.merge(myProperties, filename))
myFrameBuffer.showMessage("Properties merged");
else
myFrameBuffer.showMessage("Properties not merged");
}
else // Save to the specified file directly
{
ofstream out(filename.c_str(), ios::out);
if(out && out.is_open())
{
myProperties.save(out);
out.close();
myFrameBuffer.showMessage("Properties saved");
}
else
{
myFrameBuffer.showMessage("Properties not saved");
}
}
}
#ifdef DEVELOPER_SUPPORT
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::changeXStart(const uInt32 direction)
{
@ -472,32 +495,4 @@ void Console::changeHeight(const uInt32 direction)
message += strval.str();
myFrameBuffer.showMessage(message);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Console::saveProperties(string filename, bool merge)
{
// Merge the current properties into the PropertiesSet file
if(merge)
{
if(myPropSet.merge(myProperties, filename))
myFrameBuffer.showMessage("Properties merged");
else
myFrameBuffer.showMessage("Properties not merged");
}
else // Save to the specified file directly
{
ofstream out(filename.c_str(), ios::out);
if(out && out.is_open())
{
myProperties.save(out);
out.close();
myFrameBuffer.showMessage("Properties saved");
}
else
{
myFrameBuffer.showMessage("Properties not saved");
}
}
}
#endif

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Console.hxx,v 1.20 2004-06-20 23:30:48 stephena Exp $
// $Id: Console.hxx,v 1.21 2004-07-07 22:46:01 stephena Exp $
//============================================================================
#ifndef CONSOLE_HXX
@ -40,7 +40,7 @@ class FrameBuffer;
This class represents the entire game console.
@author Bradford W. Mott
@version $Id: Console.hxx,v 1.20 2004-06-20 23:30:48 stephena Exp $
@version $Id: Console.hxx,v 1.21 2004-07-07 22:46:01 stephena Exp $
*/
class Console
{
@ -170,8 +170,6 @@ class Console
*/
static const Properties& defaultProperties();
#ifdef DEVELOPER_SUPPORT
public:
/**
Toggle between NTSC and PAL mode. The frontends will need to
reload their palette.
@ -184,6 +182,17 @@ class Console
*/
void togglePalette();
/**
Save a copy of the current properties after any changes.
@param filename Filename to save the properties into.
@param merge Whether or not to merge the changes into the
main properties file.
*/
void saveProperties(string filename, bool merge = false);
#ifdef DEVELOPER_SUPPORT
public:
/**
Change the "Display.XStart" variable. Currently, a system reset is issued
after the change. GUI's may need to resize their viewports.
@ -215,15 +224,6 @@ class Console
@param direction A 1 indicates increase, 0 indicates decrease.
*/
void changeHeight(const uInt32 direction);
/**
Save a copy of the current properties after any changes.
@param filename Filename to save the properties into.
@param merge Whether or not to merge the changes into the
main properties file.
*/
void saveProperties(string filename, bool merge = false);
#endif
private:

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Props.cxx,v 1.5 2004-07-05 00:53:48 stephena Exp $
// $Id: Props.cxx,v 1.6 2004-07-07 22:46:01 stephena Exp $
//============================================================================
#include "Props.hxx"
@ -282,11 +282,10 @@ void Properties::merge(const Properties& properties)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Properties::print()
{
cout << "|"
<< get("Cartridge.MD5") << "|"
cout << get("Cartridge.MD5") << "|"
<< get("Cartridge.Name") << "|"
<< get("Cartridge.Rarity") << "|"
<< get("Cartridge.Manufactuer") << "|"
<< get("Cartridge.Note") << "|"
<< get("Cartridge.Note")
<< endl;
}

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Settings.cxx,v 1.23 2004-07-05 00:53:48 stephena Exp $
// $Id: Settings.cxx,v 1.24 2004-07-07 22:46:01 stephena Exp $
//============================================================================
#include <cassert>
@ -23,11 +23,6 @@
#include "bspf.hxx"
#include "Settings.hxx"
#ifdef DEVELOPER_SUPPORT
#include "Props.hxx"
#endif
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Settings::Settings()
{
@ -58,19 +53,11 @@ Settings::Settings()
set("mergeprops", "false");
set("paddle", "0");
set("palette", "standard");
#ifdef SNAPSHOT_SUPPORT
set("ssdir", ".");
set("ssname", "romname");
set("sssingle", "false");
#endif
#ifdef DEVELOPER_SUPPORT
userDefinedProperties.set("Display.Format", "-1");
userDefinedProperties.set("Display.XStart", "-1");
userDefinedProperties.set("Display.Width", "-1");
userDefinedProperties.set("Display.YStart", "-1");
userDefinedProperties.set("Display.Height", "-1");
#endif
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -155,8 +142,8 @@ bool Settings::loadCommandLine(Int32 argc, char** argv)
}
else if(key == "listrominfo")
{
set(key, "true", false);
return true;
set(key, "true", false); // this confusing line means set 'listrominfo'
return true; // to true, but don't save to the settings file
}
if(++i >= argc)
@ -192,37 +179,28 @@ void Settings::usage()
<< " nearest Normal scaling (GL_NEAREST)\n"
<< " linear Blurred scaling (GL_LINEAR)\n"
<< " -gl_aspect <number> Scale the width by the given amount\n"
<< " -gl_fsmax <0|1> Use the largest available screenmode in fullscreen OpenGL\n"
<< " -gl_fsmax <1|0> Use the largest available screenmode in fullscreen OpenGL\n"
<< endl
#endif
<< " -sound <0|1> Enable sound generation\n"
<< " -sound <1|0> Enable sound generation\n"
<< " -fragsize <number> The size of sound fragments (must be a power of two)\n"
<< " -framerate <number> Display the given number of frames per second\n"
<< " -zoom <size> Makes window be 'size' times normal\n"
<< " -fullscreen <0|1> Play the game in fullscreen mode\n"
<< " -grabmouse <0|1> Keeps the mouse in the game window\n"
<< " -hidecursor <0|1> Hides the mouse cursor in the game window\n"
<< " -fullscreen <1|0> Play the game in fullscreen mode\n"
<< " -grabmouse <1|0> Keeps the mouse in the game window\n"
<< " -hidecursor <1|0> Hides the mouse cursor in the game window\n"
<< " -volume <number> Set the volume (0 - 100)\n"
<< " -paddle <0|1|2|3> Indicates which paddle the mouse should emulate\n"
<< " -altpro <props file> Use the given properties file instead of stella.pro\n"
<< " -showinfo <0|1> Shows some game info\n"
<< " -accurate <0|1> Accurate game timing (uses more CPU)\n"
<< " -showinfo <1|0> Shows some game info\n"
<< " -accurate <1|0> Accurate game timing (uses more CPU)\n"
#ifdef SNAPSHOT_SUPPORT
<< " -ssdir <path> The directory to save snapshot files to\n"
<< " -ssname <name> How to name the snapshot (romname or md5sum)\n"
<< " -sssingle <0|1> Generate single snapshot instead of many\n"
<< " -sssingle <1|0> Generate single snapshot instead of many\n"
#endif
<< endl
#ifdef DEVELOPER_SUPPORT
<< " DEVELOPER options (see Stella manual for details)\n"
<< " -Dformat Sets \"Display.Format\"\n"
<< " -Dxstart Sets \"Display.XStart\"\n"
<< " -Dwidth Sets \"Display.Width\"\n"
<< " -Dystart Sets \"Display.YStart\"\n"
<< " -Dheight Sets \"Display.Height\"\n"
<< " -mergeprops <0|1> Merge changed properties into properties file,\n"
<< " -mergeprops <1|0> Merge changed properties into properties file,\n"
<< " or save into a separate file\n"
#endif
<< endl;
#endif
}

View File

@ -13,16 +13,12 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Settings.hxx,v 1.14 2004-07-05 00:53:48 stephena Exp $
// $Id: Settings.hxx,v 1.15 2004-07-07 22:46:01 stephena Exp $
//============================================================================
#ifndef SETTINGS_HXX
#define SETTINGS_HXX
#ifdef DEVELOPER_SUPPORT
#include "Props.hxx"
#endif
#include "bspf.hxx"
@ -30,7 +26,7 @@
This class provides an interface for accessing frontend specific settings.
@author Stephen Anthony
@version $Id: Settings.hxx,v 1.14 2004-07-05 00:53:48 stephena Exp $
@version $Id: Settings.hxx,v 1.15 2004-07-07 22:46:01 stephena Exp $
*/
class Settings
{
@ -204,12 +200,6 @@ class Settings
*/
string baseDir() { return myBaseDir; }
public:
#ifdef DEVELOPER_SUPPORT
// User-modified properties
Properties userDefinedProperties;
#endif
protected:
void set(const string& key, const string& value, bool save = true);