DMA performance / Virtua Racing
Posted: Wed Oct 20, 2010 11:16 pm
I've been thinking about games where graphics data is transferred to VRAM repeatedly (namely Virtua Racing), and the slow speed of DMA really impacts things. But not much can be done about that.
Can somebody tell me if my calculations are off? Imagine this hypothetical scenario (I realize VR uses 32-cell mode instead):
40-cell mode, 256x192 centered viewport (just using Plane B, maybe A or the Window to mask the area outside it), screen is blanked for all other scanlines. 768 tiles are needed to define the display, that's 24K and let's double buffer it for 48K total. Now we can do DMA to one set of tiles while displaying the other.
So you get 263-192=71 lines of high-bandwidth access to the VDP. DMA to VRAM is 205 bytes/line in 40-cell mode, 71*205 = 14555 bytes/frame. That's not close to the 24K we need, going down to 30 FPS means we require only 12K per frame which is about 60 lines of DMA. Is this actually obtainable or are there other sources of delays?
To simply things, let's assume the 68000 isn't doing anything other than DMAing data to VRAM, CRAM, VSRAM, reading joysticks and sending the odd command byte or two to the Z80 once per frame. And the Z80 isn't accessing banked ROM. Maybe all the game logic is running elsewhere like the SVP's DSP or Sega CD's 68000.
Also, does the SVP render graphics data directly in the 4-bit tile format (I guess doing a lot of read-modify-write operations to insert new polygons), or is there some hardware assistance involved? I know on the 68000 side there are some memory areas that swizzle memory around, but nothing but the diagnostic code uses it and I don't know if the SVP has a similar "swizzled" window to the 128K RAM to assist in making tile-format data, which would otherwise have to be done in software.
Can somebody tell me if my calculations are off? Imagine this hypothetical scenario (I realize VR uses 32-cell mode instead):
40-cell mode, 256x192 centered viewport (just using Plane B, maybe A or the Window to mask the area outside it), screen is blanked for all other scanlines. 768 tiles are needed to define the display, that's 24K and let's double buffer it for 48K total. Now we can do DMA to one set of tiles while displaying the other.
So you get 263-192=71 lines of high-bandwidth access to the VDP. DMA to VRAM is 205 bytes/line in 40-cell mode, 71*205 = 14555 bytes/frame. That's not close to the 24K we need, going down to 30 FPS means we require only 12K per frame which is about 60 lines of DMA. Is this actually obtainable or are there other sources of delays?
To simply things, let's assume the 68000 isn't doing anything other than DMAing data to VRAM, CRAM, VSRAM, reading joysticks and sending the odd command byte or two to the Z80 once per frame. And the Z80 isn't accessing banked ROM. Maybe all the game logic is running elsewhere like the SVP's DSP or Sega CD's 68000.
Also, does the SVP render graphics data directly in the 4-bit tile format (I guess doing a lot of read-modify-write operations to insert new polygons), or is there some hardware assistance involved? I know on the 68000 side there are some memory areas that swizzle memory around, but nothing but the diagnostic code uses it and I don't know if the SVP has a similar "swizzled" window to the 128K RAM to assist in making tile-format data, which would otherwise have to be done in software.