MiSTer-devel / TurboGrafx16_MiSTer

TurboGrafx-16 CD / PC Engine CD for MiSTer
94 stars 56 forks source link

Outrun (Japan) Course Map is slightly off #213

Open MP2E opened 2 weeks ago

MP2E commented 2 weeks ago

The Course Map at the end of a race is missing the Course Map text at the top, and also appears to be shifted to the left side. To get to this screen, simply start the game and let the timer run out.

Here's what the screen looks like on MiSTer currently: APC_0089

Here's how it looks on my CoreGrafx via RGB: APC_0088

For MiSTer video output, I'm using an IO Direct board from MiSTer Addons with a Saturn RGB cable. direct_video is enabled as is composite_sync, and the image looks perfectly centered during game play in Outrun which leads me to believe it's not my setup.

Also this doesn't seem to be related to recent changes because the current release core does this as well as the latest unstable build.

dshadoff commented 1 week ago

Hmmm. interesting issue. I have confirmed that the MiSTer screen looks like that (although it only appears for a couple of seconds).

Comparing the two pictures you have provided, I can see that a large number of sprites are not being displayed - not just the "Course Map" title, but also the car and the start banner, and roughly half of the landscape features next to the road.

Are you able to test older versions of the core (say, from last year and/or the previous year for example) ? There have been several sprite-related changes in the past year, which may have had an effect. If we find that it has not always been a problem, then we can look further into what change caused it; if we find that is was always a problem, then it's a video mode that is not properly considered.

I have verified on both Mesen and Mednafen that this screen appears properly on those emulators, but I don't yet understand what is happening.

MP2E commented 1 week ago

I have some time and went through testing a bunch of releases. I narrowed it down and release 20200517 is the first release with the sprite issue. Release 20200326 properly shows the sprites.

However, the Course Map screen is shifted to the left no matter which version I tested

dshadoff commented 1 week ago

Thank you. 20200517 was the first release of the rewrite that srg320 did to add CDROM support and fix many video issues.

dshadoff commented 7 hours ago

I had a chance to look at this a bit today, comparing the display to what is seen on Mednafen. First, I would like to put aside the statement about horizontal offset, and first focus on the missing parts of display.

As I had mentioned earlier, "a large number of sprites are not being displayed" - indeed, none of the sprites are being displayed (confirmed by disabling the sprite layer on Mednafen and comparing the resulting screenshot).

However, why they are not being displayed is not yet clear.

Looking at what the video registers are set to - on Mednafen:

The screen is set to 7MHz dotclock here as well. The "incorrect position" screenshot looks as though it may still be running in 5MHz dotclock mode, but that's not the most important point.

It's not clear to me why the sprites aren't displaying on the MiSTer core, unless some trigger event is not happening for either loading the DVSSR data, or setting up the video registers.

Perhaps, prior to displaying this screen, it is expecting an interrupt (for example, after the first DVSSR transfer, or some other interrupt) in order to update all of the video registers to display sprites and set the dotclock to 7MHz... But that trigger event doesn't take place.

Unfortunatly, I haven't used SignalTap to read the internal status of the core, so I can't see the actual MiSTer register values to confirm.

Debug_registers

This is how the screen looks when the sprite layer is turned off:

Sprites_disabled

dshadoff commented 5 hours ago

Digging a little deeper here, Mednafen updates several VDC registers and the dotclock shortly after an interrupt sends execution to $E019. This is pointed to be an interrupt vector at $FFF8, which corresponds to IRQ1. So, probably MiSTer is not triggering/accepting that specific IRQ1 (HuC6270 IRQ) for some reason.