Open eliasdaler opened 1 month ago
I mean, supporting all emulators out there is going to be difficult. The main loop is definitely different from the typical one from psyq, and there's absolutely a few tricks used here and there that are unusual, even though I tried to avoid really nasty stuff which I know would've been hell to work out on emulators.
My point being, this feels more like this belongs to the mednafen repository than anything else. I'm more than happy to help locate what the emulator is doing that's not proper, but it's also likely documented in the psx-spx, so emulators following it would have no issues.
My hunch is how psyqo is handling DMA transfers, which uses documented behavior of the DMA hardware registers but which is rarely used by games. Note that I said "rarely" , not "never".
This code, basically: https://github.com/grumpycoders/pcsx-redux/blob/300e80b3070e83d5bd2061175daa11d26d3de4ac/src/mips/psyqo/src/gpu.cpp#L137-L186
I know I surprised @stenzek with it, who had to tweak some details of his own implementation in Duckstation.
Note this works fine in older but proper emulators like Xebra.
My point being, this feels more like this belongs to the mednafen repository than anything else. I'm more than happy to help locate what the emulator is doing that's not proper, but it's also likely documented in the psx-spx, so emulators following it would have no issues.
Yes, I understand that it might be mednafen doing wrong things, so it would be good if you could take a look so that I don't come to them with the code and it turns out that it's the psyqo issue. If it's mednafen doing things wrong, I'll report it to them. :)
It would be great to support mednafen as well as it's yet another data point for some bugs which show up on HW, but don't show up in Redux/Duckstation.
Right, we can try and narrow it down a bit, but FYI, there's also emulators like older PCSX, ePSXe, or even no$psx, which also struggle with this code, afaik. Basically, they don't properly update the DMA hardware registers upon completion, and psyqo heavily relies on that to avoid a way more costly back-and-forth to the main loop.
The psyqo applications (even basic ones) don't seem to work on Mednafen - here's a "hello" sample - it hangs somewhere after the first frame (but seems to boot and do a clear):
Here's a .cue/.iso of the demo I built:
game.zip
And here's the output of "warnings" psx.dbg_mask of Mednafen - not sure if it's relevant, because most of the warnings happen during boot logo: dbg_out.txt