GxLightRecordPack
function · gx · unreached
- Address
0x5933c0· 419 bytes, up to0x593562- Signature
void __fastcall (void *arg1, uint32_t unused, uint32_t index, uint32_t *outRecord)- Meaning
- Rounds a light record's float colours to bytes with +0.5; called only from the unreached 0x589dc0
- Confidence
- verified, proof one
- Finding
- gx/draw#fixed-lights
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
- GxLightPack gx
Callees 1
- __ftol crt
Calls and jumps by a bare address, from tables/calls.tsv.