added PlusROM support developer option (fixes #1019)

This commit is contained in:
thrust26 2024-10-19 10:01:16 +02:00
parent 810d587a9b
commit 408e42e328
13 changed files with 74 additions and 6 deletions

View File

@ -12,6 +12,10 @@
Release History Release History
=========================================================================== ===========================================================================
7.0 to 7.1 (xxx x, 202x)
* Added developer option for disabling PlusROM support (TODO: Doc)
6.7.1 to 7.0 (October 5, 2024) 6.7.1 to 7.0 (October 5, 2024)
* Enhanced ROM launcher to allow multiple images per ROM. * Enhanced ROM launcher to allow multiple images per ROM.

View File

@ -46,6 +46,7 @@ void DevSettingsHandler::loadSettings(SettingsSet set)
// AtariVox/SaveKey/PlusROM access // AtariVox/SaveKey/PlusROM access
myExternAccess[set] = settings.getBool(prefix + "extaccess"); myExternAccess[set] = settings.getBool(prefix + "extaccess");
myConsole[set] = settings.getString(prefix + "console") == "7800" ? 1 : 0; myConsole[set] = settings.getString(prefix + "console") == "7800" ? 1 : 0;
myPlusROM[set] = devSettings ? settings.getBool("dev.plusroms.on") : true;
// Randomization // Randomization
myRandomBank[set] = settings.getBool(prefix + "bankrandom"); myRandomBank[set] = settings.getBool(prefix + "bankrandom");
myRandomizeTIA[set] = settings.getBool(prefix + "tiarandom"); myRandomizeTIA[set] = settings.getBool(prefix + "tiarandom");
@ -118,6 +119,7 @@ void DevSettingsHandler::saveSettings(SettingsSet set)
if(devSettings) if(devSettings)
{ {
settings.setValue("dev.plusroms.on", myPlusROM[set]);
settings.setValue("dev.hsrandom", myRandomHotspots[set]); settings.setValue("dev.hsrandom", myRandomHotspots[set]);
// Undriven TIA pins // Undriven TIA pins
settings.setValue("dev.tiadriven", myUndrivenPins[set]); settings.setValue("dev.tiadriven", myUndrivenPins[set]);
@ -183,6 +185,7 @@ void DevSettingsHandler::applySettings(SettingsSet set)
{ {
myOSystem.console().cartridge().enableRandomHotspots(myRandomHotspots[set]); myOSystem.console().cartridge().enableRandomHotspots(myRandomHotspots[set]);
myOSystem.console().tia().driveUnusedPinsRandom(myUndrivenPins[set]); myOSystem.console().tia().driveUnusedPinsRandom(myUndrivenPins[set]);
myOSystem.console().cartridge().enablePlusROM(myPlusROM[set]);
// Notes: // Notes:
// - thumb exceptions not updated, because set in cart constructor // - thumb exceptions not updated, because set in cart constructor
// - other missing settings are used on-the-fly // - other missing settings are used on-the-fly

View File

@ -51,6 +51,7 @@ class DevSettingsHandler
std::array<bool, numSets> myDetectedInfo{}; std::array<bool, numSets> myDetectedInfo{};
std::array<bool, numSets> myExternAccess{}; std::array<bool, numSets> myExternAccess{};
std::array<int, numSets> myConsole{}; std::array<int, numSets> myConsole{};
std::array<int, numSets> myPlusROM{};
std::array<bool, numSets> myRandomBank{}; std::array<bool, numSets> myRandomBank{};
std::array<bool, numSets> myRandomizeTIA{}; std::array<bool, numSets> myRandomizeTIA{};
std::array<bool, numSets> myRandomizeRAM{}; std::array<bool, numSets> myRandomizeRAM{};

View File

@ -149,6 +149,13 @@ class Cartridge : public Device
*/ */
virtual bool isPlusROM() const { return false; } virtual bool isPlusROM() const { return false; }
/**
Enable or disable PlusROM support.
@param enabled Whether to enable the PlusROM support
*/
virtual void enablePlusROM(bool enable) { };
/** /**
Set the callback for displaying messages Set the callback for displaying messages
*/ */

View File

@ -272,6 +272,14 @@ class CartridgeCDF : public CartridgeARM
*/ */
bool isPlusROM() const override { return myPlusROM->isValid(); } bool isPlusROM() const override { return myPlusROM->isValid(); }
/**
Enable or disable PlusROM support.
@param enabled Whether to enable the PlusROM support
*/
void enablePlusROM(bool enable) override { myPlusROM->enable(enable); }
private: private:
static constexpr uInt8 COMMSTREAM = 0x20, JUMPSTREAM_BASE = 0x21; static constexpr uInt8 COMMSTREAM = 0x20, JUMPSTREAM_BASE = 0x21;
static constexpr uInt16 LDAXY_OVERRIDE_INACTIVE = 0xFFFF; static constexpr uInt16 LDAXY_OVERRIDE_INACTIVE = 0xFFFF;

View File

@ -157,6 +157,13 @@ class CartridgeDPCPlus : public CartridgeARM
*/ */
bool isPlusROM() const override { return myPlusROM->isValid(); } bool isPlusROM() const override { return myPlusROM->isValid(); }
/**
Enable or disable PlusROM support.
@param enabled Whether to enable the PlusROM support
*/
void enablePlusROM(bool enable) override { myPlusROM->enable(enable); }
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT
/** /**
Get debugger widget responsible for accessing the inner workings Get debugger widget responsible for accessing the inner workings

View File

@ -193,6 +193,13 @@ class CartridgeE7 : public Cartridge
*/ */
bool isPlusROM() const override { return myPlusROM->isValid(); } bool isPlusROM() const override { return myPlusROM->isValid(); }
/**
Enable or disable PlusROM support.
@param enabled Whether to enable the PlusROM support
*/
void enablePlusROM(bool enable) override { myPlusROM->enable(enable); }
/** /**
Set the callback for displaying messages Set the callback for displaying messages
*/ */

View File

@ -194,6 +194,13 @@ class CartridgeEnhanced : public Cartridge
*/ */
bool isPlusROM() const override { return myPlusROM->isValid(); } bool isPlusROM() const override { return myPlusROM->isValid(); }
/**
Enable or disable PlusROM support.
@param enabled Whether to enable the PlusROM support
*/
void enablePlusROM(bool enable) override { myPlusROM->enable(enable); }
/** /**
Set the callback for displaying messages Set the callback for displaying messages
*/ */
@ -339,7 +346,7 @@ class CartridgeEnhanced : public Cartridge
*/ */
uInt16 ramAddressSegmentOffset(uInt16 address) const { uInt16 ramAddressSegmentOffset(uInt16 address) const {
return static_cast<uInt16>( return static_cast<uInt16>(
(myCurrentSegOffset[((address & ROM_MASK) >> myBankShift) % myBankSegs] - mySize) (myCurrentSegOffset[((address & ROM_MASK) >> myBankShift) % myBankSegs] - mySize)
>> (myBankShift - myRamBankShift)); >> (myBankShift - myRamBankShift));
} }

View File

@ -23,7 +23,6 @@
#include "PlusROM.hxx" #include "PlusROM.hxx"
#include "Logger.hxx" #include "Logger.hxx"
#include "Version.hxx" #include "Version.hxx"
#include "Settings.hxx"
#include "CartDetector.hxx" #include "CartDetector.hxx"
#if defined(HTTP_LIB_SUPPORT) #if defined(HTTP_LIB_SUPPORT)

View File

@ -18,13 +18,12 @@
#ifndef PLUSROM_HXX #ifndef PLUSROM_HXX
#define PLUSROM_HXX #define PLUSROM_HXX
class Settings;
#include <deque> #include <deque>
#include "bspf.hxx" #include "bspf.hxx"
#include "Serializable.hxx" #include "Serializable.hxx"
#include "Cart.hxx" #include "Cart.hxx"
#include "Settings.hxx"
/** /**
Class used to emulate the 'PlusROM' meta-scheme, documented at Class used to emulate the 'PlusROM' meta-scheme, documented at
@ -75,7 +74,18 @@ class PlusROM : public Serializable
@return Whether this is actually a PlusROM cart @return Whether this is actually a PlusROM cart
*/ */
bool isValid() const { return myIsPlusROM; } bool isValid() const {
return myIsPlusROM && myIsEnabled;
}
/**
Enable or disable PlusROM support.
@param enabled Whether to enable the PlusROM support
*/
void enable(bool enabled) {
myIsEnabled = enabled;
}
/** /**
Read from hotspot addresses ($1FF2 and $1FF3). Read from hotspot addresses ($1FF2 and $1FF3).
@ -175,6 +185,7 @@ class PlusROM : public Serializable
const Cartridge& myCart; const Cartridge& myCart;
bool myIsPlusROM{false}; bool myIsPlusROM{false};
bool myIsEnabled{true};
string myHost; string myHost;
string myPath; string myPath;

View File

@ -313,6 +313,7 @@ Settings::Settings()
setPermanent("dev.tm.horizon", "30s"); // = ~30 seconds setPermanent("dev.tm.horizon", "30s"); // = ~30 seconds
setPermanent("dev.detectedinfo", "true"); setPermanent("dev.detectedinfo", "true");
setPermanent("dev.extaccess", "true"); setPermanent("dev.extaccess", "true");
setPermanent("dev.plusroms.on", "true");
// Thumb ARM emulation options // Thumb ARM emulation options
setPermanent("dev.thumb.trapfatal", "true"); setPermanent("dev.thumb.trapfatal", "true");
setPermanent("dev.arm.mips", CartridgeELF::MIPS_DEF); setPermanent("dev.arm.mips", CartridgeELF::MIPS_DEF);
@ -810,6 +811,7 @@ void Settings::usage()
<< " -dev.thumb.mammode <0-3> Selects the LPC's MAM mode\n" << " -dev.thumb.mammode <0-3> Selects the LPC's MAM mode\n"
#endif #endif
<< " -dev.extaccess <1|0> Enable messages for external access\n" << " -dev.extaccess <1|0> Enable messages for external access\n"
<< " -dev.plusroms.on <1|0> Enable PlusROM support\n"
<< " -dev.tia.type <standard|custom| Selects a TIA type\n" << " -dev.tia.type <standard|custom| Selects a TIA type\n"
<< " koolaidman|\n" << " koolaidman|\n"
<< " cosmicark|pesco|\n" << " cosmicark|pesco|\n"

View File

@ -129,7 +129,7 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
// AtariVox/SaveKey/PlusROM access // AtariVox/SaveKey/PlusROM access
myExternAccessWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, myExternAccessWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1,
"Display external access message"); "External access messages");
myExternAccessWidget->setToolTip("Display a message for any external access\n" myExternAccessWidget->setToolTip("Display a message for any external access\n"
"AtariVox/SaveKey EEPROM, PlusROM, Supercharger...)."); "AtariVox/SaveKey EEPROM, PlusROM, Supercharger...).");
wid.push_back(myExternAccessWidget); wid.push_back(myExternAccessWidget);
@ -147,6 +147,13 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
myConsoleWidget->setToolTip("Emulate Color/B&W/Pause key and zero\n" myConsoleWidget->setToolTip("Emulate Color/B&W/Pause key and zero\n"
"page RAM initialization differently."); "page RAM initialization differently.");
wid.push_back(myConsoleWidget); wid.push_back(myConsoleWidget);
// PlusROM functionality
myPlusRomWidget = new CheckboxWidget(myTab, font,
myDetectedInfoWidget->getLeft(), ypos + 1,
"PlusROM support");
myPlusRomWidget->setToolTip("Enable PlusROM support");
wid.push_back(myPlusRomWidget);
ypos += lineHeight + VGAP; ypos += lineHeight + VGAP;
// Randomize items // Randomize items
@ -748,6 +755,7 @@ void DeveloperDialog::getWidgetStates(SettingsSet set)
// AtariVox/SaveKey/PlusROM access // AtariVox/SaveKey/PlusROM access
myExternAccess[set] = myExternAccessWidget->getState(); myExternAccess[set] = myExternAccessWidget->getState();
myConsole[set] = myConsoleWidget->getSelected() == 1; myConsole[set] = myConsoleWidget->getSelected() == 1;
myPlusROM[set] = myPlusRomWidget->getState() == 1;
// Randomization // Randomization
myRandomBank[set] = myRandomBankWidget->getState(); myRandomBank[set] = myRandomBankWidget->getState();
myRandomizeTIA[set] = myRandomizeTIAWidget->getState(); myRandomizeTIA[set] = myRandomizeTIAWidget->getState();
@ -812,6 +820,7 @@ void DeveloperDialog::setWidgetStates(SettingsSet set)
// AtariVox/SaveKey/PlusROM access // AtariVox/SaveKey/PlusROM access
myExternAccessWidget->setState(myExternAccess[set]); myExternAccessWidget->setState(myExternAccess[set]);
myConsoleWidget->setSelectedIndex(myConsole[set]); myConsoleWidget->setSelectedIndex(myConsole[set]);
myPlusRomWidget->setState(myPlusROM[set]);
// Randomization // Randomization
myRandomBankWidget->setState(myRandomBank[set]); myRandomBankWidget->setState(myRandomBank[set]);
myRandomizeTIAWidget->setState(myRandomizeTIA[set]); myRandomizeTIAWidget->setState(myRandomizeTIA[set]);
@ -965,6 +974,7 @@ void DeveloperDialog::setDefaults()
// AtariVox/SaveKey/PlusROM access // AtariVox/SaveKey/PlusROM access
myExternAccess[set] = devSettings; myExternAccess[set] = devSettings;
myConsole[set] = 0; myConsole[set] = 0;
myPlusROM[set] = true;
// Randomization // Randomization
myRandomBank[set] = devSettings; myRandomBank[set] = devSettings;
myRandomizeTIA[set] = devSettings; myRandomizeTIA[set] = devSettings;
@ -1149,6 +1159,7 @@ void DeveloperDialog::handleCommand(CommandSender* sender, int cmd, int data, in
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DeveloperDialog::handleSettings(bool devSettings) void DeveloperDialog::handleSettings(bool devSettings)
{ {
myPlusRomWidget->setEnabled(devSettings);
myRandomHotspotsWidget->setEnabled(devSettings); myRandomHotspotsWidget->setEnabled(devSettings);
myUndrivenPinsWidget->setEnabled(devSettings); myUndrivenPinsWidget->setEnabled(devSettings);
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT

View File

@ -88,6 +88,7 @@ class DeveloperDialog : public Dialog, DevSettingsHandler
CheckboxWidget* myFrameStatsWidget{nullptr}; CheckboxWidget* myFrameStatsWidget{nullptr};
CheckboxWidget* myDetectedInfoWidget{nullptr}; CheckboxWidget* myDetectedInfoWidget{nullptr};
CheckboxWidget* myExternAccessWidget{nullptr}; CheckboxWidget* myExternAccessWidget{nullptr};
CheckboxWidget* myPlusRomWidget{nullptr};
PopUpWidget* myConsoleWidget{nullptr}; PopUpWidget* myConsoleWidget{nullptr};
StaticTextWidget* myLoadingROMLabel{nullptr}; StaticTextWidget* myLoadingROMLabel{nullptr};
CheckboxWidget* myRandomBankWidget{nullptr}; CheckboxWidget* myRandomBankWidget{nullptr};