benilla-re systems structs docs

UnscaleScreenXY

function · screencoord · primitive

Address
0x41ade0 · 37 bytes, up to 0x41ae04
Signature
void __fastcall (float *out_x, float *out_y, float x, float y)
Meaning
Writes x over 0x832a44 and y over 0x832a48 to whichever outputs are not null
Confidence
verified, proof one
Finding
screencoord#scaling-and-unscaling
Test
screencoord::sc_41ade0_unscale_xy

Finding: Scaling and unscaling in screencoord

Eight functions convert a coordinate between layout units and raw ones, x by K1 and y by K2:

functiontakesresult
0x41ae60x on the stack, ret 4K1·x in st0
0x41ae70y on the stack, ret 4K2·y in st0
0x41ae40x on the stack, ret 4x/K1 in st0
0x41ae50y on the stack, ret 4y/K2 in st0
0x41ad80ecx and edx pointers, x, y on the stack, ret 8stores K1·x through ecx and K2·y through edx, each only when its pointer is not null
0x41ade0the samestores x/K1 and y/K2, each only when its pointer is not null
0x41adb0ecx a rectangle of four floats, edx the outputwrites K1·r[0], K1·r[2], K2·r[1], K2·r[3] in that order
0x41ae10the samewrites r[0]/K1, r[2]/K1, r[1]/K2, r[3]/K2 in that order

The single-value functions return the 53-bit product or quotient without rounding to float; the pointer forms store each result rounded to float. Nothing tests for a zero scale: a zero divisor gives an infinity, or NaN for a zero argument. 0x41adb0 and 0x41ae10 have no caller and are in the last entry.

The derivation is in the doc.

Callers 14

Callees 0

None by a direct call or jump.

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