VI doc by Steb (steb@bigfoot.com) 0.3 - All untested at the minute...
1964 website : http://www.emuhq.com/1964/

-- Registers --

0x4400000 - VI_STATUS_REG (pixel size, antialising etc...)
0x4400004 - VI_WIDTH_REG (width of screen)
0x4400008 - VI_ORIGIN_REG (Origin of VRAM in RDRAM)

-- Finding the screen height --

Screenheight = VI_WIDTH_REG*0.75 		(slow) 
Screenheight = (VI_WIDTH_REG * 3) >> 2 		(fast)

-- Determining how big the pixel is --

bits 0 and 1 of VI_STATUS_REG defines pixel size - i.e. 5/5/5/1 (16bit color) or 8/8/8/8 (32bit color)

switch (status & 0x0003)	//VI_STATUS_REG bytes 01
{
	case 0:
		sprintf(String, "No Data / Sync");
		break;
	case 1:
		sprintf(String, "Reserved!");
		break;
	case 2:
		sprintf(String, "5/5/5/1 : 16 bit");
		break;
	case 3:
		sprintf(String, "8/8/8/8 : 32 bit");
		break;
}

--  Reading from VRAM and plotting to screen --

VRAMstart	= VI_ORIGIN_REG
VRAMend   	= VI_ORIGIN_REG + (VI_WIDTH_REG * height)

do a loop from VRAMstart to VRAMend addresses in RDRAM, decoding the pixel you get according to the pixelsize

-- decoding pixels --

pixels are arranged in BGRA format

  -8/8/8/8 (24 bit) mode- 

-------------------------------------
|   R    |    G   |   B    |   A    |
|--------|--------|--------|--------|
|        |        |        |        |
32      24       16        8        0

Red	= pixel >> 24 & 0xFF
Green	= pixel >> 16 & 0xFF
Blue 	= pixel >> 8 & 0xFF
Alpha	= pixel & 0xFF

   -5/5/5/1 (16 bit) mode- 

---------------------
|  R  |  G  |  B  |A|
|-----|-----|-----|-|
|     |     |     | |
16    11    6     1 0

Red	= pixel >> 11 & 0x1F
Green	= pixel >> 6 & 0x1F
Blue 	= pixel >> 1 & 0x1F
Alpha	= pixel & 0x1F