[FYI] VGA 400x300 scanline driver (SVGA timing, single cog)
kuroneko
Posts: 3,623
Disclaimer: This driver is a cleanup exercise to get the cog count of a [thread=135844]previous attempt[/thread] down from three to one.
A scanline is emitted twice. The initial run reads, buffers and emits the data. Then the line indicator in hub RAM is increased to indicate that the line buffer can be reused. The second run simply emits data from the internal copy which leaves an update window of about 164 hub windowsA for the renderer(s). The video h/w does not control the sync lines during the visible part of the scanline(s) which removes the need for clean-up code (no time). IOW colour values can be anything.
Data rate requirements are rather high (10MB/s) but managable.
A it's slightly larger as the reader needs to catch up with the writer
A scanline is emitted twice. The initial run reads, buffers and emits the data. Then the line indicator in hub RAM is increased to indicate that the line buffer can be reused. The second run simply emits data from the internal copy which leaves an update window of about 164 hub windowsA for the renderer(s). The video h/w does not control the sync lines during the visible part of the scanline(s) which removes the need for clean-up code (no time). IOW colour values can be anything.
Data rate requirements are rather high (10MB/s) but managable.
A it's slightly larger as the reader needs to catch up with the writer
Comments
Source is included but I didn't get out of my way to make it bst-proof. The VGA driver (pin group 2) is of the WHOP type so it's only guaranteed to work at 80MHz. It uses 5 cogs (video, background, foreground, animation and SPIN bouncer). The ball image is used as is (with permission) and uncompressed at runtime (which explains the odd look at the beginning).
Merry Christmas!
Currently I am working on something slightly related but using a different bitmap based approach with 5 or 10MB/s streaming with lower resolution but using 12 bit color. Arcade game resolutions were never particulary high but having more colors is always nice.
Cheers,
Roger.