code wiki / _hdl_build / nx_f32_raster_gate.nx

nx_f32_raster_gate.nx

buildroot/runtime/_hdl_build/nx_f32_raster_gate.nx

8003 B222 linesdepth 2pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic f32
docsdependenciesstructsconstsfunctions

about

nx_f32_raster_gate.nx -- R4: the FIRST visible hardware-f32 3D artifact. Renders a rotated, directionally-shaded cube using nx_f32_hw f32 math (mat4 rotation + orthographic projection), painter-sorted faces, integer barycentric fill, and writes a 24-bit BMP to web_assets/_game_build. Proves the hardware-f32 stack drives a REAL raster image -- off the 1970s ASCII floor. exit 0 = rendered (center pixel != background); the BMP is the artifact. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_f32_hw.nx nx_f32_raster_gate.nx

imports: nx_syscalls.nxnx_f32_hw.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 fratio f32_div f32_of m4_identity f32_of ↻ f32_neg m4_mul f32_of ↻ f32_add f32_mul f32_of ↻ m4_vec4 f32_of ↻ f32_add ↻ f32_mul ↻ f32_int f32_mul ↻ rot_nz sys_mmap ↻ f32_of ↻ m4_vec4 ↻ shade f32_of ↻ f32_int ↻ f32_mul ↻ packc fill_tri imax min3 imin imin ↻ max3 imax ↻ same_sign3 write_bmp sys_mmap ↻ put_u32le sys_openat_wr

structs

none

consts

9const W: i64 = 256
10const H: i64 = 256
11const SCALE: i64 = 64

functions

13func imin(a: i64, b: i64) -> i64 { if a < b { return a } return b }
called by 2: min3fill_tri
14func imax(a: i64, b: i64) -> i64 { if a > b { return a } return b }
called by 2: max3fill_tri
15func min3(a: i64, b: i64, c: i64) -> i64 { return imin(a, imin(b, c)) }
called by 1: fill_tri calls 1: imin
16func max3(a: i64, b: i64, c: i64) -> i64 { return imax(a, imax(b, c)) }
called by 1: fill_tri calls 1: imax
17func same_sign3(a: i64, b: i64, c: i64) -> i64
called by 1: fill_tri
23func fill_tri(fb: *i64, x0: i64, y0: i64, x1: i64, y1: i64, x2: i64, y2: i64, col: i64) -> i64
called by 1: main calls 5: imaxmin3iminmax3same_sign3
44func put_u32le(b: *u8, o: i64, v: i64) -> i64
called by 1: write_bmp
52func write_bmp(fb: *i64, path: *u8) -> i64
87func fratio(num: i64, den: i64) -> i64 { return f32_div(f32_of(num), f32_of(den)) }
called by 1: main calls 2: f32_divf32_of
89func rot_nz(R: *i64, lx: i64, ly: i64, lz: i64) -> i64
called by 1: main calls 3: sys_mmapf32_ofm4_vec4
100func shade(nz: i64) -> i64
called by 1: main calls 3: f32_off32_intf32_mul
105func packc(r: i64, g: i64, b: i64, br: i64) -> i64
called by 1: main
112func main() -> i64