code wiki / _hdl_build / nx_mp3_fixture.nx
nx_mp3_fixture.nx
buildroot/runtime/_hdl_build/nx_mp3_fixture.nx
about
nx_mp3_fixture.nx -- write a tiny sovereign DRM-free MP3 with an ID3v2.3 tag (TIT2 title, TPE1 artist/narrator,
TALB album) + a minimal MP3 audio frame, so the audio->.nmz rung can be gated end-to-end (nx_audio_book parses
the ID3 metadata + carries the audio bytes -> .nmz @kind=audio). ID3v2.3: 10-byte header ("ID3" ver flags
syncsafe-size) then frames (id(4) plain-BE-size(4) flags(2) enc(1) text). expect_exit: 0 license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 6 | const K_MAGIC_8859: i64 = 8859 |
| 7 | const K_MAGIC_8192: i64 = 8192 |
functions
| 9 | func mf_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 10 | func mf_p(s: *u8) -> i64 { sys_write(1, s, mf_slen(s)); return 0 } |
| 11 | func mf_n(v: i64) -> i64 { let b: *u8=sys_mmap(24); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(24); 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 } |
| 12 | func ensure_dir(path: *u8) -> i64 { __syscall(258, 0-100, path, 0x1ed, 0, 0, 0); return 0 } called by 1: main |
| 13 | func put32be(m: *u8, o: i64, v: i64) -> i64 { m[o]=((v>>24)&0xff) as u8; m[o+1]=((v>>16)&0xff) as u8; m[o+2]=((v>>8)&0xff) as u8; m[o+3]=(v&0xff) as u8; return o+4 } called by 1: text_frame |
| 14 | func puts(m: *u8, o: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ m[o+i]=s[i]; i=i+1 } return o+i } called by 1: text_frame |
| 17 | func text_frame(m: *u8, o: i64, id: *u8, text: *u8) -> i64 |
| 28 | func main() -> i64 |