diff --git a/Changes.txt b/Changes.txt index 056572a76..693f3719c 100644 --- a/Changes.txt +++ b/Changes.txt @@ -181,6 +181,10 @@ * Fixed bug in DPC+ scheme; 'fast fetch mode' was enabled at startup, when it should be disabled by default. + * Some more work on DPC+ playfield 'jitter' effect for certain older DPC+ + driver versions; more ROMs are now detected properly. Special thanks + to SpiceWare for his research in this area. + * Added proper Retron77 port. * Added proper libretro port, and fixed display for OpenGLES renderers. diff --git a/src/debugger/gui/CartDPCPlusWidget.cxx b/src/debugger/gui/CartDPCPlusWidget.cxx index e55da1d1c..18166c6af 100644 --- a/src/debugger/gui/CartDPCPlusWidget.cxx +++ b/src/debugger/gui/CartDPCPlusWidget.cxx @@ -35,7 +35,8 @@ CartridgeDPCPlusWidget::CartridgeDPCPlusWidget( << "DPC registers accessible @ $F000 - $F07F\n" << " $F000 - $F03F (R), $F040 - $F07F (W)\n" << "Banks accessible at hotspots $FFF6 to $FFFB\n" - << "Startup bank = " << cart.startBank() << "\n"; + << "Startup bank = " << cart.startBank() << "\n" + << "Ver = " << cart.myDriverMD5; #if 0 // Eventually, we should query this from the debugger/disassembler diff --git a/src/emucore/CartDPCPlus.cxx b/src/emucore/CartDPCPlus.cxx index 9071b69d8..ab7230f78 100644 --- a/src/emucore/CartDPCPlus.cxx +++ b/src/emucore/CartDPCPlus.cxx @@ -57,9 +57,20 @@ CartridgeDPCPlus::CartridgeDPCPlus(const ByteBuffer& image, size_t size, Thumbulator::ConfigureFor::DPCplus, this); - // Currently only one known DPC+ ARM driver exhibits a problem - // with the default mask to use for DFxFRACLOW - if(MD5::hash(image, 3_KB) == "8dd73b44fd11c488326ce507cbeb19d1") + // Currently 4 DPC+ driver versions have been identified: + // 17884ec14f9b1d06fe8d617a1fbdcf47 Jitter Encore Compatible + // 5f80b5a5adbe483addc3f6e6f1b472f8 Stable Encore Compatible + // 8dd73b44fd11c488326ce507cbeb19d1 Stable NOT Encore Compatible + // b328dbdf787400c0f0e2b88b425872a5 Jitter Encore Compatible + // + // Jitter/Stable refers to the appearance of the playfield in bB games if + // the DFxFRACINC registers are not updated before every drawscreen. + // + // The default mask for DFxFRACLOW implements the Jitter behavior. This + // changes the mask to implement the Stable behavior. + myDriverMD5 = MD5::hash(image, 3_KB); + if(myDriverMD5 == "5f80b5a5adbe483addc3f6e6f1b472f8" || + myDriverMD5 == "8dd73b44fd11c488326ce507cbeb19d1" ) myFractionalLowMask = 0x0F0000; setInitialState(); diff --git a/src/emucore/CartDPCPlus.hxx b/src/emucore/CartDPCPlus.hxx index abc14f21d..46b18af99 100644 --- a/src/emucore/CartDPCPlus.hxx +++ b/src/emucore/CartDPCPlus.hxx @@ -272,6 +272,10 @@ class CartridgeDPCPlus : public Cartridge // Indicates the offset into the ROM image (aligns to current bank) uInt16 myBankOffset{0}; + // MD5 value of the 3K DPC+ driver. Used to determine which mask to use, + // and shown in the Cartridge tab of the debugger + string myDriverMD5; + // 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