code wiki / (root) / nx_voxel_native.nx

nx_voxel_native.nx

buildroot/runtime/nx_voxel_native.nx

13750 B362 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind tooltopic voxel
docsdependenciesstructsconstsfunctions

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

nx_tier.nx nx_syscalls.nx nx_palette.nx nx_tissue.nx nx_world_seed.nx nx_game_engine_lib.nx nx_voxel_native.nx

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

main sys_mmap term_raw_on sys_ioctl vx_init vx_qfill vx_qtab vx_build nx_world_seed_generate _height_at nx_xorshift64 vx_set sys_now_ms sys_mmap ↻ sys_clock_gettime_mono vx_render vx_qtab ↻ sys_mmap ↻ bput_clear bputc bput bput ↻ bputn bputc ↻ sys_mmap ↻ bputc ↻ vx_cast_col vx_cos vx_sin vx_sin ↻ vx_cell vx_shade vx_basecol bput_bg bputc ↻ bput ↻ bputn ↻ bput_fg bputc ↻ bput ↻

structs

none

consts

21const K_MAGIC_1092: i64 = 1092
22const K_MAGIC_1189: i64 = 1189
23const K_MAGIC_1285: i64 = 1285
24const K_MAGIC_1380: i64 = 1380
25const K_MAGIC_1474: i64 = 1474
26const K_MAGIC_1567: i64 = 1567
27const K_MAGIC_1660: i64 = 1660
28const K_MAGIC_1751: i64 = 1751
29const K_MAGIC_1842: i64 = 1842
30const K_MAGIC_1931: i64 = 1931
31const K_MAGIC_2019: i64 = 2019
32const K_MAGIC_2106: i64 = 2106
33const K_MAGIC_2191: i64 = 2191
34const K_MAGIC_2276: i64 = 2276
35const K_MAGIC_2359: i64 = 2359
36const K_MAGIC_2440: i64 = 2440
37const K_MAGIC_2520: i64 = 2520
38const K_MAGIC_2598: i64 = 2598
39const K_MAGIC_2675: i64 = 2675
40const K_MAGIC_2751: i64 = 2751
41const K_MAGIC_2824: i64 = 2824
42const K_MAGIC_2896: i64 = 2896
43const K_MAGIC_2967: i64 = 2967
44const K_MAGIC_3035: i64 = 3035
45const K_MAGIC_3102: i64 = 3102
46const K_MAGIC_3166: i64 = 3166
47const K_MAGIC_3229: i64 = 3229
48const K_MAGIC_3290: i64 = 3290
49const K_MAGIC_3349: i64 = 3349
50const K_MAGIC_3406: i64 = 3406
51const K_MAGIC_3461: i64 = 3461
52const K_MAGIC_3513: i64 = 3513
53const K_MAGIC_3564: i64 = 3564
54const K_MAGIC_3612: i64 = 3612
55const K_MAGIC_3659: i64 = 3659
56const K_MAGIC_3703: i64 = 3703
57const K_MAGIC_3745: i64 = 3745
58const K_MAGIC_3784: i64 = 3784
59const K_MAGIC_3822: i64 = 3822
60const K_MAGIC_3857: i64 = 3857
61const K_MAGIC_3889: i64 = 3889
62const K_MAGIC_3920: i64 = 3920
63const K_MAGIC_3948: i64 = 3948
64const K_MAGIC_3973: i64 = 3973
65const K_MAGIC_3996: i64 = 3996
66const K_MAGIC_4017: i64 = 4017
67const K_MAGIC_4036: i64 = 4036
68const K_MAGIC_4052: i64 = 4052
69const K_MAGIC_4065: i64 = 4065
70const K_MAGIC_4076: i64 = 4076
71const K_MAGIC_4085: i64 = 4085
72const K_MAGIC_4091: i64 = 4091
73const K_MAGIC_4095: i64 = 4095
74const K_MAGIC_4096: i64 = 4096
75const K_MAGIC_2048: i64 = 2048
76const K_MAGIC_12345: i64 = 12345
77const K_MAGIC_8192: i64 = 8192
78const K_MAGIC_131072: i64 = 131072
79const K_MAGIC_1024: i64 = 1024

functions

83func vx_qfill(q: *i64) -> i64
called by 1: vx_init
91func vx_qtab(st: *i64) -> *i64 { return ((st as i64) + K_MAGIC_4096) as *i64 }
92func vx_sin(q: *i64, a0: i64) -> i64
101func vx_cos(q: *i64, a: i64) -> i64 { return vx_sin(q, a + 64) }
called by 3: vx_lookvx_movevx_cast_col calls 1: vx_sin
103func vx_cell(st: *i64, x: i64, y: i64) -> i64
111func vx_set(st: *i64, x: i64, y: i64, v: i64) -> i64
117func vx_build(st: *i64, seed: i64) -> i64
156func vx_init(st: *i64, seed: i64) -> i64
called by 1: main calls 3: vx_qfillvx_qtabvx_build
166func vx_look(st: *i64, q: *i64) -> i64
called by 1: vx_input calls 3: vx_cosvx_sinvx_cell
184func vx_break(st: *i64) -> i64
called by 1: vx_input calls 1: vx_set
188func vx_place(st: *i64) -> i64
called by 1: vx_input calls 2: vx_cellvx_set
197func vx_blockname(st: *i64, buf: *u8, off: *i64) -> i64
called by 1: vx_render calls 1: bput
205func vx_move(st: *i64, q: *i64, fwd: i64) -> i64
called by 1: vx_input calls 3: vx_cosvx_sinvx_cell
214func vx_turn(st: *i64, d: i64) -> i64 { st[2] = (st[2] + d) & 255; return 0 }
called by 1: vx_input
216func vx_basecol(cell: i64) -> i64
called by 1: vx_cast_col
223func vx_shade(rgb: i64, f: i64) -> i64
called by 1: vx_cast_col
231func vx_cast_col(st: *i64, q: *i64, c: i64, ctop: *i64, cbot: *i64, ccol: *i64) -> i64
263func vx_render(buf: *u8, st: *i64, ctop: *i64, cbot: *i64, ccol: *i64) -> i64
302func vx_input(st: *i64, key: i64) -> i64
317func vx_key(c: i64) -> i64
called by 1: main
332func main() -> i64