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)
u8 in RAM at 0xE141 called DRAW_CLIPRECT_X0H
76543210
xxxxxXXX
X: RW X0 Left edge of drawable region (-1024..1023), high byte
u8 in RAM at 0xE142 called DRAW_CLIPRECT_Y0L
76543210
YYYYYYYY
Y: RW Y0 Top edge of drawable region (-512..511)
u8 in RAM at 0xE143 called DRAW_CLIPRECT_Y0H
76543210
xxxxxxYY
Y: RW Y0 Top edge of drawable region (-512..511), high byte
u8 in RAM at 0xE144 called DRAW_CLIPRECT_X1L
76543210
XXXXXXXX
X: RW X1 Right edge of drawable region (-2048..2047)
u8 in RAM at 0xE145 called DRAW_CLIPRECT_X1H
76543210
xxxxxXXX
X: RW X1 Left edge of drawable region (-2048..2047), high byte
u8 in RAM at 0xE146 called DRAW_CLIPRECT_Y1L
76543210
YYYYYYYY
Y: RW Y1 Bottom edge of drawable region (-512..511)
u8 in RAM at 0xE147 called DRAW_CLIPRECT_Y1H
76543210
xxxxxxYY
Y: RW Y1 Bottom edge of drawable region (-512..511), high byte
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)
u8 in RAM at 0xE149 called DRAW_VERTEX_X0H
76543210
xxxxxXXX
X: RW X0 (-1024..1023), high byte
u8 in RAM at 0xE14A called DRAW_VERTEX_Y0L
76543210
YYYYYYYY
Y: RW Y0 (-512..511)
u8 in RAM at 0xE14B called DRAW_VERTEX_Y0H
76543210
xxxxxxYY
Y: RW Y0 (-512..511), high byte
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)
u8 in RAM at 0xE14D called DRAW_VERTEX_X1H
76543210
xxxxxXXX
X: RW X1 (-1024..1023), high byte
u8 in RAM at 0xE14E called DRAW_VERTEX_Y1L
76543210
YYYYYYYY
Y: RW Y1 (-512..511)
u8 in RAM at 0xE14F called DRAW_VERTEX_Y1H
76543210
xxxxxxYY
Y: RW Y1 (-512..511), high byte
Vertex 2 is used for triangles.
u8 in RAM at 0xE150 called DRAW_VERTEX_X2L
76543210
XXXXXXXX
X: RW X2 (-1024..1023)
u8 in RAM at 0xE151 called DRAW_VERTEX_X2H
76543210
xxxxxXXX
X: RW X2 (-1024..1023), high byte
u8 in RAM at 0xE152 called DRAW_VERTEX_Y2L
76543210
YYYYYYYY
Y: RW Y2 (-512..511)
u8 in RAM at 0xE153 called DRAW_VERTEX_Y2H
76543210
xxxxxxYY
Y: RW Y2 (-512..511), high byte
Vertex 3 is used for quads.
u8 in RAM at 0xE154 called DRAW_VERTEX_X3L
76543210
XXXXXXXX
X: RW X3 (-1024..1023)
u8 in RAM at 0xE155 called DRAW_VERTEX_X3H
76543210
xxxxxXXX
X: RW X3 (-1024..1023), high byte
u8 in RAM at 0xE156 called DRAW_VERTEX_Y3L
76543210
YYYYYYYY
Y: RW Y3 (-512..511)
u8 in RAM at 0xE157 called DRAW_VERTEX_Y3H
76543210
xxxxxxYY
Y: RW Y3 (-512..511), high byte
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.
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.
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)
Name | Value | Comment |
DRAW_COMMAND_CLEAR_CLIPRECT | 0 | Clear the region defined by the cliprect |
DRAW_COMMAND_DRAW_POINT | 1 | Draw a single point (x0,y0) |
DRAW_COMMAND_DRAW_2_POINTS | 2 | Draw 2 points (x0,y0) and (x1,y1) |
DRAW_COMMAND_DRAW_3_POINTS | 3 | Draw 3 points |
DRAW_COMMAND_DRAW_4_POINTS | 4 | Draw 4 points |
DRAW_COMMAND_DRAW_LINE | 5 | Draw a line (x0,y0)-(x1,y1) |
DRAW_COMMAND_DRAW_STRING_OF_2_LINES | 6 | Draw two lines: (x0,y0)-(x1,y1)-(x2,y2) |
DRAW_COMMAND_DRAW_STRING_OF_3_LINES | 7 | Draw three lines: (x0,y0)-(x1,y1)-(x2,y2)-(x3,y3) |
DRAW_COMMAND_DRAW_STAR_OF_3_LINES | 8 | Draw three lines that share (x0,y0) as the first end. The other ends are 1, 2, and 3. |
DRAW_COMMAND_DRAW_TWO_DISCONNECTED_LINES | 9 | Draw lines (x0,y0)-(x1,y1), and (x2,y2)-(x3,y3) |
DRAW_COMMAND_DRAW_TRIANGLE_EDGES | 10 | Draw the edges of the triangle 0,1,2. Specify the points in clockwise order. |
DRAW_COMMAND_DRAW_FILLED_TRIANGLE | 11 | Draw a filled triangle using 0,1,2. Specify the points in clockwise order. |
DRAW_COMMAND_DRAW_BOX_EDGES | 12 | Draw 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_BOX | 13 | Draw a filled (screen-aligned) box whose corners are defined by the min/max values in (x0,y0) and (x1,y1) |
DRAW_COMMAND_DRAW_QUAD_EDGES | 14 | Draw the edges of a 4-point polygon using 0,1,2,3. Specify the points in clockwise order. |
DRAW_COMMAND_DRAW_FILLED_QUAD | 15 | Draw a filled 4-point polygon using 0,1,2,3. Specify the points in clockwise order. |