code wiki / (root) / nx_craft_move_emit_t72.nx

nx_craft_move_emit_t72.nx

buildroot/runtime/nx_craft_move_emit_t72.nx

57403 B942 linesdepth 11pulls 82 transitivereach 1 importersview sourcekind tooltopic craft
docsdependenciesstructsconstsfunctions

about

nx_craft_emit.nx -- THE SOVEREIGN CRAFT SHIP LANE (retires _ops/nx_emit_game.sh's laptop/WSL dependency for /world/craft): gate-check -> .nx -> .wat -> .wasm -> page -> live docroot, every stage BYTE-ASSERTED before the next runs (the emit script's founding law, organ form: a green tool on empty input is not a check -- a 0-byte .wat once shipped a 20-byte "game"). The page itself is built IN-PROCESS by gpe_build (nx_game_page_emit as a LIB -- one emitter, not a fork), and the deploy is tmp+rename with a READ-BACK byte+marker assert (what LANDED is the claim, never what was written). Gate RED = refuses to emit anything at all. usage: nx_craft_emit (runs from nishihost cwd like every registered tool) exit: 0 SHIPPED | 2 gate-red | 3 wat | 4 wasm | 5 page | 6 deploy | 7 readback | 8 recipe-malformed W1 (2026-08-12): worlds come from knowledge/world_recipes.conf rows (name\tvnum\tseed\tout\t title\tcontrols); the builtin three below are the fallback when the file is absent, and the source actually consumed is ANNOUNCED (recipe_src=) on every run. license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 9 imports · 1 importers

nx_syscalls.nx nx_game_page_move_t72.nx nx_softbind.nx nx_jsbalance.nx nx_jsscope.nx nx_relief_lib.nx nx_nxa_fk.nx nx_wasm_memory_lib.nx nx_wasm_craft_move_t72.nx nx_craft_move_emit_t72.nx nx_craft_move_fit_t72.nx

imports: nx_syscalls.nxnx_game_page_move_t72.nxnx_softbind.nxnx_jsbalance.nxnx_jsscope.nxnx_relief_lib.nxnx_nxa_fk.nxnx_wasm_memory_lib.nxnx_wasm_craft_move_t72.nx

imported by: nx_craft_move_fit_t72.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ce_puts sys_write ce_slen ce_run sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ ce_run_argv sys_mmap ↻ sys_munmap sys_fork sys_execve sys_exit ↻ sys_wait4 wait_status_rc wait_term_signal wait_exit_code sys_munmap ↻ ce_pn sys_write ↻ sys_mmap ↻ cw_donors sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻

structs

none

consts

30const CE_GATE: *u8 = "nx_wasm_craft_gate.elf"
31const CE_CWAT: *u8 = "nx_compile_wat.elf"
32const CE_WATC: *u8 = "nx_wat_compiler.elf"
35const CE_VMGATE: *u8 = "nx_wasm_craft_vm_gate.elf"
36const CE_SRC: *u8 = "buildroot/runtime/nx_wasm_craft.nx"
37const CE_WAT: *u8 = "buildroot/_build/nx_wasm_craft_emit.wat"
38const CE_WASM: *u8 = "buildroot/_build/nx_wasm_craft_emit.wasm"
46const CE_WAT_MT: *u8 = "buildroot/_build/nx_wasm_craft_emit_mt.wat"
47const CE_WASM_MT: *u8 = "buildroot/_build/nx_wasm_craft_emit_mt.wasm"
48const CE_MT_TMP: *u8 = "sites/nishifamily/world/craft_mt.wasm.stage"
49const CE_MT_OUT: *u8 = "sites/nishifamily/world/craft_mt.wasm"
50const CE_SHARED: *u8 = "--shared"
54const CE_MT_HEADROOM: i64 = 2
55const CE_MT_PAGES_MIN: i64 = 16
56const CE_MT_PAGES_MAX: i64 = 65536
57const CE_TMP: *u8 = "sites/nishifamily/world/craft.html.stage"
58const CE_OUT: *u8 = "sites/nishifamily/world/craft.html"
59const CE_TITLE: *u8 = "NISHI CRAFT - SOVEREIGN 3D"
60const CE_NATIVE: *u8 = "nx_desktop_craft"
63const CE_TMP2: *u8 = "sites/nishifamily/world/beach.html.stage"
64const CE_OUT2: *u8 = "sites/nishifamily/world/beach.html"
65const CE_TITLE2: *u8 = "NISHI SHORE - REVIEW STAGE"
66const CE_CTRL2: *u8 = "the flat-light REVIEW STAGE: mixed beachwear across the cast (bred, stable per girl) &middot; same engine, same controls as <a href=\"craft\">NISHI CRAFT</a> &middot; ?review=1 auto-frames the nearest girl<br>ISEKAI: cross to <a href=\"craft\">NISHI CRAFT</a> or <a href=\"vale\">NISHI VALE</a> &mdash; level, ledger and party come along"
69const CE_TMP3: *u8 = "sites/nishifamily/world/vale.html.stage"
70const CE_OUT3: *u8 = "sites/nishifamily/world/vale.html"
71const CE_TITLE3: *u8 = "NISHI VALE - THE MEDIEVAL HIGHLAND"
72const CE_CTRL3: *u8 = "deep woods, cold snowline, cave-riddled stone &mdash; and wardens who hunt WIDE by day &middot; your traveler arrives with his ledger, his level and his party from <a href=\"craft\">NISHI CRAFT</a> or <a href=\"beach\">NISHI SHORE</a> &middot; <b>G</b> invites a bonded girl to your party &middot; same controls"
73const CE_CTRL: *u8 = "click canvas = MOUSELOOK (Esc frees) &middot; <b>WASD</b> move &middot; <b>SPACE</b> jump &middot; L/R-click or <b>E</b>/<b>B</b> break/place &middot; <b>Q</b> cycles 7 slots (blocks &middot; HOE &middot; SEEDS) &middot; till grass, plant, let rain or a pond do the rest, break the GOLDEN crop = harvest &middot; <b>E</b> on a girl = meet her, <b>G</b> invites her to your party &middot; nights are the wardens' &middot; <b>H</b> home &middot; gamepad + touch<br>ISEKAI: your level, ledger and party travel with you &mdash; walk into <a href=\"beach\">NISHI SHORE</a> or <a href=\"vale\">NISHI VALE</a> &middot; <a href=\"craft_immersion\">what is broken and what is next</a>"
74const CE_MIN_WAT: i64 = 500000
75const CE_MIN_WASM: i64 = 50000
76const CE_MIN_PAGE: i64 = 100000
77const CE_MODE: i64 = 0x1a4
163const CE_COMPILE_ARG_WORDS: i64 = 1+2+2+3+2+1
281const CW_NPC_ASSET: *u8 = "sites/nishifamily/world/ref9d.nxa"
309const CW_FACE_SPAN_UM: i64 = 250000 // a 250mm head region: the per-region atlas this argues for
332const CW_NXA_UNIT_UM: i64 = 10 // VERT/SKEL units are 0.01 mm, so one unit is ten microns
333const CW_SKEL_W: i64 = 8 // words per joint: parent, tx ty tz, qx qy qz qw
334const CW_TEXC_W_G: i64 = 2 // TEXC payload word 2 is the atlas grid g
355const CW_Q16: i64 = 65536
571const CE_EV_CAP: i64 = 8192

functions

79func ce_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
80func ce_puts(s: *u8) -> i64 { sys_write(1, s, ce_slen(s)); return 0 }
81func ce_pn(v: i64) -> i64
99func ce_stamp(t: *u8) -> *u8
114func ce_run_argv(elf: *u8,argv: *i64) -> i64
135func ce_run(elf: *u8,a1: *u8,a2: *u8) -> i64
called by 1: main calls 3: sys_mmapce_run_argvsys_munmap
147func ce_run5(elf: *u8,a1: *u8,a2: *u8,a3: *u8,a4: *u8,a5: *u8) -> i64
164func ce_compiler_argv(out: *u8,shared_max: *u8,argv: *i64,words: i64,floor_text: *u8,limit_text: *u8) -> i64
called by 1: ce_compile_craft calls 1: ce_num_str
192func ce_compile_craft(out: *u8,shared_max: *u8) -> i64
209func ce_num_str(v: i64, b: *u8) -> i64
225func ce_wat_pages(p: *u8) -> i64
called by 1: main calls 3: sys_mmapsys_read_filece_slen
254func ce_find(hay: *u8, n: i64, needle: *u8) -> i64
called by 3: cw_npc_atlasmaince_ship calls 1: ce_slen
267func ce_fsize(p: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
282func cw_rd64(b: *u8, off: i64) -> i64 { var v: i64 = 0; var k: i64 = 7; while k >= 0 { v = v*256 + (b[off+k] as i64); k = k - 1 } return v }
283func cw_tag4(b: *u8, off: i64, t: *u8) -> i64 { if b[off] == t[0] { if b[off+1] == t[1] { if b[off+2] == t[2] { if b[off+3] == t[3] { return 1 } } } } return 0 }
310func cw_band_line(nm: *u8, lambda_um: i64, res: i64) -> i64
335func cw_bone_span_um(ab: *u8, skoff: i64, nj: i64, j: i64) -> i64
called by 1: cw_chart_adequacy calls 2: cw_rd64nf_isqrt
356func cw_chart_vres(ab: *u8, tc: i64, rectoff: i64, j: i64, res: i64, g: i64) -> i64
called by 1: cw_chart_adequacy calls 1: cw_rd64
362func cw_chart_line(nm: *u8, jj: i64, span: i64, cres: i64) -> i64
374func cw_chart_adequacy(ab: *u8, res: i64) -> i64
434func cw_atlas_adequate(ab: *u8, tmoff: i64) -> i64
475func cw_npc_atlas(page: *u8, pn: i64) -> i64
510func cw_donors() -> i64
572func ce_cat(d: *u8, p: i64, s: *u8) -> i64
called by 1: ce_evidence
577func ce_catn(d: *u8, p: i64, v: i64) -> i64
called by 1: ce_evidence
587func ce_evidence(base_ctrl: *u8, out: *u8) -> i64
608func main() -> i64
835func ce_ship(out: *u8, pn: i64, tmpp: *u8, outp: *u8) -> i64