DRAW CLIPRECT X0L

The cliprect controls where pixels can be drawn within the HiColor Layer. The rectangle is inclusive.

u8 in RAM at 0xE140 called DRAW_CLIPRECT_X0L

76543210
XXXXXXXX

X: RW X0 Left edge of drawable region (-1024..1023)

DRAW CLIPRECT X0H

u8 in RAM at 0xE141 called DRAW_CLIPRECT_X0H

76543210
xxxxxXXX

X: RW X0 Left edge of drawable region (-1024..1023), high byte

DRAW CLIPRECT Y0L

u8 in RAM at 0xE142 called DRAW_CLIPRECT_Y0L

76543210
YYYYYYYY

Y: RW Y0 Top edge of drawable region (-512..511)

DRAW CLIPRECT Y0H

u8 in RAM at 0xE143 called DRAW_CLIPRECT_Y0H

76543210
xxxxxxYY

Y: RW Y0 Top edge of drawable region (-512..511), high byte

DRAW CLIPRECT X1L

u8 in RAM at 0xE144 called DRAW_CLIPRECT_X1L

76543210
XXXXXXXX

X: RW X1 Right edge of drawable region (-2048..2047)

DRAW CLIPRECT X1H

u8 in RAM at 0xE145 called DRAW_CLIPRECT_X1H

76543210
xxxxxXXX

X: RW X1 Left edge of drawable region (-2048..2047), high byte

DRAW CLIPRECT Y1L

u8 in RAM at 0xE146 called DRAW_CLIPRECT_Y1L

76543210
YYYYYYYY

Y: RW Y1 Bottom edge of drawable region (-512..511)

DRAW CLIPRECT Y1H

u8 in RAM at 0xE147 called DRAW_CLIPRECT_Y1H

76543210
xxxxxxYY

Y: RW Y1 Bottom edge of drawable region (-512..511), high byte

DRAW VERTEX X0L

Vertex 0 is used for points, lines, triangles. It is also used as the top-left corner when drawing boxes.

u8 in RAM at 0xE148 called DRAW_VERTEX_X0L

76543210
XXXXXXXX

X: RW X0 (-1024..1023)

DRAW VERTEX X0H

u8 in RAM at 0xE149 called DRAW_VERTEX_X0H

76543210
xxxxxXXX

X: RW X0 (-1024..1023), high byte

DRAW VERTEX Y0L

u8 in RAM at 0xE14A called DRAW_VERTEX_Y0L

76543210
YYYYYYYY

Y: RW Y0 (-512..511)

DRAW VERTEX Y0H

u8 in RAM at 0xE14B called DRAW_VERTEX_Y0H

76543210
xxxxxxYY

Y: RW Y0 (-512..511), high byte

DRAW VERTEX X1L

Vertex 1 is used for lines and triangles. It is also used as the bottom-right corner when drawing boxes.

u8 in RAM at 0xE14C called DRAW_VERTEX_X1L

76543210
XXXXXXXX

X: RW X1 (-1024..1023)

DRAW VERTEX X1H

u8 in RAM at 0xE14D called DRAW_VERTEX_X1H

76543210
xxxxxXXX

X: RW X1 (-1024..1023), high byte

DRAW VERTEX Y1L

u8 in RAM at 0xE14E called DRAW_VERTEX_Y1L

76543210
YYYYYYYY

Y: RW Y1 (-512..511)

DRAW VERTEX Y1H

u8 in RAM at 0xE14F called DRAW_VERTEX_Y1H

76543210
xxxxxxYY

Y: RW Y1 (-512..511), high byte

DRAW VERTEX X2L

Vertex 2 is used for triangles.

u8 in RAM at 0xE150 called DRAW_VERTEX_X2L

76543210
XXXXXXXX

X: RW X2 (-1024..1023)

DRAW VERTEX X2H

u8 in RAM at 0xE151 called DRAW_VERTEX_X2H

76543210
xxxxxXXX

X: RW X2 (-1024..1023), high byte

DRAW VERTEX Y2L

u8 in RAM at 0xE152 called DRAW_VERTEX_Y2L

76543210
YYYYYYYY

Y: RW Y2 (-512..511)

DRAW VERTEX Y2H

u8 in RAM at 0xE153 called DRAW_VERTEX_Y2H

76543210
xxxxxxYY

Y: RW Y2 (-512..511), high byte

DRAW VERTEX X3L

Vertex 3 is used for quads.

u8 in RAM at 0xE154 called DRAW_VERTEX_X3L

76543210
XXXXXXXX

X: RW X3 (-1024..1023)

DRAW VERTEX X3H

u8 in RAM at 0xE155 called DRAW_VERTEX_X3H

76543210
xxxxxXXX

X: RW X3 (-1024..1023), high byte

DRAW VERTEX Y3L

u8 in RAM at 0xE156 called DRAW_VERTEX_Y3L

76543210
YYYYYYYY

Y: RW Y3 (-512..511)

DRAW VERTEX Y3H

u8 in RAM at 0xE157 called DRAW_VERTEX_Y3H

76543210
xxxxxxYY

Y: RW Y3 (-512..511), high byte

DRAW STENCIL PATTERN L

This Stencil Pattern is a 4x4 pixel, 1-bit image. A 0 means use COLOR0, and a 1 means use COLOR1.

u8 in RAM at 0xE15C called DRAW_STENCIL_PATTERNL

76543210
AAAABBBB

A: RW Colors for the 1st (top) row of the pattern.
B: RW Colors for the 2nd row of the pattern.

DRAW STENCIL PATTERN H

u8 in RAM at 0xE15D called DRAW_STENCIL_PATTERNH

76543210
CCCCDDDD

C: RW Colors for the 3rd row of the pattern.
D: RW Colors for the 4th (bottom) row of the pattern.

DRAW COMMAND

Note that this register cannot be written to unless the HICOLOR_STATUS.BUSY flag is clear. The act of writing to this register (when allowed) triggers BUSY, and the command immediately begins to execute.

u8 in RAM at 0xE15F called DRAW_COMMAND

76543210
ASBFMMMM

A: RW Stencil Absolute (1=align to top-left corner of layer, 0=align to X0,Y0 coordinate)
S: RW Stencil Enable (1=Use Stencil, 0=use COLOR0)
B: RW 1=Backface-cull (uses vertices 0,1, and 2) to clip all object(s). 0=Just draw.
F: RW 1=Frontface-cull (uses vertices 0,1, and 2) to clip all object(s). 0=Just draw.
M: RW Draw Command Mode (See enum DrawCommandMode)

const DRAW_COMMAND_STENCIL_ABSOLUTE


DRAW_COMMAND_STENCIL_ABSOLUTE = 128

const DRAW_COMMAND_STENCIL_RELATIVE


DRAW_COMMAND_STENCIL_RELATIVE = 0

const DRAW_COMMAND_STENCIL_ENABLE


DRAW_COMMAND_STENCIL_ENABLE = 64

const DRAW_COMMAND_STENCIL_DISABLE


DRAW_COMMAND_STENCIL_DISABLE = 0

const DRAW_COMMAND_CULL_BACKS


DRAW_COMMAND_CULL_BACKS = 32

const DRAW_COMMAND_CULL_FRONTS


DRAW_COMMAND_CULL_FRONTS = 16


enum DrawCommandMode

NameValueComment
DRAW_COMMAND_CLEAR_CLIPRECT0Clear the region defined by the cliprect
DRAW_COMMAND_DRAW_POINT1Draw a single point (x0,y0)
DRAW_COMMAND_DRAW_2_POINTS2Draw 2 points (x0,y0) and (x1,y1)
DRAW_COMMAND_DRAW_3_POINTS3Draw 3 points
DRAW_COMMAND_DRAW_4_POINTS4Draw 4 points
DRAW_COMMAND_DRAW_LINE5Draw a line (x0,y0)-(x1,y1)
DRAW_COMMAND_DRAW_STRING_OF_2_LINES6Draw two lines: (x0,y0)-(x1,y1)-(x2,y2)
DRAW_COMMAND_DRAW_STRING_OF_3_LINES7Draw three lines: (x0,y0)-(x1,y1)-(x2,y2)-(x3,y3)
DRAW_COMMAND_DRAW_STAR_OF_3_LINES8Draw three lines that share (x0,y0) as the first end. The other ends are 1, 2, and 3.
DRAW_COMMAND_DRAW_TWO_DISCONNECTED_LINES9Draw lines (x0,y0)-(x1,y1), and (x2,y2)-(x3,y3)
DRAW_COMMAND_DRAW_TRIANGLE_EDGES10Draw the edges of the triangle 0,1,2. Specify the points in clockwise order.
DRAW_COMMAND_DRAW_FILLED_TRIANGLE11Draw a filled triangle using 0,1,2. Specify the points in clockwise order.
DRAW_COMMAND_DRAW_BOX_EDGES12Draw the edges of a screen-aligned box whose corners are defined by the min/max values in (x0,y0) and (x1,y1)
DRAW_COMMAND_DRAW_FILLED_BOX13Draw a filled (screen-aligned) box whose corners are defined by the min/max values in (x0,y0) and (x1,y1)
DRAW_COMMAND_DRAW_QUAD_EDGES14Draw the edges of a 4-point polygon using 0,1,2,3. Specify the points in clockwise order.
DRAW_COMMAND_DRAW_FILLED_QUAD15Draw a filled 4-point polygon using 0,1,2,3. Specify the points in clockwise order.