code wiki / _hdl_build / nx_wire_endlesssky_gate.nx

nx_wire_endlesssky_gate.nx

buildroot/runtime/_hdl_build/nx_wire_endlesssky_gate.nx

32260 B764 linesdepth 6pulls 25 transitivereach 0 importersview sourcekind gate/prooftopic wire
docsdependenciesstructsconstsfunctions

about

nx_wire_endlesssky_gate.nx -- TITLE WIRING #3: Endless Sky (space trading / adventure). An actual playable trading loop built ONLY from certified parts: nx_worldsim holds 5 factions (player-trader + 4 governments) whose economy CONSERVES wealth exactly (trades move credits, production is accounted); nx_plotgen generates mission graphs that the REAL nx_story_vm executes stepwise (branches taken when their flag-gates are satisfied, REFUSED when not); mission content round-trips through nx_gamesave as a durable content file; ship outfits apply as nx_rpgstats modifiers to cargo capacity and the trading skill ranks up through rs_skill_rank; the ambient theme renders through nx_gamemusic; the whole game state passes the GX-9 save/load transparency test. CAPS EXERCISED (bit = nx_gamebench capability index; measured mask = artifact payload[0]): bit 21 world-sim-factions bit 12 dialogue-tree-branching bit 19 scripting-content-format bit 9 rpg-stats-progression bit 16 audio-sfx-music bit 15 save-load-persistence bit 18 ui-menus-hud (nx_gamehud: every OUTFIT PURCHASE decided through a modal menu, returned id drives the buy) + bit 0 render-2d (nx_game_raster: live mission-map frame, pure fn of state). NOT exercised: none of the title's required vector remains unproven by this loop. FLAGSHIP (mutation target): CONSERVATION. Paying a mission reward by MINTING credits instead of transferring them from the government's treasury must drive the economy tooth RED (total grew beyond accounted production) while the game still plays to a win. DIALECT: no `else if`, no `||`, no multiline `else` (nx_cc parser desync -- see nx_wire_probe.nx aux2). license_tier: ORIGINAL expect_exit: 0

dependencies 14 imports · 0 importers

nx_syscalls.nx nx_gamehud.nx nx_game_raster.nx nx_frame_sanity.nx nx_wire_harness.nx nx_gamesave.nx nx_rpgstats.nx nx_worldsim.nx nx_plotgen.nx nx_gamemusic.nx nx_wire_endlesssky_gate.nx

diagram shows first 10 each side; +4 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_gamehud.nxnx_game_raster.nxnx_frame_sanity.nxnx_wire_harness.nxnx_gamesave.nxnx_rpgstats.nxnx_worldsim.nxnx_plotgen.nxnx_gamemusic.nxnx_audio_wav.nxnx_gate_verdict.nxnx_trimesh.nxnx_objload.nx

imported by: nobody (leaf or entry point)

structs

none

consts

39const ES_NFAC: i64 = 5 // 0 = player-trader, 1..4 = governments
40const ES_RATE: i64 = 3 // production per territory per tick
41const ES_MAXT: i64 = 300
42const ES_MNODES: i64 = 12 // mission graph nodes
43const ES_MISSIONS_WIN: i64 = 3
44const ES_CREDITS_WIN: i64 = 1500
45const ES_CARGO_BASE: i64 = 40
46const ES_SKILL_TH: i64 = 8 // trades per skill rank
47const ES_SKILL_MAX: i64 = 5
48const ES_OUTFIT_MAX: i64 = 4
49const ES_OUTFIT_COST: i64 = 300
51const ES_HDRN: i64 = 24
52const ES_WSW: i64 = 52 // ws_words(5)
53const ES_NSV: i64 = 76 // 24 hdr + 52 worldsim words
54const ES_SCHEMA: i64 = 7309
55const ES_CONTENT_SCHEMA: i64 = 7319
56const ES_ART_SCHEMA: i64 = 7329
58const ES_T1W: i64 = 8
59const ES_T2W: i64 = 25
61const EW_O_WS: i64 = 24
62const EO_CHT: i64 = 80
63const EO_CHR: i64 = 128
64const EO_CHS: i64 = 176
65const EO_IEN: i64 = 224
66const EO_HUD: i64 = 240 // nx_gamehud arena APPENDED (transient UI; hud[63]=777 lazy-init marker
68const EG_WORDS: i64 = 304
69const ES_HUDINK: i64 = 30 // T11 experiential min ink (mission map is sparser than a 3D scene)
71const E_SEED: i64 = 0
72const E_TICK: i64 = 1
73const E_TRADES: i64 = 2
74const E_MDONE: i64 = 3
75const E_CUR: i64 = 4
76const E_FLAGS: i64 = 5
77const E_GATED: i64 = 6
78const E_BLOCKED: i64 = 7
79const E_OUTFITS: i64 = 8
80const E_WIN: i64 = 9
81const E_EXPADD: i64 = 10 // accumulated ACCOUNTED production
82const E_START: i64 = 11 // total wealth at game start
83const E_NMODS: i64 = 12
84const E_MODP: i64 = 13 // 4 pairs (kind,val) -> 13..20
85const E_STEPS: i64 = 21 // mission steps executed via sv_choose
86const E_RES1: i64 = 22
87const E_RES2: i64 = 23
238const ER2_W: i64 = 320
239const ER2_H: i64 = 180

functions

89func ww(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
90func wn(v: i64) -> i64
99func ebit(i: i64) -> i64 { var v: i64=1; var k: i64=0; while k<i { v=v*2; k=k+1 } return v }
100func eckv(ck: i64, v0: i64) -> i64
105func e_ws(e: *i64) -> *i64 { return (e as i64 + EW_O_WS*8) as *i64 }
106func e_mseed(e: *i64) -> i64 { return e[E_SEED]*31 + e[E_MDONE]*101 + 7 }
108func e_outfit_kind(i: i64) -> i64 { if i%2==0 { return 0 } return 1 }
109func e_outfit_val(i: i64) -> i64
115func e_new(e: *i64, seed: i64) -> i64
140func e_cargo(e: *i64) -> i64
145func e_tick(e: *i64) -> i64
226func e_run_full(e: *i64) -> i64
240func e_render(e: *i64, fb: *i64) -> i64
267func e_fbck(fb: *i64) -> i64
271func e_rchain(seed: i64, ticks: i64, out: *i64) -> i64
296func e_serialize(e: *i64, S: *i64) -> i64
304func e_restore(e: *i64, S: *i64) -> i64
320func e_ck(e: *i64) -> i64
330func e_song(sng: *i64, k: i64, a2: i64, b2: i64, c2: i64) -> i64
334func e_render_theme(smp: *i64, nsamp: i64) -> i64
363func main() -> i64