code wiki / _hdl_build / nx_tactics_emit.nx

nx_tactics_emit.nx

buildroot/runtime/_hdl_build/nx_tactics_emit.nx

11126 B250 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind orphan librarytopic tactics
docsdependenciesstructsconstsfunctions

about

nx_tactics_emit.nx -- the TACTICS GAME EMITTER (G-ECO-005 rung 3): a data tactics game-spec in, a complete playable tactics game module out, hands-off -- the SECOND engine's autonomy lever, mirroring nx_game_emit for dungeons. It reads a tactics spec (grid/squad/enemy/hp/dmg/moves/ range/walls/cover/hit-curve/seed) and WRITES a per-game .nx module that fills the engine cfg and calls teng_run (nx_tactics_engine_lib). The generated game is then built native by Nishi's own toolchain and is playable in a terminal (and headless-provable via a scripted bot). Spec grammar (one key per line): name <module> title <hud> grid_w/grid_h n_player/n_enemy hp dmg moves range n_walls n_cover hit_base hit_distdiv cover_penalty seed CLI: nx_tactics_emit <specpath> -> writes runtime/_hdl_build/<name>.nx SELF-GATE (no args): parse knowledge/specs/game_tactics.spec, emit the module, and PROVE it: cfg parsed right + module written + module calls teng_run + a scripted bot drives the parsed cfg to a battle RESOLUTION. TACTICS-EMIT-GATE verdict=GREEN -> knowledge/status/tactics_emit.log. HONEST AUTHORSHIP: this emitter + the engine lib are TUTOR-authored tooling; the GAMES it writes from specs are emitter output (the autonomy lever). license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_tactics_engine_lib.nx nx_tactics_emit.nx

imports: nx_syscalls.nxnx_tactics_engine_lib.nx

imported by: nobody (leaf or entry point)

structs

none

consts

20const K_MAGIC_12345: i64 = 12345
21const K_MAGIC_65536: i64 = 65536
22const K_MAGIC_8192: i64 = 8192
23const K_MAGIC_6000: i64 = 6000

functions

25func te_w(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: te_emit calls 1: sys_write
26func te_c(fd: i64, c: i64) -> i64 { let b: *u8 = sys_mmap(8); b[0] = c as u8; sys_write(fd, b, 1); return 0 }
called by 1: te_wn calls 2: sys_mmapsys_write
27func te_wn(fd: i64, v: i64) -> i64
37func te_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: te_findte_has
38func te_read(path: *u8, buf: *u8, cap: i64) -> i64
47func te_match(buf: *u8, pos: i64, key: *u8) -> i64
called by 1: te_find
52func te_linestart(buf: *u8, pos: i64) -> i64
called by 1: te_find
57func te_find(buf: *u8, len: i64, key: *u8) -> i64
66func te_pint(buf: *u8, pos: i64) -> i64
called by 1: te_int
76func te_int(buf: *u8, len: i64, key: *u8, dflt: i64) -> i64
called by 1: te_parse_cfg calls 2: te_findte_pint
81func te_str(buf: *u8, len: i64, key: *u8, out: *u8) -> i64
calls 1: te_find
94func te_has(buf: *u8, len: i64, pat: *u8) -> i64
calls 1: te_strlen
105func te_modpath(name: *u8, out: *u8) -> i64
called by 1: te_emit
117func te_parse_cfg(buf: *u8, len: i64, cfg: *i64) -> i64
calls 1: te_int
134func te_emit(name: *u8, cfg: *i64) -> i64
155func te_bot(st: *i64, cap: i64) -> i64
189func main(argc: i64, argv: *i64) -> i64