code wiki / (root) / nx_nishios_term.nx

nx_nishios_term.nx

buildroot/runtime/nx_nishios_term.nx

6673 B97 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tooltopic nishios
docsdependenciesstructsconstsfunctions

about

nx_nishios_term.nx -- NishiOS GUI rung-4: a TERMINAL WINDOW rendering REAL system content. This is where the GUI meets the actual ecosystem: a terminal window that READS a real sovereign file (the replacement-tools registry) and renders it as text using the existing full 8x8 ASCII font (nx_font8x8 font8x8_table, printable 0x20..0x7E) into the framebuffer (nx_fb). Not lorem-ipsum -- genuine bytes off disk, drawn glyph by glyph, with a blinking-style cursor block. KAT: the terminal window is drawn, the header line renders (text pixels present), the real file is read (len>0) and its lines render in the body (text pixels present), and the BMP exports. HONEST SCOPE: renders a file's bytes (a `cat`); a LIVE shell (typing + running tools in the window) needs the PS/2 keyboard driver + wiring the bridge in -- the next rungs. No hw writes (Rule 26). expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_fb.nx nx_font8x8.nx nx_nishios_term.nx

imports: nx_fb.nxnx_font8x8.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main tm_puts font8x8_table sys_mmap fg fb_rect fb_setpx term_str term_char fb_rect ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close term_char ↻ fb_bmp_save sys_mmap ↻ fb_p32 fb_p16 sys_openat_wr sys_write sys_close ↻ sys_openat_wr ↻ count_text tm_num

structs

none

consts

13const K_MAGIC_192054: i64 = 192054

functions

15func tm_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main
16func tm_num(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 }
called by 1: main
19func term_char(fb: *u8, W: i64, H: i64, table: *u8, x: i64, y: i64, scale: i64, ch: i64, r: i64, g: i64, b: i64) -> i64
called by 2: term_strmain calls 1: fb_rect
27func term_str(fb: *u8, W: i64, H: i64, table: *u8, x: i64, y: i64, scale: i64, s: *u8, r: i64, g: i64, b: i64) -> i64
called by 1: main calls 1: term_char
33func count_text(fb: *u8, W: i64, x0: i64, y0: i64, x1: i64, y1: i64) -> i64
called by 1: main
40func main() -> i64