this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

(chore) update Zig source to use new BOOT()

+12 -23
+1 -1
demos/bunny/wasmmark/build.zig
··· 14 14 // so our own usage must start above the 96kb mark 15 15 lib.global_base = 96 * 1024; 16 16 lib.stack_size = 8192; 17 - lib.export_symbol_names = &[_][]const u8{ "TIC", "OVR", "BDR", "SCR", "INIT" }; 17 + lib.export_symbol_names = &[_][]const u8{ "TIC", "OVR", "BDR", "SCR", "BOOT" }; 18 18 lib.install(); 19 19 }
+6 -13
demos/bunny/wasmmark/src/main.zig
··· 96 96 var fps : FPS = undefined; 97 97 var bunnyCount : usize = 0; 98 98 var bunnies : [MAX_BUNNIES]Bunny = undefined; 99 - var started = false; 100 99 101 100 fn addBunny() void { 102 101 if (bunnyCount >= MAX_BUNNIES) return; ··· 111 110 bunnyCount -= 1; 112 111 } 113 112 114 - fn start() void { 115 - rnd = RndGen.init(0).random(); 116 - fps.initFPS(); 117 - addBunny(); 118 - started = true; 119 - 120 - // tic.ZERO = tic.FIRST + 1; 121 - } 122 - 123 - 124 113 export fn testscreen() void { 125 114 var i : usize = 0; 126 115 ··· 134 123 } 135 124 } 136 125 137 - export fn TIC() void { 138 - if (!started) { start(); } 126 + export fn BOOT() void { 127 + rnd = RndGen.init(0).random(); 128 + fps.initFPS(); 129 + addBunny(); 130 + } 139 131 132 + export fn TIC() void { 140 133 if (t==0) { 141 134 tic.music(0, .{}); 142 135 }
+1 -1
demos/wasm/build.zig
··· 14 14 // so our own usage must start above the 96kb mark 15 15 lib.global_base = 96 * 1024; 16 16 lib.stack_size = 8192; 17 - lib.export_symbol_names = &[_][]const u8{ "TIC", "OVR", "BDR", "SCR", "INIT" }; 17 + lib.export_symbol_names = &[_][]const u8{ "TIC", "OVR", "BDR", "SCR", "BOOT" }; 18 18 lib.install(); 19 19 }
+1 -1
templates/zig/build.zig
··· 14 14 // so our own usage must start above the 96kb mark 15 15 lib.global_base = 96 * 1024; 16 16 lib.stack_size = 8192; 17 - lib.export_symbol_names = &[_][]const u8{ "TIC", "OVR", "BDR", "SCR", "INIT" }; 17 + lib.export_symbol_names = &[_][]const u8{ "TIC", "OVR", "BDR", "SCR", "BOOT" }; 18 18 lib.install(); 19 19 }
+3 -7
templates/zig/src/main.zig
··· 1 1 const tic = @import("tic80.zig"); 2 2 3 - var started = false; 4 - 5 - fn start() void { 6 - } 7 - 8 3 const TICGuy = struct { 9 4 x : i32 = 96, 10 5 y : i32 = 24, ··· 13 8 var t : u16 = 0; 14 9 var mascot : TICGuy = .{}; 15 10 11 + export fn BOOT() void { 12 + } 13 + 16 14 export fn TIC() void { 17 - if (!started) { start(); } 18 - 19 15 if (tic.btn(0) != 0) { 20 16 mascot.y -= 1; 21 17 }
tools/zig_sync