From dea17160d5a6de1f34614a7d873b6ff44ebf1180 Mon Sep 17 00:00:00 2001
From: stephena
Date: Wed, 21 Jan 2009 12:03:17 +0000
Subject: [PATCH] The location of EEPROM files (actually, the parent directory)
can now be changed with the '-eepromdir' commandline argument as well as
within the 'Config Files' UI.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1650 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
---
stella/Changes.txt | 14 +++-
stella/docs/index.html | 109 ++----------------------------
stella/src/emucore/Console.cxx | 8 +--
stella/src/emucore/OSystem.cxx | 10 ++-
stella/src/emucore/OSystem.hxx | 10 ++-
stella/src/emucore/Settings.cxx | 4 +-
stella/src/gui/FileSnapDialog.cxx | 30 +++++++-
stella/src/gui/FileSnapDialog.hxx | 7 +-
stella/src/win32/FSNodeWin32.cxx | 6 +-
9 files changed, 79 insertions(+), 119 deletions(-)
diff --git a/stella/Changes.txt b/stella/Changes.txt
index 3e5bcc963..6c09ed4eb 100644
--- a/stella/Changes.txt
+++ b/stella/Changes.txt
@@ -20,7 +20,19 @@
* Fixed bug where volume wasn't being saved in 'Audio Settings' when
started from the ROM launcher.
- * Made the ROM launcher filename filtering be case-insensitive.
+ * Fixed crash which sometimes occurred when viewing snapshots in the
+ ROM Info viewer.
+
+ * Allow setting window sizes for the ROM launcher and debugger to be larger
+ than your desktop resolution. Be careful with this feature, as switching
+ to fullscreen mode may cause problems in such cases.
+
+ * Made the ROM launcher filename filtering be case-insensitive. This fixes
+ a bug whereby ROMs with uppercase extensions were marked as invalid.
+
+ * The location of EEPROM files used for AtariVox/Savekey emulation can
+ now be changed with the '-eepromdir' commandline argument as well as
+ in the UI.
* Removed 'Emulation_HmoveBlanks' ROM property and associated UI item.
You can no longer optionally turn off HMOVE blanking; it is always
diff --git a/stella/docs/index.html b/stella/docs/index.html
index f65094238..04ad37178 100644
--- a/stella/docs/index.html
+++ b/stella/docs/index.html
@@ -10,7 +10,7 @@
A multi-platform Atari 2600 VCS emulator
- Release 2.7
+ Release 2.7.1
User's Guide
@@ -222,106 +222,6 @@
DS and Playstation Portable (among others).
- New in Release 2.7
-
-
-- Totally reworked the built-in UI to be font-sensitive and use higher-resolution
- fonts. Stella now requires a minimum screen size of 640x480.
- If used in a resolution smaller than that, the fonts will be reduced
- accordingly. Related to this, switching between software and OpenGL
- rendering now requires an application restart.
-
-- Added three different sized fonts (small, medium, large) which can be
- used in the ROM launcher.
-
-- Added ability to temporarily override ROM properties from the UI. This
- is tied to a right mouse button context menu in the ROM launcher, and
- is very useful when you want to use a set of properties for all
- subsequent ROMs without having to manually change each one.
-
-- Added ability to filter the files shown in the ROM launcher. Currently,
- the choices are 'all files', 'all roms', or 'roms ending with a certain
- extension'. This functionality is tied to a right mouse button context
- menu in the ROM launcher. Extensions can also be set with the
- '-launcherexts' commandline argument.
-
-- Added ability to reload the listing in the ROM launcher, either from
- a right mouse button context menu or pressing the Control/Cmd-R key.
-
-- Made the ROM info viewer in the ROM launcher configurable to show
- snapshots in 1x or 2x mode.
-
-- Made the delay between consecutive keys being recognized as one word
- configurable in the ROM launcher. This is useful if you find that you
- have to press keys too quickly to jump to a specific ROM. This can be
- set in the UI or using the '-listdelay' commandline argument.
-
-- Updated internal ROM properties database to ROM-Hunter version 4
- (thanks go to RomHunter for his tireless research in this area).
-
-- Expanded the statistics overlay for the TIA image to also show
- Display Format and Bankswitch type information.
-
-- Added '-ss1x' commandline argument and associated UI item, used to
- generate snapshots in 1x mode, independent of the filtering/scaling
- currently in use.
-
-- Various path textboxes in the UI now recognize './' (or '.\') to mean
- the current directory and '~/' (or '~\') to mean your home directory
- (for Windows, home directory will be your 'My Documents' folder).
-
-- Large speedup in loading directories with many files in the ROM launcher.
-
-- Fixed reset issue in 3E, 4A50, AR, CV, E7, F4SC, F6SC, F8SC, FASC and MC
- ROMs; the internal RAM wasn't being randomized after the initial reset.
-
-- M6532/RIOT RAM is now randomized at every reset, not just when the
- emulation starts.
-
-- Fixed bug in _diff pseudo-registers in the debugger; they were actually
- defined backwards.
-
-- Added fix for 'Challenge/Surfers Delight' ROM; the startup bank was
- incorrect. Combined with the new 'Override Properties' functionality,
- you can now play both games directly from the UI (no need to use the
- commandline).
-
-- Fixed paddle issue with Activision Casino ROM; the last card in game 4
- can now be reached.
-
-- Added new pseudo-registers to the debugger, useful for conditional
- breakpoints (_fcount, _cclocks, _vsync, _vblank).
-
-- Added 'timing' commandline argument functionality to the UI, so you no
- longer need to use the commandline to set it.
-
-- Size restrictions on the TIA image are now strictly enforced. The
- maximum height of a 1x TIA image is now 256 lines.
-
-- Added a new setting to the 'fullres' option named 'auto'. Using
- 'auto' will let Stella decide the best videomode to use in fullscreen.
-
-- Changed 'gl_fsmax' option to mean 'scale TIA image in fullscreen'. It
- will have no effect on UI modes.
-
-- Changed 'gl_aspect' option to range 80-100 (previously, it was 50-100).
-
-- Removed 'ui_zoom' and 'tia_zoom' options, replacing them with
- 'tia_filter' (which can be zoom1x, zoom2x, etc). There is no equivalent
- for ui_zoom, since the UI can no longer be scaled.
-
-- Added experimental 64-bit version for Vista64 (may also work on WinXP64).
- This hasn't been extensively tested, and is probably quite a bit slower
- than the 32-bit version.
-
-- OSX port now requires at least 10.3 and XCode 3.0 to compile. Sorry,
- but I no longer have access to older systems to compile for 10.2.
-
-- Huge updates to the documentation, particularly concerning the debugger.
- Many features that have been in Stella for a while are now documented for
- the first time.
-
-
Features
@@ -2267,8 +2167,11 @@
This is very useful in the testing stages of creating a new game, since
writing to a real EEPROM many times will eventually wear it out.
- The EEPROM files have a special name/location depending on which
- version of Stella you use, which are currently not configurable:
+ The location of the EEPROM files are configurable through the
+ '-eepromdir' commandline argument and within the application itself
+ (see Section 5 - Starting a Game). If the
+ path for these files hasn't been set, the default location will depend on the
+ version of Stella, as follows:
diff --git a/stella/src/emucore/Console.cxx b/stella/src/emucore/Console.cxx
index d4682ca22..bc4e261d0 100644
--- a/stella/src/emucore/Console.cxx
+++ b/stella/src/emucore/Console.cxx
@@ -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.152 2009-01-19 16:52:32 stephena Exp $
+// $Id: Console.cxx,v 1.153 2009-01-21 12:03:16 stephena Exp $
//============================================================================
#include
@@ -669,15 +669,15 @@ void Console::setControllers()
}
else if(right == "ATARIVOX")
{
- string eepromfile = myOSystem->baseDir() + BSPF_PATH_SEPARATOR +
- "atarivox_eeprom.dat";
+ const string& eepromfile = myOSystem->eepromDir() + BSPF_PATH_SEPARATOR +
+ "atarivox_eeprom.dat";
myControllers[rightPort] = myAVox =
new AtariVox(Controller::Right, *myEvent, *mySystem, myOSystem->serialPort(),
myOSystem->settings().getString("avoxport"), eepromfile);
}
else if(right == "SAVEKEY")
{
- string eepromfile = myOSystem->baseDir() + BSPF_PATH_SEPARATOR +
+ const string& eepromfile = myOSystem->eepromDir() + BSPF_PATH_SEPARATOR +
"savekey_eeprom.dat";
myControllers[rightPort] = new SaveKey(Controller::Right, *myEvent, *mySystem,
eepromfile);
diff --git a/stella/src/emucore/OSystem.cxx b/stella/src/emucore/OSystem.cxx
index 50caa73d5..8824e4132 100644
--- a/stella/src/emucore/OSystem.cxx
+++ b/stella/src/emucore/OSystem.cxx
@@ -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: OSystem.cxx,v 1.150 2009-01-20 16:21:28 stephena Exp $
+// $Id: OSystem.cxx,v 1.151 2009-01-21 12:03:17 stephena Exp $
//============================================================================
#include
@@ -292,6 +292,14 @@ void OSystem::setConfigPaths()
if(!node.isDirectory())
AbstractFilesystemNode::makeDir(mySnapshotDir);
+ s = mySettings->getString("eepromdir");
+ if(s == "") s = myBaseDir;
+ mySettings->setString("eepromdir", s);
+ node = FilesystemNode(s);
+ myEEPROMDir = node.getPath();
+ if(!node.isDirectory())
+ AbstractFilesystemNode::makeDir(myEEPROMDir);
+
s = mySettings->getString("cheatfile");
if(s == "") s = myBaseDir + BSPF_PATH_SEPARATOR + "stella.cht";
mySettings->setString("cheatfile", s);
diff --git a/stella/src/emucore/OSystem.hxx b/stella/src/emucore/OSystem.hxx
index 0e8b2e931..19dadac92 100644
--- a/stella/src/emucore/OSystem.hxx
+++ b/stella/src/emucore/OSystem.hxx
@@ -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: OSystem.hxx,v 1.77 2009-01-16 21:46:30 stephena Exp $
+// $Id: OSystem.hxx,v 1.78 2009-01-21 12:03:17 stephena Exp $
//============================================================================
#ifndef OSYSTEM_HXX
@@ -56,7 +56,7 @@ typedef Common::Array ResolutionList;
other objects belong.
@author Stephen Anthony
- @version $Id: OSystem.hxx,v 1.77 2009-01-16 21:46:30 stephena Exp $
+ @version $Id: OSystem.hxx,v 1.78 2009-01-21 12:03:17 stephena Exp $
*/
class OSystem
{
@@ -264,6 +264,11 @@ class OSystem
*/
const string& snapshotDir() const { return mySnapshotDir; }
+ /**
+ Return the full/complete directory name for storing EEPROM files.
+ */
+ const string& eepromDir() const { return myEEPROMDir; }
+
/**
This method should be called to get the full path of the cheat file.
@@ -490,6 +495,7 @@ class OSystem
string myBaseDir, myBaseDirExpanded;
string myStateDir;
string mySnapshotDir;
+ string myEEPROMDir;
string myCheatFile;
string myConfigFile;
diff --git a/stella/src/emucore/Settings.cxx b/stella/src/emucore/Settings.cxx
index 6fb91d012..99c34ad55 100644
--- a/stella/src/emucore/Settings.cxx
+++ b/stella/src/emucore/Settings.cxx
@@ -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.159 2009-01-20 16:33:06 stephena Exp $
+// $Id: Settings.cxx,v 1.160 2009-01-21 12:03:17 stephena Exp $
//============================================================================
#include
@@ -85,6 +85,7 @@ Settings::Settings(OSystem* osystem)
setInternal("cheatfile", "");
setInternal("palettefile", "");
setInternal("propsfile", "");
+ setInternal("eepromdir", "");
// ROM browser options
setInternal("launcherres", "640x480");
@@ -346,6 +347,7 @@ void Settings::usage()
<< " -cheatfile Full pathname of cheatfile database\n"
<< " -palettefile Full pathname of user-defined palette file\n"
<< " -propsfile Full pathname of ROM properties file\n"
+ << " -eepromdir Directory in which to save EEPROM files\n"
<< " -avoxport The name of the serial port where an AtariVox is connected\n"
<< " -help Show the text you're now reading\n"
#ifdef DEBUGGER_SUPPORT
diff --git a/stella/src/gui/FileSnapDialog.cxx b/stella/src/gui/FileSnapDialog.cxx
index 9dc54c7d4..653049cb5 100644
--- a/stella/src/gui/FileSnapDialog.cxx
+++ b/stella/src/gui/FileSnapDialog.cxx
@@ -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: FileSnapDialog.cxx,v 1.29 2009-01-16 21:46:31 stephena Exp $
+// $Id: FileSnapDialog.cxx,v 1.30 2009-01-21 12:03:17 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@@ -49,7 +49,7 @@ FileSnapDialog::FileSnapDialog(
// Set real dimensions
_w = 52 * fontWidth + 8;
- _h = 10 * (lineHeight + 4) + 10;
+ _h = 11 * (lineHeight + 4) + 10;
xpos = vBorder; ypos = vBorder;
@@ -113,6 +113,16 @@ FileSnapDialog::FileSnapDialog(
_w - xpos - 10, lineHeight, "");
wid.push_back(mySnapPath);
+ // EEPROM directory
+ xpos = vBorder; ypos += b->getHeight() + 3;
+ b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
+ "EEPROM path:", kChooseEEPROMDirCmd);
+ wid.push_back(b);
+ xpos += buttonWidth + 10;
+ myEEPROMPath = new EditTextWidget(this, font, xpos, ypos + 2,
+ _w - xpos - 10, lineHeight, "");
+ wid.push_back(myEEPROMPath);
+
// Snapshot single or multiple saves
xpos = 30; ypos += b->getHeight() + 5;
mySnapSingle = new CheckboxWidget(this, font, xpos, ypos,
@@ -161,6 +171,7 @@ void FileSnapDialog::loadConfig()
myPaletteFile->setEditString(settings.getString("palettefile"));
myPropsFile->setEditString(settings.getString("propsfile"));
mySnapPath->setEditString(settings.getString("ssdir"));
+ myEEPROMPath->setEditString(settings.getString("eepromdir"));
mySnapSingle->setState(!settings.getBool("sssingle"));
mySnap1x->setState(settings.getBool("ss1x"));
}
@@ -174,6 +185,7 @@ void FileSnapDialog::saveConfig()
instance().settings().setString("palettefile", myPaletteFile->getEditString());
instance().settings().setString("propsfile", myPropsFile->getEditString());
instance().settings().setString("ssdir", mySnapPath->getEditString());
+ instance().settings().setString("eepromdir", myEEPROMPath->getEditString());
instance().settings().setBool("sssingle", !mySnapSingle->getState());
instance().settings().setBool("ss1x", mySnap1x->getState());
@@ -192,12 +204,14 @@ void FileSnapDialog::setDefaults()
const string& palettefile = basedir + BSPF_PATH_SEPARATOR + "stella.pal";
const string& propsfile = basedir + BSPF_PATH_SEPARATOR + "stella.pro";
const string& ssdir = basedir + BSPF_PATH_SEPARATOR + "snapshots";
+ const string& eepromdir = basedir;
myRomPath->setEditString(romdir);
myStatePath->setEditString(statedir);
myCheatFile->setEditString(cheatfile);
myPaletteFile->setEditString(palettefile);
myPropsFile->setEditString(propsfile);
+ myEEPROMPath->setEditString(eepromdir);
mySnapPath->setEditString(ssdir);
mySnapSingle->setState(true);
@@ -251,6 +265,11 @@ void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
FilesystemNode::kListDirectoriesOnly, kSnapDirChosenCmd);
break;
+ case kChooseEEPROMDirCmd:
+ myBrowser->show("Select EEPROM directory:", myEEPROMPath->getEditString(),
+ FilesystemNode::kListDirectoriesOnly, kEEPROMDirChosenCmd);
+ break;
+
case kRomDirChosenCmd:
{
FilesystemNode dir(myBrowser->getResult());
@@ -293,6 +312,13 @@ void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
break;
}
+ case kEEPROMDirChosenCmd:
+ {
+ FilesystemNode dir(myBrowser->getResult());
+ myEEPROMPath->setEditString(dir.getPath());
+ break;
+ }
+
case kReloadRomDirCmd:
sendCommand(kReloadRomDirCmd, 0, 0);
break;
diff --git a/stella/src/gui/FileSnapDialog.hxx b/stella/src/gui/FileSnapDialog.hxx
index cf84cc697..15808271f 100644
--- a/stella/src/gui/FileSnapDialog.hxx
+++ b/stella/src/gui/FileSnapDialog.hxx
@@ -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: FileSnapDialog.hxx,v 1.13 2009-01-04 22:27:43 stephena Exp $
+// $Id: FileSnapDialog.hxx,v 1.14 2009-01-21 12:03:17 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@@ -56,10 +56,12 @@ class FileSnapDialog : public Dialog, public CommandSender
kChoosePaletteFileCmd = 'LOpf', // palette file (stella.pal)
kChoosePropsFileCmd = 'LOpr', // properties file (stella.pro)
kChooseSnapDirCmd = 'LOsn', // snapshot dir
+ kChooseEEPROMDirCmd = 'LOee', // eeprom dir
kStateDirChosenCmd = 'LOsc', // state dir changed
kCheatFileChosenCmd = 'LOcc', // cheatfile changed
kPaletteFileChosenCmd = 'LOpc', // palette file changed
- kPropsFileChosenCmd = 'LOrc' // properties file changed
+ kPropsFileChosenCmd = 'LOrc', // properties file changed
+ kEEPROMDirChosenCmd = 'LOec' // eeprom dir changed
};
BrowserDialog* myBrowser;
@@ -67,6 +69,7 @@ class FileSnapDialog : public Dialog, public CommandSender
// Config paths
EditTextWidget* myRomPath;
EditTextWidget* myStatePath;
+ EditTextWidget* myEEPROMPath;
EditTextWidget* myCheatFile;
EditTextWidget* myPaletteFile;
EditTextWidget* myPropsFile;
diff --git a/stella/src/win32/FSNodeWin32.cxx b/stella/src/win32/FSNodeWin32.cxx
index bcf33ce1a..46e9a6a2a 100644
--- a/stella/src/win32/FSNodeWin32.cxx
+++ b/stella/src/win32/FSNodeWin32.cxx
@@ -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: FSNodeWin32.cxx,v 1.23 2009-01-17 15:14:46 stephena Exp $
+// $Id: FSNodeWin32.cxx,v 1.24 2009-01-21 12:03:17 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@@ -388,9 +388,9 @@ bool WindowsFilesystemNode::
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AbstractFilesystemNode* WindowsFilesystemNode::getParent() const
{
- assert(_isValid || _isPseudoRoot);
+// assert(_isValid || _isPseudoRoot);
- if (_isPseudoRoot)
+ if (!_isValid || _isPseudoRoot)
return 0;
WindowsFilesystemNode* p = new WindowsFilesystemNode();