implement some initial f32 support

This commit is contained in:
2021-10-27 20:03:23 +02:00
parent 7f5dd9aa80
commit 23d926dbb3
6 changed files with 146 additions and 27 deletions

16
warptunnel.hw Normal file
View File

@@ -0,0 +1,16 @@
import "uw8.ram" memory(2);
import "uw8.time" global mut time: i32;
export fn tic() {
let i: i32;
loop pixels {
let defer x = (i % 320) as f32 - 160.1;
let defer y = (i / 320 - 128) as f32;
let defer dist = 10000.0 / (x*x + y*y);
let defer t = time as f32 / 20 as f32;
i?120 = (x * dist + t) as i32 ^ (y * dist + t) as i32;
branch_if (i := i + 1) < 320*256: pixels
}
}