code wiki / _hdl_build / nx_games_reg_seed.nx

nx_games_reg_seed.nx source

↩ module page · 53 lines · 4617 B

1// nx_games_reg_seed.nx -- seed the UNIFIED GAMES registry into the SOVEREIGN content-addressed store via 2// nx_native_config (ncfg_*), NOT a pipe/tsv file (operator: no tsv; use the nishi data management). This is 3// the ONE SPACE for ALL our games (operator: "all our games in one space"), consolidating the 3 fragmented 4// sources discovered by nx_game_publish + the NAS-live web games: 5// - web (NAS-live, anon hub): voxels, tictactoe, econsim 6// - pets-wasm (nx_arcade_serve :7700): pets, pets3d, dungeon 7// - dungeon/tactics (knowledge/specs): abyss, crypt, skirmish, laststand 8// Row = {id, title, engine, path, deployed}. deployed=1 => NAS-served (the manifest hashes its bytes, 9// content-addressed version); deployed=0 => cataloged with its location (arcade:/spec:), not yet NAS-live 10// (deploying those runtimes is a separate task -- NOT faked with a hash). Additive: add games as more rows. 11import "nx_syscalls.nx" 12import "nx_native_config.nx" 13 14func gr_row(w: *i64, idx: i64, id: *u8, title: *u8, engine: *u8, path: *u8, deployed: *u8) -> i64 { 15 let keys: *i64 = sys_mmap(8 * 8) as *i64 16 let vals: *i64 = sys_mmap(8 * 8) as *i64 17 keys[0] = ("id\x00") as i64; vals[0] = (id as i64) 18 keys[1] = ("title\x00") as i64; vals[1] = (title as i64) 19 keys[2] = ("engine\x00") as i64; vals[2] = (engine as i64) 20 keys[3] = ("path\x00") as i64; vals[3] = (path as i64) 21 keys[4] = ("deployed\x00") as i64; vals[4] = (deployed as i64) 22 return ncfg_add_row(w, "game\x00" as *u8, idx, keys, vals, 5) 23} 24func gr_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } 25 26func main() -> i64 { 27 let w: *i64 = ncfg_begin() 28 // --- NAS-live web games (deployed=1 -> hashed in the manifest) --- 29 gr_row(w, 0, "voxels\x00" as *u8, "Voxels\x00" as *u8, "web\x00" as *u8, "/voxels\x00" as *u8, "1\x00" as *u8) 30 gr_row(w, 1, "tictactoe\x00" as *u8, "Tic-Tac-Toe\x00" as *u8, "web\x00" as *u8, "/tictactoe\x00" as *u8, "1\x00" as *u8) 31 gr_row(w, 2, "econsim\x00" as *u8, "Econ Sim\x00" as *u8, "web\x00" as *u8, "/econsim\x00" as *u8, "1\x00" as *u8) 32 // --- arcade wasm games (nx_arcade_serve :7700) -- cataloged, not yet NAS-live --- 33 gr_row(w, 3, "pets\x00" as *u8, "Pets\x00" as *u8, "pets-wasm\x00" as *u8, "arcade:7700/pets\x00" as *u8, "0\x00" as *u8) 34 gr_row(w, 4, "pets3d\x00" as *u8, "Pets3D\x00" as *u8, "pets-wasm\x00" as *u8, "arcade:7700/pets3dview\x00" as *u8, "0\x00" as *u8) 35 gr_row(w, 5, "dungeon\x00" as *u8, "Dungeon\x00" as *u8, "dungeon-wasm\x00" as *u8, "arcade:7700/\x00" as *u8, "0\x00" as *u8) 36 // --- spec games (knowledge/specs, dungeon/tactics engines) -- cataloged --- 37 gr_row(w, 6, "abyss\x00" as *u8, "THE ABYSS\x00" as *u8, "dungeon\x00" as *u8, "spec:game_abyss.spec\x00" as *u8, "0\x00" as *u8) 38 gr_row(w, 7, "crypt\x00" as *u8, "THE CRYPT\x00" as *u8, "dungeon\x00" as *u8, "spec:game_crypt.spec\x00" as *u8, "0\x00" as *u8) 39 gr_row(w, 8, "skirmish\x00" as *u8, "NISHI SKIRMISH\x00" as *u8, "tactics\x00" as *u8, "spec:game_tactics.spec\x00" as *u8, "0\x00" as *u8) 40 gr_row(w, 9, "laststand\x00" as *u8, "LAST STAND\x00" as *u8, "tactics\x00" as *u8, "spec:game_tac_laststand.spec\x00" as *u8, "0\x00" as *u8) 41 // --- the INFINITE procgen voxel world (nx_wasm_mineworld, gate 7/7 GREEN 2026-07-02) -- NAS-live web --- 42 gr_row(w, 10, "mineworld\x00" as *u8, "Nishi MineWorld\x00" as *u8, "wasm-3d\x00" as *u8, "/mineworld\x00" as *u8, "1\x00" as *u8) 43 // --- SHARED-WORLD multiplayer MineWorld (GTA-online rung 1; nx_mp_serve relay :7702, gate 5/5) --- 44 gr_row(w, 11, "mineworld-mp\x00" as *u8, "MineWorld ONLINE\x00" as *u8, "wasm-3d-mp\x00" as *u8, "/mineworld-mp\x00" as *u8, "1\x00" as *u8) 45 // --- Nishi 3D renderer showcase (nx_meshview_wasm via nx_render_core: lit cube/skinned/Phong sphere/torus; 46 // sovereign chain nx_compile_wat->nx_wat_compiler, VM-parity gated; browser = last-mile blit only) --- 47 gr_row(w, 12, "meshview3d\x00" as *u8, "Nishi 3D Renderer\x00" as *u8, "wasm-3d\x00" as *u8, "/meshview3d\x00" as *u8, "1\x00" as *u8) 48 ncfg_set_count(w, "game\x00" as *u8, 13) 49 let rc: i64 = ncfg_commit("knowledge/store/games-reg-\x00" as *u8, w) 50 if rc == 0 { gr_w("nx_games_reg_seed: 13 games (6 web-live + 3 arcade + 4 spec) committed to native store games-reg- (no tsv)\n\x00" as *u8) } 51 else { gr_w("nx_games_reg_seed: commit FAILED\n\x00" as *u8) } 52 return rc 53}