this repo has no description
0
fork

Configure Feed

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

Merge remote-tracking branch 'origin/pr/1850'

nesbox 4870cc90 144351aa

+165 -144
+55 -48
demos/bunny/wasmmark/src/tic80.zig
··· 29 29 b: u8, 30 30 }; 31 31 32 + const TextureSource = enum(i32) { 33 + TILES = 0, 34 + MAP, 35 + VBANK1 36 + }; 37 + 38 + 32 39 // ------------------------ 33 40 // HARDWARE REGISTERS / RAM 34 41 ··· 94 101 // import the RAW api 95 102 96 103 pub const raw = struct { 97 - extern fn btn(id: i32) i32; 98 - extern fn btnp(id: i32, hold: i32, period: i32 ) bool; 99 - extern fn clip(x: i32, y: i32, w: i32, h: i32) void; 100 - extern fn cls(color: i32) void; 101 - extern fn circ(x: i32, y: i32, radius: i32, color: i32) void; 102 - extern fn circb(x: i32, y: i32, radius: i32, color: i32) void; 103 - extern fn exit() void; 104 - extern fn elli(x: i32, y: i32, a: i32, b: i32, color: i32) void; 105 - extern fn ellib(x: i32, y: i32, a: i32, b: i32, color: i32) void; 106 - extern fn fget(id: i32, flag: u8) bool; 107 - extern fn font(text: [*:0]u8, x: u32, y: i32, trans_colors: ?[*]const u8, color_count: i32, char_width: i32, char_height: i32, fixed: bool, scale: i32) i32; 108 - extern fn fset(id: i32, flag: u8, value: bool) bool; 109 - extern fn key(keycode: i32) bool; 110 - extern fn keyp(keycode: i32, hold: i32, period: i32 ) bool; 111 - extern fn line(x0: i32, y0: i32, x1: i32, y1: i32, color: i32) void; 112 - extern fn map(x: i32, y: i32, w: i32, h: i32, sx: i32, sy: i32, trans_colors: ?[*]const u8, color_count: i32, scale: i32, remap: i32) void; 113 - extern fn memcpy(to: u32, from: u32, length: u32) void; 114 - extern fn memset(addr: u32, value: u8, length: u32) void; 115 - extern fn mget(x: i32, y:i32) i32; 116 - extern fn mouse(data: *MouseData) void; 117 - extern fn mset(x: i32, y:i32, value: bool) void; 118 - extern fn music(track: i32, frame: i32, row: i32, loop: bool, sustain: bool, tempo: i32, speed: i32) void; 119 - extern fn peek(addr: u32, bits: i32) u8; 120 - extern fn peek4(addr4: u32) u8; 121 - extern fn peek2(addr2: u32) u8; 122 - extern fn peek1(bitaddr: u32) u8; 123 - extern fn pix(x: i32, y:i32, color: i32) void; 124 - extern fn pmem(index: u32, value: i64) u32; 125 - extern fn poke(addr: u32, value: u8, bits: i32) void; 126 - extern fn poke4(addr4: u32, value: u8) void; 127 - extern fn poke2(addr2: u32, value: u8) void; 128 - extern fn poke1(bitaddr: u32, value: u8) void; 129 - extern fn print(text: [*:0]u8, x: i32, y: i32, color: i32, fixed: bool, scale: i32, smallfont: bool) i32; 130 - extern fn rect(x: i32, y: i32, w: i32, h:i32, color: i32) void; 131 - extern fn rectb(x: i32, y: i32, w: i32, h:i32, color: i32) void; 132 - extern fn reset() void; 133 - extern fn sfx(id: i32, note: i32, octave: i32, duration: i32, channel: i32, volumeLeft: i32, volumeRight: i32, speed: i32) void; 134 - extern fn spr(id: i32, x: i32, y: i32, trans_colors: ?[*]const u8, color_count: i32, scale: i32, flip: i32, rotate: i32, w: i32, h: i32) void; 135 - extern fn sync(mask: i32, bank: i32, tocart: bool) void; 136 - extern fn ttri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, u1: f32, v1: f32, u2: f32, v2: f32, u3: f32, v3: f32, texsrc: i32, trans_colors: ?[*]const u8, color_count: i32, z1: f32, z2: f32, z3: f32, depth: bool) void; 137 - extern fn tri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, color: i32) void; 138 - extern fn trib(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, color: i32) void; 139 - extern fn time() f32; 140 - extern fn trace(text: [*:0]u8, color: i32) void; 141 - extern fn tstamp() u64; 142 - extern fn vbank(bank: i32) u8; 104 + pub extern fn btn(id: i32) i32; 105 + pub extern fn btnp(id: i32, hold: i32, period: i32 ) bool; 106 + pub extern fn clip(x: i32, y: i32, w: i32, h: i32) void; 107 + pub extern fn cls(color: i32) void; 108 + pub extern fn circ(x: i32, y: i32, radius: i32, color: i32) void; 109 + pub extern fn circb(x: i32, y: i32, radius: i32, color: i32) void; 110 + pub extern fn exit() void; 111 + pub extern fn elli(x: i32, y: i32, a: i32, b: i32, color: i32) void; 112 + pub extern fn ellib(x: i32, y: i32, a: i32, b: i32, color: i32) void; 113 + pub extern fn fget(id: i32, flag: u8) bool; 114 + pub extern fn font(text: [*:0]u8, x: u32, y: i32, trans_colors: ?[*]const u8, color_count: i32, char_width: i32, char_height: i32, fixed: bool, scale: i32) i32; 115 + pub extern fn fset(id: i32, flag: u8, value: bool) bool; 116 + pub extern fn key(keycode: i32) bool; 117 + pub extern fn keyp(keycode: i32, hold: i32, period: i32 ) bool; 118 + pub extern fn line(x0: i32, y0: i32, x1: i32, y1: i32, color: i32) void; 119 + pub extern fn map(x: i32, y: i32, w: i32, h: i32, sx: i32, sy: i32, trans_colors: ?[*]const u8, color_count: i32, scale: i32, remap: i32) void; 120 + pub extern fn memcpy(to: u32, from: u32, length: u32) void; 121 + pub extern fn memset(addr: u32, value: u8, length: u32) void; 122 + pub extern fn mget(x: i32, y:i32) i32; 123 + pub extern fn mouse(data: *MouseData) void; 124 + pub extern fn mset(x: i32, y:i32, value: bool) void; 125 + pub extern fn music(track: i32, frame: i32, row: i32, loop: bool, sustain: bool, tempo: i32, speed: i32) void; 126 + pub extern fn peek(addr: u32, bits: i32) u8; 127 + pub extern fn peek4(addr4: u32) u8; 128 + pub extern fn peek2(addr2: u32) u8; 129 + pub extern fn peek1(bitaddr: u32) u8; 130 + pub extern fn pix(x: i32, y:i32, color: i32) void; 131 + pub extern fn pmem(index: u32, value: i64) u32; 132 + pub extern fn poke(addr: u32, value: u8, bits: i32) void; 133 + pub extern fn poke4(addr4: u32, value: u8) void; 134 + pub extern fn poke2(addr2: u32, value: u8) void; 135 + pub extern fn poke1(bitaddr: u32, value: u8) void; 136 + pub extern fn print(text: [*:0]const u8, x: i32, y: i32, color: i32, fixed: bool, scale: i32, smallfont: bool) i32; 137 + pub extern fn rect(x: i32, y: i32, w: i32, h:i32, color: i32) void; 138 + pub extern fn rectb(x: i32, y: i32, w: i32, h:i32, color: i32) void; 139 + pub extern fn reset() void; 140 + pub extern fn sfx(id: i32, note: i32, octave: i32, duration: i32, channel: i32, volumeLeft: i32, volumeRight: i32, speed: i32) void; 141 + pub extern fn spr(id: i32, x: i32, y: i32, trans_colors: ?[*]const u8, color_count: i32, scale: i32, flip: i32, rotate: i32, w: i32, h: i32) void; 142 + pub extern fn sync(mask: i32, bank: i32, tocart: bool) void; 143 + pub extern fn ttri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, u1: f32, v1: f32, u2: f32, v2: f32, u3: f32, v3: f32, texture_source: i32, trans_colors: ?[*]const u8, color_count: i32, z1: f32, z2: f32, z3: f32, depth: bool) void; 144 + pub extern fn tri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, color: i32) void; 145 + pub extern fn trib(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, color: i32) void; 146 + pub extern fn time() f32; 147 + pub extern fn trace(text: [*:0]const u8, color: i32) void; 148 + pub extern fn tstamp() u64; 149 + pub extern fn vbank(bank: i32) u8; 143 150 }; 144 151 145 152 // ----- ··· 261 268 pub const trib = raw.trib; 262 269 263 270 const TextriArgs = struct { 264 - texsrc : i32 = 0, 271 + texture_source : TextureSource = TextureSource.TILES, 265 272 transparent: []const u8 = .{}, 266 273 z1 : f32 = 0, 267 274 z2 : f32 = 0, ··· 272 279 pub fn ttri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, @"u1": f32, v1: f32, @"u2": f32, v2: f32, @"u3": f32, v3: f32, args: TextriArgs) void { 273 280 const color_count = @intCast(u8,args.transparent.len); 274 281 const trans_colors = args.transparent.ptr; 275 - raw.ttri(x1, y1, x2, y2, x3, y3, @"u1", v1, @"u2", v2, @"u3", v3, args.texsrc, trans_colors, color_count, args.z1, args.z2, args.z3, args.depth); 282 + raw.ttri(x1, y1, x2, y2, x3, y3, @"u1", v1, @"u2", v2, @"u3", v3, @enumToInt(args.texture_source), trans_colors, color_count, args.z1, args.z2, args.z3, args.depth); 276 283 } 277 284 278 285 // ----
+55 -48
demos/wasm/src/tic80.zig
··· 29 29 b: u8, 30 30 }; 31 31 32 + const TextureSource = enum(i32) { 33 + TILES = 0, 34 + MAP, 35 + VBANK1 36 + }; 37 + 38 + 32 39 // ------------------------ 33 40 // HARDWARE REGISTERS / RAM 34 41 ··· 94 101 // import the RAW api 95 102 96 103 pub const raw = struct { 97 - extern fn btn(id: i32) i32; 98 - extern fn btnp(id: i32, hold: i32, period: i32 ) bool; 99 - extern fn clip(x: i32, y: i32, w: i32, h: i32) void; 100 - extern fn cls(color: i32) void; 101 - extern fn circ(x: i32, y: i32, radius: i32, color: i32) void; 102 - extern fn circb(x: i32, y: i32, radius: i32, color: i32) void; 103 - extern fn exit() void; 104 - extern fn elli(x: i32, y: i32, a: i32, b: i32, color: i32) void; 105 - extern fn ellib(x: i32, y: i32, a: i32, b: i32, color: i32) void; 106 - extern fn fget(id: i32, flag: u8) bool; 107 - extern fn font(text: [*:0]u8, x: u32, y: i32, trans_colors: ?[*]const u8, color_count: i32, char_width: i32, char_height: i32, fixed: bool, scale: i32) i32; 108 - extern fn fset(id: i32, flag: u8, value: bool) bool; 109 - extern fn key(keycode: i32) bool; 110 - extern fn keyp(keycode: i32, hold: i32, period: i32 ) bool; 111 - extern fn line(x0: i32, y0: i32, x1: i32, y1: i32, color: i32) void; 112 - extern fn map(x: i32, y: i32, w: i32, h: i32, sx: i32, sy: i32, trans_colors: ?[*]const u8, color_count: i32, scale: i32, remap: i32) void; 113 - extern fn memcpy(to: u32, from: u32, length: u32) void; 114 - extern fn memset(addr: u32, value: u8, length: u32) void; 115 - extern fn mget(x: i32, y:i32) i32; 116 - extern fn mouse(data: *MouseData) void; 117 - extern fn mset(x: i32, y:i32, value: bool) void; 118 - extern fn music(track: i32, frame: i32, row: i32, loop: bool, sustain: bool, tempo: i32, speed: i32) void; 119 - extern fn peek(addr: u32, bits: i32) u8; 120 - extern fn peek4(addr4: u32) u8; 121 - extern fn peek2(addr2: u32) u8; 122 - extern fn peek1(bitaddr: u32) u8; 123 - extern fn pix(x: i32, y:i32, color: i32) void; 124 - extern fn pmem(index: u32, value: i64) u32; 125 - extern fn poke(addr: u32, value: u8, bits: i32) void; 126 - extern fn poke4(addr4: u32, value: u8) void; 127 - extern fn poke2(addr2: u32, value: u8) void; 128 - extern fn poke1(bitaddr: u32, value: u8) void; 129 - extern fn print(text: [*:0]u8, x: i32, y: i32, color: i32, fixed: bool, scale: i32, smallfont: bool) i32; 130 - extern fn rect(x: i32, y: i32, w: i32, h:i32, color: i32) void; 131 - extern fn rectb(x: i32, y: i32, w: i32, h:i32, color: i32) void; 132 - extern fn reset() void; 133 - extern fn sfx(id: i32, note: i32, octave: i32, duration: i32, channel: i32, volumeLeft: i32, volumeRight: i32, speed: i32) void; 134 - extern fn spr(id: i32, x: i32, y: i32, trans_colors: ?[*]const u8, color_count: i32, scale: i32, flip: i32, rotate: i32, w: i32, h: i32) void; 135 - extern fn sync(mask: i32, bank: i32, tocart: bool) void; 136 - extern fn ttri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, u1: f32, v1: f32, u2: f32, v2: f32, u3: f32, v3: f32, texsrc: i32, trans_colors: ?[*]const u8, color_count: i32, z1: f32, z2: f32, z3: f32, depth: bool) void; 137 - extern fn tri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, color: i32) void; 138 - extern fn trib(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, color: i32) void; 139 - extern fn time() f32; 140 - extern fn trace(text: [*:0]u8, color: i32) void; 141 - extern fn tstamp() u64; 142 - extern fn vbank(bank: i32) u8; 104 + pub extern fn btn(id: i32) i32; 105 + pub extern fn btnp(id: i32, hold: i32, period: i32 ) bool; 106 + pub extern fn clip(x: i32, y: i32, w: i32, h: i32) void; 107 + pub extern fn cls(color: i32) void; 108 + pub extern fn circ(x: i32, y: i32, radius: i32, color: i32) void; 109 + pub extern fn circb(x: i32, y: i32, radius: i32, color: i32) void; 110 + pub extern fn exit() void; 111 + pub extern fn elli(x: i32, y: i32, a: i32, b: i32, color: i32) void; 112 + pub extern fn ellib(x: i32, y: i32, a: i32, b: i32, color: i32) void; 113 + pub extern fn fget(id: i32, flag: u8) bool; 114 + pub extern fn font(text: [*:0]u8, x: u32, y: i32, trans_colors: ?[*]const u8, color_count: i32, char_width: i32, char_height: i32, fixed: bool, scale: i32) i32; 115 + pub extern fn fset(id: i32, flag: u8, value: bool) bool; 116 + pub extern fn key(keycode: i32) bool; 117 + pub extern fn keyp(keycode: i32, hold: i32, period: i32 ) bool; 118 + pub extern fn line(x0: i32, y0: i32, x1: i32, y1: i32, color: i32) void; 119 + pub extern fn map(x: i32, y: i32, w: i32, h: i32, sx: i32, sy: i32, trans_colors: ?[*]const u8, color_count: i32, scale: i32, remap: i32) void; 120 + pub extern fn memcpy(to: u32, from: u32, length: u32) void; 121 + pub extern fn memset(addr: u32, value: u8, length: u32) void; 122 + pub extern fn mget(x: i32, y:i32) i32; 123 + pub extern fn mouse(data: *MouseData) void; 124 + pub extern fn mset(x: i32, y:i32, value: bool) void; 125 + pub extern fn music(track: i32, frame: i32, row: i32, loop: bool, sustain: bool, tempo: i32, speed: i32) void; 126 + pub extern fn peek(addr: u32, bits: i32) u8; 127 + pub extern fn peek4(addr4: u32) u8; 128 + pub extern fn peek2(addr2: u32) u8; 129 + pub extern fn peek1(bitaddr: u32) u8; 130 + pub extern fn pix(x: i32, y:i32, color: i32) void; 131 + pub extern fn pmem(index: u32, value: i64) u32; 132 + pub extern fn poke(addr: u32, value: u8, bits: i32) void; 133 + pub extern fn poke4(addr4: u32, value: u8) void; 134 + pub extern fn poke2(addr2: u32, value: u8) void; 135 + pub extern fn poke1(bitaddr: u32, value: u8) void; 136 + pub extern fn print(text: [*:0]const u8, x: i32, y: i32, color: i32, fixed: bool, scale: i32, smallfont: bool) i32; 137 + pub extern fn rect(x: i32, y: i32, w: i32, h:i32, color: i32) void; 138 + pub extern fn rectb(x: i32, y: i32, w: i32, h:i32, color: i32) void; 139 + pub extern fn reset() void; 140 + pub extern fn sfx(id: i32, note: i32, octave: i32, duration: i32, channel: i32, volumeLeft: i32, volumeRight: i32, speed: i32) void; 141 + pub extern fn spr(id: i32, x: i32, y: i32, trans_colors: ?[*]const u8, color_count: i32, scale: i32, flip: i32, rotate: i32, w: i32, h: i32) void; 142 + pub extern fn sync(mask: i32, bank: i32, tocart: bool) void; 143 + pub extern fn ttri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, u1: f32, v1: f32, u2: f32, v2: f32, u3: f32, v3: f32, texture_source: i32, trans_colors: ?[*]const u8, color_count: i32, z1: f32, z2: f32, z3: f32, depth: bool) void; 144 + pub extern fn tri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, color: i32) void; 145 + pub extern fn trib(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, color: i32) void; 146 + pub extern fn time() f32; 147 + pub extern fn trace(text: [*:0]const u8, color: i32) void; 148 + pub extern fn tstamp() u64; 149 + pub extern fn vbank(bank: i32) u8; 143 150 }; 144 151 145 152 // ----- ··· 261 268 pub const trib = raw.trib; 262 269 263 270 const TextriArgs = struct { 264 - texsrc : i32 = 0, 271 + texture_source : TextureSource = TextureSource.TILES, 265 272 transparent: []const u8 = .{}, 266 273 z1 : f32 = 0, 267 274 z2 : f32 = 0, ··· 272 279 pub fn ttri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, @"u1": f32, v1: f32, @"u2": f32, v2: f32, @"u3": f32, v3: f32, args: TextriArgs) void { 273 280 const color_count = @intCast(u8,args.transparent.len); 274 281 const trans_colors = args.transparent.ptr; 275 - raw.ttri(x1, y1, x2, y2, x3, y3, @"u1", v1, @"u2", v2, @"u3", v3, args.texsrc, trans_colors, color_count, args.z1, args.z2, args.z3, args.depth); 282 + raw.ttri(x1, y1, x2, y2, x3, y3, @"u1", v1, @"u2", v2, @"u3", v3, @enumToInt(args.texture_source), trans_colors, color_count, args.z1, args.z2, args.z3, args.depth); 276 283 } 277 284 278 285 // ----
+55 -48
templates/zig/src/tic80.zig
··· 29 29 b: u8, 30 30 }; 31 31 32 + const TextureSource = enum(i32) { 33 + TILES = 0, 34 + MAP, 35 + VBANK1 36 + }; 37 + 38 + 32 39 // ------------------------ 33 40 // HARDWARE REGISTERS / RAM 34 41 ··· 94 101 // import the RAW api 95 102 96 103 pub const raw = struct { 97 - extern fn btn(id: i32) i32; 98 - extern fn btnp(id: i32, hold: i32, period: i32 ) bool; 99 - extern fn clip(x: i32, y: i32, w: i32, h: i32) void; 100 - extern fn cls(color: i32) void; 101 - extern fn circ(x: i32, y: i32, radius: i32, color: i32) void; 102 - extern fn circb(x: i32, y: i32, radius: i32, color: i32) void; 103 - extern fn exit() void; 104 - extern fn elli(x: i32, y: i32, a: i32, b: i32, color: i32) void; 105 - extern fn ellib(x: i32, y: i32, a: i32, b: i32, color: i32) void; 106 - extern fn fget(id: i32, flag: u8) bool; 107 - extern fn font(text: [*:0]u8, x: u32, y: i32, trans_colors: ?[*]const u8, color_count: i32, char_width: i32, char_height: i32, fixed: bool, scale: i32) i32; 108 - extern fn fset(id: i32, flag: u8, value: bool) bool; 109 - extern fn key(keycode: i32) bool; 110 - extern fn keyp(keycode: i32, hold: i32, period: i32 ) bool; 111 - extern fn line(x0: i32, y0: i32, x1: i32, y1: i32, color: i32) void; 112 - extern fn map(x: i32, y: i32, w: i32, h: i32, sx: i32, sy: i32, trans_colors: ?[*]const u8, color_count: i32, scale: i32, remap: i32) void; 113 - extern fn memcpy(to: u32, from: u32, length: u32) void; 114 - extern fn memset(addr: u32, value: u8, length: u32) void; 115 - extern fn mget(x: i32, y:i32) i32; 116 - extern fn mouse(data: *MouseData) void; 117 - extern fn mset(x: i32, y:i32, value: bool) void; 118 - extern fn music(track: i32, frame: i32, row: i32, loop: bool, sustain: bool, tempo: i32, speed: i32) void; 119 - extern fn peek(addr: u32, bits: i32) u8; 120 - extern fn peek4(addr4: u32) u8; 121 - extern fn peek2(addr2: u32) u8; 122 - extern fn peek1(bitaddr: u32) u8; 123 - extern fn pix(x: i32, y:i32, color: i32) void; 124 - extern fn pmem(index: u32, value: i64) u32; 125 - extern fn poke(addr: u32, value: u8, bits: i32) void; 126 - extern fn poke4(addr4: u32, value: u8) void; 127 - extern fn poke2(addr2: u32, value: u8) void; 128 - extern fn poke1(bitaddr: u32, value: u8) void; 129 - extern fn print(text: [*:0]u8, x: i32, y: i32, color: i32, fixed: bool, scale: i32, smallfont: bool) i32; 130 - extern fn rect(x: i32, y: i32, w: i32, h:i32, color: i32) void; 131 - extern fn rectb(x: i32, y: i32, w: i32, h:i32, color: i32) void; 132 - extern fn reset() void; 133 - extern fn sfx(id: i32, note: i32, octave: i32, duration: i32, channel: i32, volumeLeft: i32, volumeRight: i32, speed: i32) void; 134 - extern fn spr(id: i32, x: i32, y: i32, trans_colors: ?[*]const u8, color_count: i32, scale: i32, flip: i32, rotate: i32, w: i32, h: i32) void; 135 - extern fn sync(mask: i32, bank: i32, tocart: bool) void; 136 - extern fn ttri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, u1: f32, v1: f32, u2: f32, v2: f32, u3: f32, v3: f32, texsrc: i32, trans_colors: ?[*]const u8, color_count: i32, z1: f32, z2: f32, z3: f32, depth: bool) void; 137 - extern fn tri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, color: i32) void; 138 - extern fn trib(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, color: i32) void; 139 - extern fn time() f32; 140 - extern fn trace(text: [*:0]u8, color: i32) void; 141 - extern fn tstamp() u64; 142 - extern fn vbank(bank: i32) u8; 104 + pub extern fn btn(id: i32) i32; 105 + pub extern fn btnp(id: i32, hold: i32, period: i32 ) bool; 106 + pub extern fn clip(x: i32, y: i32, w: i32, h: i32) void; 107 + pub extern fn cls(color: i32) void; 108 + pub extern fn circ(x: i32, y: i32, radius: i32, color: i32) void; 109 + pub extern fn circb(x: i32, y: i32, radius: i32, color: i32) void; 110 + pub extern fn exit() void; 111 + pub extern fn elli(x: i32, y: i32, a: i32, b: i32, color: i32) void; 112 + pub extern fn ellib(x: i32, y: i32, a: i32, b: i32, color: i32) void; 113 + pub extern fn fget(id: i32, flag: u8) bool; 114 + pub extern fn font(text: [*:0]u8, x: u32, y: i32, trans_colors: ?[*]const u8, color_count: i32, char_width: i32, char_height: i32, fixed: bool, scale: i32) i32; 115 + pub extern fn fset(id: i32, flag: u8, value: bool) bool; 116 + pub extern fn key(keycode: i32) bool; 117 + pub extern fn keyp(keycode: i32, hold: i32, period: i32 ) bool; 118 + pub extern fn line(x0: i32, y0: i32, x1: i32, y1: i32, color: i32) void; 119 + pub extern fn map(x: i32, y: i32, w: i32, h: i32, sx: i32, sy: i32, trans_colors: ?[*]const u8, color_count: i32, scale: i32, remap: i32) void; 120 + pub extern fn memcpy(to: u32, from: u32, length: u32) void; 121 + pub extern fn memset(addr: u32, value: u8, length: u32) void; 122 + pub extern fn mget(x: i32, y:i32) i32; 123 + pub extern fn mouse(data: *MouseData) void; 124 + pub extern fn mset(x: i32, y:i32, value: bool) void; 125 + pub extern fn music(track: i32, frame: i32, row: i32, loop: bool, sustain: bool, tempo: i32, speed: i32) void; 126 + pub extern fn peek(addr: u32, bits: i32) u8; 127 + pub extern fn peek4(addr4: u32) u8; 128 + pub extern fn peek2(addr2: u32) u8; 129 + pub extern fn peek1(bitaddr: u32) u8; 130 + pub extern fn pix(x: i32, y:i32, color: i32) void; 131 + pub extern fn pmem(index: u32, value: i64) u32; 132 + pub extern fn poke(addr: u32, value: u8, bits: i32) void; 133 + pub extern fn poke4(addr4: u32, value: u8) void; 134 + pub extern fn poke2(addr2: u32, value: u8) void; 135 + pub extern fn poke1(bitaddr: u32, value: u8) void; 136 + pub extern fn print(text: [*:0]const u8, x: i32, y: i32, color: i32, fixed: bool, scale: i32, smallfont: bool) i32; 137 + pub extern fn rect(x: i32, y: i32, w: i32, h:i32, color: i32) void; 138 + pub extern fn rectb(x: i32, y: i32, w: i32, h:i32, color: i32) void; 139 + pub extern fn reset() void; 140 + pub extern fn sfx(id: i32, note: i32, octave: i32, duration: i32, channel: i32, volumeLeft: i32, volumeRight: i32, speed: i32) void; 141 + pub extern fn spr(id: i32, x: i32, y: i32, trans_colors: ?[*]const u8, color_count: i32, scale: i32, flip: i32, rotate: i32, w: i32, h: i32) void; 142 + pub extern fn sync(mask: i32, bank: i32, tocart: bool) void; 143 + pub extern fn ttri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, u1: f32, v1: f32, u2: f32, v2: f32, u3: f32, v3: f32, texture_source: i32, trans_colors: ?[*]const u8, color_count: i32, z1: f32, z2: f32, z3: f32, depth: bool) void; 144 + pub extern fn tri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, color: i32) void; 145 + pub extern fn trib(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, color: i32) void; 146 + pub extern fn time() f32; 147 + pub extern fn trace(text: [*:0]const u8, color: i32) void; 148 + pub extern fn tstamp() u64; 149 + pub extern fn vbank(bank: i32) u8; 143 150 }; 144 151 145 152 // ----- ··· 261 268 pub const trib = raw.trib; 262 269 263 270 const TextriArgs = struct { 264 - texsrc : i32 = 0, 271 + texture_source : TextureSource = TextureSource.TILES, 265 272 transparent: []const u8 = .{}, 266 273 z1 : f32 = 0, 267 274 z2 : f32 = 0, ··· 272 279 pub fn ttri(x1: f32, y1: f32, x2: f32, y2: f32, x3: f32, y3: f32, @"u1": f32, v1: f32, @"u2": f32, v2: f32, @"u3": f32, v3: f32, args: TextriArgs) void { 273 280 const color_count = @intCast(u8,args.transparent.len); 274 281 const trans_colors = args.transparent.ptr; 275 - raw.ttri(x1, y1, x2, y2, x3, y3, @"u1", v1, @"u2", v2, @"u3", v3, args.texsrc, trans_colors, color_count, args.z1, args.z2, args.z3, args.depth); 282 + raw.ttri(x1, y1, x2, y2, x3, y3, @"u1", v1, @"u2", v2, @"u3", v3, @enumToInt(args.texture_source), trans_colors, color_count, args.z1, args.z2, args.z3, args.depth); 276 283 } 277 284 278 285 // ----