Added new and changed existing ARM developer options

TODO: doc
This commit is contained in:
thrust26 2024-08-10 15:50:15 +02:00
parent b45eb6247d
commit a222da34ea
5 changed files with 43 additions and 18 deletions

View File

@ -42,6 +42,8 @@ void DevSettingsHandler::loadSettings(SettingsSet set)
myFrameStats[set] = settings.getBool(prefix + "stats"); myFrameStats[set] = settings.getBool(prefix + "stats");
myDetectedInfo[set] = settings.getBool(prefix + "detectedinfo"); myDetectedInfo[set] = settings.getBool(prefix + "detectedinfo");
// AtariVox/SaveKey/PlusROM access
myExternAccess[set] = settings.getBool(prefix + "extaccess");
myConsole[set] = settings.getString(prefix + "console") == "7800" ? 1 : 0; myConsole[set] = settings.getString(prefix + "console") == "7800" ? 1 : 0;
// Randomization // Randomization
myRandomBank[set] = settings.getBool(prefix + "bankrandom"); myRandomBank[set] = settings.getBool(prefix + "bankrandom");
@ -60,8 +62,7 @@ void DevSettingsHandler::loadSettings(SettingsSet set)
#endif #endif
// Thumb ARM emulation exception // Thumb ARM emulation exception
myThumbException[set] = devSettings ? settings.getBool("dev.thumb.trapfatal") : false; myThumbException[set] = devSettings ? settings.getBool("dev.thumb.trapfatal") : false;
// AtariVox/SaveKey/PlusROM access myArmCycles[set] = devSettings ? settings.getInt("dev.arm.mips") : 250; // TODO: use constant
myExternAccess[set] = settings.getBool(prefix + "extaccess");
// TIA tab // TIA tab
myTIAType[set] = devSettings ? settings.getString("dev.tia.type") : "standard"; myTIAType[set] = devSettings ? settings.getString("dev.tia.type") : "standard";

View File

@ -67,6 +67,7 @@ class DevSettingsHandler
std::array<bool, numSets> myWRPortBreak; std::array<bool, numSets> myWRPortBreak;
#endif #endif
std::array<bool, numSets> myThumbException; std::array<bool, numSets> myThumbException;
std::array<int, numSets> myArmCycles;
// TIA sets // TIA sets
std::array<string, numSets> myTIAType; std::array<string, numSets> myTIAType;
std::array<bool, numSets> myPlInvPhase; std::array<bool, numSets> myPlInvPhase;

View File

@ -311,6 +311,7 @@ Settings::Settings()
setPermanent("dev.extaccess", "true"); setPermanent("dev.extaccess", "true");
// Thumb ARM emulation options // Thumb ARM emulation options
setPermanent("dev.thumb.trapfatal", "true"); setPermanent("dev.thumb.trapfatal", "true");
setPermanent("dev.arm.mips", "150"); // TODO: use constant
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT
setPermanent("dev.thumb.inccycles", "true"); setPermanent("dev.thumb.inccycles", "true");
setPermanent("dev.thumb.cyclefactor", "1.05"); setPermanent("dev.thumb.cyclefactor", "1.05");
@ -794,6 +795,7 @@ void Settings::usage()
#endif #endif
<< " -dev.thumb.trapfatal <1|0> Determines whether errors in ARM emulation\n" << " -dev.thumb.trapfatal <1|0> Determines whether errors in ARM emulation\n"
<< " throw an exception\n" << " throw an exception\n"
<< " -dev.arm.mips <number> Limit emulation speed to simulate ARM CPU used.\n"
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT
<< " -dev.thumb.inccycles <1|0> Determines whether ARM emulation cycles\n" << " -dev.thumb.inccycles <1|0> Determines whether ARM emulation cycles\n"
<< " increase system cycles\n" << " increase system cycles\n"

View File

@ -55,7 +55,7 @@ DeveloperDialog::DeveloperDialog(OSystem& osystem, DialogContainer& parent,
VGAP = Dialog::vGap(); VGAP = Dialog::vGap();
// Set real dimensions // Set real dimensions
setSize(53 * fontWidth + HBORDER * 2, setSize(61 * fontWidth + HBORDER * 2,
_th + VGAP * 3 + lineHeight + 14 * (lineHeight + VGAP) + buttonHeight + VBORDER * 3, _th + VGAP * 3 + lineHeight + 14 * (lineHeight + VGAP) + buttonHeight + VBORDER * 3,
max_w, max_h); max_w, max_h);
@ -198,27 +198,40 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font)
ypos += lineHeight + VGAP; ypos += lineHeight + VGAP;
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT
myRWPortBreakWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, myPortBreakLabel = new StaticTextWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, "Break on:");
"Break on reads from write ports"); myRWPortBreakWidget = new CheckboxWidget(myTab, font, myPortBreakLabel->getRight() + fontWidth * 1, ypos + 1,
"Reads from write ports");
myRWPortBreakWidget->setToolTip("Cause reads from write ports to interrupt\n" myRWPortBreakWidget->setToolTip("Cause reads from write ports to interrupt\n"
"emulation and enter debugger."); "emulation and enter debugger.");
wid.push_back(myRWPortBreakWidget); wid.push_back(myRWPortBreakWidget);
ypos += lineHeight + VGAP; //ypos += lineHeight + VGAP;
myWRPortBreakWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, myWRPortBreakWidget = new CheckboxWidget(myTab, font, myRWPortBreakWidget->getRight() + fontWidth * 2, ypos + 1,
"Break on writes to read ports"); "Writes to read ports");
myWRPortBreakWidget->setToolTip("Cause writes to read ports to interrupt\n" myWRPortBreakWidget->setToolTip("Cause writes to read ports to interrupt\n"
"emulation and enter debugger."); "emulation and enter debugger.");
wid.push_back(myWRPortBreakWidget); wid.push_back(myWRPortBreakWidget);
ypos += lineHeight + VGAP; ypos += lineHeight + VGAP;
#endif
#endif
// Thumb ARM emulation exception // Thumb ARM emulation exception
myThumbExceptionWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, myThumbExceptionWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1,
"Fatal ARM emulation error throws exception"); "Strict ARM emulation");
myThumbExceptionWidget->setToolTip("Cause Thumb ARM emulation to throw exceptions\n" myThumbExceptionWidget->setToolTip("Strict checking for exceptions and suspicious program\n"
"on fatal errors and enter the debugger."); "behaviour in ARM emulation.\n"
"Interrupts emulation and enters debugger in such cases.");
wid.push_back(myThumbExceptionWidget); wid.push_back(myThumbExceptionWidget);
ypos += lineHeight + VGAP;
myArmSpeedWidget = new SliderWidget(myTab, font, HBORDER + INDENT * 1, ypos - 1,
fontWidth * 10, lineHeight, "Limit ARM speed ",
0, kArmSpeedChanged, fontWidth * 10, " cycles");
myArmSpeedWidget->setMinValue(50); // TODO: use constant
myArmSpeedWidget->setMaxValue(250); // TODO: use constant
myArmSpeedWidget->setTickmarkIntervals(4);
myArmSpeedWidget->setStepValue(2);
myArmSpeedWidget->setToolTip("Limit emulation speed to simulate ARM CPU used.");
wid.push_back(myArmSpeedWidget);
// Add items for tab 0 // Add items for tab 0
addToFocusList(wid, myTab, tabID); addToFocusList(wid, myTab, tabID);
@ -385,7 +398,7 @@ void DeveloperDialog::addVideoTab(const GUI::Font& font)
myTVJitterSenseWidget = new SliderWidget(myTab, font, myTVJitterSenseWidget = new SliderWidget(myTab, font,
myTVJitterWidget->getLeft() + CheckboxWidget::prefixSize(font), ypos - 1, myTVJitterWidget->getLeft() + CheckboxWidget::prefixSize(font), ypos - 1,
fontWidth * 9, lineHeight, fontWidth * 10, lineHeight,
"Sensitivity ", 0, 0, fontWidth * 2); "Sensitivity ", 0, 0, fontWidth * 2);
myTVJitterSenseWidget->setMinValue(JitterEmulation::MIN_SENSITIVITY); myTVJitterSenseWidget->setMinValue(JitterEmulation::MIN_SENSITIVITY);
myTVJitterSenseWidget->setMaxValue(JitterEmulation::MAX_SENSITIVITY); myTVJitterSenseWidget->setMaxValue(JitterEmulation::MAX_SENSITIVITY);
@ -396,7 +409,7 @@ void DeveloperDialog::addVideoTab(const GUI::Font& font)
myTVJitterRecWidget = new SliderWidget(myTab, font, myTVJitterRecWidget = new SliderWidget(myTab, font,
myTVJitterSenseWidget->getRight() + fontWidth * 2, ypos - 1, myTVJitterSenseWidget->getRight() + fontWidth * 2, ypos - 1,
fontWidth * 9, lineHeight, fontWidth * 10, lineHeight,
"Recovery ", 0, 0, fontWidth * 2); "Recovery ", 0, 0, fontWidth * 2);
myTVJitterRecWidget->setMinValue(JitterEmulation::MIN_RECOVERY); myTVJitterRecWidget->setMinValue(JitterEmulation::MIN_RECOVERY);
myTVJitterRecWidget->setMaxValue(JitterEmulation::MAX_RECOVERY); myTVJitterRecWidget->setMaxValue(JitterEmulation::MAX_RECOVERY);
@ -705,6 +718,8 @@ void DeveloperDialog::getWidgetStates(SettingsSet set)
{ {
myFrameStats[set] = myFrameStatsWidget->getState(); myFrameStats[set] = myFrameStatsWidget->getState();
myDetectedInfo[set] = myDetectedInfoWidget->getState(); myDetectedInfo[set] = myDetectedInfoWidget->getState();
// AtariVox/SaveKey/PlusROM access
myExternAccess[set] = myExternAccessWidget->getState();
myConsole[set] = myConsoleWidget->getSelected() == 1; myConsole[set] = myConsoleWidget->getSelected() == 1;
// Randomization // Randomization
myRandomBank[set] = myRandomBankWidget->getState(); myRandomBank[set] = myRandomBankWidget->getState();
@ -728,8 +743,7 @@ void DeveloperDialog::getWidgetStates(SettingsSet set)
#endif #endif
// Thumb ARM emulation exception // Thumb ARM emulation exception
myThumbException[set] = myThumbExceptionWidget->getState(); myThumbException[set] = myThumbExceptionWidget->getState();
// AtariVox/SaveKey/PlusROM access myArmCycles[set] = myArmSpeedWidget->getValue();
myExternAccess[set] = myExternAccessWidget->getState();
// TIA tab // TIA tab
myTIAType[set] = myTIATypeWidget->getSelectedTag().toString(); myTIAType[set] = myTIATypeWidget->getSelectedTag().toString();
@ -765,6 +779,8 @@ void DeveloperDialog::setWidgetStates(SettingsSet set)
{ {
myFrameStatsWidget->setState(myFrameStats[set]); myFrameStatsWidget->setState(myFrameStats[set]);
myDetectedInfoWidget->setState(myDetectedInfo[set]); myDetectedInfoWidget->setState(myDetectedInfo[set]);
// AtariVox/SaveKey/PlusROM access
myExternAccessWidget->setState(myExternAccess[set]);
myConsoleWidget->setSelectedIndex(myConsole[set]); myConsoleWidget->setSelectedIndex(myConsole[set]);
// Randomization // Randomization
myRandomBankWidget->setState(myRandomBank[set]); myRandomBankWidget->setState(myRandomBank[set]);
@ -787,8 +803,7 @@ void DeveloperDialog::setWidgetStates(SettingsSet set)
#endif #endif
// Thumb ARM emulation exception // Thumb ARM emulation exception
myThumbExceptionWidget->setState(myThumbException[set]); myThumbExceptionWidget->setState(myThumbException[set]);
// AtariVox/SaveKey/PlusROM access myArmSpeedWidget->setValue(myArmCycles[set]);
myExternAccessWidget->setState(myExternAccess[set]);
handleConsole(); handleConsole();
// TIA tab // TIA tab
@ -936,6 +951,7 @@ void DeveloperDialog::setDefaults()
#endif #endif
// Thumb ARM emulation exception // Thumb ARM emulation exception
myThumbException[set] = devSettings; myThumbException[set] = devSettings;
myArmCycles[set] = devSettings ? 150 : 250;
setWidgetStates(set); setWidgetStates(set);
break; break;
@ -1106,10 +1122,12 @@ void DeveloperDialog::handleSettings(bool devSettings)
myRandomHotspotsWidget->setEnabled(devSettings); myRandomHotspotsWidget->setEnabled(devSettings);
myUndrivenPinsWidget->setEnabled(devSettings); myUndrivenPinsWidget->setEnabled(devSettings);
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT
myPortBreakLabel->setEnabled(devSettings);
myRWPortBreakWidget->setEnabled(devSettings); myRWPortBreakWidget->setEnabled(devSettings);
myWRPortBreakWidget->setEnabled(devSettings); myWRPortBreakWidget->setEnabled(devSettings);
#endif #endif
myThumbExceptionWidget->setEnabled(devSettings); myThumbExceptionWidget->setEnabled(devSettings);
myArmSpeedWidget->setEnabled(devSettings);
if (mySettings != devSettings) if (mySettings != devSettings)
{ {

View File

@ -57,6 +57,7 @@ class DeveloperDialog : public Dialog, DevSettingsHandler
kPlrSettings = 'DVpl', kPlrSettings = 'DVpl',
kDevSettings = 'DVdv', kDevSettings = 'DVdv',
kConsole = 'DVco', kConsole = 'DVco',
kArmSpeedChanged = 'DVas',
kTIAType = 'DVtt', kTIAType = 'DVtt',
kTVJitter = 'DVjt', kTVJitter = 'DVjt',
kTimeMachine = 'DTtm', kTimeMachine = 'DTtm',
@ -97,10 +98,12 @@ class DeveloperDialog : public Dialog, DevSettingsHandler
CheckboxWidget* myRandomHotspotsWidget{nullptr}; CheckboxWidget* myRandomHotspotsWidget{nullptr};
CheckboxWidget* myUndrivenPinsWidget{nullptr}; CheckboxWidget* myUndrivenPinsWidget{nullptr};
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT
StaticTextWidget* myPortBreakLabel{nullptr};
CheckboxWidget* myRWPortBreakWidget{nullptr}; CheckboxWidget* myRWPortBreakWidget{nullptr};
CheckboxWidget* myWRPortBreakWidget{nullptr}; CheckboxWidget* myWRPortBreakWidget{nullptr};
#endif #endif
CheckboxWidget* myThumbExceptionWidget{nullptr}; CheckboxWidget* myThumbExceptionWidget{nullptr};
SliderWidget* myArmSpeedWidget{nullptr};
// TIA widgets // TIA widgets
RadioButtonGroup* mySettingsGroupTia{nullptr}; RadioButtonGroup* mySettingsGroupTia{nullptr};