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
===========================================================================
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)
* Enhanced ROM launcher to allow multiple images per ROM.

View File

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

View File

@ -149,6 +149,13 @@ class Cartridge : public Device
*/
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
*/

View File

@ -272,6 +272,14 @@ class CartridgeCDF : public CartridgeARM
*/
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:
static constexpr uInt8 COMMSTREAM = 0x20, JUMPSTREAM_BASE = 0x21;
static constexpr uInt16 LDAXY_OVERRIDE_INACTIVE = 0xFFFF;

View File

@ -157,6 +157,13 @@ class CartridgeDPCPlus : public CartridgeARM
*/
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
/**
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(); }
/**
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
*/

View File

@ -194,6 +194,13 @@ class CartridgeEnhanced : public Cartridge
*/
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
*/
@ -339,7 +346,7 @@ class CartridgeEnhanced : public Cartridge
*/
uInt16 ramAddressSegmentOffset(uInt16 address) const {
return static_cast<uInt16>(
(myCurrentSegOffset[((address & ROM_MASK) >> myBankShift) % myBankSegs] - mySize)
(myCurrentSegOffset[((address & ROM_MASK) >> myBankShift) % myBankSegs] - mySize)
>> (myBankShift - myRamBankShift));
}

View File

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

View File

@ -18,13 +18,12 @@
#ifndef PLUSROM_HXX
#define PLUSROM_HXX
class Settings;
#include <deque>
#include "bspf.hxx"
#include "Serializable.hxx"
#include "Cart.hxx"
#include "Settings.hxx"
/**
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
*/
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).
@ -175,6 +185,7 @@ class PlusROM : public Serializable
const Cartridge& myCart;
bool myIsPlusROM{false};
bool myIsEnabled{true};
string myHost;
string myPath;

View File

@ -313,6 +313,7 @@ Settings::Settings()
setPermanent("dev.tm.horizon", "30s"); // = ~30 seconds
setPermanent("dev.detectedinfo", "true");
setPermanent("dev.extaccess", "true");
setPermanent("dev.plusroms.on", "true");
// Thumb ARM emulation options
setPermanent("dev.thumb.trapfatal", "true");
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"
#endif
<< " -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"
<< " koolaidman|\n"
<< " cosmicark|pesco|\n"

View File

@ -129,7 +129,7 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
// AtariVox/SaveKey/PlusROM access
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"
"AtariVox/SaveKey EEPROM, PlusROM, Supercharger...).");
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"
"page RAM initialization differently.");
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;
// Randomize items
@ -748,6 +755,7 @@ void DeveloperDialog::getWidgetStates(SettingsSet set)
// AtariVox/SaveKey/PlusROM access
myExternAccess[set] = myExternAccessWidget->getState();
myConsole[set] = myConsoleWidget->getSelected() == 1;
myPlusROM[set] = myPlusRomWidget->getState() == 1;
// Randomization
myRandomBank[set] = myRandomBankWidget->getState();
myRandomizeTIA[set] = myRandomizeTIAWidget->getState();
@ -812,6 +820,7 @@ void DeveloperDialog::setWidgetStates(SettingsSet set)
// AtariVox/SaveKey/PlusROM access
myExternAccessWidget->setState(myExternAccess[set]);
myConsoleWidget->setSelectedIndex(myConsole[set]);
myPlusRomWidget->setState(myPlusROM[set]);
// Randomization
myRandomBankWidget->setState(myRandomBank[set]);
myRandomizeTIAWidget->setState(myRandomizeTIA[set]);
@ -965,6 +974,7 @@ void DeveloperDialog::setDefaults()
// AtariVox/SaveKey/PlusROM access
myExternAccess[set] = devSettings;
myConsole[set] = 0;
myPlusROM[set] = true;
// Randomization
myRandomBank[set] = devSettings;
myRandomizeTIA[set] = devSettings;
@ -1149,6 +1159,7 @@ void DeveloperDialog::handleCommand(CommandSender* sender, int cmd, int data, in
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void DeveloperDialog::handleSettings(bool devSettings)
{
myPlusRomWidget->setEnabled(devSettings);
myRandomHotspotsWidget->setEnabled(devSettings);
myUndrivenPinsWidget->setEnabled(devSettings);
#ifdef DEBUGGER_SUPPORT

View File

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