
--------------------------------------------------------------------------------
  Mecrisp-Quintus with graphics for HX1K Nandland Go
--------------------------------------------------------------------------------

This is an experiment on how to do pixel graphics with very limited memory.

How to install:

iceprog -b nandland.bin
iceprog -o 64k mecrisp-quintus-nandland-with-tools.bin

How to open a terminal:

picocom -b 115200 /dev/ttyUSB1 --imap lfcrlf,crcrlf --omap delbs,crlf --send-cmd "ascii-xfr -s -l 800 -c 1 -n"

Reset the CPU by pressing S2 & S4 at once.

Its quite similar to the regular Nandland target, but the textmode logic
is replaced by an experimental double buffered pixel graphics unit.

The first pixel is fetched from memory, and when the xpos and ypos counters of the VGA sync
generator reach the location, the current pixel is shown, and the next pixel is fetched.
This allows to display a few pixels with very little memory, but requires the pixels sorted
by their position accordingly.

The pixel unit has two memory pages of 512 pixels each, which should be flipped on the falling
edge of the vsync signal to avoid flickering.

* $20000 - $207FF: 512 words of pixel data, each 24 bits wide, aligned for 32 bit @ and !
  Pixel format is: [31:24] Zero [23] Unused [22:20] RGB, 8 colors [19:10] y [9:0] x

* $10080: Graphics control register.
  Read: [0] vsync, active low for 640x480 VGA
  Write, any value: Flip pixel memory pages

To draw on this quite strange pixels logic, these assembler routines are provided:

  clrscr             ( -- ) Clear pixels in current pixels buffer page
  putpixel ( x y color -- ) Add one pixel to the current pixels buffer page
  flipbuffer         ( -- ) Flip pixel buffer pages on next vsync

Coordinates are 0 to 639 for x,
                0 to 479 for y, and
                colors are 3 bits, one bit each for R,G,B.

--------------------------------------------------------------------------------
