Chilly Willy wrote:Well, H40 cell mode would need 40x28x2x2 = 4480 bytes for two name tables. From 65536 leaves 61056 bytes (we're not going to bother with sprites or scrolling in a game like this). 61056 / (160 *2) gives us two 320x190 size screens worth of storage. Or you could render to only 38 cells horizontally (304 pixels) to give two screens of 304x200. That would probably be best, and you wouldn't have to worry about overscan much either.
Two nametables in H40 mode would be 64x28x2x2 = 7168 bytes because the scroll plane must be 64 cells wide. But since we only need one scroll plane, perhaps we can put the nametables on top of one another. Both scroll planes would just be displaying the same pattern. If that works, it would cut the size down to 3584 bytes.
To set up the VDP, just set all nametables, the sprite attribute table, and H-scroll table to VRAM 0000. For this to work, the first 32 bytes of VRAM need to be zeroed, but this is no problem since the top cell line won't be used anyway.
Fonzie wrote:- Put Hint (or whatever) on line 180 (the less line you display the more DMA power you get).
- Hint stop the vdp display, start DMA
- Once DMA is finished, start vdp display again, exit HINT...
Like Stef said, starting a dma at line 180 or so almost double the DMA bandwidth during a single VBLANK.
That should get you 30 fps but I'm concerned that it may look awkward -- a chunk of blank at the bottom of the screen. I'm thinking line 208, maybe 200, but perhaps I should reserve judgment until I see it. Nevertheless, there are other ways to preserve bandwidth.
You could reduce the render window and use some static patterns to draw a window frame and possibly a status bar. If you need more bandwidth, you could always just DMA all the way through the active display period. It depends if you want to do anything with the main cpu other than DMA to VRAM.
Another consideration is that you need to update the nametable to update the palette assignments, and this must be done in VBLANK. Unless you only need 16 colors -- I suppose it depends on the game.
And if you're looking to squeeze a bit more out of VRAM, you can store patterns inbetween lines in the scroll nametable. That's a bit extreme, though.
Fonzie wrote:In H32 mode, i got 208 tiles DMAted during extended VBLANK without any problem, I wonder if it's a record or what...
208? That's it? Well, I guess it's a record until someone claims otherwise. Congratulations!