diff --git a/configure b/configure index 169657f2b..a1ecfb1ae 100755 --- a/configure +++ b/configure @@ -22,7 +22,6 @@ _build_sound=yes _build_debugger=yes _build_joystick=yes _build_cheats=yes -_build_thumb=yes _build_static=no _build_profile=no @@ -198,8 +197,6 @@ Optional Features: --disable-joystick --enable-cheats enable/disable cheatcode support [enabled] --disable-cheats - --enable-thumb enable/disable Thumb ARM support [enabled] - --disable-thumb --enable-windowed enable/disable windowed rendering modes [enabled] --disable-windowed --enable-shared build shared binary [enabled] @@ -239,8 +236,6 @@ for ac_option in $@; do --disable-cheats) _build_cheats=no ;; --enable-windowed) _build_windowed=yes ;; --disable-windowed) _build_windowed=no ;; - --enable-thumb) _build_thumb=yes ;; - --disable-thumb) _build_thumb=no ;; --enable-shared) _build_static=no ;; --enable-static) _build_static=yes ;; --disable-static) _build_static=no ;; @@ -660,14 +655,6 @@ else echo fi -if test "$_build_thumb" = yes ; then - echo_n " Thumb ARM emulation support enabled" - echo -else - echo_n " Thumb ARM emulation support disabled" - echo -fi - if test "$_build_static" = yes ; then echo_n " Static binary enabled" echo @@ -779,10 +766,6 @@ if test "$_build_cheats" = yes ; then INCLUDES="$INCLUDES -I$CHEAT" fi -if test "$_build_thumb" = yes ; then - DEFINES="$DEFINES -DTHUMB_SUPPORT" -fi - if test "$_build_profile" = no ; then _build_profile= fi diff --git a/src/common/LinkedObjectPool.hxx b/src/common/LinkedObjectPool.hxx index 17f320fcf..f10bd22e9 100644 --- a/src/common/LinkedObjectPool.hxx +++ b/src/common/LinkedObjectPool.hxx @@ -55,6 +55,7 @@ class LinkedObjectPool public: using iter = typename std::list::iterator; using const_iter = typename std::list::const_iterator; + using size_type = typename std::list::size_type; /* Create a pool of size CAPACITY; the active list starts out empty. @@ -200,7 +201,7 @@ class LinkedObjectPool #endif uInt32 capacity() const { return CAPACITY; } - uInt32 size() const { return myList.size(); } + size_type size() const { return myList.size(); } bool empty() const { return myList.size() == 0; } bool full() const { return myList.size() >= CAPACITY; } diff --git a/src/common/RewindManager.cxx b/src/common/RewindManager.cxx index 6527aff04..1b2841a83 100644 --- a/src/common/RewindManager.cxx +++ b/src/common/RewindManager.cxx @@ -126,9 +126,9 @@ void RewindManager::compressStates() uInt64 lastCycle = currentCycle; double expectedCycles = 76 * 262.0; // == cycles of 1 frame, TODO: use actual number of scanlines double maxDelta = 0; - uInt32 removeIdx = 0; + size_type removeIdx = 0; - uInt32 idx = myStateList.size() - 1; + size_type idx = myStateList.size() - 1; for(auto it = myStateList.last(); it != myStateList.first(); --it) { cerr << *it << endl << endl; // debug code diff --git a/src/common/RewindManager.hxx b/src/common/RewindManager.hxx index 295fe6799..17740d159 100644 --- a/src/common/RewindManager.hxx +++ b/src/common/RewindManager.hxx @@ -99,6 +99,8 @@ class RewindManager } }; + using size_type = Common::LinkedObjectPool::size_type; + // The linked-list to store states (internally it takes care of reducing // frequent (de)-allocations) Common::LinkedObjectPool myStateList; diff --git a/src/emucore/CartBUS.cxx b/src/emucore/CartBUS.cxx index 1facde3de..355be4da4 100644 --- a/src/emucore/CartBUS.cxx +++ b/src/emucore/CartBUS.cxx @@ -63,12 +63,12 @@ CartridgeBUS::CartridgeBUS(const BytePtr& image, uInt32 size, // Pointer to the display RAM myDisplayImage = myBUSRAM + DSRAM; -#ifdef THUMB_SUPPORT // Create Thumbulator ARM emulator myThumbEmulator = make_unique( reinterpret_cast(myImage), reinterpret_cast(myBUSRAM), - settings.getBool("thumb.trapfatal"), Thumbulator::ConfigureFor::BUS, this); -#endif + settings.getBool("thumb.trapfatal"), Thumbulator::ConfigureFor::BUS, this + ); + setInitialState(); } @@ -107,9 +107,7 @@ void CartridgeBUS::setInitialState() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeBUS::consoleChanged(ConsoleTiming timing) { -#ifdef THUMB_SUPPORT myThumbEmulator->setConsoleTiming(timing); -#endif } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -154,8 +152,7 @@ inline void CartridgeBUS::callFunction(uInt8 value) { switch (value) { - #ifdef THUMB_SUPPORT - // Call user written ARM code (will most likely be C compiled for ARM) + // Call user written ARM code (will most likely be C compiled for ARM) case 254: // call with IRQ driven audio, no special handling needed at this // time for Stella as ARM code "runs in zero 6507 cycles". case 255: // call without IRQ driven audio @@ -176,7 +173,6 @@ inline void CartridgeBUS::callFunction(uInt8 value) } } break; - #endif } } diff --git a/src/emucore/CartBUS.hxx b/src/emucore/CartBUS.hxx index cfe9503c3..b20289534 100644 --- a/src/emucore/CartBUS.hxx +++ b/src/emucore/CartBUS.hxx @@ -19,9 +19,7 @@ #define CARTRIDGE_BUS_HXX class System; -#ifdef THUMB_SUPPORT - class Thumbulator; -#endif +class Thumbulator; #ifdef DEBUGGER_SUPPORT #include "CartBUSWidget.hxx" #endif @@ -226,10 +224,8 @@ class CartridgeBUS : public Cartridge // $1800 - 2K C Variable & Stack uInt8 myBUSRAM[8192]; -#ifdef THUMB_SUPPORT // Pointer to the Thumb ARM emulator object unique_ptr myThumbEmulator; -#endif // Indicates the offset into the ROM image (aligns to current bank) uInt16 myBankOffset; diff --git a/src/emucore/CartCDF.cxx b/src/emucore/CartCDF.cxx index 308448c9a..611cba081 100644 --- a/src/emucore/CartCDF.cxx +++ b/src/emucore/CartCDF.cxx @@ -66,13 +66,12 @@ CartridgeCDF::CartridgeCDF(const BytePtr& image, uInt32 size, setVersion(); -#ifdef THUMB_SUPPORT // Create Thumbulator ARM emulator myThumbEmulator = make_unique( reinterpret_cast(myImage), reinterpret_cast(myCDFRAM), settings.getBool("thumb.trapfatal"), myVersion ? Thumbulator::ConfigureFor::CDF1 : Thumbulator::ConfigureFor::CDF, this); -#endif + setInitialState(); } @@ -112,9 +111,7 @@ void CartridgeCDF::setInitialState() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeCDF::consoleChanged(ConsoleTiming timing) { -#ifdef THUMB_SUPPORT myThumbEmulator->setConsoleTiming(timing); -#endif } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -154,7 +151,6 @@ inline void CartridgeCDF::callFunction(uInt8 value) { switch (value) { -#ifdef THUMB_SUPPORT // Call user written ARM code (will most likely be C compiled for ARM) case 254: // call with IRQ driven audio, no special handling needed at this // time for Stella as ARM code "runs in zero 6507 cycles". @@ -176,7 +172,6 @@ inline void CartridgeCDF::callFunction(uInt8 value) } } break; -#endif } } diff --git a/src/emucore/CartCDF.hxx b/src/emucore/CartCDF.hxx index 34d4e9bf9..29c25cb76 100644 --- a/src/emucore/CartCDF.hxx +++ b/src/emucore/CartCDF.hxx @@ -19,9 +19,7 @@ #define CARTRIDGE_CDF_HXX class System; -#ifdef THUMB_SUPPORT - class Thumbulator; -#endif +class Thumbulator; #ifdef DEBUGGER_SUPPORT #include "CartCDFWidget.hxx" #endif @@ -221,10 +219,8 @@ class CartridgeCDF : public Cartridge // $1800 - 2K C Variable & Stack uInt8 myCDFRAM[8192]; - #ifdef THUMB_SUPPORT // Pointer to the Thumb ARM emulator object unique_ptr myThumbEmulator; - #endif // Indicates the offset into the ROM image (aligns to current bank) uInt16 myBankOffset; diff --git a/src/emucore/CartDPCPlus.cxx b/src/emucore/CartDPCPlus.cxx index 3e6099ac1..7825916de 100644 --- a/src/emucore/CartDPCPlus.cxx +++ b/src/emucore/CartDPCPlus.cxx @@ -52,7 +52,6 @@ CartridgeDPCPlus::CartridgeDPCPlus(const BytePtr& image, uInt32 size, // Pointer to the Frequency RAM myFrequencyImage = myDisplayImage + 0x1000; -#ifdef THUMB_SUPPORT // Create Thumbulator ARM emulator myThumbEmulator = make_unique (reinterpret_cast(myImage), @@ -60,7 +59,7 @@ CartridgeDPCPlus::CartridgeDPCPlus(const BytePtr& image, uInt32 size, settings.getBool("thumb.trapfatal"), Thumbulator::ConfigureFor::DPCplus, this); -#endif + setInitialState(); // DPC+ always starts in bank 5 @@ -103,9 +102,7 @@ void CartridgeDPCPlus::setInitialState() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void CartridgeDPCPlus::consoleChanged(ConsoleTiming timing) { -#ifdef THUMB_SUPPORT myThumbEmulator->setConsoleTiming(timing); -#endif } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -177,7 +174,6 @@ inline void CartridgeDPCPlus::callFunction(uInt8 value) myDisplayImage[myCounters[myParameter[2]]+i] = myParameter[0]; myParameterPointer = 0; break; - #ifdef THUMB_SUPPORT // Call user written ARM code (most likely be C compiled for ARM) case 254: // call with IRQ driven audio, no special handling needed at this // time for Stella as ARM code "runs in zero 6507 cycles". @@ -199,7 +195,6 @@ inline void CartridgeDPCPlus::callFunction(uInt8 value) } } break; - #endif // reserved } } diff --git a/src/emucore/CartDPCPlus.hxx b/src/emucore/CartDPCPlus.hxx index 37d7ad2fe..7b9a9b745 100644 --- a/src/emucore/CartDPCPlus.hxx +++ b/src/emucore/CartDPCPlus.hxx @@ -19,9 +19,8 @@ #define CARTRIDGE_DPC_PLUS_HXX class System; -#ifdef THUMB_SUPPORT - #include "Thumbulator.hxx" -#endif + +#include "Thumbulator.hxx" #ifdef DEBUGGER_SUPPORT #include "CartDPCPlusWidget.hxx" #endif @@ -212,10 +211,8 @@ class CartridgeDPCPlus : public Cartridge // 1K Frequency Data uInt8 myDPCRAM[8192]; -#ifdef THUMB_SUPPORT // Pointer to the Thumb ARM emulator object unique_ptr myThumbEmulator; -#endif // Pointer to the 1K frequency table uInt8* myFrequencyImage; diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index 1bc5292ad..ccbd12463 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -160,10 +160,8 @@ Settings::Settings(OSystem& osystem) setInternal("plr.rewind.uncompressed", 30); setInternal("plr.rewind.interval", 4); // = 1 second setInternal("plr.rewind.horizon", 5); // = ~10 minutes -#ifdef THUMB_SUPPORT // Thumb ARM emulation options setInternal("plr.thumb.trapfatal", "false"); -#endif // developer settings setInternal("dev.settings", "false"); @@ -182,10 +180,8 @@ Settings::Settings(OSystem& osystem) setInternal("dev.rewind.uncompressed", 60); setInternal("dev.rewind.interval", 2); // = 1 frame setInternal("dev.rewind.horizon", 3); // = ~10 seconds -#ifdef THUMB_SUPPORT // Thumb ARM emulation options setInternal("dev.thumb.trapfatal", "true"); -#endif } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -585,10 +581,7 @@ void Settings::usage() const << " -dev.tv.jitter <1|0> Enable TV jitter effect\n" << " -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" - - #ifdef THUMB_SUPPORT - << " -dev.thumb.trapfatal <1|0> Determines whether errors in ARM emulation throw an exception\n" - #endif + << " -dev.thumb.trapfatal <1|0> Determines whether errors in ARM emulation throw an exception\n" << endl << std::flush; } diff --git a/src/emucore/Thumbulator.cxx b/src/emucore/Thumbulator.cxx index 554f4368b..3a175f5c9 100644 --- a/src/emucore/Thumbulator.cxx +++ b/src/emucore/Thumbulator.cxx @@ -22,8 +22,6 @@ // Code is public domain and used with the author's consent //============================================================================ -#ifdef THUMB_SUPPORT - #include "bspf.hxx" #include "Base.hxx" #include "Cart.hxx" @@ -2361,5 +2359,3 @@ int Thumbulator::reset() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - bool Thumbulator::trapOnFatal = true; - -#endif diff --git a/src/emucore/Thumbulator.hxx b/src/emucore/Thumbulator.hxx index 68ca803e8..6b9c4173d 100644 --- a/src/emucore/Thumbulator.hxx +++ b/src/emucore/Thumbulator.hxx @@ -22,8 +22,6 @@ // Code is public domain and used with the author's consent //============================================================================ -#ifdef THUMB_SUPPORT - #ifndef THUMBULATOR_HXX #define THUMBULATOR_HXX @@ -162,5 +160,3 @@ class Thumbulator }; #endif // THUMBULATOR_HXX - -#endif diff --git a/src/gui/DeveloperDialog.cxx b/src/gui/DeveloperDialog.cxx index 5b9885f48..e9d1d595c 100644 --- a/src/gui/DeveloperDialog.cxx +++ b/src/gui/DeveloperDialog.cxx @@ -147,12 +147,10 @@ void DeveloperDialog::addEmulationTab(const GUI::Font& font) wid.push_back(myUndrivenPinsWidget); ypos += lineHeight + VGAP; -#ifdef THUMB_SUPPORT // Thumb ARM emulation exception myThumbExceptionWidget = new CheckboxWidget(myTab, font, HBORDER + INDENT * 1, ypos + 1, "Fatal ARM emulation error throws exception"); wid.push_back(myThumbExceptionWidget); -#endif // Add items for tab 0 addToFocusList(wid, myTab, tabID); diff --git a/src/macosx/stella.xcodeproj/project.pbxproj b/src/macosx/stella.xcodeproj/project.pbxproj index 4fd34027f..67989e38c 100644 --- a/src/macosx/stella.xcodeproj/project.pbxproj +++ b/src/macosx/stella.xcodeproj/project.pbxproj @@ -2820,7 +2820,6 @@ DEBUGGER_SUPPORT, JOYSTICK_SUPPORT, SOUND_SUPPORT, - THUMB_SUPPORT, WINDOWED_SUPPORT, BSPF_MAC_OSX, MAC_OSX, @@ -2873,7 +2872,6 @@ DEBUGGER_SUPPORT, JOYSTICK_SUPPORT, SOUND_SUPPORT, - THUMB_SUPPORT, WINDOWED_SUPPORT, BSPF_MAC_OSX, MAC_OSX,