From 24421fa9ee5399fa87bb108ce41f71a670268d19 Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Fri, 30 Aug 2019 23:32:57 -0230 Subject: [PATCH] Removed 'cfgdir', and have Distella config files placed with the ROM file they refer to. Updated docs for removal of statedir, propsfile, etc. Added 'basedir' and 'baseinappdir' to the docs. Updated changelog for above changes. --- Changes.txt | 13 +- docs/graphics/launcher_options_files.png | Bin 3588 -> 0 bytes docs/index.html | 167 +++++++---------------- src/debugger/CartDebug.cxx | 60 ++++---- src/emucore/OSystem.cxx | 4 - src/emucore/OSystem.hxx | 8 -- src/emucore/Settings.cxx | 5 +- 7 files changed, 90 insertions(+), 167 deletions(-) delete mode 100644 docs/graphics/launcher_options_files.png diff --git a/Changes.txt b/Changes.txt index 147e95751..e174fdefd 100644 --- a/Changes.txt +++ b/Changes.txt @@ -72,7 +72,18 @@ * Added hotkey for sound on/off. - * Paths have been simplified (TODO: doc) + * Paths have been simplified: (TODO - finish this) + - The following file/directory locations are no longer configurable + (statedir, nvramdir, cheatfile, palettefile, propsfile); they are + now all under the base directory + - Removed cfgdir; Distella config files are now placed with their + associated ROMs + - Added 'basedir' commandline argument, which allows to change the + base directory where almost all config-related items are stored; + related to this, discontinued the 'basedir.txt' functionality + - Added 'baseinappdir' commandline argument, which sets the base + directory to the application folder (Windows only for now); this + replaces the functionality of 'basedir.txt' * Enhanced 'Command' menu to display current state and more commands. diff --git a/docs/graphics/launcher_options_files.png b/docs/graphics/launcher_options_files.png deleted file mode 100644 index fd4242ae38824495dcb05b8898cfdf9c8c5ce0dc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3588 zcmeHJi#t^79-hI3kxPtQX^TmksW4=_v@vE(E+ehRnyuoD5HTf}Of*J_LDW`h(ynx7 z)M(8@QmP#zWs_T?B&8VF3YAMD_cLRk=h>aV;q3LSwSM3CThI5b^?TR*{@(8-;N_}{ zUX4Z|5UTEOE;Ix}4wQ~(mE@&&paoYX4GIUGcQ_*ur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eTa*2ZK4@J5yBR5HM> z@5Ektlf4;%v}J>n!%L+i&ytaaC?(C0O_Z$xitgt;oVwRx*&~z^_KQQ~W9;zTx!!S_ zUav3`2ebJT*1(JvpZ!~I^@5;Na;&iM=Dog6d-4azX&G99Z>Ry=qIaWo4D0Y-l_9fl zLoK?m9jXNN&AHvTV-KA7$!#1fu`f6W94leOpUNd6J2s@Kt+^8KEX>LCzYuu6nksls zHB#h7IqFW)EChSOVyUx>F*Nyaq&F2$3uifB`h-1MSu5jkD<^1iXfRr2rNXPDKA!v8 zoU3uChGS{c;K|JLEy>FSa6bbE_MG@$+(07}&<3k~zwwOxikr@bv$6_`he% zo1BBh+OLlcAL^LSFOKeirVd&IdAsbQpIEPuiSdUMZXyQ1*=4ED4uW*FC^bqAJ+)*@|G3r6Vmo-K#1iR1X}NP*lO| zRZSGQcJeagLN7phW9AvH54k0F7+g&qgtXRbQtEuPr-z;s(kq7P&KC3a2!jC6(dfaTEl&3xa146jk!C;%jG6%---VK D(k~02 diff --git a/docs/index.html b/docs/index.html index d2ab1ecf5..3acfac39e 100644 --- a/docs/index.html +++ b/docs/index.html @@ -566,13 +566,9 @@

If this is your first time starting Stella, you may have to navigate to your ROMs. The path of the first ROM you play automatically defines the default ROM path. You - can change it later in the Configure Paths dialog. -

+ can change it later in the ROM Launcher dialog.

-

At this point, you may want to set the locations for snapshots and other - external paths. This is described in more detail in - Advanced Configuration - Snapshot Settings and - Advanced Configuration - Configure Paths. +

At this point, you may want to set the locations for snapshots. This is described in more detail in Advanced Configuration - Snapshot Settings. These settings are optional, and can be left at the defaults if you won't be using snapshots in the ROM launcher.

@@ -2348,36 +2344,6 @@ Set the directory where the ROM launcher will start. - -
-statedir <dir>
- Set the directory in which to access state files. - - - -
-cheatfile <file>
- Set the full pathname of the cheatfile database. - - - -
-palettefile <file>
- Set the full pathname of the user-defined palette file. - - - -
-propsfile <file>
- Set the full pathname of the ROM properties file. - - - -
-nvramdir <dir>
- Set the directory in which to access non-volatile (flash/EEPROM) files. - - - -
-cfgdir <dir>
- Set the directory in which to access Distella config files. - -
-avoxport <name>
Set the name of the serial port where an AtariVox is connected. @@ -2389,6 +2355,16 @@ can be created, allowing to simulate testing on 'smaller' systems. + +
-basedir <dir>
+ Override the base directory for all config files. + + + +
-baseinappdir
+ Override the base directory for all config files by attempting to use the application directory. For now this is only supported in Windows. + +
-help
Prints a help message describing these options, and then @@ -2867,26 +2843,6 @@
- -

Configure Paths dialog:

- - - - - - -
     - - - - - - - - -
ItemBrief descriptionFor more information,
see CommandLine
ROM pathSpecifies location of ROM files
(only enabled in ROM launcher mode)
-romdir
Cheat fileSpecifies location of cheatfile database-cheatfile
Palette fileSpecifies location of user palette-palettefile
Properties file Specifies location of external stella.pro database-propsfile
State pathSpecifies location of state files-statedir
NVRAM pathSpecifies location of NVRAM (flash/EEPROM) files-nvramdir
-
-

Developer Settings dialog:

@@ -3200,34 +3156,30 @@ 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 location of the EEPROM files are configurable through the - '-nvramdir' commandline argument and within the application itself - (see Advanced Configuration - Configure Paths). - If the path for these files hasn't been set, the default location will depend on the - version of Stella, as follows:

+

The location of EEPROM files will depend on the version of Stella, as follows:

- + - + + + + +
Linux/Unix~/.stella/nvram/atarivox_eeprom.dat
- ~/.stella/nvram/savekey_eeprom.dat
$HOME/.config/stella/nvram/atarivox_eeprom.dat
+ $HOME/.config/stella/nvram/savekey_eeprom.dat
Macintosh~/Library/Application Support/Stella/nvram/atarivox_eeprom.dat
- ~/Library/Application Support/Stella/nvram/savekey_eeprom.dat
$HOME/Library/Application Support/Stella/nvram/atarivox_eeprom.dat
+ $HOME/Library/Application Support/Stella/nvram/savekey_eeprom.dat
Windows %APPDATA%\Stella\nvram\atarivox_eeprom.dat
- %APPDATA%\Stella\nvram\savekey_eeprom.dat
    - OR
- _BASEDIR_\nvram\atarivox_eeprom.dat
- _BASEDIR_\nvram\savekey_eeprom.dat
- (if a file named 'basedir.txt' exists in the application - directory containing the full pathname for _BASEDIR_) + %APPDATA%\Stella\nvram\savekey_eeprom.dat
If using 'basedir'
or 'baseinappdir'
_BASEDIR_/nvram/atarivox_eeprom.dat
+ _BASEDIR_/nvram/savekey_eeprom.dat

Note that these EEPROM files will be created when necessary, and @@ -3490,7 +3442,7 @@

The settings file has a special name/location depending on which version of Stella - you use, which is currently not configurable:

+ you use, which is not configurable:

@@ -3499,16 +3451,15 @@ - + - + + + + +
MacintoshNot applicable; settings are saved in ~/Library/Preferences/Stella-emu.plistNot applicable; settings are saved in $HOME/Library/Preferences/Stella-emu.plist
Windows%APPDATA%\Stella\stella.ini    - OR
- _BASEDIR_\stella.ini    - (if a file named 'basedir.txt' exists in the application - directory containing the full pathname for _BASEDIR_) -
%APPDATA%\Stella\stella.ini
If using 'basedir'
or 'baseinappdir'
_BASEDIR_/stellarc (or stella.ini)

@@ -3585,11 +3536,7 @@ Ms Pac-Man (Stella extended codes): 108fea1 - infinite lives -

The name of the cheat database file is configurable through the - '-cheatfile' commandline argument and within the application itself - (see Advanced Configuration - Configure Paths). If the - path for this file hasn't been set, the default filename will depend on the - version of Stella, as follows:

+

The name of the cheat database file will depend on the version of Stella, as follows:

@@ -3598,16 +3545,15 @@ Ms Pac-Man (Stella extended codes): - + - + + + + +
Macintosh~/Library/Application Support/Stella/stella.cht$HOME/Library/Application Support/Stella/stella.cht
Windows%APPDATA%\Stella\stella.cht    - OR
- _BASEDIR_\stella.cht    - (if a file named 'basedir.txt' exists in the application - directory containing the full pathname for _BASEDIR_) -
%APPDATA%\Stella\stella.cht
If using 'basedir'
or 'baseinappdir'
_BASEDIR_/stella.cht

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

@@ -3931,11 +3877,7 @@ Ms Pac-Man (Stella extended codes): -

The name of the properties file is configurable through the - '-propsfile' commandline argument and within the application itself - (see Advanced Configuration - Configure Paths). If the - path for this file hasn't been set, the default filename will depend on the - version of Stella, as follows:

+

The name of the properties file will depend on the version of Stella, as follows:

@@ -3944,17 +3886,15 @@ Ms Pac-Man (Stella extended codes): - + - - + + + + +
Macintosh~/Library/Application Support/Stella/stella.pro$HOME/Library/Application Support/Stella/stella.pro
Windows%APPDATA%\Stella\stella.pro    - OR
- _BASEDIR_\stella.pro    - (if a file named 'basedir.txt' exists in the application - directory containing the full pathname for _BASEDIR_) -
%APPDATA%\Stella\stella.pro
If using 'basedir'
or 'baseinappdir'
_BASEDIR_/stella.pro

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

@@ -3996,11 +3936,7 @@ Ms Pac-Man (Stella extended codes): need to specify those colours in the palette file. -

The name of the palette file is configurable through the - '-palettefile' commandline argument and within the application itself - (see Advanced Configuration - Configure Paths). If the - path for this file hasn't been set, the default filename will depend on the - version of Stella, as follows:

+

The name of the palette file will depend on the version of Stella, as follows:

@@ -4009,16 +3945,15 @@ Ms Pac-Man (Stella extended codes): - + - + + + + +
Macintosh~/Library/Application Support/Stella/stella.pal%HOME/Library/Application Support/Stella/stella.pal
Windows%APPDATA%\Stella\stella.pal    - OR
- _BASEDIR_\stella.pal    - (if a file named 'basedir.txt' exists in the application - directory containing the full pathname for _BASEDIR_) -
%APPDATA%\Stella\stella.pal
If using 'basedir'
or 'baseinappdir'
_BASEDIR_/stella.pal

Note that to actually use the external palette, the palette file must diff --git a/src/debugger/CartDebug.cxx b/src/debugger/CartDebug.cxx index 660dbceec..0ea5ee036 100644 --- a/src/debugger/CartDebug.cxx +++ b/src/debugger/CartDebug.cxx @@ -696,7 +696,7 @@ string CartDebug::loadListFile() if(lst.isFile() && lst.isReadable()) myListFile = lst.getPath(); else - return DebuggerParser::red("list file not found in:\n " + lst.getShortPath()); + return DebuggerParser::red("list file \'" + lst.getShortPath() + "\' not found"); } FilesystemNode node(myListFile); @@ -741,7 +741,7 @@ string CartDebug::loadListFile() } myDebugger.rom().invalidate(); - return "loaded " + node.getShortPath() + " OK"; + return "list file '" + node.getShortPath() + "' loaded OK"; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -756,7 +756,7 @@ string CartDebug::loadSymbolFile() if(sym.isFile() && sym.isReadable()) mySymbolFile = sym.getPath(); else - return DebuggerParser::red("symbol file not found in:\n " + sym.getShortPath()); + return DebuggerParser::red("symbol file \'" + sym.getShortPath() + "\' not found"); } FilesystemNode node(mySymbolFile); @@ -801,32 +801,22 @@ string CartDebug::loadSymbolFile() } myDebugger.rom().invalidate(); - return "loaded " + node.getShortPath() + " OK"; + return "symbol file '" + node.getShortPath() + "' loaded OK"; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - string CartDebug::loadConfigFile() { - // There are two possible locations for loading config files - // (in order of decreasing relevance): - // 1) ROM dir based on properties entry name - // 2) CFG dir based on properties entry name + // The default naming/location for config files is the ROM dir based on the + // actual ROM filename if(myCfgFile == "") { - const string& propsname = - myConsole.properties().get(PropType::Cart_Name) + ".cfg"; - - FilesystemNode case1(myOSystem.romFile().getParent().getPath() + propsname); - FilesystemNode case2(myOSystem.cfgDir() + propsname); - - if(case1.isFile() && case1.isReadable()) - myCfgFile = case1.getPath(); - else if(case2.isFile() && case2.isReadable()) - myCfgFile = case2.getPath(); + FilesystemNode cfg(myOSystem.romFile().getPathWithExt("") + ".cfg"); + if(cfg.isFile() && cfg.isReadable()) + myCfgFile = cfg.getPath(); else - return DebuggerParser::red("config file not found in:\n " + - case1.getShortPath() + "\n " + case2.getShortPath()); + return DebuggerParser::red("config file \'" + cfg.getShortPath() + "\' not found"); } FilesystemNode node(myCfgFile); @@ -910,7 +900,7 @@ string CartDebug::loadConfigFile() stringstream retVal; if(myConsole.cartridge().bankCount() > 1) retVal << DebuggerParser::red("config file for multi-bank ROM not fully supported\n"); - retVal << "loaded " << node.getShortPath() << " OK"; + retVal << "config file '" << node.getShortPath() << "' loaded OK"; return retVal.str(); } @@ -918,29 +908,25 @@ string CartDebug::loadConfigFile() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - string CartDebug::saveConfigFile() { - // While there are two possible locations for loading config files, - // the main 'config' directory is used whenever possible when saving, - // unless the rom-specific file already exists + // The default naming/location for config files is the ROM dir based on the + // actual ROM filename - FilesystemNode node; - - FilesystemNode case0(myCfgFile); - if(myCfgFile != "" && case0.isFile() && case0.isWritable()) - node = case0; - else + FilesystemNode cfg; + if(myCfgFile == "") { - const string& propsname = - myConsole.properties().get(PropType::Cart_Name) + ".cfg"; - - node = FilesystemNode(myOSystem.cfgDir() + propsname); + cfg = FilesystemNode(myOSystem.romFile().getPathWithExt("") + ".cfg"); + if(cfg.isFile() && cfg.isWritable()) + myCfgFile = cfg.getPath(); + else + return DebuggerParser::red("config file \'" + cfg.getShortPath() + "\' not writable"); } const string& name = myConsole.properties().get(PropType::Cart_Name); const string& md5 = myConsole.properties().get(PropType::Cart_MD5); - ofstream out(node.getPath()); + ofstream out(cfg.getPath()); if(!out.is_open()) - return "Unable to save directives to " + node.getShortPath(); + return "Unable to save directives to " + cfg.getShortPath(); // Store all bank information out << "//Stella.pro: \"" << name << "\"" << endl @@ -955,7 +941,7 @@ string CartDebug::saveConfigFile() stringstream retVal; if(myConsole.cartridge().bankCount() > 1) retVal << DebuggerParser::red("config file for multi-bank ROM not fully supported\n"); - retVal << "saved " << node.getShortPath() << " OK"; + retVal << "config file '" << cfg.getShortPath() << "' saved OK"; return retVal.str(); } diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx index 19049450b..356418c7d 100644 --- a/src/emucore/OSystem.cxx +++ b/src/emucore/OSystem.cxx @@ -276,9 +276,6 @@ void OSystem::setConfigPaths() buildDirIfRequired(myStateDir, myBaseDir + "state"); buildDirIfRequired(myNVRamDir, myBaseDir + "nvram"); -#ifdef DEBUGGER_SUPPORT - buildDirIfRequired(myCfgDir, myBaseDir + "cfg"); -#endif #ifdef PNG_SUPPORT mySnapshotSaveDir = mySettings->getString("snapsavedir"); @@ -303,7 +300,6 @@ void OSystem::setConfigPaths() dbgPath("base dir ", myBaseDir); dbgPath("state dir ", myStateDir); dbgPath("nvram dir ", myNVRamDir); - dbgPath("cfg dir ", myCfgDir); dbgPath("ssave dir ", mySnapshotSaveDir); dbgPath("sload dir ", mySnapshotLoadDir); dbgPath("cheat file", myCheatFile); diff --git a/src/emucore/OSystem.hxx b/src/emucore/OSystem.hxx index bb2874bb0..da0dc471b 100644 --- a/src/emucore/OSystem.hxx +++ b/src/emucore/OSystem.hxx @@ -262,13 +262,6 @@ class OSystem const string& cheatFile() const { return myCheatFile; } #endif - #ifdef DEBUGGER_SUPPORT - /** - Return the full/complete directory name for storing Distella cfg files. - */ - const string& cfgDir() const { return myCfgDir; } - #endif - #ifdef PNG_SUPPORT /** Return the full/complete directory name for saving and loading @@ -540,7 +533,6 @@ class OSystem string mySnapshotSaveDir; string mySnapshotLoadDir; string myNVRamDir; - string myCfgDir; string myDefaultSaveDir; string myDefaultLoadDir; diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index 330aa541d..5846fc365 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -495,7 +495,7 @@ void Settings::usage() const << " -ctrldelay Delay before controller input is repeated in UI\n" << " -ctrlrate Rate per second of repeated controller input in UI\n" << " -basic_settings <0|1> Display only a basic settings dialog\n" - << " -romdir

Directory from which to load ROM files\n" + << " -romdir Set the directory where the ROM launcher will start\n" << " -avoxport The name of the serial port where an AtariVox is\n" << " connected\n" << " -holdreset Start the emulator with the Game Reset switch\n" @@ -508,6 +508,9 @@ void Settings::usage() const << " direction/fire button held down\n" << " -maxres Used by developers to force the maximum size of\n" << " the application window\n" + << " -basedir Override the base directory for all config files\n" + << " -baseinappdir Override the base directory for all config files\n" + << " by attempting to use the application directory\n" << " -help Show the text you're now reading\n" #ifdef DEBUGGER_SUPPORT << endl