[FYI] VGA 256x192 scanline driver (XGA timing, single cog)
kuroneko
Posts: 3,623
This driver has been originally posted over at Jeff's place so before someone tells me I'm biased I post it here too. It's nothing spectacular in terms of resolution but literally a proof of concept whether 256x192 full colour can be signalled as 1024x768 (64MHz pixel clock) in a single cog. It's been used since successfully as a drop-in replacement.
A scanline is emitted 4 times. 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 three subsequent runs simply emit data from the internal copy which leaves an update window of about 3x105 hub windows 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.
Edit: The comment in the top level file (*.demo.spin) should read:
A scanline is emitted 4 times. 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 three subsequent runs simply emit data from the internal copy which leaves an update window of about 3x105 hub windows 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.
Edit: The comment in the top level file (*.demo.spin) should read:
' When vertical blank starts the frame indicator is set to [COLOR="red"]0[/COLOR]. ' Once line N (0..191) is fetched it changes to [COLOR="red"]N+1[/COLOR]. Following ' that the buffer can be modified.This (driver) change was done to retain compatibility with the original driver.