mirror of https://github.com/stella-emu/stella.git
Merge branch 'master' into refactor/cart
This commit is contained in:
commit
cf9c109681
|
@ -28,6 +28,8 @@
|
|||
|
||||
* Added detection of color and audio data in DiStella.
|
||||
|
||||
* Restored 'cfg' directory for Distella config files.
|
||||
|
||||
-Have fun!
|
||||
|
||||
|
||||
|
|
|
@ -843,12 +843,13 @@ string CartDebug::loadSymbolFile()
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
string CartDebug::loadConfigFile()
|
||||
{
|
||||
// The default naming/location for config files is the ROM dir based on the
|
||||
// actual ROM filename
|
||||
// The default naming/location for config files is the CFG dir and based
|
||||
// on the actual ROM filename
|
||||
|
||||
if(myCfgFile == "")
|
||||
{
|
||||
FilesystemNode cfg(myOSystem.romFile().getPathWithExt("") + ".cfg");
|
||||
FilesystemNode romNode(myOSystem.romFile().getPathWithExt("") + ".cfg");
|
||||
FilesystemNode cfg(myOSystem.cfgDir() + romNode.getName());
|
||||
if(cfg.isFile() && cfg.isReadable())
|
||||
myCfgFile = cfg.getPath();
|
||||
else
|
||||
|
@ -964,14 +965,14 @@ string CartDebug::loadConfigFile()
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
string CartDebug::saveConfigFile()
|
||||
{
|
||||
// The default naming/location for config files is the ROM dir based on the
|
||||
// actual ROM filename
|
||||
// The default naming/location for config files is the CFG dir and based
|
||||
// on the actual ROM filename
|
||||
|
||||
FilesystemNode cfg;
|
||||
if(myCfgFile == "")
|
||||
{
|
||||
cfg = FilesystemNode(myOSystem.romFile().getPathWithExt("") + ".cfg");
|
||||
if(cfg.isFile() && cfg.isWritable())
|
||||
FilesystemNode romNode(myOSystem.romFile().getPathWithExt("") + ".cfg");
|
||||
FilesystemNode cfg(myOSystem.cfgDir() + romNode.getName());
|
||||
if(cfg.getParent().isWritable())
|
||||
myCfgFile = cfg.getPath();
|
||||
else
|
||||
return DebuggerParser::red("config file \'" + cfg.getShortPath() + "\' not writable");
|
||||
|
@ -980,6 +981,7 @@ string CartDebug::saveConfigFile()
|
|||
const string& name = myConsole.properties().get(PropType::Cart_Name);
|
||||
const string& md5 = myConsole.properties().get(PropType::Cart_MD5);
|
||||
|
||||
FilesystemNode cfg(myCfgFile);
|
||||
ofstream out(cfg.getPath());
|
||||
if(!out.is_open())
|
||||
return "Unable to save directives to " + cfg.getShortPath();
|
||||
|
|
|
@ -343,7 +343,7 @@ class CartDebug : public DebuggerSystem
|
|||
uInt16 myLabelLength{8}; // longest pre-defined label
|
||||
|
||||
// Filenames to use for various I/O (currently these are hardcoded)
|
||||
string myListFile, mySymbolFile, myCfgFile, myDisasmFile, myRomFile;
|
||||
string myListFile, mySymbolFile, myCfgFile, myDisasmFile;
|
||||
|
||||
/// Table of instruction mnemonics
|
||||
static std::array<const char*, 16> ourTIAMnemonicR; // read mode
|
||||
|
|
|
@ -221,6 +221,12 @@ uInt16 Cartridge3E::bankCount() const
|
|||
return myRomBanks + myRamBanks;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
uInt16 Cartridge3E::bankSize(uInt16 bank) const
|
||||
{
|
||||
return 2_KB; // we cannot use bankCount() here, because it delivers wrong numbers
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool Cartridge3E::patch(uInt16 address, uInt8 value)
|
||||
{
|
||||
|
|
|
@ -111,6 +111,14 @@ class Cartridge3E : public Cartridge
|
|||
*/
|
||||
uInt16 bankCount() const override;
|
||||
|
||||
/**
|
||||
Get the size of a bank.
|
||||
|
||||
@param bank The bank to get the size for
|
||||
@return The bank's size
|
||||
*/
|
||||
virtual uInt16 bankSize(uInt16 bank = 0) const;
|
||||
|
||||
/**
|
||||
Patch the cartridge ROM.
|
||||
|
||||
|
|
|
@ -268,6 +268,9 @@ 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");
|
||||
|
@ -292,6 +295,7 @@ 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);
|
||||
|
|
|
@ -270,6 +270,13 @@ 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
|
||||
|
@ -529,6 +536,7 @@ class OSystem
|
|||
string mySnapshotSaveDir;
|
||||
string mySnapshotLoadDir;
|
||||
string myNVRamDir;
|
||||
string myCfgDir;
|
||||
string myDefaultSaveDir;
|
||||
string myDefaultLoadDir;
|
||||
|
||||
|
|
Loading…
Reference in New Issue