Was thinking about how to do 1080p video and it occurred to me that the P1 tile driver might be good for that.
Tested the idea out today, it seems to work (see screenshot).
Started out with 2 cogs, one for the video output and one to build the video line data.
If your P2 clock is below 250 MHz, another cog would be needed to help build the video line data.
Update: New color scheme seems to work. Now able to replicate the P1 "VGA_demo" (see new screenshot below).
Driver is using the actual P1 ROM font do draw the characters and buttons.
Update2: Added "Graphics" from P1 and can run "Graphics_Demo"
Update3: Code now attached here.
Using 3 cogs:
One is the VGA driver that outputs 1080p in 2bpp LUT mode from a 1080x16 pixel buffer (one row of tiles). The LUT offset (%bbbb) cycles through 0 and 7.
Second cog populates the 1080x16 pixel buffer based on the 120x68 tile pointer array and ATN signals from the VGA driver
Third cog dynamically updates the tile colors at LUT offsets (%bbbb) 0 through 7, guided by ATN signals from the VGA driver, based on the palette, which is reloaded every frame.
There are 5 arrays needed by this driver, requiring a total of 88.5 kB (out of 512 kB available in P2):
One is the pixel output buffer (7.5 kB):
TileBuffer1 'pixel output buffer. 1920 of 2bpp tile data (16 lines)
Another is the tile pointer array (32 kB):
Tiles '1920x1080 in 16x16 tiles '20 bits for tile address, upper 12 bits free
Another is the tile color pointer array (32 kB):
TileColors 'One long for each tile, picks four colors from 256 color palette. Note: bytes are read little endian
Then, there's the 256 color, 24-bit palette (1 kB):
palette '256 element array of 24-bit colors (Note: Lower 8-bits are (must be?) zero).
Finally, the P1 ROM Font (16 kB):
P1RomFont file "p1_font.dat"