code wiki / _hdl_build / nx_drift_engine.nx
nx_drift_engine.nx
buildroot/runtime/_hdl_build/nx_drift_engine.nx
about
nx_drift_engine.nx -- the SOVEREIGN engine behind /world/drift: "Nishi Drift", a SURVIVAL game emitted
by composing certified parts in a DIFFERENT mix than Frontier (no worldsim -- survival is depletion,
not a conserved economy). Stranded on a dying hauler: oxygen + hull bleed each cycle, scavenge sector
wrecks (loot tiers), dive deep for double parts at the cost of hull or grab safe to recover air, repair
the beacon (60 parts) and survive to cycle 12 for rescue -- or die. Proves the recombinator composes
into a SECOND genre. The proof battery is genre-honest: the flagship is LOSABILITY (a survival game that
cannot be lost is hollow), not conservation.
Parts: nx_loottable · nx_rpgstats (rising scavenge skill) · nx_gamehud + nx_wire_harness (risk/safe
menu) · nx_game_raster (render) · 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_loottable.nxnx_rpgstats.nxnx_gamehud.nxnx_game_raster.nxnx_wire_harness.nxnx_gamesave.nxnx_png_write.nxnx_game_depth.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 WIN_MAGIC_1469598103: i64 = 1469598103 |
| 23 | const WIN_MAGIC_20260721: i64 = 20260721 |
| 24 | const WIN_MAGIC_7402: i64 = 7402 |
| 25 | const WIN_MAGIC_2000: i64 = 2000 |
| 27 | const NS: i64 = 5 |
| 28 | const FW: i64 = 400 |
| 29 | const FH: i64 = 240 |
| 30 | const WORDS: i64 = 512 |
| 31 | const WIN_CYCLE: i64 = 12 |
| 32 | const WIN_PARTS: i64 = 60 |
| 33 | const F_TICK:i64=0 |
| 34 | const F_SEC: i64=1 |
| 35 | const F_CYC: i64=2 |
| 36 | const F_OXY: i64=3 |
| 37 | const F_HULL:i64=4 |
| 38 | const F_PARTS:i64=5 |
| 39 | const F_SCAV:i64=6 |
| 40 | const F_SKILL:i64=7 |
| 41 | const F_DEEP:i64=8 |
| 42 | const F_WIN: i64=9 |
| 43 | const F_LOSE:i64=10 |
| 44 | const F_RNG: i64=11 |
| 45 | const F_PX: i64=12 |
| 46 | const F_PY: i64=13 |
| 47 | const F_CUR: i64=14 // current wreck tier |
| 48 | const F_HDR: i64=24 |
| 49 | const O_HUD: i64=32 |
functions
| 50 | func g_hud(g: *i64) -> *i64 { return (g as i64 + O_HUD*8) as *i64 } |
| 51 | func d_rng(g: *i64) -> i64 called by 1: de_tick |
| 58 | func sec_x(i: i64) -> i64 { return 44 + i*76 } |
| 59 | func sec_y(i: i64) -> i64 { if i%2==0 { return 84 } else { return 150 } } |
| 61 | func de_new(g: *i64, seed: i64) -> i64 |
| 74 | func loot_weights(wts: *i64) -> i64 { wts[0]=520; wts[1]=280; wts[2]=120; wts[3]=60; wts[4]=20; return 0 } called by 1: de_tick |
| 77 | func de_tick(g: *i64, policy: i64) -> i64 |
| 119 | func de_render(g: *i64, fb: *i64) -> i64 |
| 155 | func de_fbck(fb: *i64) -> i64 { return wh_fbck(fb, FW*FH) } |
| 156 | func de_quality(fb: *i64) -> i64 |
| 161 | func de_png(fb: *i64, path: *u8) -> i64 |
| 168 | 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 } |
| 169 | func wn(v: i64) -> i64 |
| 179 | func de_run(g: *i64, seed: i64, policy: i64, fb: *i64) -> i64 |
| 192 | func main() -> i64 |