AMBIENT LIGHT COLORL

In HiColor 4096-color mode, this is the Green & Blue values of an RGB value. In HiColor 256-color mode, this is the 8-bit color index, and the Lighting Engine cannot apply light to it.

u8 in RAM at 0xE160 called AMBIENT_LIGHT0_COLORL
u8 in RAM at 0xE162 called AMBIENT_LIGHT1_COLORL

76543210
GGGGBBBB

G: RW Green
B: RW Blue

AMBIENT LIGHT COLORH

In 4096-color mode, this is the top byte of an RGB value. In 256-color mode, this register is not used.

u8 in RAM at 0xE161 called AMBIENT_LIGHT0_COLORH
u8 in RAM at 0xE163 called AMBIENT_LIGHT1_COLORH

76543210
PPPPRRRR

P: RW Light Power (-8..0..7), where -8 is 'off', 0 is 'normal', 7 is 'double-bright'.
R: RW Red Value of an RGB value

DIRECTIONAL LIGHT COLORL

In HiColor 4096-color mode, this is the Green & Blue values of an RGB value. In HiColor 256-color mode, this is the 8-bit color index, and the Lighting Engine cannot apply light to it. This directional light is like an infinitely far away sun. It casts parallel rays. Note that it has a normal which indicates the direction that the light is shining. The light has no fall-off.

u8 in RAM at 0xE164 called DIRECTIONAL_LIGHT0_COLORL
u8 in RAM at 0xE169 called DIRECTIONAL_LIGHT1_COLORL
u8 in RAM at 0xE16E called DIRECTIONAL_LIGHT2_COLORL

76543210
GGGGBBBB

G: RW Green
B: RW Blue

DIRECTIONAL LIGHT COLORH

In 4096-color mode, this is the top byte of an RGB value. In 256-color mode, this register is not used.

u8 in RAM at 0xE165 called DIRECTIONAL_LIGHT0_COLORH
u8 in RAM at 0xE16A called DIRECTIONAL_LIGHT1_COLORH
u8 in RAM at 0xE16F called DIRECTIONAL_LIGHT2_COLORH

76543210
PPPPRRRR

P: RW Light Power (-8..0..7), where -8 is 'off', 0 is 'normal', 7 is 'double-bright'.
R: RW Red Value of an RGB value

DIRECTIONAL LIGHT NORMALX

A value from -127..127, indicating the X component of the light normal. The normal should have a unit length of 127.

u8 in RAM at 0xE166 called DIRECTIONAL_LIGHT0_NORMALX
u8 in RAM at 0xE16B called DIRECTIONAL_LIGHT1_NORMALX
u8 in RAM at 0xE170 called DIRECTIONAL_LIGHT2_NORMALX

76543210
NNNNNNNN

N: RW The value of the normal's X axis (-127..127).

DIRECTIONAL LIGHT NORMALY

A value from -127..127, indicating the Y component of the light normal.

u8 in RAM at 0xE167 called DIRECTIONAL_LIGHT0_NORMALY
u8 in RAM at 0xE16C called DIRECTIONAL_LIGHT1_NORMALY
u8 in RAM at 0xE171 called DIRECTIONAL_LIGHT2_NORMALY

76543210
NNNNNNNN

N: RW The value of the normal's Y axis (-127..127).

DIRECTIONAL LIGHT 0 NORMALZ

A value from -127..127, indicating the Z component of the light normal.

u8 in RAM at 0xE168 called DIRECTIONAL_LIGHT0_NORMALZ
u8 in RAM at 0xE16D called DIRECTIONAL_LIGHT1_NORMALZ
u8 in RAM at 0xE172 called DIRECTIONAL_LIGHT2_NORMALZ

76543210
NNNNNNNN

N: RW The value of the normal's Z axis (-127..127).

MATERIAL DIFFUSE COLORL

In HiColor 4096-color mode, this is the Green & Blue values of an RGB value. In HiColor 256-color mode, this is the 8-bit color index, and the Lighting Engine cannot apply light to it.

u8 in RAM at 0xE176 called MATERIAL_DIFFUSE_COLOR0L
u8 in RAM at 0xE179 called MATERIAL_DIFFUSE_COLOR1L

76543210
GGGGBBBB

G: RW Green
B: RW Blue

MATERIAL DIFFUSE COLORH

In 4096-color mode, this is the top byte of an RGB value. In 256-color mode, this register is not used.

u8 in RAM at 0xE177 called MATERIAL_DIFFUSE_COLOR0H
u8 in RAM at 0xE17A called MATERIAL_DIFFUSE_COLOR1H

76543210
TxDDRRRR

T: RW Transparency (1=Transparent, 0=Opaque)
D: RW Depth (0..3)
R: RW Red Value of an RGB value

MATERIAL CONTROL REGISTER

Controls the lighting that will affect the color of the next object rendered by the Draw Engine. Each control register is specific to a draw-color. Thus, you can make patterns within surfaces appear to self illuminate, or react to different lights, etc. Note that you can set a bit in the first control register that will cause it to drive both colors identically. Note that you can configure the Lighting Engine to 'do nothing' to the input colors, by clearing the control register's USE_LIGHTING_ENGINE bit to use 'Self Lit' mode. Then, you can set the one or two material colors that you need, and draw objects using the Draw Engine. In this configuration, they will use the exact colors that you have specified.

u8 in RAM at 0xE178 called MATERIAL_0_CONTROL
u8 in RAM at 0xE17B called MATERIAL_1_CONTROL

76543210
SUNMxCBA

S: RW Use Lighting Engine (0=Self Lit, 1=Use Lights). A self lit object emits its' own material color, without any lighting calculations involved.
U: RW Use Material 0 Control for Material 1 as well (1=Use this register for both materials, 0 = Each material uses its' own Material Control Register). This bit is only available on the first control register.
N: RW Use Ambient Light 1
M: RW Use Ambient Light 0
C: RW Use Light 2
B: RW Use Light 1
A: RW Use Light 0

SURFACE NORMALX

A 3d vector of length 127, indicating the direction of the surface normal.

u8 in RAM at 0xE173 called SURFACE_NORMALX

76543210
NNNNNNNN

N: RW The value of the normal's X axis (-127..127).

SURFACE NORMALY

A 3d vector of length 127, indicating the direction of the surface normal.

u8 in RAM at 0xE174 called SURFACE_NORMALY

76543210
NNNNNNNN

N: RW The value of the normal's Y axis (-127..127).

SURFACE NORMALZ

A 3d vector of length 127, indicating the direction of the surface normal.

u8 in RAM at 0xE175 called SURFACE_NORMALZ

76543210
NNNNNNNN

N: RW The value of the normal's X axis (-127..127).

RESULT COLOR0L

In 4096-color mode, this is the Green & Blue values of an RGB value. In 256-color mode, this is the 8-bit color index.

u8 in RAM at 0xE17C called RESULT_COLOR0L

76543210
GGGGBBBB

G: RW Green
B: RW Blue

RESULT COLOR0H

In 4096-color mode, this is the top byte of an RGB value. In 256-color mode, this register is not used.

u8 in RAM at 0xE17D called RESULT_COLOR0H

76543210
TxDDRRRR

T: RW Transparency Bit (1=Transparent, 0=Opaque)
D: RW Per-Pixel Depth (0..3)
R: RW Red Value of an RGB value

RESULT COLOR1L

In 4096-color mode, this is the Green & Blue values of an RGB value. In 256-color mode, this is the 8-bit color index.

u8 in RAM at 0xE17E called RESULT_COLOR1L

76543210
GGGGBBBB

G: RW Green
B: RW Blue

RESULT COLOR1H

In 4096-color mode, this is the top byte of an RGB value. In 256-color mode, this register is not used.

u8 in RAM at 0xE17F called RESULT_COLOR1H

76543210
TxDDRRRR

T: RW Transparency Bit (1=Transparent, 0=Opaque)
D: RW Per-Pixel Depth (0..3)
R: RW Red Value of an RGB value

const LIGHTCONTROL_ENABLE_LIGHT0


LIGHTCONTROL_ENABLE_LIGHT0 = 1

const LIGHTCONTROL_ENABLE_LIGHT1


LIGHTCONTROL_ENABLE_LIGHT1 = 2

const LIGHTCONTROL_ENABLE_LIGHT2


LIGHTCONTROL_ENABLE_LIGHT2 = 4

const LIGHTCONTROL_ENABLE_AMBIENT_LIGHT0


LIGHTCONTROL_ENABLE_AMBIENT_LIGHT0 = 16

const LIGHTCONTROL_ENABLE_AMBIENT_LIGHT1


LIGHTCONTROL_ENABLE_AMBIENT_LIGHT1 = 32

const LIGHTCONTROL_USE_CONTROL0_FOR_MATERIAL0AND1


LIGHTCONTROL_USE_CONTROL0_FOR_MATERIAL0AND1 = 64

const LIGHTCONTROL_USE_CONTROL0_FOR_MATERIAL0


LIGHTCONTROL_USE_CONTROL0_FOR_MATERIAL0 = 0

const LIGHTCONTROL_ENABLE_LIGHTING_ENGINE


LIGHTCONTROL_ENABLE_LIGHTING_ENGINE = 128

const LIGHTCONTROL_DISABLE_LIGHTING_ENGINE


LIGHTCONTROL_DISABLE_LIGHTING_ENGINE = 0

const LIGHTCONTROL_SELF_LIT


LIGHTCONTROL_SELF_LIT = 0