The end of the frame

The real3d chip is not like a normal 3d card. Normal 3d cards literally just eat polygons usually in order. Real3d has a scene graph view of the entire frame. In order to start rendering the database must be complete.
But something that puzzled me for a long time is what marks the database as complete? For a long time people assumed (mame etc) that when 0x88 is written to this marks the end of the frame. But this can not be true. Some games write it multiple times per frame. Many games will write 0x88 after updating the culling ram, but then update the polygon ram without calling 0x88.
This is emergency call ambulance
So it updates the high culling ram, calls 0x88, then writes to poly ram.
It looks like the last thing that is written in every frame is a write to the tilegen register C. I'm pretty sure this register write says start rendering the 3d.
This is virtua fighter 3
The last thing it writes is reg C. This is true for everything except the loading stages between games. Then this happens.
It still writes C to the tilegen register. But at that point 0x88 has never been written so, so I assume it doesn't render anything. If it does try and render stuff. The attached image is what's going on in the background. There is a good chance this will crash the real3d board. It would crash us too but we put some hacks in the renderer to stop it happening.
What does this mean for emulation?
Well not a huge amount, because 99% of the time the scene database is updated every single frame. It's only in certain places like vf3 where this might be an issue.
But we could check if 0x88 had been written to when the tilegen register C is written it. If it has render that frame. That would stop all the garbage background problems and the hacks we need in the renderer.
It's not immediately clear what 0x88 actually does, but my best guess is it marks like a specific transfer as complete, that's why it can be called many times per frame. Without it, I don't think it'll try and draw a frame.
It would be interesting to know if there are any games this logic doesn't work for.
But something that puzzled me for a long time is what marks the database as complete? For a long time people assumed (mame etc) that when 0x88 is written to this marks the end of the frame. But this can not be true. Some games write it multiple times per frame. Many games will write 0x88 after updating the culling ram, but then update the polygon ram without calling 0x88.
This is emergency call ambulance
- Code: Select all
write reg 60 80000000 33
write reg 64 80000000 33
write reg 68 80000000 33
write reg 6c 80000000 33
write reg 10 2 33
write reg 10 4 33
write reg 10 8 33
WriteHighCullingRAM 62
flush 62
WritePolygonRAM 62
write reg c 3 62
swap buffers 100
So it updates the high culling ram, calls 0x88, then writes to poly ram.
It looks like the last thing that is written in every frame is a write to the tilegen register C. I'm pretty sure this register write says start rendering the 3d.
This is virtua fighter 3
- Code: Select all
WritePolygonRAM 47
WriteHighCullingRAM 73
flush 73
write reg c 3 73
swap buffers 100
The last thing it writes is reg C. This is true for everything except the loading stages between games. Then this happens.
- Code: Select all
write reg 40 0 33
write reg c 3 35
WriteLowCullingRAM 35
flush 35
It still writes C to the tilegen register. But at that point 0x88 has never been written so, so I assume it doesn't render anything. If it does try and render stuff. The attached image is what's going on in the background. There is a good chance this will crash the real3d board. It would crash us too but we put some hacks in the renderer to stop it happening.
What does this mean for emulation?
Well not a huge amount, because 99% of the time the scene database is updated every single frame. It's only in certain places like vf3 where this might be an issue.
But we could check if 0x88 had been written to when the tilegen register C is written it. If it has render that frame. That would stop all the garbage background problems and the hacks we need in the renderer.
It's not immediately clear what 0x88 actually does, but my best guess is it marks like a specific transfer as complete, that's why it can be called many times per frame. Without it, I don't think it'll try and draw a frame.
It would be interesting to know if there are any games this logic doesn't work for.