--------------------------
Screen test demo
--------------------------
By David Tucker
david.tucker@goliathindustries.com
http://www.goliathindustries.com/vb/

(C) 2005, all rights reserved


--------------------
- To Do -
--------------------
 - Column Table code looks broken.
 - Does HBias and Affine mode support multiple BGMaps?
 - When switching from Affine/HBias to normal, fill in missing BGMap
 - Posibly add support for unknown elements


--------------------
- Summary -
--------------------
MX,MY and SCX,SCY and OVR define a set of data to cut out of the BGMaps

The resulting image lets call BGCut, where BGCut is 1024x1024 pixles.

GX,GY and W,H takes up to 384x224 pixles from BGCut and place them on the screen


--------------------
- 1 bit flag -
--------------------
OVR
 - seting to 1 disables 'MX,MY wraping' instead a bgmap is filled with 
   OVERPLANE_CHARACTER and is used as the 'wrap' bgmap.
 - When ovr is set the image never wraps, once the source BGMap(s)
   roll off the screen they never reapear no mater how big MX,MY get.

--------------------
- 2 bit flags -
--------------------
SCX & SCY
 - There are a maximum of 8 BGMaps that can be put together at a time, but
   SCX and SCY each can be set to 1,2,4, or 8 BGMaps each making a maximum
   of 16 BGMaps requested.  If there are more BGMaps requested than avalible 
   SCY takes presedent over SCX, so SCX=3 and SCY=1 is the same as SCX=2 and SCY=1
 - The BGMaps must be aligned on boundarys with respect to the total
   number of BGMaps requested, so If you request two BGMaps the first BGMap:
   can be at 0,2,4,6,8,10,12.  If the BGMap requested falls in between it will 
   be rounded down to the nearest apropriate BGMap, so BGMap 1 would be 0...

   # BGMaps   BGMap Base Index
     1        0,1,2,3,4,5,6,7,8,9,a,b,c,d
     2        0,2,4,6,8,a,c
     4        0,4,8 (c results in a corrupt map)
     8        0 (8 results in a corrupt map)


--------------------
- 4 bit address -
--------------------
BGMAP_BASE	(0x0 - 0xD)
- Values greater than 0xD read random junk from memory


--------------------
- 16 bit registers -
--------------------
GX	(0xFC00 - 0x03FF)
 - Wraps at +/- 0x0200 so 0x201 wraps to -0x0200 etc, 
   a value of 0x0400 or 0xFC00 is the same a 0x0000
 - Always wraps to the first two (or one) BGMaps no 
   mater how many BGMaps are enabled with SCX

GY	(0xFC00 - 0x0DF)
 - Values less than 0xFE00 and BGMap wraps to 0x0200, values of 
   0xFC00 gives a full wrap to screen.
 - Does not wrap with positive values
 - Always wraps to the first two (or one) BGMaps no 
   mater how many BGMaps are enabled with SCX

GP(-0x100 - 0x0FF)
 - same wraping as changing GX

MX( -0xFFFF - 0xFFF)
 - Simply wraps to SCX unless OVR is set, thain it loads OVER_PLAIN

MY( -0xFFFF - 0xFFF)
 - Simply wraps to SCY unless OVR is set, thain it loads OVER_PLAIN

MP(-0x100 - 0x0FF)
 - Same wraping as changing MX

W	(0xFC00 - 0x03FF)
 - Values less than zero: bgmap is exposed in the negative in increments of 8
 - Values greater than 0x0200 and BGMap wraps to 0xFE00, values of 
   0x0400 gives a full wrap to screen.
 - Always wraps to the first two (or one) BGMaps no 
   mater how many BGMaps are enabled with SCX
 
H	(0x0008 - 0x03FF)
 - Values less than 8: bgmap always shows the first 8 lines
 - Values greater than 0x0200 and BGMap wraps to 0xFE00, values of 
   0x0400 gives a full wrap to screen.
 - Always wraps to the first two (or one) BGMaps no 
   mater how many BGMaps are enabled with SCX

OVERPLANE_CHARACTER	(0x0000 - 0xDFFF)
 - The Overplane Character is not taken from the character table but instead
   it is an index into BGMap memory, so 0 is char 0 from bgmap 0, 0x1000 is 
   char 0 from bgmap 1

 - Values less than zero result in random junk.

PARAM_BASE(0x000 - 0xEBF)

-------
