Refactor DPC+ code wrt 'jitter'. The code and commenting now properly indicates that it is

a difference in mask values, and not actually jitter (TV 'jitter' effect is actually something else,
and is not causing the screen shaking here).
This commit is contained in:
Stephen Anthony 2019-04-24 17:11:37 -02:30
parent 681c8156bd
commit ea89ef01b4
4 changed files with 19 additions and 24 deletions

View File

@ -63,12 +63,12 @@
* 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 * Allow the DPC+ scheme to not enable playfield 'jitter' effect for
DPC+ driver versions; this allows 'Epic Adventure' ROM to finally certain older DPC+ driver versions; this allows 'Epic Adventure' ROM
work in Stella. to finally work in Stella.
* PNG image support is now conditionally compiled into Stella. All * PNG/ZIP image support is now conditionally compiled into Stella.
major ports (Linux/macOS/Windows) have it enabled by default. All major ports (Linux/macOS/Windows) have it enabled by default.
-Have fun! -Have fun!

View File

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

View File

@ -37,7 +37,7 @@ CartridgeDPCPlus::CartridgeDPCPlus(const BytePtr& image, uInt32 size,
myARMCycles(0), myARMCycles(0),
myFractionalClocks(0.0), myFractionalClocks(0.0),
myBankOffset(0), myBankOffset(0),
myJitterEnabled(true) myFractionalLowMask(0x0F00FF)
{ {
// 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
@ -65,10 +65,10 @@ CartridgeDPCPlus::CartridgeDPCPlus(const BytePtr& image, uInt32 size,
Thumbulator::ConfigureFor::DPCplus, Thumbulator::ConfigureFor::DPCplus,
this); this);
// Disable jitter on certain DPC+ driver versions // Currently only one known DPC+ ARM driver exhibits a problem
string driverMD5; // with the default mask to use for DFxFRACLOW
driverMD5 = MD5::hash(image, 3*1024); if(MD5::hash(image, 3*1024) == "8dd73b44fd11c488326ce507cbeb19d1")
myJitterEnabled = driverMD5 != "8dd73b44fd11c488326ce507cbeb19d1"; myFractionalLowMask = 0x0F0000;
setInitialState(); setInitialState();
} }
@ -406,7 +406,7 @@ 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] =
(myFractionalCounters[index] & (myJitterEnabled ? 0x0F00FF : 0x0F0000)) | (uInt16(value) << 8); (myFractionalCounters[index] & myFractionalLowMask) | (uInt16(value) << 8);
break; break;
// DFxFRACHI - fractional data pointer high byte // DFxFRACHI - fractional data pointer high byte
@ -685,9 +685,6 @@ 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(...)
{ {
@ -749,9 +746,6 @@ 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,11 +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 // Older DPC+ driver code had different behaviour wrt the mask used
// This is the default option, and should always be enabled // to retrieve 'DFxFRACLOW' (fractional data pointer low byte)
// However, certain ROMs were released with older DPC+ ARM drivers, // ROMs built with an old DPC+ driver and using the newer mask can
// before the scheme was finalized; this allows those ROMs to run // result in 'jittering' in the playfield display
bool myJitterEnabled; // For current versions, this is 0x0F00FF; older versions need 0x0F0000
uInt32 myFractionalLowMask;
private: private:
// Following constructors and assignment operators not supported // Following constructors and assignment operators not supported