diff --git a/Changes.txt b/Changes.txt
index 3dc7425c7..a1fdb873a 100644
--- a/Changes.txt
+++ b/Changes.txt
@@ -53,6 +53,11 @@
* Fixed regression in RIOT INTIM reads; at least one known ROM
(Mr. Roboto Berzerk hack) wasn't working properly.
+ * Added support for different directories for saving/loading PNG
+ files. These are set with the 'snapsavedir' and 'snaploaddir'
+ commandline arguments (which replace the old 'snapdir'), and are
+ also available within the UI.
+
* Updated included PNG and ZLIB libraries to latest stable version.
-Have fun!
diff --git a/docs/graphics/launcher_options_files.png b/docs/graphics/launcher_options_files.png
index eee82230a..217ca0304 100644
Binary files a/docs/graphics/launcher_options_files.png and b/docs/graphics/launcher_options_files.png differ
diff --git a/docs/index.html b/docs/index.html
index dc16b117a..5b853b5c6 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -2101,10 +2101,15 @@
-sssingle <1|0> |
Generate single snapshot instead of many, overwriting
@@ -2552,7 +2557,8 @@
Item | Brief description | For more information, see CommandLine |
Rom path | specifies location of ROM files | -romdir |
- Snapshot path | specifies where to load/save snapshots | -snapdir |
+ Snapshot save path | specifies where to save snapshots | -snapsavedir |
+ Snapshot load path | specifies where to load snapshots | -snaploaddir |
Cheat file | specifies location of cheatfile database | -cheatfile |
Palette file | specifies location of user palette | -palettefile |
Properties file | specifies location of external stella.pro database | -propsfile |
diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx
index 174512dab..4ba7db027 100644
--- a/src/emucore/EventHandler.cxx
+++ b/src/emucore/EventHandler.cxx
@@ -1948,7 +1948,7 @@ void EventHandler::takeSnapshot(uInt32 number)
// Figure out the correct snapshot name
string filename;
bool showmessage = number == 0;
- string sspath = myOSystem->snapshotDir() +
+ string sspath = myOSystem->snapshotSaveDir() +
myOSystem->console().properties().get(Cartridge_Name);
// Check whether we want multiple snapshots created
diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx
index 22f1159db..1d2d0c218 100644
--- a/src/emucore/OSystem.cxx
+++ b/src/emucore/OSystem.cxx
@@ -348,7 +348,8 @@ void OSystem::setConfigPaths()
string s;
validatePath(myStateDir, "statedir", myBaseDir + "statedir");
- validatePath(mySnapshotDir, "snapdir", defaultSnapDir());
+ validatePath(mySnapshotSaveDir, "snapsavedir", defaultSnapSaveDir());
+ validatePath(mySnapshotLoadDir, "snaploaddir", defaultSnapLoadDir());
validatePath(myEEPROMDir, "eepromdir", myBaseDir);
validatePath(myCfgDir, "cfgdir", myBaseDir + "cfg");
diff --git a/src/emucore/OSystem.hxx b/src/emucore/OSystem.hxx
index 1e41b890f..388e0c904 100644
--- a/src/emucore/OSystem.hxx
+++ b/src/emucore/OSystem.hxx
@@ -314,9 +314,11 @@ class OSystem
const string& stateDir() const { return myStateDir; }
/**
- Return the full/complete directory name for storing PNG snapshots.
+ Return the full/complete directory name for saving and loading
+ PNG snapshots.
*/
- const string& snapshotDir() const { return mySnapshotDir; }
+ const string& snapshotSaveDir() const { return mySnapshotSaveDir; }
+ const string& snapshotLoadDir() const { return mySnapshotLoadDir; }
/**
Return the full/complete directory name for storing EEPROM files.
@@ -505,13 +507,14 @@ class OSystem
virtual void stateChanged(EventHandler::State state);
/**
- Returns the default path for the snapshot directory.
+ Returns the default save and load paths for the snapshot directory.
Since this varies greatly among different systems and is the one
directory that most end-users care about (vs. config file stuff
that usually isn't user-modifiable), we create a special method
for it.
*/
- virtual string defaultSnapDir() { return "~"; }
+ virtual string defaultSnapSaveDir() { return "~"; }
+ virtual string defaultSnapLoadDir() { return "~"; }
/**
Set the position of the application window, generally using
@@ -610,7 +613,8 @@ class OSystem
enum { kNumUIPalettes = 2 };
string myBaseDir;
string myStateDir;
- string mySnapshotDir;
+ string mySnapshotSaveDir;
+ string mySnapshotLoadDir;
string myEEPROMDir;
string myCfgDir;
diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx
index 7035c7034..203f43f4c 100644
--- a/src/emucore/Settings.cxx
+++ b/src/emucore/Settings.cxx
@@ -94,7 +94,8 @@ Settings::Settings(OSystem* osystem)
setInternal("ctrlcombo", "true");
// Snapshot options
- setInternal("snapdir", "");
+ setInternal("snapsavedir", "");
+ setInternal("snaploaddir", "");
setInternal("sssingle", "false");
setInternal("ss1x", "false");
setInternal("ssinterval", "2");
@@ -398,7 +399,8 @@ void Settings::usage()
<< " -autoslot <1|0> Automatically switch to next save slot when state saving\n"
<< " -stats <1|0> Overlay console info during emulation\n"
<< " -fastscbios <1|0> Disable Supercharger BIOS progress loading bars\n"
- << " -snapdir The directory to save snapshot files to\n"
+ << " -snapsavedir The directory to save snapshot files to\n"
+ << " -snaploaddir The directory to load snapshot files from\n"
<< " -sssingle <1|0> Generate single snapshot instead of many\n"
<< " -ss1x <1|0> Generate TIA snapshot in 1x mode (ignore scaling/effects)\n"
<< " -ssinterval getHeight() + 3;
b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
- "Snapshot path:", kChooseSnapDirCmd);
+ "Snapshot save path:", kChooseSnapSaveDirCmd);
wid.push_back(b);
xpos += buttonWidth + 10;
- mySnapPath = new EditTextWidget(this, font, xpos, ypos + 2,
+ mySnapSavePath = new EditTextWidget(this, font, xpos, ypos + 2,
_w - xpos - 10, lineHeight, "");
- wid.push_back(mySnapPath);
+ wid.push_back(mySnapSavePath);
+
+ // Snapshot path (load files)
+ xpos = vBorder; ypos += romButton->getHeight() + 3;
+ b = new ButtonWidget(this, font, xpos, ypos, buttonWidth, buttonHeight,
+ "Snapshot load path:", kChooseSnapLoadDirCmd);
+ wid.push_back(b);
+ xpos += buttonWidth + 10;
+ mySnapLoadPath = new EditTextWidget(this, font, xpos, ypos + 2,
+ _w - xpos - 10, lineHeight, "");
+ wid.push_back(mySnapLoadPath);
// Cheat file
xpos = vBorder; ypos += b->getHeight() + 3;
@@ -188,7 +198,8 @@ void FileSnapDialog::loadConfig()
{
const Settings& settings = instance().settings();
myRomPath->setEditString(settings.getString("romdir"));
- mySnapPath->setEditString(settings.getString("snapdir"));
+ mySnapSavePath->setEditString(settings.getString("snapsavedir"));
+ mySnapLoadPath->setEditString(settings.getString("snaploaddir"));
myCheatFile->setEditString(settings.getString("cheatfile"));
myPaletteFile->setEditString(settings.getString("palettefile"));
myPropsFile->setEditString(settings.getString("propsfile"));
@@ -203,7 +214,8 @@ void FileSnapDialog::loadConfig()
void FileSnapDialog::saveConfig()
{
instance().settings().setString("romdir", myRomPath->getEditString());
- instance().settings().setString("snapdir", mySnapPath->getEditString());
+ instance().settings().setString("snapsavedir", mySnapSavePath->getEditString());
+ instance().settings().setString("snaploaddir", mySnapLoadPath->getEditString());
instance().settings().setString("cheatfile", myCheatFile->getEditString());
instance().settings().setString("palettefile", myPaletteFile->getEditString());
instance().settings().setString("propsfile", myPropsFile->getEditString());
@@ -227,7 +239,8 @@ void FileSnapDialog::setDefaults()
node = FilesystemNode("~");
myRomPath->setEditString(node.getShortPath());
- mySnapPath->setEditString(instance().defaultSnapDir());
+ mySnapSavePath->setEditString(instance().defaultSnapSaveDir());
+ mySnapLoadPath->setEditString(instance().defaultSnapLoadDir());
const string& cheatfile = basedir + "stella.cht";
node = FilesystemNode(cheatfile);
@@ -276,9 +289,14 @@ void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
FilesystemNode::kListDirectoriesOnly, kRomDirChosenCmd);
break;
- case kChooseSnapDirCmd:
- myBrowser->show("Select snapshot directory:", mySnapPath->getEditString(),
- FilesystemNode::kListDirectoriesOnly, kSnapDirChosenCmd);
+ case kChooseSnapSaveDirCmd:
+ myBrowser->show("Select snapshot save directory:", mySnapSavePath->getEditString(),
+ FilesystemNode::kListDirectoriesOnly, kSnapSaveDirChosenCmd);
+ break;
+
+ case kChooseSnapLoadDirCmd:
+ myBrowser->show("Select snapshot load directory:", mySnapLoadPath->getEditString(),
+ FilesystemNode::kListDirectoriesOnly, kSnapLoadDirChosenCmd);
break;
case kChooseCheatFileCmd:
@@ -313,10 +331,17 @@ void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
break;
}
- case kSnapDirChosenCmd:
+ case kSnapSaveDirChosenCmd:
{
FilesystemNode dir(myBrowser->getResult());
- mySnapPath->setEditString(dir.getShortPath());
+ mySnapSavePath->setEditString(dir.getShortPath());
+ break;
+ }
+
+ case kSnapLoadDirChosenCmd:
+ {
+ FilesystemNode dir(myBrowser->getResult());
+ mySnapLoadPath->setEditString(dir.getShortPath());
break;
}
diff --git a/src/gui/FileSnapDialog.hxx b/src/gui/FileSnapDialog.hxx
index 2e7ec5c1b..4ac4808ff 100644
--- a/src/gui/FileSnapDialog.hxx
+++ b/src/gui/FileSnapDialog.hxx
@@ -58,7 +58,8 @@ class FileSnapDialog : public Dialog, public CommandSender
kChooseCheatFileCmd = 'LOcf', // cheatfile (stella.cht)
kChoosePaletteFileCmd = 'LOpf', // palette file (stella.pal)
kChoosePropsFileCmd = 'LOpr', // properties file (stella.pro)
- kChooseSnapDirCmd = 'LOsn', // snapshot dir
+ kChooseSnapSaveDirCmd = 'LOss', // snapshot dir (save files)
+ kChooseSnapLoadDirCmd = 'LOsl', // snapshot dir (load files)
kChooseEEPROMDirCmd = 'LOee', // eeprom dir
kStateDirChosenCmd = 'LOsc', // state dir changed
kCheatFileChosenCmd = 'LOcc', // cheatfile changed
@@ -76,7 +77,8 @@ class FileSnapDialog : public Dialog, public CommandSender
EditTextWidget* myCheatFile;
EditTextWidget* myPaletteFile;
EditTextWidget* myPropsFile;
- EditTextWidget* mySnapPath;
+ EditTextWidget* mySnapSavePath;
+ EditTextWidget* mySnapLoadPath;
// Other snapshot settings
CheckboxWidget* mySnapSingle;
diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx
index 42a81fd1f..53a36b5e6 100644
--- a/src/gui/LauncherDialog.cxx
+++ b/src/gui/LauncherDialog.cxx
@@ -603,7 +603,11 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
updateListing();
break;
- case kSnapDirChosenCmd:
+ case kSnapSaveDirChosenCmd:
+ // Stub just in case we need it
+ break;
+
+ case kSnapLoadDirChosenCmd:
// Stub just in case we need it
break;
diff --git a/src/gui/LauncherDialog.hxx b/src/gui/LauncherDialog.hxx
index 27d640d08..4f4d5ae6e 100644
--- a/src/gui/LauncherDialog.hxx
+++ b/src/gui/LauncherDialog.hxx
@@ -49,10 +49,11 @@ class StringListWidget;
// These must be accessible from dialogs created by this class
enum {
- kRomDirChosenCmd = 'romc', // rom chosen
- kSnapDirChosenCmd = 'snpc', // snap chosen
- kReloadRomDirCmd = 'rdrl', // reload the current listing
- kReloadFiltersCmd = 'rlfl' // reload filtering options and current listing
+ kRomDirChosenCmd = 'romc', // rom chosen
+ kSnapSaveDirChosenCmd = 'snsc', // snap chosen (save files)
+ kSnapLoadDirChosenCmd = 'snlc', // snap chosen (load files)
+ kReloadRomDirCmd = 'rdrl', // reload the current listing
+ kReloadFiltersCmd = 'rlfl' // reload filtering options and current listing
};
class LauncherDialog : public Dialog
diff --git a/src/gui/RomInfoWidget.cxx b/src/gui/RomInfoWidget.cxx
index da0327953..38a09a6a1 100644
--- a/src/gui/RomInfoWidget.cxx
+++ b/src/gui/RomInfoWidget.cxx
@@ -108,7 +108,7 @@ void RomInfoWidget::parseProperties()
myRomInfo.clear();
// Get a valid filename representing a snapshot file for this rom
- const string& filename = instance().snapshotDir() +
+ const string& filename = instance().snapshotLoadDir() +
myProperties.get(Cartridge_Name) + ".png";
// Read the PNG file
diff --git a/src/gui/VideoDialog.cxx b/src/gui/VideoDialog.cxx
index 9fa0697b5..9cfa0d548 100644
--- a/src/gui/VideoDialog.cxx
+++ b/src/gui/VideoDialog.cxx
@@ -174,7 +174,7 @@ VideoDialog::VideoDialog(OSystem* osystem, DialogContainer* parent,
// Add message concerning usage
const GUI::Font& infofont = instance().infoFont();
- ypos = myTab->getHeight() - 5 - fontHeight - infofont.getFontHeight()- 10;
+ ypos = myTab->getHeight() - 5 - fontHeight - infofont.getFontHeight() - 10;
new StaticTextWidget(myTab, infofont, 10, ypos,
font.getStringWidth("(*) Requires application restart"), fontHeight,
"(*) Requires application restart", kTextAlignLeft);
diff --git a/src/macosx/OSystemMACOSX.cxx b/src/macosx/OSystemMACOSX.cxx
index 49dc64eff..e32bc7ca7 100644
--- a/src/macosx/OSystemMACOSX.cxx
+++ b/src/macosx/OSystemMACOSX.cxx
@@ -46,8 +46,14 @@ OSystemMACOSX::~OSystemMACOSX()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-string OSystemMACOSX::defaultSnapDir()
+string OSystemMACOSX::defaultSnapSaveDir()
{
FilesystemNode desktop("~/Desktop");
return desktop.isDirectory() ? desktop.getShortPath() : "~";
}
+
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+string OSystemMACOSX::defaultSnapLoadDir()
+{
+ return defaultSnapSaveDir();
+}
diff --git a/src/macosx/OSystemMACOSX.hxx b/src/macosx/OSystemMACOSX.hxx
index a2c2c9925..750d9a73b 100644
--- a/src/macosx/OSystemMACOSX.hxx
+++ b/src/macosx/OSystemMACOSX.hxx
@@ -42,9 +42,10 @@ class OSystemMACOSX : public OSystem
virtual ~OSystemMACOSX();
/**
- Returns the default path for the snapshot directory.
+ Returns the default paths for the snapshot directory.
*/
- string defaultSnapDir();
+ string defaultSnapSaveDir();
+ string defaultSnapLoadDir();
};
#endif
diff --git a/src/win32/OSystemWin32.cxx b/src/win32/OSystemWin32.cxx
index dc1dcf9ec..0ca877e85 100644
--- a/src/win32/OSystemWin32.cxx
+++ b/src/win32/OSystemWin32.cxx
@@ -91,13 +91,19 @@ OSystemWin32::~OSystemWin32()
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-string OSystemWin32::defaultSnapDir()
+string OSystemWin32::defaultSnapSaveDir()
{
HomeFinder homefinder;
FilesystemNode desktop(homefinder.getDesktopPath());
return desktop.isDirectory() ? desktop.getShortPath() : "~";
}
+// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+string OSystemWin32::defaultSnapLoadDir()
+{
+ return defaultSnapSaveDir();
+}
+
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void OSystemWin32::setAppWindowPos(int x, int y, int w, int h)
{
diff --git a/src/win32/OSystemWin32.hxx b/src/win32/OSystemWin32.hxx
index 8c1f774b0..b3d28771b 100644
--- a/src/win32/OSystemWin32.hxx
+++ b/src/win32/OSystemWin32.hxx
@@ -44,9 +44,10 @@ class OSystemWin32 : public OSystem
public:
/**
- Returns the default path for the snapshot directory.
+ Returns the default paths for the snapshot directory.
*/
- string defaultSnapDir();
+ string defaultSnapSaveDir();
+ string defaultSnapLoadDir();
/**
Move window to given position. The width and height are also
|