Jump to content
  • entries
    657
  • comments
    2,702
  • views
    902,444

DPC+ Jitter


SpiceWare

1,123 views

DPC+ Jitter issues yet again, this time with text_adventure.

text_adventure.bas.bin

 

Back in 2015 I added support to Stella for jitter emulation. It was initiated by the topic Game test on Harmony Cart where bB game Doom Patrol exhibited jitter on real hardware.  The jitter was caused by 2 different things:

 

  1. Overscan running longer/shorter than normal, covered in blog entry Overscan Jitter
  2. DPC+ jitter if the DFxFRACINC registers are not updated every frame, covered in blog entry Overscan Jitter 2, DPC+ Jitter

 

The topic links to the Doom Patrol topic with these ROMS:

Doom Patrol-0.5.bin

 

Doom Patrol-0.6.bin

 

0.5 exhibits DPC+ jitter, which is visible on the initial screen on real hardware. The playfield (DOOM PATROL text, etc) and background colors will jitter up/down, while the score display and tank do not exhibit jitter.

 

899570357_DoomPatrol-0.5_1.thumb.png.23059920b6970f42614e7af77a4f8b52.png

 

 

 

0.6 has been updated to set DFxFRACINC before each call to DRAWSCREEN, so does not exhibit DPC+ jitter on real hardware.

 

 

 

Later on this DPC+ jitter emulation caused problems with the game Epic Adventure.

epicadv22.bin

 

 

Epic Adventure used a different version of the DPC+ driver than Doom Patrol did, so we modified Stella to turn off DPC+ jitter emulation if the DPC+ driver used in Epic Adventure was detected. This was done using the MD5 value of the driver, calculated by doing this in Mac Terminal (command also works under Linux):

$ dd count=3 bs=1024 if=epicadv22.bin | md5
3+0 records in
3+0 records out
3072 bytes transferred in 0.000054 secs (57012840 bytes/sec)
8dd73b44fd11c488326ce507cbeb19d1

 

This MD5 value is used in CartDPCPlus.cxx:

  // 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")
    myFractionalLowMask = 0x0F0000;

 

Turns out I have an ENCORE build of this game as the original uses the DPC+ driver that doesn't work on the Harmony Encore.  I don't know where I got it from, but it does jitter when played using the current build of Stella.

epicadv22_encore.bin

 

MD 5 values:

  • 17884ec14f9b1d06fe8d617a1fbdcf47 - Doom Patrol-0.5.bin
  • 17884ec14f9b1d06fe8d617a1fbdcf47 - Doom Patrol-0.6.bin
  • 8dd73b44fd11c488326ce507cbeb19d1 - epicadv22.bin
  • 5f80b5a5adbe483addc3f6e6f1b472f8 - epicadv22_encore.bin
  • 5f80b5a5adbe483addc3f6e6f1b472f8 - text_adventure.bas.bin
  • 5f80b5a5adbe483addc3f6e6f1b472f8 - Space Rocks Encore build
  • 5f80b5a5adbe483addc3f6e6f1b472f8 - Stay Frosty 2 RC8

 

4 Comments


Recommended Comments

I will test all these ROMs on my system later this evening.

 

My main question is, why is this happening?  Does changing the mask work around a bug in the original ROM code, or is it because of different behaviour in various DPC+ drivers?  I don't want to get into the case of modifying Stella to work with buggy ROM's, where the ROM programmer made some error that they can fix themselves.  However, if it's because of driver differences, then I can add it to Stella.

 

Basically, I want all DPC+ ROMs that work on Harmony to work in Stella, and all ROMs that break on Harmony to break in Stella.  I want it to be one-to-one.  And if a ROM is buggy, it's not the job of the emulator to work around that.

 

BTW, thanks for the research into this somewhat confusing issue.

Link to comment
On 3/9/2020 at 8:56 AM, stephena said:

My main question is, why is this happening?  Does changing the mask work around a bug in the original ROM code, or is it because of different behaviour in various DPC+ drivers?

 

To me it appears as though different DPC+ drivers behave differently.  Adding to the confusion is some games have been hex-edited to patch the DPC+ driver to work around a bug that prevented games from playing on the Harmony Encore, meaning 1 driver version may have 2 MD5 values.

On 11/6/2014 at 2:44 AM, batari said:

...

To fix any errant DPC+ games, use a hex editor to change the bytes at offset 0x200 from 00 A0 85 to 01 A0 C5. Then they will load on Encore (or any other Harmony version) with no problem.

...


 

As seen in this post, I can easily replace the driver used by an existing ROM:

On 3/5/2017 at 6:10 PM, SpiceWare said:

I used these terminal instructions on my Mac to remove the driver you used and put the newer one in its place. They'll also work in Linux:


dd skip=3 count=29 if=chaoticGrill-2017-03-05.bin of=cg29K.bin bs=1024
cat DPC+20121020.arm cg29K.bin > newcg.bin

 

 

So what I plan to do is:

  • Extract the 3 different DPC+ drivers I've identified in this blog post.
  • Review other DPC+ games to see if I can find addition driver variations, extract them out as well.
  • For each version of the DPC+ driver:
    • Replace the DPC+ driver in Doom Patrol 0.5, Epic Adventure, and Text Adventure
    • test each on real hardware:
      • DPC+ driver exhibits jitter Yes/No
      • DPC+ driver is Encore Compatible Yes/No
  • See if I can match Encore compatible drivers with a non-Encore compatible drivers (ie: just the 3 bytes at 0x200 are different)

With that we'll know how Stella should behave for each driver.  

Additionally, I'll see if I can nail down dates for each DPC+ version. I should be able to do that by comparing drivers found in the Harmony Cart Development forum as well as the 2014 Holiday Cart - Stay Frosty 2 forum (as various DPC+ issues were found & fixed while working on SF2). Once figured out we could have Stella show the date, Encore compatibility, etc. in the debugger.

 

This could take a while.

  • Like 1
Link to comment

Appreciate any help you can provide for this.  It may take some time and will miss the 6.1 release window (coming up soon), but that's fine; I just want it fixed properly, whenever it happens.

Link to comment

Last night I wrote a bash script that:

  • extracts the DPC+ drivers from games found in Games/
  • saves the drivers in Drivers/ using the MD5 value as part of the filename. This way only 1 driver file is created for each version even if multiple games have the same driver.
  • extracts the 29K of game code from the 3 test games
  • merges each driver with each 29K of code, saving them in Test/ with the MD5 value as part of the filename.

 

I then put the games from this blog entry, and some ROMs from my projects, into Games and ran the script. It found 4 DPC+ driver versions and created 12 test ROMs.

 

I then ran each test on hardware on both the regular and the Encore version of Harmony. Initial results:

	17884ec14f9b1d06fe8d617a1fbdcf47
		Jitters
		Encore Compatible

	5f80b5a5adbe483addc3f6e6f1b472f8
		Stable
		Encore Compatible

	8dd73b44fd11c488326ce507cbeb19d1
		Stable
		Not Compatible with Encore

	b328dbdf787400c0f0e2b88b425872a5
		Jitter
		Encore Compatible

 

Next is to scour around AtariAge to see if I can find any other versions of the DPC+ driver.

 

After that see if I can nail down dates for each version.

 

Script and all the files:

DPCplusVersions.zip

  • Like 1
  • Thanks 2
Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...