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 @@
Stella will require a restart for changes to this file to take effect.
@@ -2670,7 +2686,13 @@ Ms Pac-Man (Stella extended codes):Stella will require a restart for changes to this file to take effect.
@@ -2733,7 +2755,12 @@ Ms Pac-Man (Stella extended codes):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");