nx_geo_wasm.nx
buildroot/runtime/nx_geo_wasm.nx
about
nx_geo_wasm.nx -- GEO-024h: sovereign Web-Mercator projection compiled to WASM for the Nishi Maps
browser client. WASM-TARGET rules (per nx_pets_wasm): NO syscalls, fixed offsets, top-level funcs
auto-export, NO forward references (nxc2 resolves top-to-bottom). Pipeline: nxc2 --target wat -> wat
-> wasm (wabt last-mile / nx_wat_compiler sovereign) -> browser calls these exports to reproject on
pan/zoom = true infinite zoom, geo math stays Nishi-authored + Nishi-compiled.
STEP A: nm_merc_x (exact integer longitude axis, no trig). STEP B: nm_merc_y (the Mercator latitude
axis) via nm_tan -- a LOCALS-ONLY CORDIC (no sys_mmap, so it crosses into wasm AND runs native).
license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: fx.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 12 | const NM_LN2: i64 = 45426 // ln(2) in Q16.16 (log2 -> ln) |
functions
| 15 | func nm_add(a: i64, b: i64) -> i64 { return a + b } |
| 18 | func nm_worldpx(z: i64) -> i64 { var n: i64 = 256; var t: i64 = 0; while t < z { n = n * 2; t = t + 1 } return n } |
| 21 | func nm_merc_x(lon: i64, z: i64) -> i64 calls 1: nm_worldpx |
| 29 | func nm_tan(theta_raw: i64) -> i64 |
| 54 | func nm_merc_y(lat: i64, z: i64) -> i64 |