Fastest way to clear VRAM page?
In which video mode?
Fastest for what ? For the z80 or for the video?
In SC5, I don't mind to use Z80 or VDP. Put 0's in all VRAM positions? Make copys? Some instruction to make clear?
Thanks.
HMMV? start at Y = 0 end at Y = 212
Look it up in the VDP programmers guide. In the meanwhile let your cpu do some other work.
In SC5, I don't mind to use Z80 or VDP. Put 0's in all VRAM positions? Make copys? Some instruction to make clear?
Thanks.
In this case, if you are a fanatic, the fastest way is to use both.
Send an HMMV command to fill from 0,0 to 255,127 and in the meanwhile fill with the z80 from 0,128 to 255,255
HMMV is fine for me. I'm not fanatic, simply I'd like clear screen between image sequences.
Thanks people.
HMMV is fine for me. I'm not fanatic, simply I'd like clear screen between image sequences.
Thanks people. 
that is what the cls command does.... you already have this.... ;-)
HMMV is fine for me. I'm not fanatic, simply I'd like clear screen between image sequences.
Thanks people. 
that is what the cls command does.... you already have this.... ;-)
Right, good apreciation. I suposse it works in all graphic modes, right? This is, it clears active page, 32Kb in SC5 mode and 64Kb in SC7/SC8 modes.
In this case, if you are a fanatic, the fastest way is to use both.
Send an HMMV command to fill from 0,0 to 255,127 and in the meanwhile fill with the z80 from 0,128 to 255,255
I've been thinking about this as well, but not really tested this.. I know that you know lot about VDP, so can you explain why this works? I thought the data to VRAM goes from either CPU or VDP, but they all share the same write clock cycles. How much faster is it? Why the best ratio is 50%/50%?
Oh, and disable the screen while clearing it, of course.
The VDP command engine doesn’t use all available VRAM access slots during blanking, it skips some because it isn’t fast enough, so by combining forces with the CPU together they can use the access slots more efficiently…
Many details in the V9938 VRAM timings article, “CPU and command reads/writes” section. Quote:
The most extreme situation occurs in this test. Execute a HMMV VDP command (this is the fastest command, see below) while simultaneously executing a long series of OUT (#98),A instructions (the fastest way to send CPU write requests). In our measurements, in the mode 'sprites on' the command execution speed was approximately cut in half! But in the other two modes [sprites off/screen off], the execution speed was barely influenced.
If I’m not mistaken, HMMV uses 48 cycles (@21MHz) per byte, OUT (98H),A uses 72 cycles per byte. While the screen is disabled VRAM access slots are usually just 8 cycles apart, so both can achieve their maximum throughput. Although the VDP command engine will be stalled a bit by the CPU at first, probably they will quickly align to interleave nicely avoiding the stall.
So, given that HMMV is 33% faster than OUT, probably a better ratio is 60/40.
