Several of you have contacte me asking for more information about this fix.
As I said, I got the request from
@Tailsnic Retroworks to fix this as people were claiming 7–8 frames delay. I have found more or less several places that if fixed, they could account for ~5 frames delay.
- JVS, 2 frames: the I/O board
- Render, 3 frames: the graphics library's default mode sends frame k to the PowerVR vertex processor (TA) at V-blank k+1. Rendering takes place starting at k+2, and the frame is displayed at k+3.
I could optimize up to a total of 5 frames, plus the game's own inherent reaction frames (which the CPS2 also has).
I decied to fix the Render one. The game initializes the library with flags 0x00100000 (PC=0x8C34DCDC).
I changed the 0x00 to 0x10. This mode is supported by the library; in fact, the library uses 0x00100010 as its default configuration.
With bit 0x10 enabled, the library itself sends the lists to the TA at the end of the frame. This is already used at PC=0x8C36A160.
This way, rendering starts at k+1 and the frame appears at k+2.
There is one byte at file offset 0x32DCDC (0x8C34DCDC), 0x00100000 → 0x00100010. What I achieved with that bit set, is that 0x8C36A160 hands the display lists to the PowerVR vertex processor (TA) at end of scene instead of doing that int V‑blank ISR, so the frame reaches the screen one V‑blank earlier.