nx_voxel_native.nx
buildroot/runtime/nx_voxel_native.nx
about
nx_voxel_native.nx -- PLAYABLE first-person RAYCAST voxel explorer (the 3rd game mode:
the operator's "minecraft stuff"). A procgen world (driven by the REAL nx_world_seed
terrain procgen) rendered first-person via per-column raymarch with truecolor depth
shading, walk + turn. Native (nx_cc->nxasm_x86, no gcc), terminal-rendered, hostable.
HONEST LADDER PLACEMENT (operator: weak-voxel < our-minecraftclone < Minecraft < Unreal
procgen): this is a SOVEREIGN first-person voxel walker -- well above the static 1bpp
substrate demo, but far below Minecraft (no block place/break/craft/infinite-chunks/
lighting/save) and far below Unreal-class procgen. The procgen here = nx_world_seed
heightmap (a real Nishi organ); biome/feature procgen (nx_procgen_biome/features) +
chunked infinite world + block editing are NAMED next rungs, not claimed here.
LAWS: <=6 args/func, flat ifs, no &&/||, integer-only. Reuses engine-lib terminal helpers.
license_tier: ORIGINAL
dependencies 6 imports · 0 importers
imports: nx_tier.nxnx_syscalls.nxnx_palette.nxnx_tissue.nxnx_world_seed.nxnx_game_engine_lib.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
| 21 | const K_MAGIC_1092: i64 = 1092 |
| 22 | const K_MAGIC_1189: i64 = 1189 |
| 23 | const K_MAGIC_1285: i64 = 1285 |
| 24 | const K_MAGIC_1380: i64 = 1380 |
| 25 | const K_MAGIC_1474: i64 = 1474 |
| 26 | const K_MAGIC_1567: i64 = 1567 |
| 27 | const K_MAGIC_1660: i64 = 1660 |
| 28 | const K_MAGIC_1751: i64 = 1751 |
| 29 | const K_MAGIC_1842: i64 = 1842 |
| 30 | const K_MAGIC_1931: i64 = 1931 |
| 31 | const K_MAGIC_2019: i64 = 2019 |
| 32 | const K_MAGIC_2106: i64 = 2106 |
| 33 | const K_MAGIC_2191: i64 = 2191 |
| 34 | const K_MAGIC_2276: i64 = 2276 |
| 35 | const K_MAGIC_2359: i64 = 2359 |
| 36 | const K_MAGIC_2440: i64 = 2440 |
| 37 | const K_MAGIC_2520: i64 = 2520 |
| 38 | const K_MAGIC_2598: i64 = 2598 |
| 39 | const K_MAGIC_2675: i64 = 2675 |
| 40 | const K_MAGIC_2751: i64 = 2751 |
| 41 | const K_MAGIC_2824: i64 = 2824 |
| 42 | const K_MAGIC_2896: i64 = 2896 |
| 43 | const K_MAGIC_2967: i64 = 2967 |
| 44 | const K_MAGIC_3035: i64 = 3035 |
| 45 | const K_MAGIC_3102: i64 = 3102 |
| 46 | const K_MAGIC_3166: i64 = 3166 |
| 47 | const K_MAGIC_3229: i64 = 3229 |
| 48 | const K_MAGIC_3290: i64 = 3290 |
| 49 | const K_MAGIC_3349: i64 = 3349 |
| 50 | const K_MAGIC_3406: i64 = 3406 |
| 51 | const K_MAGIC_3461: i64 = 3461 |
| 52 | const K_MAGIC_3513: i64 = 3513 |
| 53 | const K_MAGIC_3564: i64 = 3564 |
| 54 | const K_MAGIC_3612: i64 = 3612 |
| 55 | const K_MAGIC_3659: i64 = 3659 |
| 56 | const K_MAGIC_3703: i64 = 3703 |
| 57 | const K_MAGIC_3745: i64 = 3745 |
| 58 | const K_MAGIC_3784: i64 = 3784 |
| 59 | const K_MAGIC_3822: i64 = 3822 |
| 60 | const K_MAGIC_3857: i64 = 3857 |
| 61 | const K_MAGIC_3889: i64 = 3889 |
| 62 | const K_MAGIC_3920: i64 = 3920 |
| 63 | const K_MAGIC_3948: i64 = 3948 |
| 64 | const K_MAGIC_3973: i64 = 3973 |
| 65 | const K_MAGIC_3996: i64 = 3996 |
| 66 | const K_MAGIC_4017: i64 = 4017 |
| 67 | const K_MAGIC_4036: i64 = 4036 |
| 68 | const K_MAGIC_4052: i64 = 4052 |
| 69 | const K_MAGIC_4065: i64 = 4065 |
| 70 | const K_MAGIC_4076: i64 = 4076 |
| 71 | const K_MAGIC_4085: i64 = 4085 |
| 72 | const K_MAGIC_4091: i64 = 4091 |
| 73 | const K_MAGIC_4095: i64 = 4095 |
| 74 | const K_MAGIC_4096: i64 = 4096 |
| 75 | const K_MAGIC_2048: i64 = 2048 |
| 76 | const K_MAGIC_12345: i64 = 12345 |
| 77 | const K_MAGIC_8192: i64 = 8192 |
| 78 | const K_MAGIC_131072: i64 = 131072 |
| 79 | const K_MAGIC_1024: i64 = 1024 |
functions
| 83 | func vx_qfill(q: *i64) -> i64 called by 1: vx_init |
| 91 | func vx_qtab(st: *i64) -> *i64 { return ((st as i64) + K_MAGIC_4096) as *i64 } |
| 92 | func vx_sin(q: *i64, a0: i64) -> i64 |
| 101 | func vx_cos(q: *i64, a: i64) -> i64 { return vx_sin(q, a + 64) } |
| 103 | func vx_cell(st: *i64, x: i64, y: i64) -> i64 |
| 111 | func vx_set(st: *i64, x: i64, y: i64, v: i64) -> i64 |
| 117 | func vx_build(st: *i64, seed: i64) -> i64 |
| 156 | func vx_init(st: *i64, seed: i64) -> i64 |
| 166 | func vx_look(st: *i64, q: *i64) -> i64 |
| 184 | func vx_break(st: *i64) -> i64 |
| 188 | func vx_place(st: *i64) -> i64 |
| 197 | func vx_blockname(st: *i64, buf: *u8, off: *i64) -> i64 |
| 205 | func vx_move(st: *i64, q: *i64, fwd: i64) -> i64 |
| 214 | func vx_turn(st: *i64, d: i64) -> i64 { st[2] = (st[2] + d) & 255; return 0 } called by 1: vx_input |
| 216 | func vx_basecol(cell: i64) -> i64 called by 1: vx_cast_col |
| 223 | func vx_shade(rgb: i64, f: i64) -> i64 called by 1: vx_cast_col |
| 231 | func vx_cast_col(st: *i64, q: *i64, c: i64, ctop: *i64, cbot: *i64, ccol: *i64) -> i64 |
| 263 | func vx_render(buf: *u8, st: *i64, ctop: *i64, cbot: *i64, ccol: *i64) -> i64 |
| 302 | func vx_input(st: *i64, key: i64) -> i64 |
| 317 | func vx_key(c: i64) -> i64 called by 1: main |
| 332 | func main() -> i64 |