benilla-re systems structs docs

GetMapAreaAtPoint

function · ui · primitive

Address
0x4a6ec0 · 567 bytes, up to 0x4a70f6
Meaning
Returns the area id under a point of the displayed map, or 0
Confidence
verified, proof two
Finding
ui/geometry#the-cell-of-a-point
Test
ui::geo_4a6ec0

Finding: The cell of a point in ui: map geometry

0x4a6ec0(u, v) returns the area id under a point of the displayed map, or 0. The row is the selection's: the selected zone, else the continent's own row, else the direct-area word. Both arguments are clamped to 0 to 1. The row's two extents (+0x10 less +0x14, +0x18 less +0x1c) must be nonzero. The position is lo + (1 − u)·extent, and a cell's coordinate on each axis is 0.5 − position / 34133.33, which must lie in 0 to 1 inclusive; the cell is column trunc(128·x) and row trunc(128·y) of the continent's grid. A direct area, the world view and a missing row give 0.

The derivation is in the doc.

Callers 2

Callees 1

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