code wiki / _hdl_build / nx_sim_page.nx

nx_sim_page.nx

buildroot/runtime/_hdl_build/nx_sim_page.nx

4055 B45 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind tooltopic sim
docsdependenciesstructsconstsfunctions

about

nx_sim_page.nx -- GENERIC sovereign packager: any base-relative Nishi sim wasm -> self-contained .html that runs in any browser. Extracted at the 3rd sim (simlab/solarsim/gassim) per the DRY-at-3 rule: the blit JS is identical across sims, only the title/description differ -> pass them as args (data-driven, not hardcoded). The emitted JS does ONLY: BLIT our wasm framebuffer to the canvas via putImageData (copy bytes, NOT canvas drawing), drive the sim each animation frame (ex.tick(0)), and forward R (reset = tick(3)) / space (pause). ALL physics + integer rasterization live in the sovereign wasm (no JS logic, no canvas-draw, no float, no 3rd-party). Any sim that exports init/tick/render/ww/hh/fb_off + treats tick(3) as reset works unchanged. usage: nx_sim_page <in.wasm> <out.html> <title> <description>. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_base64.nx nx_wasmfit.nx nx_sim_page.nx

imports: nx_syscalls.nxnx_base64.nxnx_wasmfit.nx

imported by: nobody (leaf or entry point)

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

main hw sys_write 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 ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close b64_encode b64_enc_char sys_openat_wr sys_write ↻ sys_close ↻

structs

none

consts

none

functions

13func hw(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: main calls 1: sys_write
15func main(argc: i64, argv: *i64) -> i64