Shop Learn P1 Docs P2 Docs
Taqoz Reloaded 2.8 - VGA with 1, 2, 4, 8bit colour — Parallax Forums

Taqoz Reloaded 2.8 - VGA with 1, 2, 4, 8bit colour

Christof Eb.Christof Eb. Posts: 695
edited 2022-04-10 16:51 in Forth

Hi, perhaps this is interesting for others?

One of the strong sides of P2 is it's capability of video output. And VGA output is already provided as part of Taqoz.

I am using Kiss board at 200MHz and a monitor hyundai L17t which can do 1280x1024@75Hz. For other resolutions see MEDIA.FTH.
I was asking myself, what would be a good compromise between resolution and number of colours. So I ended up with:
color8 \ Switch to 640 * 360 * 8bit 230400 bytes 256 colours
color4 \ Switch to 640 * 512 * 4bit 163840 bytes 16 colours
color2 \ Switch to 1024 * 768 * 2bit 196608 bytes 4 colours
hires \ Switch to 1280 * ``1024 * 1bit 163840 bytes 2 colours

Text output is based on a plot function, which is dependant of the number of colour bits.
PEN ( color -- ) \ sets colour for plot and text
PAPER ( color -- ) \ sets colour for background
vclr \ clears screen to background colour
BPP ( bits -- ) \ sets number of colours 1, 2, 4, 8
!PAL copies colour-palette for bpp to location for the video driver
PLOT ( pen x y -- ) \ plots a dot
vga \ text output to vga
con \ text output to serial console
convga \ text output to both
emit; \ switch text output back
vmem4 \ fills video memory with fixed pattern to be viewed with .memo

You can combine the bpp setting with other resolution, as long as the video data does not overwrite other items. You can patch new colour values into the PAL table ( see MEDIA.FTH ). As the video cog will use this table from HUB memory, this will be effective for the active picture.
At the moment my routines are not assembler, could be faster...

This is using named local variables, so you need Auto.J (included) ( and MEDIA.FTH , if not already loaded )

Have fun, Christof


Sign In or Register to comment.