r/psxdev • u/CAPTAINCAPSLOCK111 • 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
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:
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
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.