benilla-re systems structs docs

SetScreenAspect

function · screencoord · primitive

Address
0x41ad10 · 65 bytes, up to 0x41ad50
Signature
void __stdcall (float aspect)
Meaning
Stores the aspect a, a·0.75, and the scales K2 = 1/sqrt(a² + 1) and K1 = a·K2 with K2 unrounded
Confidence
verified, proof two
Finding
screencoord#screen-scale-state
Test
screencoord::sc_41ad10_set_scale

Finding: Screen scale state in screencoord

0x41ad10 takes the display aspect a, a float, on the stack (ret 4) and sets four floats. With RN24 rounding to float and L = 1/√(a² + 1) computed at 53 bits:

globalvalue
0x832a40a, the dword as passed
0x832a44K1 = RN24(a·L), the screen's width in layout units
0x832a48K2 = RN24(L), the screen's height in layout units
0x832a4cA = RN24(0.75·a)

(K1, K2) is the unit vector along (a, 1), so the screen's diagonal is one layout unit. The file holds 4/3's values except K2: a 1.3333334, K1 0.8 (0x3f4ccccd), K2 0.6 (0x3f19999a), A 1.0; a call with RN24(4/3) stores K2 as 0x3f199999. 0x41ad70 returns A in st0.

The derivation is in the doc.

Callers 2

Callees 0

None by a direct call or jump.

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