Disable 'jitter' effect in older DPC+ driver versions (fixes #429).

This commit is contained in:
Stephen Anthony 2019-04-21 21:56:54 -02:30
parent 94507a9444
commit 7b2ca28306
4 changed files with 27 additions and 3 deletions

View File

@ -59,6 +59,10 @@
* Fixed 'Dancing Plate (Unknown) (PAL)' to use joystick. * Fixed 'Dancing Plate (Unknown) (PAL)' to use joystick.
* Allow the DPC+ scheme to not enable 'jitter' effect for certain older
DPC+ driver versions; this allows 'Epic Adventure' ROM to finally
work in Stella.
* PNG image support is now conditionally compiled into Stella. All * PNG image support is now conditionally compiled into Stella. All
major ports (Linux/macOS/Windows) have it enabled by default. major ports (Linux/macOS/Windows) have it enabled by default.

View File

@ -27,7 +27,7 @@
#include "StateManager.hxx" #include "StateManager.hxx"
#define STATE_HEADER "06000002state" #define STATE_HEADER "06000003state"
// #define MOVIE_HEADER "03030000movie" // #define MOVIE_HEADER "03030000movie"
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -18,6 +18,7 @@
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT
#include "Debugger.hxx" #include "Debugger.hxx"
#endif #endif
#include "MD5.hxx"
#include "System.hxx" #include "System.hxx"
#include "Thumbulator.hxx" #include "Thumbulator.hxx"
#include "CartDPCPlus.hxx" #include "CartDPCPlus.hxx"
@ -35,7 +36,8 @@ CartridgeDPCPlus::CartridgeDPCPlus(const BytePtr& image, uInt32 size,
myAudioCycles(0), myAudioCycles(0),
myARMCycles(0), myARMCycles(0),
myFractionalClocks(0.0), myFractionalClocks(0.0),
myBankOffset(0) myBankOffset(0),
myJitterEnabled(true)
{ {
// Image is always 32K, but in the case of ROM > 29K, the image is // Image is always 32K, but in the case of ROM > 29K, the image is
// copied to the end of the buffer // copied to the end of the buffer
@ -63,6 +65,11 @@ CartridgeDPCPlus::CartridgeDPCPlus(const BytePtr& image, uInt32 size,
Thumbulator::ConfigureFor::DPCplus, Thumbulator::ConfigureFor::DPCplus,
this); this);
// Disable jitter on certain DPC+ driver versions
string driverMD5;
driverMD5 = MD5::hash(image, 3*1024);
myJitterEnabled = driverMD5 != "8dd73b44fd11c488326ce507cbeb19d1";
setInitialState(); setInitialState();
} }
@ -398,7 +405,8 @@ bool CartridgeDPCPlus::poke(uInt16 address, uInt8 value)
{ {
//DFxFRACLOW - fractional data pointer low byte //DFxFRACLOW - fractional data pointer low byte
case 0x00: case 0x00:
myFractionalCounters[index] = (myFractionalCounters[index] & 0x0F00FF) | (uInt16(value) << 8); myFractionalCounters[index] =
(myFractionalCounters[index] & (myJitterEnabled ? 0x0F00FF : 0x0F0000)) | (uInt16(value) << 8);
break; break;
// DFxFRACHI - fractional data pointer high byte // DFxFRACHI - fractional data pointer high byte
@ -677,6 +685,9 @@ bool CartridgeDPCPlus::save(Serializer& out) const
// Clock info for Thumbulator // Clock info for Thumbulator
out.putLong(myARMCycles); out.putLong(myARMCycles);
// Jitter effect
out.putBool(myJitterEnabled);
} }
catch(...) catch(...)
{ {
@ -738,6 +749,9 @@ bool CartridgeDPCPlus::load(Serializer& in)
// Clock info for Thumbulator // Clock info for Thumbulator
myARMCycles = in.getLong(); myARMCycles = in.getLong();
// Jitter effect
myJitterEnabled = in.getBool();
} }
catch(...) catch(...)
{ {

View File

@ -270,6 +270,12 @@ class CartridgeDPCPlus : public Cartridge
// Indicates the offset into the ROM image (aligns to current bank) // Indicates the offset into the ROM image (aligns to current bank)
uInt16 myBankOffset; uInt16 myBankOffset;
// Indicates whether 'jitter' should be emulated
// This is the default option, and should always be enabled
// However, certain ROMs were released with older DPC+ ARM drivers,
// before the scheme was finalized; this allows those ROMs to run
bool myJitterEnabled;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported
CartridgeDPCPlus() = delete; CartridgeDPCPlus() = delete;