code wiki / _hdl_build / nx_f32_raster_gate.nx
nx_f32_raster_gate.nx
buildroot/runtime/_hdl_build/nx_f32_raster_gate.nx
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
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
structs
| none |
consts
| 9 | const W: i64 = 256 |
| 10 | const H: i64 = 256 |
| 11 | const SCALE: i64 = 64 |
functions
| 13 | func imin(a: i64, b: i64) -> i64 { if a < b { return a } return b } |
| 14 | func imax(a: i64, b: i64) -> i64 { if a > b { return a } return b } |
| 15 | func min3(a: i64, b: i64, c: i64) -> i64 { return imin(a, imin(b, c)) } |
| 16 | func max3(a: i64, b: i64, c: i64) -> i64 { return imax(a, imax(b, c)) } |
| 17 | func same_sign3(a: i64, b: i64, c: i64) -> i64 called by 1: fill_tri |
| 23 | func fill_tri(fb: *i64, x0: i64, y0: i64, x1: i64, y1: i64, x2: i64, y2: i64, col: i64) -> i64 |
| 44 | func put_u32le(b: *u8, o: i64, v: i64) -> i64 called by 1: write_bmp |
| 52 | func write_bmp(fb: *i64, path: *u8) -> i64 |
| 87 | func fratio(num: i64, den: i64) -> i64 { return f32_div(f32_of(num), f32_of(den)) } |
| 89 | func rot_nz(R: *i64, lx: i64, ly: i64, lz: i64) -> i64 |
| 100 | func shade(nz: i64) -> i64 |
| 105 | func packc(r: i64, g: i64, b: i64, br: i64) -> i64 called by 1: main |
| 112 | func main() -> i64 |