benilla-re systems structs docs

__ctrlfp

function · crt · boundary

Address
0x40cf81 · 35 bytes, up to 0x40cfa3
Signature
int32_t __cdecl (uint32_t newWord, uint32_t mask)
Meaning
Sets the x87 control word to (old & ~mask) | (new & mask) and returns the old word
Confidence
verified, proof one
Name from
the community database (idb)
Finding
ui/billing#the-minutes-reading

Finding: The minutes reading in ui: play time and the billing rest time

The poll reads the time left as minutes: left = deadline - now as a dword, zero-extended, times the f32 0x378bcf65 (a hair over 1/60000) at 53-bit precision, rounded up, truncated to an integer, and compared as unsigned. For 1 <= left < 89,999,999 the reading is left / 60000 + 1 (integer division): a whole minute reads as two, 0 reads 0. For n >= 2 the first left that reads n is floor(60000(n - 1) * 2^34 / 17179869375) + 1, which is 60000(n - 1) less k ms, k = 1 from n = 1501, 2 from 3000, 3 from 4499. The arm's 4320-minute cap reaches only k of 1 and 2; more needs a wrapped left.

The derivation is in the doc.

Callers 12

Callees 0

None by a direct call or jump.

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