diff --git a/examples/curlywas/tunnel.cwa b/examples/curlywas/tunnel.cwa index d76f61b..8d6bdb9 100644 --- a/examples/curlywas/tunnel.cwa +++ b/examples/curlywas/tunnel.cwa @@ -3,14 +3,16 @@ include "../include/microw8-api.cwa" export fn upd() { let i: i32; loop pixels { - let inline t = time() * 63 as f32; - let lazy x = (i % 320 - 160) as f32; - let lazy y = (i / 320 - 120) as f32; - let inline d = 40000 as f32 / sqrt(x * x + y * y); - let inline u = atan2(x, y) * (512.0 / 3.141); - let inline c = ((i32.trunc_sat_f32_s(d + t * 2 as f32) ^ i32.trunc_sat_f32_s(u + t)) & 255) >> 4; + let inline t = 16!56; + let inline x = (i % 320 - 160) as f32; + let inline y = (i #/ 320 - 120) as f32; + let inline d = 0xa000 as f32 / sqrt(x * x + y * y); + let inline a = atan2(x, y) * 163_f; // (512 / pi) + let inline u = i32.trunc_sat_f32_s(a) + t; + let inline v = i32.trunc_sat_f32_s(d) + t * 2; + let inline c = ((v ^ u) #/ 16) % 16; i?FRAMEBUFFER = c; branch_if (i := i + 1) < 320*240: pixels; } -} \ No newline at end of file +} diff --git a/site/content/docs.md b/site/content/docs.md index 5fa0e59..1e9e224 100644 --- a/site/content/docs.md +++ b/site/content/docs.md @@ -21,7 +21,7 @@ loaded. 00000-00040: user memory 00040-00044: time since module start in ms 00044-0004c: gamepad state -0004c-00050: reserved +0004c-00050: number of frames since module start 00050-00070: sound data (synced to sound thread) 00070-00078: reserved 00078-12c78: frame buffer diff --git a/src/run-web.html b/src/run-web.html index c56d30a..3fa6583 100644 --- a/src/run-web.html +++ b/src/run-web.html @@ -1 +1 @@ -