diff --git a/src/common/DevSettingsHandler.cxx b/src/common/DevSettingsHandler.cxx index c33e22340..c457c16d8 100644 --- a/src/common/DevSettingsHandler.cxx +++ b/src/common/DevSettingsHandler.cxx @@ -24,6 +24,7 @@ #include "StateManager.hxx" #include "TIA.hxx" #include "Cart.hxx" +#include "CartELF.hxx" #include "DevSettingsHandler.hxx" @@ -62,7 +63,7 @@ void DevSettingsHandler::loadSettings(SettingsSet set) #endif // Thumb ARM emulation exception myThumbException[set] = devSettings ? settings.getBool("dev.thumb.trapfatal") : false; - myArmSpeed[set] = devSettings ? settings.getInt("dev.arm.mips") : 250; // TODO: use constant + myArmSpeed[set] = devSettings ? settings.getInt("dev.arm.mips") : CartridgeELF::MIPS_MAX; // TIA tab myTIAType[set] = devSettings ? settings.getString("dev.tia.type") : "standard"; diff --git a/src/emucore/CartELF.hxx b/src/emucore/CartELF.hxx index 9b3d496d5..bda7d121b 100644 --- a/src/emucore/CartELF.hxx +++ b/src/emucore/CartELF.hxx @@ -31,7 +31,8 @@ class ElfLinker; class CartridgeELF: public Cartridge { public: static constexpr uInt32 MIPS_MAX = 300; - static constexpr uInt32 MIPS_MIN = 50; + static constexpr uInt32 MIPS_MIN = 50; + static constexpr uInt32 MIPS_DEF = 150; public: CartridgeELF(const ByteBuffer& image, size_t size, string_view md5, diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index 438163620..8dd3c12eb 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -24,6 +24,7 @@ #include "PaletteHandler.hxx" #include "Joystick.hxx" #include "Paddles.hxx" +#include "CartELF.hxx" #ifdef GUI_SUPPORT #include "JitterEmulation.hxx" #endif @@ -311,7 +312,7 @@ Settings::Settings() setPermanent("dev.extaccess", "true"); // Thumb ARM emulation options setPermanent("dev.thumb.trapfatal", "true"); - setPermanent("dev.arm.mips", "150"); // TODO: use constant + setPermanent("dev.arm.mips", CartridgeELF::MIPS_DEF); #ifdef DEBUGGER_SUPPORT setPermanent("dev.thumb.inccycles", "true"); setPermanent("dev.thumb.cyclefactor", "1.05"); diff --git a/src/gui/DeveloperDialog.cxx b/src/gui/DeveloperDialog.cxx index 365486a33..282a62726 100644 --- a/src/gui/DeveloperDialog.cxx +++ b/src/gui/DeveloperDialog.cxx @@ -229,9 +229,9 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font) myArmSpeedWidget = new SliderWidget(myTab, font, HBORDER + INDENT * 1, ypos - 1, fontWidth * 10, lineHeight, "Limit ARM speed (*) ", 0, kArmSpeedChanged, fontWidth * 9, " MIPS"); - myArmSpeedWidget->setMinValue(CartridgeELF::MIPS_MIN); // TODO: use constant - myArmSpeedWidget->setMaxValue(CartridgeELF::MIPS_MAX); // TODO: use constant - myArmSpeedWidget->setTickmarkIntervals(4); + myArmSpeedWidget->setMinValue(CartridgeELF::MIPS_MIN); + myArmSpeedWidget->setMaxValue(CartridgeELF::MIPS_MAX); + myArmSpeedWidget->setTickmarkIntervals((CartridgeELF::MIPS_MAX - CartridgeELF::MIPS_MIN) / 50); myArmSpeedWidget->setStepValue(2); myArmSpeedWidget->setToolTip("Limit emulation speed to simulate ARM CPU used for ELF."); wid.push_back(myArmSpeedWidget); @@ -959,7 +959,7 @@ void DeveloperDialog::setDefaults() #endif // Thumb ARM emulation exception myThumbException[set] = devSettings; - myArmSpeed[set] = devSettings ? 150 : 250; + myArmSpeed[set] = devSettings ? CartridgeELF::MIPS_DEF : CartridgeELF::MIPS_MAX; setWidgetStates(set); break;