mirror of
https://github.com/exoticorn/microw8.git
synced 2026-01-20 11:16:42 +01:00
add frame counter at memory location 72
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user