code wiki / _hdl_build / nx_chip8_wasm_gate.nx
nx_chip8_wasm_gate.nx
buildroot/runtime/_hdl_build/nx_chip8_wasm_gate.nx
about
nx_chip8_wasm_gate.nx -- R0.3 WASM proof: compiles nx_chip8.nx to wasm via the sovereign pipeline, then
drives the SAME program in nx_wasm_vm (reset -> load -> step, state persisting in the VM's linear memory)
and checks registers + framebuffer + collision match the native gate. Proves the CHIP-8 emulator runs in
the browser lane, bit-identical to native. NISHI all the way (fork sovereign compilers -> nx_wasm_vm, no .sh).
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_gate_emit_lib.nxnx_wasm_vm.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 9 | const CWAT_ELF: *u8 = "/tmp/nx_compile_wat.sov.elf" |
| 10 | const WATC_ELF: *u8 = "/tmp/nx_wat_compiler.sov.elf" |
| 11 | const SRC_NX: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/runtime/nx_chip8.nx" |
| 12 | const OUT_WAT: *u8 = "/tmp/ch8.wat" |
| 13 | const OUT_WASM: *u8 = "/tmp/ch8.wasm" |
functions
| 15 | func run_elf(elf: *u8, a1: *u8, a2: *u8) -> i64 |
| 36 | func wld(mod: *WasmMod, addr: i64, byte: i64) -> i64 { return wm_run(mod, "ch8_load" as *u8, 0, addr, byte, 0, 0, 3) } |
| 37 | func wstep(mod: *WasmMod) -> i64 { return wm_run(mod, "ch8_step" as *u8, 0, 0, 0, 0, 0, 1) } |
| 38 | func wreg(mod: *WasmMod, xi: i64) -> i64 { return wm_run(mod, "ch8_reg" as *u8, 0, xi, 0, 0, 0, 2) } |
| 39 | func wpix(mod: *WasmMod, px: i64, py: i64) -> i64 { return wm_run(mod, "ch8_pixel" as *u8, 0, px, py, 0, 0, 3) } |
| 40 | func wvf(mod: *WasmMod) -> i64 { return wm_run(mod, "ch8_vf" as *u8, 0, 0, 0, 0, 0, 1) } |
| 41 | func wgeti(mod: *WasmMod) -> i64 { return wm_run(mod, "ch8_geti" as *u8, 0, 0, 0, 0, 0, 1) } |
| 43 | func main() -> i64 |