code wiki / _hdl_build / nx_roku_grid_emit.nx
nx_roku_grid_emit.nx
buildroot/runtime/_hdl_build/nx_roku_grid_emit.nx
about
nx_roku_grid_emit.nx -- SOVEREIGN Roku grid channel emitter (R1 embedded + R1c remote-fetch). Emits a channel
whose home screen is a SceneGraph MarkupGrid of media items. Two modes:
(default) embedded catalog -- GridScene builds 6 ContentNodes from a baked-in list (offline; the
device first-light build).
remote <baseurl> server-backed client -- GridScene fetches <baseurl>/catalog.json via roUrlTransfer +
ParseJson and builds the grid from the live feed (the Jellyfin model; the real app).
Parts: manifest, source/main.brs, components/GridScene.xml, components/PosterItem.xml, images/icon.png +
poster1..6.png (sovereign solid-colour generated stills, our own PNG encoder). BrightScript/SceneGraph EMITTED,
never hand-written. Packaged by opc_write (STORED zip, real CRC-32). PNG/zip helpers duplicated from nx_roku_emit
(2nd use; extract to nx_roku_lib at a 3rd PNG consumer). license_tier: ORIGINAL
nx_roku_grid_emit [out.zip] (embedded)
nx_roku_grid_emit remote <baseurl> [out.zip] (remote-fetch)
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_crc32.nxnx_opc.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
| 16 | const K_MAGIC_65521: i64 = 65521 |
| 17 | const K_MAGIC_262144: i64 = 262144 |
| 18 | const K_MAGIC_65535: i64 = 65535 |
| 19 | const K_MAGIC_4096: i64 = 4096 |
| 20 | const K_MAGIC_8192: i64 = 8192 |
functions
| 22 | func rk_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 23 | func rk_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; if m==0{bb[0]=48 as u8;sys_write(1,bb,1);return 0}; let t: *u8=sys_mmap(28); while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 } |
| 24 | func rk_streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while a[i]!=(0 as u8){ if a[i]!=b[i]{return 0} i=i+1 } if b[i]!=(0 as u8){return 0} return 1 } |
| 25 | func rk_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ dst[off+i]=s[i]; i=i+1 } return off+i } |
| 26 | func rk_u32be(buf: *u8, off: i64, v: i64) -> i64 { buf[off]=((v>>24)&0xff) as u8; buf[off+1]=((v>>16)&0xff) as u8; buf[off+2]=((v>>8)&0xff) as u8; buf[off+3]=(v&0xff) as u8; return off+4 } |
| 27 | func rk_u16le(buf: *u8, off: i64, v: i64) -> i64 { buf[off]=(v&0xff) as u8; buf[off+1]=((v>>8)&0xff) as u8; return off+2 } called by 1: rk_png_solid |
| 28 | func rk_adler32(data: *u8, n: i64) -> i64 { var a: i64=1; var b: i64=0; var i: i64=0; while i<n { a=(a+(data[i] as i64))%K_MAGIC_65521; b=(b+a)%K_MAGIC_65521; i=i+1 } return (b<<16)|a } called by 1: rk_png_solid |
| 29 | func rk_png_chunk(out: *u8, off: i64, typ: *u8, data: *u8, dlen: i64) -> i64 |
| 36 | func rk_png_solid(out: *u8, w: i64, h: i64, r: i64, g: i64, bl: i64) -> i64 |
| 59 | func emit_gridscene_head(scn: *u8, off: i64) -> i64 |
| 75 | func emit_gridscene_embedded(scn: *u8) -> i64 |
| 96 | func emit_gridscene_remote(scn: *u8, baseurl: *u8) -> i64 |
| 129 | func main(argc: i64, argv: *i64) -> i64 |