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

- - -

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();