Skip to content

JCAP Log #9: Video Part 4

Connor Spangler edited this page Apr 30, 2018 · 35 revisions

NES CPU-PPU Setup

Video System Implementation

We finally have all the information we need to fully implement a VGA arcade graphics system, minus one final critical consideration. The main and cog RAM sizes and their constraint of the graphics representation solution have already been addressed, however the Propeller 1 core clock as it pertains to the pixel clock represents one final technical hurdle to overcome, and will ultimately define the high-level architecture of the system.

Colors

A critical constraint posed by the "direct" method of using waitvid discussed in Video Part 2 is that each series of 16 pixels can only have 4 colors: 2 bits per pixel addressing one of the four color bytes. We need 16 colors per 8x8 pixel tile, which even if we only push out 8 pixels per waitvid we're still restricted to a 4 color palette. The solution to this problem is novel: simply switch the color palette with the pixel palette. By populating the color palette with the colors of the next four pixels, we can directly display them by waitviding each color sequentially, i.e. waitvid pixels, #%%3210

Nanoseconds

It is in no way shape or form an exaggeration to say that the timing of this video system on the Propeller 1 comes down to single nanoseconds. Let's look at the numbers to find out why...

Our 640x480 VGA pixel clock is 25.175 MHz, meaning our video generation circuit has to spit out a pixel every 40 nanoseconds.


Propeller Video Output

Propeller Video Output