r/psxdev • • 3d ago

PS1 devs: which rendering bugs only showed up on real hardware for you?

I’m working on a PS1 renderer in C, and I’m interested in where emulator testing can give a misleading impression that something is correct.

Which rendering problems have you seen work in an emulator but fail on an actual PlayStation? I’m particularly interested in GPU command timing, VRAM transfers, and drawing while a transfer is still in progress. What small test helped you isolate the difference?

7 Upvotes

4 comments sorted by

3

u/izzy88izzy 3d ago

Hi, I've been working on PSoXide (a PS1 SDK, emulator and engine in Rust) for almost a year now, with multiple rounds of measuring on real hardware, so I might be able to help. At this point the PSoXide emulator is quite faithful to the console and I'd recommend it for performance testing too, since it tells you exactly where the frame time goes. Have a look at the engine as well, it's designed specifically to push the hardware to its limit, feel free to grab whatever code could be useful for your project.

Emulator: https://github.com/EBonura/PSoXide-emulator

SDK and engine: https://github.com/EBonura/PSoXide (engine is under /engine)

Two bugs that passed in the emulator and failed on my SCPH-9002, both about DMA2 linked-list timing:

  1. Oversized linked-list nodes. A title screen sent "PRESS START" as one 41-word node. On console the frame froze with only the tail of the text drawn, the pad was dead, and the music kept playing. The music was the clue: the CPU was alive, waiting for a draw-done that never came. The list walk drops words from a node bigger than the 16-word GP0 FIFO, so the command closing my frame never arrived.

The test: draw N flat rectangles per node, step the node size up from 16 words, run it with the GPU idle and again while it's busy with a big fill, then count the rectangles on screen. 16 words was always clean. Rectangles went missing from 20 words with the GPU busy and from 24 with it idle. I now cap nodes at 16.

2. Flushing the I-cache while a list is still being walked. My code overlays called FlushCache at runtime. On console I got silent freezes, and once an exception where the faulting instruction decoded as a GPU list header, so the CPU had fetched a DMA word as code. I found it by bisecting: one disc with seven variants of the same build, filmed with a capture card. Only "no flush" and "wait for GPU idle, then flush" survived. The fix is to mask interrupts and wait for every DMA channel to finish before flushing.

Tip: when the console freezes, check whether audio still runs, and have an on-screen exception handler that prints EPC and CAUSE.

2

u/CAPTAINCAPSLOCK111 3d ago

hank you for taking the time to write all of this. This is exactly the sort of answer I was hoping for: actual failures on a console, what you observed, and the small tests you used to narrow things down. The debugging process is especially useful to me.

The detail about the music continuing while the drawing stopped really stood out. Having that clue, rather than just “the console froze”, gives you a much better starting point. The same goes for your seven build variants on one disc. I might have exactlly the same issue going on in my code, the note keeps playing while the rest of the system feels frozen for no apparent reason, then it goes on with its work. without a good debugger or profiler you are lost here.

I’m working on a PS1 renderer in C, and I’ve been dealing with missing triangles, gaps and other drawing problems. I don’t want to assume those have the same cause as your freezes, but your examples give me some concrete things to investigate beyond the geometry calculations themselves.

I’m particularly interested in the linked-list node-size test. Is that test available somewhere in your repositories? Being able to compare the GPU-idle and GPU-busy cases would be very useful. I’d also like to understand whether the behaviour you saw depended on a particular DMA configuration, or whether you reproduced it with different setups.

Thanks for sharing PSoXide as well. I haven’t tried it yet, so I can’t comment on the results, but the frame-time breakdown sounds relevant to another question I’ve been trying to answer: where the time actually goes when a scene slows down. Even though my project is in C, the tests and the reasoning behind the engine could still teach me a lot. I know MIPS assembly quite well as I also use it inline for the hot paths, so this is a treasure trove to me. thanks a lot!!!

Really appreciate the detailed response. You’ve given me something concrete to work from, and I’d be happy to report back if I can reproduce the test on my setup.hank you for taking the time to write all of this. This is exactly the sort of answer I was hoping for: actual failures on a console, what you observed, and the small tests you used to narrow things down. The debugging process is especially useful to me.
Phil

2

u/CAPTAINCAPSLOCK111 3d ago

A small example would already help: what looked fine in the emulator, what went wrong on the console, and what test finally exposed the cause? I’m interested in the debugging process as much as the bug itself.