mirror of
https://github.com/exoticorn/curlywas.git
synced 2026-01-20 11:46:43 +01:00
time is now a parameter to the tic function instead of a mutable import
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
import "uw8.ram" memory(2);
|
import "uw8.ram" memory(2);
|
||||||
import "uw8.time" global mut time: i32;
|
|
||||||
|
|
||||||
export fn tic() {
|
export fn tic(time: i32) {
|
||||||
let i: i32;
|
let i: i32;
|
||||||
let defer t = time as f32 / 1000 as f32;
|
let defer t = time as f32 / 1000 as f32;
|
||||||
loop pixels {
|
loop pixels {
|
||||||
|
|||||||
10
uw8loader.hw
10
uw8loader.hw
@@ -4,7 +4,7 @@ export fn load_uw8(module_start: i32, module_end: i32, base_start: i32, base_end
|
|||||||
if ?module_start == 0 {
|
if ?module_start == 0 {
|
||||||
let defer length = module_end - module_start;
|
let defer length = module_end - module_start;
|
||||||
copy(base_end, module_start, length);
|
copy(base_end, module_start, length);
|
||||||
return length;
|
return base_end + length;
|
||||||
}
|
}
|
||||||
|
|
||||||
copy(base_end, base_start, 8);
|
copy(base_end, base_start, 8);
|
||||||
@@ -14,7 +14,7 @@ export fn load_uw8(module_start: i32, module_end: i32, base_start: i32, base_end
|
|||||||
|
|
||||||
loop sections {
|
loop sections {
|
||||||
if src < module_end & (base_start >= base_end | ?src <= ?base_start) {
|
if src < module_end & (base_start >= base_end | ?src <= ?base_start) {
|
||||||
let length2 = copy_section(dest, src);
|
let defer length2 = copy_section(dest, src);
|
||||||
dest = dest + length2;
|
dest = dest + length2;
|
||||||
if base_start < base_end & ?src == ?base_start {
|
if base_start < base_end & ?src == ?base_start {
|
||||||
base_start = base_start + section_size(base_start);
|
base_start = base_start + section_size(base_start);
|
||||||
@@ -24,7 +24,7 @@ export fn load_uw8(module_start: i32, module_end: i32, base_start: i32, base_end
|
|||||||
}
|
}
|
||||||
|
|
||||||
if base_start < base_end {
|
if base_start < base_end {
|
||||||
let length3 = copy_section(dest, base_start);
|
let defer length3 = copy_section(dest, base_start);
|
||||||
dest = dest + length3;
|
dest = dest + length3;
|
||||||
base_start = base_start + length3;
|
base_start = base_start + length3;
|
||||||
branch sections;
|
branch sections;
|
||||||
@@ -39,10 +39,10 @@ fn section_size(ptr: i32) -> i32 {
|
|||||||
let l = 0;
|
let l = 0;
|
||||||
let shift = 0;
|
let shift = 0;
|
||||||
loop size {
|
loop size {
|
||||||
let b = ?p;
|
let defer b = ?p;
|
||||||
p = p + 1;
|
|
||||||
l = l | ((b & 127) << shift);
|
l = l | ((b & 127) << shift);
|
||||||
shift = shift + 7;
|
shift = shift + 7;
|
||||||
|
p = p + 1;
|
||||||
branch_if b & 128: size;
|
branch_if b & 128: size;
|
||||||
}
|
}
|
||||||
p - ptr + l
|
p - ptr + l
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import "uw8.ram" memory(2);
|
import "uw8.ram" memory(2);
|
||||||
import "uw8.time" global mut time: i32;
|
|
||||||
|
|
||||||
export fn tic() {
|
export fn tic(time: i32) {
|
||||||
let i: i32;
|
let i: i32;
|
||||||
loop pixels {
|
loop pixels {
|
||||||
let defer x = (i % 320) as f32 - 160.1;
|
let defer x = (i % 320) as f32 - 160.1;
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import "uw8.ram" memory(2);
|
import "uw8.ram" memory(2);
|
||||||
import "uw8.time" global mut time: i32;
|
|
||||||
|
|
||||||
export fn tic() {
|
export fn tic(time: i32) {
|
||||||
let i: i32;
|
let i: i32;
|
||||||
loop frame {
|
loop frame {
|
||||||
i?120 = (i % 320 + time / 10) ^ (i / 320);
|
i?120 = (i % 320 + time / 10) ^ (i / 320);
|
||||||
|
|||||||
Reference in New Issue
Block a user