diff --git a/stella/docs/index.html b/stella/docs/index.html index 005194069..c63870c54 100644 --- a/stella/docs/index.html +++ b/stella/docs/index.html @@ -2214,7 +2214,13 @@ Windows %MY_DOCUMENTS%\Stella\atarivox_eeprom.dat
- %MY_DOCUMENTS%\Stella\savekey_eeprom.dat
+ %MY_DOCUMENTS%\Stella\savekey_eeprom.dat    + OR
+ _BASEDIR_\atarivox_eeprom.dat
+ _BASEDIR_\savekey_eeprom.dat
+ (if a file named 'basedir.txt' exists in the application + directory containing the full pathname for _BASEDIR_) + @@ -2328,7 +2334,12 @@ Windows - %MY_DOCUMENTS%\Stella\stella.ini + %MY_DOCUMENTS%\Stella\stella.ini    + OR
+ _BASEDIR_\stella.ini    + (if a file named 'basedir.txt' exists in the application + directory containing the full pathname for _BASEDIR_) + @@ -2425,7 +2436,12 @@ Ms Pac-Man (Stella extended codes): Windows - %MY_DOCUMENTS%\Stella\stella.cht + %MY_DOCUMENTS%\Stella\stella.cht    + OR
+ _BASEDIR_\stella.cht    + (if a file named 'basedir.txt' exists in the application + directory containing the full pathname for _BASEDIR_) +

Stella will require a restart for changes to this file to take effect.

@@ -2670,7 +2686,13 @@ Ms Pac-Man (Stella extended codes): Windows - %MY_DOCUMENTS%\Stella\stella.pro + %MY_DOCUMENTS%\Stella\stella.pro    + OR
+ _BASEDIR_\stella.pro    + (if a file named 'basedir.txt' exists in the application + directory containing the full pathname for _BASEDIR_) + +

Stella will require a restart for changes to this file to take effect.

@@ -2733,7 +2755,12 @@ Ms Pac-Man (Stella extended codes): Windows - %MY_DOCUMENTS%\Stella\stella.pal + %MY_DOCUMENTS%\Stella\stella.pal    + OR
+ _BASEDIR_\stella.pal    + (if a file named 'basedir.txt' exists in the application + directory containing the full pathname for _BASEDIR_) +

Note that to actually use the external palette, the palette file must diff --git a/stella/src/win32/OSystemWin32.cxx b/stella/src/win32/OSystemWin32.cxx index 454046c38..469239d68 100644 --- a/stella/src/win32/OSystemWin32.cxx +++ b/stella/src/win32/OSystemWin32.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: OSystemWin32.cxx,v 1.31 2009-01-16 21:46:31 stephena Exp $ +// $Id: OSystemWin32.cxx,v 1.32 2009-01-30 23:31:41 stephena Exp $ //============================================================================ #include "bspf.hxx" @@ -35,11 +35,33 @@ OSystemWin32::OSystemWin32() : OSystem() { - string basedir = "."; + string basedir = ""; - FilesystemNode home("~\\"); - if(home.isDirectory()) - basedir = "~\\Stella"; + // Check if the base directory should be overridden + // Shouldn't normally be necessary, but is useful for those people that + // don't want to clutter their 'My Documents' folder + bool overrideBasedir = false; + FilesystemNode basedirfile("basedir.txt"); + if(basedirfile.exists()) + { + ifstream in(basedirfile.getPath().c_str()); + if(in && in.is_open()) + { + in >> basedir; + in.close(); + if(basedir != "") overrideBasedir = true; + } + } + + // If basedir hasn't been specified, use the 'home' directory + if(!overrideBasedir) + { + FilesystemNode home("~\\"); + if(home.isDirectory()) + basedir = "~\\Stella"; + else + basedir = "."; // otherwise, default to current directory + } setBaseDir(basedir); setConfigFile(basedir + "\\stella.ini");