code wiki / (root) / nx_chaos.nx

nx_chaos.nx

buildroot/runtime/nx_chaos.nx

4194 B86 linesdepth 0pulls 0 transitivereach 1 importersview sourcekind librarytopic chaos
docsdependenciesstructsconstsfunctions

dependencies 0 imports · 1 importers

nx_chaos.nx nx_chaos_gate.nx

imports: none

imported by: nx_chaos_gate.nx

structs

none

consts

1const O_MAGIC_500000: i64 = 500000
2const O_MAGIC_500001: i64 = 500001
3const O_MAGIC_3900: i64 = 3900
4const O_MAGIC_4096: i64 = 4096
13const W: i64 = 256
14const H: i64 = 256
15const O_FB: i64 = 0
16const O_XA: i64 = 524288
17const O_XB: i64 = 524296
18const O_R: i64 = 524304 // r * 1000
19const O_STEP: i64 = 524312
20const O_HA: i64 = 524320 // trajectory A history
21const O_HB: i64 = 524320 + 240*8 // trajectory B history
22const HISTN: i64 = 240
23const SC: i64 = 1000000 // x in [0, SC] == [0,1]
24const STEPS_PER_TICK: i64 = 1

functions

26func rgb(r: i64, g: i64, b: i64) -> i64 { return (r & 255) | ((g & 255) << 8) | ((b & 255) << 16) }
called by 1: render_impl
28func logistic(x: i64, R: i64) -> i64 { let tmp: i64 = x*(SC-x)/SC; return tmp*R/1000 }
30func putpx(base: i64, px: i64, py: i64, c: i64) -> i64
called by 1: disc
34func disc(base: i64, px: i64, py: i64, r: i64, c: i64) -> i64
called by 1: render_impl calls 1: putpx
41func clear_fb(base: i64, c: i64) -> i64 { let fb: *i64=(base+O_FB) as *i64; var i: i64=0; while i<W*H { fb[i]=c; i=i+1 } return 0 }
called by 1: render_impl
43func init_impl(base: i64) -> i64
called by 3: tick_implinitmain
51func step_one_impl(base: i64) -> i64
called by 1: tick_impl calls 1: logistic
56func tick_impl(base: i64, cmd: i64) -> i64
called by 2: tickmain calls 2: init_implstep_one_impl
66func render_impl(base: i64) -> i64
called by 2: rendermain calls 3: clear_fbrgbdisc
80func ww() -> i64 { return W }
called by 1: main
81func hh() -> i64 { return H }
called by 1: main
82func fb_off() -> i64 { return O_FB }
called by 1: main
83func init() -> i64 { return init_impl(0) }
calls 1: init_impl
84func tick(cmd: i64) -> i64 { return tick_impl(0, cmd) }
calls 1: tick_impl
85func render() -> i64 { return render_impl(0) }
calls 1: render_impl
86func mem_bytes() -> i64 { return O_HB + HISTN*8 + O_MAGIC_4096 }