Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
More fixes for DPC+ jitter issues, thanks to Spiceware.
  • Loading branch information
sa666666 committed Mar 15, 2020
1 parent bfb08cf commit 9ff00c3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Changes.txt
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion src/debugger/gui/CartDPCPlusWidget.cxx
Expand Up @@ -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
Expand Down
17 changes: 14 additions & 3 deletions src/emucore/CartDPCPlus.cxx
Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions src/emucore/CartDPCPlus.hxx
Expand Up @@ -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
Expand Down

0 comments on commit 9ff00c3

Please sign in to comment.