code wiki / (root) / nx_craft_emit.nx

nx_craft_emit.nx

buildroot/runtime/nx_craft_emit.nx

10009 B169 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
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 license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_game_page_emit.nx nx_craft_emit.nx

imports: nx_syscalls.nxnx_game_page_emit.nx

imported by: nobody (leaf or entry point)

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

main ce_puts sys_write ce_slen ce_run sys_fork sys_mmap sys_execve sys_exit sys_wait4 ce_pn sys_write ↻ sys_mmap ↻ ce_fsize sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close sys_mmap ↻ sys_read_file ↻ gpe_build sys_mmap ↻ b64_encode b64_enc_char gpe_ap gpe_ap_n init_v init_impl_v wc_spec wsp wpack wst ejp wsp ↻ genworld wst ↻ gencol

structs

none

consts

14const CE_GATE: *u8 = "nx_wasm_craft_gate.elf"
15const CE_CWAT: *u8 = "nx_compile_wat.elf"
16const CE_WATC: *u8 = "nx_wat_compiler.elf"
17const CE_SRC: *u8 = "buildroot/runtime/nx_wasm_craft.nx"
18const CE_WAT: *u8 = "buildroot/_build/nx_wasm_craft_emit.wat"
19const CE_WASM: *u8 = "buildroot/_build/nx_wasm_craft_emit.wasm"
20const CE_TMP: *u8 = "sites/nishifamily/world/craft.html.stage"
21const CE_OUT: *u8 = "sites/nishifamily/world/craft.html"
22const CE_TITLE: *u8 = "NISHI CRAFT - SOVEREIGN 3D"
23const CE_NATIVE: *u8 = "nx_desktop_craft"
26const CE_TMP2: *u8 = "sites/nishifamily/world/beach.html.stage"
27const CE_OUT2: *u8 = "sites/nishifamily/world/beach.html"
28const CE_TITLE2: *u8 = "NISHI SHORE - REVIEW STAGE"
29const 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"
32const CE_TMP3: *u8 = "sites/nishifamily/world/vale.html.stage"
33const CE_OUT3: *u8 = "sites/nishifamily/world/vale.html"
34const CE_TITLE3: *u8 = "NISHI VALE - THE MEDIEVAL HIGHLAND"
35const 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"
36const 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>"
37const CE_MIN_WAT: i64 = 500000
38const CE_MIN_WASM: i64 = 50000
39const CE_MIN_PAGE: i64 = 100000
40const CE_MODE: i64 = 0x1a4

functions

42func ce_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: ce_putsce_find
43func ce_puts(s: *u8) -> i64 { sys_write(1, s, ce_slen(s)); return 0 }
called by 2: maince_ship calls 2: sys_writece_slen
44func ce_pn(v: i64) -> i64
called by 2: maince_ship calls 2: sys_writesys_mmap
58func ce_run(elf: *u8, a1: *u8, a2: *u8) -> i64
77func ce_find(hay: *u8, n: i64, needle: *u8) -> i64
called by 1: ce_ship calls 1: ce_slen
90func ce_fsize(p: *u8) -> i64
called by 1: main calls 2: sys_mmapsys_read_file
97func main() -> i64
151func ce_ship(out: *u8, pn: i64, tmpp: *u8, outp: *u8) -> i64