benilla-re systems structs docs

GxLightRecordUpdate

function · gx · primitive

Address
0x593040 · 751 bytes, up to 0x59332e
Signature
void * __thiscall (void *this, const void *light)
Meaning
Copies a light's position, scaled colours and attenuation into the record, setting dirty bits for what changed
Confidence
verified, proof one
Finding
gx/draw#fixed-lights
Test
gx::color_modulate_matches_binary

Finding: Fixed lights in gx: drawing

The device holds four light records (+0x24fc, 0x54 bytes each). 0x593330(index, light, offset) copies a light into a record through 0x593040, which sets one dirty bit per changed group (bit 1 enable, 2 position or direction, 4 ambient, 8 diffuse, 0x10 specular, 0x20, 0x40, 0x80 the three attenuation terms) and stores each colour as three floats byte * (scale / 255), the product of the light's scalar and 1/255 formed at 53 bits before it multiplies the byte. When the light is positional (flags & 2) the offset is subtracted from the position. 0x593570 sets the enable word. 0x589d80 does both and fails for an index of 4 or more.

The derivation is in the doc.

Callers 1

Callees 1

Calls and jumps by a bare address, from tables/calls.tsv.