MiSTer-devel / PSX_MiSTer

PSX for MiSTer
GNU General Public License v2.0
204 stars 49 forks source link

Twisted Metal 2 (USA): Flickering at top of screen at varying degree depending on Pad settings. #250

Closed SegaSnatcher closed 1 year ago

SegaSnatcher commented 1 year ago

Issue: Flickering at top of screen

Reproduce: Just setting Pad 1 to Dualshock will show a tiny bit of flickering, but if you scroll through PAD 1 options and or also engage Pad 2 as Dualshock you'll see more flickering. Make sure to turn off the Pause when in OSD feature so the game runs in the background while switching options in the OSD.

Workaround:
Using the vertical crop feature will hide it, but I'd rather not crop this game.

Bios: It's whatever Update_All grabs for the NA bios.

Core Version: PSX_unstable v230330 PSX v230218

RobertPeip commented 1 year ago

As Turbo also removes this problem, it seems the vsync routine takes too long, making the framebuffer swap too late and the rendering already started.

Are you sure this is not normal for the game? Analog output + capture card that keeps all 240 lines could maybe show it. As it's only 1-3 lines, i would assume it's normally hidden on a CRT.

Kuba-J commented 1 year ago

That's right, this area is not visible on CRT

Crt:

IMG_20230418_220438

hdmi:

IMG_20230418_220433

SegaSnatcher commented 1 year ago

As Turbo also removes this problem, it seems the vsync routine takes too long, making the framebuffer swap too late and the rendering already started.

Are you sure this is not normal for the game? Analog output + capture card that keeps all 240 lines could maybe show it. As it's only 1-3 lines, i would assume it's normally hidden on a CRT.

Curious if you have an idea why changing pad settings changes the level of flickering?

Anyways, I'm going to double check using a real PSOne hooked up to my Retrotink 5X.

SegaSnatcher commented 1 year ago

Okay, looks like the flickering is normal on a real PSOne, it even changes the level of flickering when I plug in a 2nd controller, so the MiSTer PSX core is mimicking the behavior with incredible accuracy, so false alarm.

RobertPeip commented 1 year ago

Great to hear :)

The reason is easy: PAD access usually happens after vsync IRQ and is taking quite some time because the BIOS function does busy waiting until the pad responds and that happens for several bytes for a dualshock. Can be easily 0.5% of a whole frame. So if you add another pad, being 2 lines later is not surprising.

If the developers would have seen it, it would be very easy to fix: first do the framebuffer swap, then poll pads