benilla-re systems structs docs

s_bytePackBias

global · unassigned

Address
0x8029cc · 4 bytes, up to 0x8029cf
Type
const float
Meaning
Holds 512.0, the bias that leaves a byte in a float's low mantissa bits
Confidence
verified, proof one
Finding
lighting/daynight#colour-band-value

Finding: Colour band value in lighting: day-night

A colour band's value at h is opaque black, 0xff000000, when it has no keys. Otherwise each of its three channels is the low byte of floor(f32(lo + (hi − lo)·f + 512)) − 512, with lo and hi the channel's byte at keys i and next and f the fraction; the result is 0xff000000 with the channels from the record's byte 2 in bits 16 to 23, byte 1 in 8 to 15 and byte 0 in 0 to 7.

The derivation is in the doc.