code wiki / (root) / nx_world_snap.nx

nx_world_snap.nx

buildroot/runtime/nx_world_snap.nx

43394 B737 linesdepth 6pulls 35 transitivereach 0 importersview sourcekind orphan librarytopic world
docsdependenciesstructsconstsfunctions

about

nx_world_snap.nx -- THE WORLD-ART CAPTURE INSTRUMENT (operator 2026-08-12: "make sure you are running the tools to evaluate the art and realism and quality"). The W1b style overlay applies in the BROWSER page only, so no estate instrument had ever SEEN a styled world -- this organ renders any (identity, seed, style-rows) world NATIVELY through the same engine source the wasm is compiled from (nx_wasm_craft as a lib; its 54-tooth gate is the native-behavior proof), and writes the frame as PNG for the judge battery (nx_uiq_visual analyze / nx_frame_score / eye). The style poke here is semantically what the page's NXSP loop does: sp[idx]=val post-init, idx bounded 7..58 (same belt as the page). usage: nx_world_snap <out.png> [v] [seed] [style idx:val,...] [ticks] exit: 0 written+read-back | 2 usage | 5 png-write-fail. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 4 imports · 0 importers

nx_wasm_craft.nx nx_genp_allow_lib.nx nx_png_write.nx nx_nxfh_lib.nx nx_world_snap.nx

imports: nx_wasm_craft.nxnx_genp_allow_lib.nxnx_png_write.nxnx_nxfh_lib.nx

imported by: nobody (leaf or entry point)

structs

none

consts

16const K_MAGIC_20260728: i64 = 20260728
17const K_MAGIC_4096: i64 = 4096
18const K_MAGIC_65536: i64 = 65536
19const K_MODE_RW: i64 = 420 // 0644 -- the .d16 raw depth plane, same mode nx_png_write uses
24const WS_Q_NATIVE: i64 = 1
25const WS_CH_Q: i64 = 113 // ASCII 'q' -- first byte of the `q=<n>` reduction keyword
26const WS_CH_EQ: i64 = 61 // ASCII '='
27const WS_PERMIL: i64 = 1000 // permil base for the announced resolution fraction
30const WS_QKW_LEN: i64 = 2
31const WS_CURSOR_BYTES: i64 = 16 // one i64 cursor cell, page-rounded by mmap
37const WS_PERCEPT_W: i64 = 400
38const WS_PERCEPT_H: i64 = 240
51const WS_D16_MAX: i64 = 65535
55const WS_ISQRT_HI_BOUND: i64 = 4294967296

functions

59func ws2_natw() -> i64 { return W }
60func ws2_nath() -> i64 { return H }
62func ws2_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
63func ws2_puts(s: *u8) -> i64 { sys_write(1, s, ws2_slen(s)); return 0 }
64func ws2_pn(v: i64) -> i64
77func ws2_int(s: *u8) -> i64
87func ws2_num_at(s: *u8, pos: *i64) -> i64
99func ws2_streq(a: *u8, b: *u8) -> i64
109func main(argc: i64, argv: *i64) -> i64