code wiki / _hdl_build / nx_tactics_emit.nx
nx_tactics_emit.nx
buildroot/runtime/_hdl_build/nx_tactics_emit.nx
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
imports: nx_syscalls.nxnx_tactics_engine_lib.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 20 | const K_MAGIC_12345: i64 = 12345 |
| 21 | const K_MAGIC_65536: i64 = 65536 |
| 22 | const K_MAGIC_8192: i64 = 8192 |
| 23 | const K_MAGIC_6000: i64 = 6000 |
functions
| 25 | func 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 } |
| 26 | func 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 } |
| 27 | func te_wn(fd: i64, v: i64) -> i64 |
| 37 | func te_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 38 | func te_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 47 | func te_match(buf: *u8, pos: i64, key: *u8) -> i64 called by 1: te_find |
| 52 | func te_linestart(buf: *u8, pos: i64) -> i64 called by 1: te_find |
| 57 | func te_find(buf: *u8, len: i64, key: *u8) -> i64 |
| 66 | func te_pint(buf: *u8, pos: i64) -> i64 called by 1: te_int |
| 76 | func te_int(buf: *u8, len: i64, key: *u8, dflt: i64) -> i64 |
| 81 | func te_str(buf: *u8, len: i64, key: *u8, out: *u8) -> i64 calls 1: te_find |
| 94 | func te_has(buf: *u8, len: i64, pat: *u8) -> i64 calls 1: te_strlen |
| 105 | func te_modpath(name: *u8, out: *u8) -> i64 called by 1: te_emit |
| 117 | func te_parse_cfg(buf: *u8, len: i64, cfg: *i64) -> i64 calls 1: te_int |
| 134 | func te_emit(name: *u8, cfg: *i64) -> i64 |
| 155 | func te_bot(st: *i64, cap: i64) -> i64 |
| 189 | func main(argc: i64, argv: *i64) -> i64 |