benilla-re systems structs docs

GammaRampBuild

function · gx · primitive

Address
0x591680 · 91 bytes, up to 0x5916da
Signature
void __thiscall (void *this, float gamma)
Meaning
Fills three 256-entry 16-bit tables with 65535 times (i / 255) to the power gamma
Confidence
verified, proof one
Finding
gx/device#gamma-ramp
Test
gx::gamma_ramp_matches_binary

Finding: Gamma ramp in gx: the device

0x591680(ramp, g) fills three 256-entry tables of 16-bit values at ramp +0, +0x200 and +0x400: entry i is __ftol(pow(i * (1/255), g) * 65535) in each. The constructor builds the two device ramps for g = 1.0 (+0x328 and +0x928). The device slot +0x34 builds the working ramp +0x328 from a gamma value, slot +0x30 copies in a whole ramp, and the Direct3D versions then call IDirect3DDevice9::SetGammaRamp(0, 0, ramp) only when [dev+0x38b8] & 0x20000 is set and the device is not windowed ([dev+0x20b] clear).

The derivation is in the doc.

Callers 2

Callees 2

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