code wiki / _hdl_build / nx_frontier_engine.nx
nx_frontier_engine.nx
buildroot/runtime/_hdl_build/nx_frontier_engine.nx
about
nx_frontier_engine.nx -- the SOVEREIGN engine behind the playable /world/frontier game: "Nishi
Frontier" emitted by COMPOSING certified parts (the gamebench recombinator realized in NishiLang, not
JS). A trader-explorer crossing a star map of faction stations -- find cargo (loot tiers), hold or SELL
on a CONSERVED faction economy, level up, retire rich. A genre blend matching NO ingested reference
title. The browser page is the last-mile playtest; THIS is the sovereign truth: it renders real PNG
frames and PROVES the composition (conservation, determinism, save-load, experiential) so the same
design is verified in the sovereign stack, not just the shim. Economics match the tuned live game
exactly (hold-then-sell, sell = cargo*(50+lvl*12), win at 2400cr & level 5).
Parts: nx_worldsim · nx_rpgstats · nx_loottable · nx_gamehud + nx_wire_harness · nx_game_raster ·
nx_gamesave · nx_frame_sanity (via harness) · nx_png_write. license_tier: ORIGINAL expect_exit: 0
dependencies 11 imports · 0 importers
diagram shows first 10 each side; +1 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_worldsim.nxnx_rpgstats.nxnx_loottable.nxnx_gamehud.nxnx_game_raster.nxnx_wire_harness.nxnx_gamesave.nxnx_png_write.nxnx_game_art.nxnx_game_critic.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
| 22 | const F_MAGIC_1400: i64 = 1400 |
| 23 | const F_MAGIC_20260721: i64 = 20260721 |
| 24 | const F_MAGIC_1469598103: i64 = 1469598103 |
| 25 | const F_MAGIC_7401: i64 = 7401 |
| 27 | const NF: i64 = 5 |
| 28 | const FW: i64 = 400 |
| 29 | const FH: i64 = 240 |
| 30 | const WORDS: i64 = 512 |
| 31 | const F_TICK:i64=0 |
| 32 | const F_STN: i64=1 |
| 33 | const F_XP: i64=2 |
| 34 | const F_LVL: i64=3 |
| 35 | const F_HP: i64=4 |
| 36 | const F_CRED:i64=5 |
| 37 | const F_CARGO:i64=6 |
| 38 | const F_VIS: i64=7 |
| 39 | const F_SELLS:i64=8 |
| 40 | const F_FINDS:i64=9 |
| 41 | const F_WIN: i64=10 |
| 42 | const F_RNG: i64=11 |
| 43 | const F_PX: i64=12 |
| 44 | const F_PY: i64=13 |
| 45 | const F_HDR: i64=24 |
| 46 | const O_WS: i64=32 // ws_words(5)=56 -> 32..88 |
| 47 | const O_HUD: i64=96 // 96..160 |
| 48 | const XB: i64=20 |
| 49 | const XQ: i64=10 |
| 50 | const HPB: i64=12 |
| 51 | const HPC: i64=2 |
| 52 | const HPL: i64=3 |
| 53 | const CON: i64=14 |
| 54 | const WIN_CRED: i64=2400 |
| 55 | const WIN_LVL: i64=5 |
functions
| 57 | func g_ws(g: *i64) -> *i64 { return (g as i64 + O_WS*8) as *i64 } |
| 58 | func g_hud(g: *i64) -> *i64 { return (g as i64 + O_HUD*8) as *i64 } |
| 59 | func g_rng(g: *i64) -> i64 called by 1: fe_tick |
| 66 | func stn_x(i: i64) -> i64 { return 44 + i*76 } |
| 67 | func stn_y(i: i64) -> i64 { if i%2==0 { return 84 } else { return 150 } } |
| 69 | func sell_value(cargo: i64, lvl: i64) -> i64 { return cargo * (50 + lvl*12) } called by 1: fe_tick |
| 71 | func fe_new(g: *i64, seed: i64) -> i64 |
| 90 | func cargo_weights(wts: *i64) -> i64 { wts[0]=600; wts[1]=250; wts[2]=100; wts[3]=40; wts[4]=10; return 0 } called by 1: fe_tick |
| 92 | func fe_tick(g: *i64) -> i64 |
| 126 | func fe_render(g: *i64, fb: *i64) -> i64 |
| 169 | func fe_quality(fb: *i64) -> i64 |
| 174 | func fe_fbck(fb: *i64) -> i64 { return wh_fbck(fb, FW*FH) } |
| 175 | func fe_png(fb: *i64, path: *u8) -> i64 |
| 189 | func ww(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 190 | func wn(v: i64) -> i64 |
| 200 | func main() -> i64 |