pcsx-redux icon indicating copy to clipboard operation
pcsx-redux copied to clipboard

Interpreter-JIT discrepancies

Open wheremyfoodat opened this issue 4 years ago • 16 comments

Some ROMs show different behavior between the 2 CPU cores, and are even broken in the latter Example 1: Relevant files (reposting with the author's permission): https://cdn.discordapp.com/attachments/466353899670863873/806240805073190973/psx.bin https://cdn.discordapp.com/attachments/466353899670863873/806460090336149514/psx.cue

On the interpreter, this shows an anime girl listening to music, as it should On the JIT, there's no anime girl nor music to be found.

image image

Example 2: The BIOS shell (with my memcard) is colored differently between the 2 CPU cores Picture 1 is interpreter, picture 2 is JIT

image image

My memory card: memcard1.zip

wheremyfoodat avatar Mar 09 '21 22:03 wheremyfoodat

The bios' color is supposed to be random, isn't it?

nicolasnoble avatar Mar 09 '21 22:03 nicolasnoble

JIT: Tekken 2 has broken graphics. I'd initially thought this would be due to the game's weird handling of GPU DMAs (being the icon of infinite linked list DMAs), but this works in the interpreter and should be before it issues any weird DMA image

wheremyfoodat avatar Mar 09 '21 22:03 wheremyfoodat

The bios' color is supposed to be random, isn't it?

I believe it's generated based on memcard contents? Not sure

wheremyfoodat avatar Mar 09 '21 22:03 wheremyfoodat

Not sure where it's taking its entropy from.

nicolasnoble avatar Mar 09 '21 22:03 nicolasnoble

I'll change my memcard contents as an experiment and see if the color changes

wheremyfoodat avatar Mar 09 '21 22:03 wheremyfoodat

After changing my memory card contents, the screen seems to stay the same image Not sure on the entropy source now.

wheremyfoodat avatar Mar 09 '21 23:03 wheremyfoodat

To be fair, the only "good" source of srand would be root counters. JIT and Interpreter have different cycle bias in general due to differences in memory access functions. This might be what's happening here. A good test would be to fuzz the delay of the cdrom interrupts, which would definitely influence the value of the root counters when the shell decides to pop into the menu. There's interrupt scalers for this.

nicolasnoble avatar Mar 09 '21 23:03 nicolasnoble

I'll make sure tomorrow but yeah seems to be timing-dependent, will have to look deeper for the other ones though.

There's also the "JIT literally segfaults on Amidog's CPU test" thing which makes it harder to debug, regrettably.

wheremyfoodat avatar Mar 09 '21 23:03 wheremyfoodat

JIT jumps to this point in the BIOS (system exit) in Gran Turismo, after several failed CDFileQuery calls, and hangs. image

Screen where it hangs image

Last CD-ROM activity before hanging (same sequence of commands gets repeated a few times) image

wheremyfoodat avatar Mar 22 '21 06:03 wheremyfoodat

Gran Turismo works on x86-64 JIT

wheremyfoodat avatar Jan 29 '22 20:01 wheremyfoodat

JIT: Tekken 2 has broken graphics. I'd initially thought this would be due to the game's weird handling of GPU DMAs (being the icon of infinite linked list DMAs), but this works in the interpreter and should be before it issues any weird DMA image

This relies on GTE->GPR loads (MFC2/CFC2) being delayed

wheremyfoodat avatar Feb 12 '22 23:02 wheremyfoodat

Tekken has been fixed on the x64 backend in #744

wheremyfoodat avatar Mar 02 '22 19:03 wheremyfoodat

Cross post from #850: Disney's Tarzan reportedly works on x64, not on x86-32

wheremyfoodat avatar May 21 '22 21:05 wheremyfoodat

Cross post from #850: Disney's Tarzan reportedly works on x64, not on x86-32

I clarify issue: it was about ROM's version 1.1. 1.0 works great on x86-32.

StanleyKid-22 avatar May 22 '22 19:05 StanleyKid-22

x86-32 Gekido: Urban Fighters and Metal Slug X shutdown emulator altogether. Mortal Kombat 4 works, but rarely crashes on intro movies.

StanleyKid-22 avatar May 23 '22 20:05 StanleyKid-22

Oh, nice catch, thanks

wheremyfoodat avatar May 23 '22 20:05 wheremyfoodat