mirror of https://github.com/stella-emu/stella.git
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:
parent
681c8156bd
commit
ea89ef01b4
10
Changes.txt
10
Changes.txt
|
@ -63,12 +63,12 @@
|
|||
|
||||
* 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.
|
||||
* Allow the DPC+ scheme to not enable playfield '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
|
||||
major ports (Linux/macOS/Windows) have it enabled by default.
|
||||
* PNG/ZIP image support is now conditionally compiled into Stella.
|
||||
All major ports (Linux/macOS/Windows) have it enabled by default.
|
||||
|
||||
-Have fun!
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "StateManager.hxx"
|
||||
|
||||
#define STATE_HEADER "06000003state"
|
||||
#define STATE_HEADER "06000002state"
|
||||
// #define MOVIE_HEADER "03030000movie"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -37,7 +37,7 @@ CartridgeDPCPlus::CartridgeDPCPlus(const BytePtr& image, uInt32 size,
|
|||
myARMCycles(0),
|
||||
myFractionalClocks(0.0),
|
||||
myBankOffset(0),
|
||||
myJitterEnabled(true)
|
||||
myFractionalLowMask(0x0F00FF)
|
||||
{
|
||||
// Image is always 32K, but in the case of ROM > 29K, the image is
|
||||
// copied to the end of the buffer
|
||||
|
@ -65,10 +65,10 @@ CartridgeDPCPlus::CartridgeDPCPlus(const BytePtr& image, uInt32 size,
|
|||
Thumbulator::ConfigureFor::DPCplus,
|
||||
this);
|
||||
|
||||
// Disable jitter on certain DPC+ driver versions
|
||||
string driverMD5;
|
||||
driverMD5 = MD5::hash(image, 3*1024);
|
||||
myJitterEnabled = driverMD5 != "8dd73b44fd11c488326ce507cbeb19d1";
|
||||
// Currently only one known DPC+ ARM driver exhibits a problem
|
||||
// with the default mask to use for DFxFRACLOW
|
||||
if(MD5::hash(image, 3*1024) == "8dd73b44fd11c488326ce507cbeb19d1")
|
||||
myFractionalLowMask = 0x0F0000;
|
||||
|
||||
setInitialState();
|
||||
}
|
||||
|
@ -403,10 +403,10 @@ bool CartridgeDPCPlus::poke(uInt16 address, uInt8 value)
|
|||
|
||||
switch(function)
|
||||
{
|
||||
//DFxFRACLOW - fractional data pointer low byte
|
||||
// DFxFRACLOW - fractional data pointer low byte
|
||||
case 0x00:
|
||||
myFractionalCounters[index] =
|
||||
(myFractionalCounters[index] & (myJitterEnabled ? 0x0F00FF : 0x0F0000)) | (uInt16(value) << 8);
|
||||
(myFractionalCounters[index] & myFractionalLowMask) | (uInt16(value) << 8);
|
||||
break;
|
||||
|
||||
// DFxFRACHI - fractional data pointer high byte
|
||||
|
@ -685,9 +685,6 @@ bool CartridgeDPCPlus::save(Serializer& out) const
|
|||
|
||||
// Clock info for Thumbulator
|
||||
out.putLong(myARMCycles);
|
||||
|
||||
// Jitter effect
|
||||
out.putBool(myJitterEnabled);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
|
@ -749,9 +746,6 @@ bool CartridgeDPCPlus::load(Serializer& in)
|
|||
|
||||
// Clock info for Thumbulator
|
||||
myARMCycles = in.getLong();
|
||||
|
||||
// Jitter effect
|
||||
myJitterEnabled = in.getBool();
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
|
|
|
@ -270,11 +270,12 @@ class CartridgeDPCPlus : public Cartridge
|
|||
// Indicates the offset into the ROM image (aligns to current bank)
|
||||
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;
|
||||
// Older DPC+ driver code had different behaviour wrt the mask used
|
||||
// to retrieve 'DFxFRACLOW' (fractional data pointer low byte)
|
||||
// ROMs built with an old DPC+ driver and using the newer mask can
|
||||
// result in 'jittering' in the playfield display
|
||||
// For current versions, this is 0x0F00FF; older versions need 0x0F0000
|
||||
uInt32 myFractionalLowMask;
|
||||
|
||||
private:
|
||||
// Following constructors and assignment operators not supported
|
||||
|
|
Loading…
Reference in New Issue