first full version of time for ges

This commit is contained in:
2022-03-08 22:20:54 +01:00
parent f178076b86
commit a15e796489
6 changed files with 225 additions and 187 deletions

View File

@@ -1,6 +1,8 @@
import "env.memory" memory(4);
import "env.sin" fn sin(f32) -> f32;
import "env.cos" fn cos(f32) -> f32;
import "env.pow" fn pow(f32, f32) -> f32;
export fn time() -> f32 {
(0!64) as f32 / 1000 as f32
@@ -500,6 +502,12 @@ export fn setCursorPosition(x: i32, y: i32) {
textCursorY = y * scale;
}
///////////
// SOUND //
///////////
include "ges.cwa"
///////////
// SETUP //
///////////
@@ -508,6 +516,13 @@ export fn endFrame() {
68!4 = 68!0;
}
fn memclr(base: i32, size: i32) {
loop bytes {
(base + (size := size - 1))?0 = 0;
branch_if size: bytes;
}
}
start fn setup() {
let i: i32 = 12*16*3-1;
let avg: f32;
@@ -540,10 +555,26 @@ start fn setup() {
branch_if (i := i - 1) >= 0: expand_sweetie;
}
memclr(0, 64);
memclr(112, 8);
memclr(0x14000, 0x2c000);
cls(0);
randomSeed(random());
}
data 80 {
i8(
0, 128, 0, 69, 0x8, 0xc8,
0, 128, 0, 69, 0x8, 0xc8,
0, 128, 0, 69, 0x8, 0xc8,
0, 128, 0, 69, 0x8, 0xc8,
0xff, 0xff,
1, 1, 0, 100, 0, 100
)
}
data 0x13000+192*4 {
i32(
0x2c1c1a,