diff --git a/src/emucore/MT24LC256.cxx b/src/emucore/MT24LC256.cxx index 62d7e4446..80fe2f4e3 100644 --- a/src/emucore/MT24LC256.cxx +++ b/src/emucore/MT24LC256.cxx @@ -18,6 +18,9 @@ #include #include "System.hxx" + +#include "Settings.hxx" + #include "MT24LC256.hxx" #define DEBUG_EEPROM 0 @@ -250,6 +253,9 @@ void MT24LC256::jpee_data_stop() { myDataChanged = true; myPageHit[jpee_address / PAGE_SIZE] = true; + bool devSettings = mySystem.oSystem().settings().getBool("dev.settings"); + if(mySystem.oSystem().settings().getBool(devSettings ? "dev.eepromaccess" : "plr.eepromaccess")) + mySystem.oSystem().frameBuffer().showMessage("AtariVox/SaveKey EEPROM write"); myData[(jpee_address++) & jpee_sizemask] = jpee_packet[i]; if (!(jpee_address & jpee_pagemask)) break; /* Writes can't cross page boundary! */ @@ -347,6 +353,12 @@ void MT24LC256::jpee_clock_fall() } jpee_state=3; myPageHit[jpee_address / PAGE_SIZE] = true; + + { + bool devSettings = mySystem.oSystem().settings().getBool("dev.settings"); + if(mySystem.oSystem().settings().getBool(devSettings ? "dev.eepromaccess" : "plr.eepromaccess")) + mySystem.oSystem().frameBuffer().showMessage("AtariVox/SaveKey EEPROM read"); + } jpee_nb = (myData[jpee_address & jpee_sizemask] << 1) | 1; /* Fall through */ JPEE_LOG2("I2C_READ(%04X=%02X)",jpee_address,jpee_nb/2); [[fallthrough]]; diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index ac09c2478..b54c366ed 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -164,6 +164,7 @@ Settings::Settings(OSystem& osystem) setInternal("plr.tm.horizon", "10m"); // = ~10 minutes // Thumb ARM emulation options setInternal("plr.thumb.trapfatal", "false"); + setInternal("plr.eepromaccess", "false"); // developer settings setInternal("dev.settings", "false"); @@ -184,6 +185,7 @@ Settings::Settings(OSystem& osystem) setInternal("dev.tm.horizon", "10s"); // = ~10 seconds // Thumb ARM emulation options setInternal("dev.thumb.trapfatal", "true"); + setInternal("dev.eepromaccess", "true"); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -574,6 +576,7 @@ void Settings::usage() const << " -plr.tv.jitter_recovery <1-20> Set recovery time for TV jitter effect\n" << " -plr.tiadriven <1|0> Drive unused TIA pins randomly on a read/peek\n" << " -plr.thumb.trapfatal <1|0> Determines whether errors in ARM emulation throw an exception\n" + << " -plr.eepromaccess <1|0> Enable messages for AtariVox/SaveKey access messages\n" << endl << " The same parameters but for developer settings mode\n" << " -dev.stats <1|0> Overlay console info during emulation\n" @@ -587,6 +590,7 @@ void Settings::usage() const << " -dev.tv.jitter_recovery <1-20> Set recovery time for TV jitter effect\n" << " -dev.tiadriven <1|0> Drive unused TIA pins randomly on a read/peek\n" << " -dev.thumb.trapfatal <1|0> Determines whether errors in ARM emulation throw an exception\n" + << " -dev.eepromaccess <1|0> Enable messages for AtariVox/SaveKey access messages\n" << endl << std::flush; } diff --git a/src/emucore/System.hxx b/src/emucore/System.hxx index b9dd5ee3b..de6e354df 100644 --- a/src/emucore/System.hxx +++ b/src/emucore/System.hxx @@ -88,6 +88,13 @@ class System : public Serializable void reset(bool autodetect = false); public: + /** + Answer the OSystem attached to the system. + + @return The attached OSystem + */ + const OSystem& oSystem() const { return myOSystem; } + /** Answer the 6502 microprocessor attached to the system. If a processor has not been attached calling this function will fail. diff --git a/src/gui/DeveloperDialog.cxx b/src/gui/DeveloperDialog.cxx index b19a7ebcb..cc5189061 100644 --- a/src/gui/DeveloperDialog.cxx +++ b/src/gui/DeveloperDialog.cxx @@ -83,7 +83,7 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font) int lineHeight = font.getLineHeight(); WidgetArray wid; VariantList items; - int tabID = myTab->addTab(" Emulation "); + int tabID = myTab->addTab("Emulation"); // settings set mySettingsGroup0 = new RadioButtonGroup(); @@ -154,6 +154,12 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font) myThumbExceptionWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, "Fatal ARM emulation error throws exception"); wid.push_back(myThumbExceptionWidget); + ypos += lineHeight + VGAP; + + // AtariVox/SaveKey EEPROM access + myEEPROMAccessWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, + "Display AtariVox/SaveKey EEPROM R/W access"); + wid.push_back(myEEPROMAccessWidget); // Add items for tab 0 addToFocusList(wid, myTab, tabID); @@ -510,6 +516,8 @@ void DeveloperDialog::loadSettings(SettingsSet set) myUndrivenPins[set] = instance().settings().getBool(prefix + "tiadriven"); // Thumb ARM emulation exception myThumbException[set] = instance().settings().getBool(prefix + "thumb.trapfatal"); + // AtariVox/SaveKey EEPROM access + myEEPROMAccess[set] = instance().settings().getBool(prefix + "eepromaccess"); // Debug colors myDebugColors[set] = instance().settings().getBool(prefix + "debugcolors"); @@ -542,6 +550,8 @@ void DeveloperDialog::saveSettings(SettingsSet set) instance().settings().setValue(prefix + "tiadriven", myUndrivenPins[set]); // Thumb ARM emulation exception instance().settings().setValue(prefix + "thumb.trapfatal", myThumbException[set]); + // AtariVox/SaveKey EEPROM access + instance().settings().setValue(prefix + "eepromaccess", myEEPROMAccess[set]); // Debug colors instance().settings().setValue(prefix + "debugcolors", myDebugColors[set]); @@ -577,6 +587,8 @@ void DeveloperDialog::getWidgetStates(SettingsSet set) myUndrivenPins[set] = myUndrivenPinsWidget->getState(); // Thumb ARM emulation exception myThumbException[set] = myThumbExceptionWidget->getState(); + // AtariVox/SaveKey EEPROM access + myEEPROMAccess[set] = myEEPROMAccessWidget->getState(); // Debug colors myDebugColors[set] = myDebugColorsWidget->getState(); @@ -612,6 +624,8 @@ void DeveloperDialog::setWidgetStates(SettingsSet set) myUndrivenPinsWidget->setState(myUndrivenPins[set]); // Thumb ARM emulation exception myThumbExceptionWidget->setState(myThumbException[set]); + // AtariVox/SaveKey EEPROM access + myEEPROMAccessWidget->setState(myEEPROMAccess[set]); handleConsole(); @@ -760,6 +774,8 @@ void DeveloperDialog::setDefaults() myUndrivenPins[set] = devSettings ? true : false; // Thumb ARM emulation exception myThumbException[set] = devSettings ? true : false; + // AtariVox/SaveKey EEPROM access + myEEPROMAccess[set] = devSettings ? true : false; setWidgetStates(set); break; diff --git a/src/gui/DeveloperDialog.hxx b/src/gui/DeveloperDialog.hxx index 27577b89f..794819caf 100644 --- a/src/gui/DeveloperDialog.hxx +++ b/src/gui/DeveloperDialog.hxx @@ -105,6 +105,7 @@ class DeveloperDialog : public Dialog CheckboxWidget* myRandomizeCPUWidget[5]; CheckboxWidget* myUndrivenPinsWidget; CheckboxWidget* myThumbExceptionWidget; + CheckboxWidget* myEEPROMAccessWidget; // Video widgets RadioButtonGroup* mySettingsGroup1; @@ -150,6 +151,7 @@ class DeveloperDialog : public Dialog bool myDebugColors[2]; bool myUndrivenPins[2]; bool myThumbException[2]; + bool myEEPROMAccess[2]; // States sets bool myTimeMachine[2]; int myStateSize[2];