chore: update min ver. to v0.11.0-dev.2934+1b432072b

This commit is contained in:
Rekai Nyangadzayi Musuka 2023-05-02 00:08:51 -05:00
parent a5e636d9c5
commit fb431c9483
13 changed files with 29 additions and 27 deletions

View File

@ -8,7 +8,7 @@ const nfd = @import("lib/nfd-zig/build.zig");
pub fn build(b: *std.Build) void { pub fn build(b: *std.Build) void {
// Minimum Zig Version // Minimum Zig Version
const min_ver = std.SemanticVersion.parse("0.11.0-dev.2168+322ace70f") catch return; // https://github.com/ziglang/zig/commit/322ace70f const min_ver = std.SemanticVersion.parse("0.11.0-dev.2934+1b432072b") catch return; // https://github.com/ziglang/zig/commit/322ace70f
if (builtin.zig_version.order(min_ver).compare(.lt)) { if (builtin.zig_version.order(min_ver).compare(.lt)) {
std.log.err("{s}", .{b.fmt("Zig v{} does not meet the minimum version requirement. (Zig v{})", .{ builtin.zig_version, min_ver })}); std.log.err("{s}", .{b.fmt("Zig v{} does not meet the minimum version requirement. (Zig v{})", .{ builtin.zig_version, min_ver })});
std.os.exit(1); std.os.exit(1);

@ -1 +1 @@
Subproject commit d5e66caf2180324d83ad9be30e887849f5ed74da Subproject commit c1388c731820d9847c9d54f698c55e07752bc5ea

View File

@ -27,7 +27,7 @@ pub fn write(self: *const Self, comptime T: type, address: usize, value: T) void
pub fn init(allocator: Allocator) !Self { pub fn init(allocator: Allocator) !Self {
const buf = try allocator.alloc(u8, ewram_size); const buf = try allocator.alloc(u8, ewram_size);
std.mem.set(u8, buf, 0); @memset(buf, 0);
return Self{ return Self{
.buf = buf, .buf = buf,
@ -36,7 +36,7 @@ pub fn init(allocator: Allocator) !Self {
} }
pub fn reset(self: *Self) void { pub fn reset(self: *Self) void {
std.mem.set(u8, self.buf, 0); @memset(self.buf, 0);
} }
pub fn deinit(self: *Self) void { pub fn deinit(self: *Self) void {

View File

@ -27,7 +27,7 @@ pub fn write(self: *const Self, comptime T: type, address: usize, value: T) void
pub fn init(allocator: Allocator) !Self { pub fn init(allocator: Allocator) !Self {
const buf = try allocator.alloc(u8, iwram_size); const buf = try allocator.alloc(u8, iwram_size);
std.mem.set(u8, buf, 0); @memset(buf, 0);
return Self{ return Self{
.buf = buf, .buf = buf,
@ -36,7 +36,7 @@ pub fn init(allocator: Allocator) !Self {
} }
pub fn reset(self: *Self) void { pub fn reset(self: *Self) void {
std.mem.set(u8, self.buf, 0); @memset(self.buf, 0);
} }
pub fn deinit(self: *Self) void { pub fn deinit(self: *Self) void {

View File

@ -110,7 +110,7 @@ pub const Backup = struct {
}; };
const buf = try allocator.alloc(u8, buf_size); const buf = try allocator.alloc(u8, buf_size);
std.mem.set(u8, buf, 0xFF); @memset(buf, 0xFF);
var backup = Self{ var backup = Self{
.buf = buf, .buf = buf,
@ -163,7 +163,7 @@ pub const Backup = struct {
switch (self.kind) { switch (self.kind) {
.Sram, .Flash, .Flash1M => { .Sram, .Flash, .Flash1M => {
if (self.buf.len == file_buf.len) { if (self.buf.len == file_buf.len) {
std.mem.copy(u8, self.buf, file_buf); @memcpy(self.buf, file_buf);
return log.info("Loaded Save from {s}", .{file_path}); return log.info("Loaded Save from {s}", .{file_path});
} }
@ -174,7 +174,7 @@ pub const Backup = struct {
self.eeprom.kind = if (file_buf.len == 0x200) .Small else .Large; self.eeprom.kind = if (file_buf.len == 0x200) .Small else .Large;
self.buf = try allocator.alloc(u8, file_buf.len); self.buf = try allocator.alloc(u8, file_buf.len);
std.mem.copy(u8, self.buf, file_buf); @memcpy(self.buf, file_buf);
return log.info("Loaded Save from {s}", .{file_path}); return log.info("Loaded Save from {s}", .{file_path});
} }

View File

@ -44,7 +44,7 @@ pub fn handleCommand(self: *Self, buf: []u8, byte: u8) void {
0xB0 => self.set_bank = true, 0xB0 => self.set_bank = true,
0x80 => self.prep_erase = true, 0x80 => self.prep_erase = true,
0x10 => { 0x10 => {
std.mem.set(u8, buf, 0xFF); @memset(buf, 0xFF);
self.prep_erase = false; self.prep_erase = false;
}, },
0xA0 => self.prep_write = true, 0xA0 => self.prep_write = true,
@ -61,7 +61,7 @@ pub fn shouldEraseSector(self: *const Self, addr: usize, byte: u8) bool {
pub fn erase(self: *Self, buf: []u8, sector: usize) void { pub fn erase(self: *Self, buf: []u8, sector: usize) void {
const start = self.address() + (sector & 0xF000); const start = self.address() + (sector & 0xF000);
std.mem.set(u8, buf[start..][0..0x1000], 0xFF); @memset(buf[start..][0..0x1000], 0xFF);
self.prep_erase = false; self.prep_erase = false;
self.state = .Ready; self.state = .Ready;
} }

View File

@ -58,7 +58,9 @@ pub const Eeprom = struct {
log.err("Failed to resize EEPROM buf to {} bytes", .{len}); log.err("Failed to resize EEPROM buf to {} bytes", .{len});
std.debug.panic("EEPROM entered irrecoverable state {}", .{e}); std.debug.panic("EEPROM entered irrecoverable state {}", .{e});
}; };
std.mem.set(u8, buf.*, 0xFF);
// FIXME: ptr to a slice?
@memset(buf.*, 0xFF);
} }
} }

View File

@ -266,7 +266,7 @@ pub const Ppu = struct {
sched.push(.Draw, 240 * 4); // Add first PPU Event to Scheduler sched.push(.Draw, 240 * 4); // Add first PPU Event to Scheduler
const sprites = try allocator.create([128]?Sprite); const sprites = try allocator.create([128]?Sprite);
std.mem.set(?Sprite, sprites, null); @memset(sprites, null);
return Self{ return Self{
.vram = try Vram.init(allocator), .vram = try Vram.init(allocator),
@ -307,7 +307,7 @@ pub const Ppu = struct {
self.vcount = .{ .raw = 0x0000 }; self.vcount = .{ .raw = 0x0000 };
self.scanline.reset(); self.scanline.reset();
std.mem.set(?Sprite, self.scanline_sprites, null); @memset(self.scanline_sprites, null);
} }
pub fn deinit(self: *Self) void { pub fn deinit(self: *Self) void {
@ -744,7 +744,7 @@ pub const Ppu = struct {
// Reset Current Scanline Pixel Buffer and list of fetched sprites // Reset Current Scanline Pixel Buffer and list of fetched sprites
// in prep for next scanline // in prep for next scanline
self.scanline.reset(); self.scanline.reset();
std.mem.set(?Sprite, self.scanline_sprites, null); @memset(self.scanline_sprites, null);
} }
fn getBgr555(self: *Self, maybe_top: Scanline.Pixel, maybe_btm: Scanline.Pixel) u16 { fn getBgr555(self: *Self, maybe_top: Scanline.Pixel, maybe_btm: Scanline.Pixel) u16 {
@ -1554,7 +1554,7 @@ const Scanline = struct {
fn init(allocator: Allocator) !Self { fn init(allocator: Allocator) !Self {
const buf = try allocator.alloc(Pixel, width * 2); // Top & Bottom Scanline const buf = try allocator.alloc(Pixel, width * 2); // Top & Bottom Scanline
std.mem.set(Pixel, buf, .unset); @memset(buf, .unset);
return .{ return .{
// Top & Bototm Layers // Top & Bototm Layers
@ -1565,7 +1565,7 @@ const Scanline = struct {
} }
fn reset(self: *Self) void { fn reset(self: *Self) void {
std.mem.set(Pixel, self.buf, .unset); @memset(self.buf, .unset);
} }
fn deinit(self: *Self) void { fn deinit(self: *Self) void {

View File

@ -29,13 +29,13 @@ pub fn write(self: *Self, comptime T: type, address: usize, value: T) void {
pub fn init(allocator: Allocator) !Self { pub fn init(allocator: Allocator) !Self {
const buf = try allocator.alloc(u8, buf_len); const buf = try allocator.alloc(u8, buf_len);
std.mem.set(u8, buf, 0); @memset(buf, 0);
return Self{ .buf = buf, .allocator = allocator }; return Self{ .buf = buf, .allocator = allocator };
} }
pub fn reset(self: *Self) void { pub fn reset(self: *Self) void {
std.mem.set(u8, self.buf, 0); @memset(self.buf, 0);
} }
pub fn deinit(self: *Self) void { pub fn deinit(self: *Self) void {

View File

@ -32,13 +32,13 @@ pub fn write(self: *Self, comptime T: type, address: usize, value: T) void {
pub fn init(allocator: Allocator) !Self { pub fn init(allocator: Allocator) !Self {
const buf = try allocator.alloc(u8, buf_len); const buf = try allocator.alloc(u8, buf_len);
std.mem.set(u8, buf, 0); @memset(buf, 0);
return Self{ .buf = buf, .allocator = allocator }; return Self{ .buf = buf, .allocator = allocator };
} }
pub fn reset(self: *Self) void { pub fn reset(self: *Self) void {
std.mem.set(u8, self.buf, 0); @memset(self.buf, 0);
} }
pub fn deinit(self: *Self) void { pub fn deinit(self: *Self) void {

View File

@ -40,13 +40,13 @@ pub fn write(self: *Self, comptime T: type, dispcnt: io.DisplayControl, address:
pub fn init(allocator: Allocator) !Self { pub fn init(allocator: Allocator) !Self {
const buf = try allocator.alloc(u8, buf_len); const buf = try allocator.alloc(u8, buf_len);
std.mem.set(u8, buf, 0); @memset(buf, 0);
return Self{ .buf = buf, .allocator = allocator }; return Self{ .buf = buf, .allocator = allocator };
} }
pub fn reset(self: *Self) void { pub fn reset(self: *Self) void {
std.mem.set(u8, self.buf, 0); @memset(self.buf, 0);
} }
pub fn deinit(self: *Self) void { pub fn deinit(self: *Self) void {

View File

@ -220,7 +220,7 @@ pub fn draw(state: *State, tex_id: GLuint, cpu: *Arm7tdmi) void {
const sorted = blk: { const sorted = blk: {
var buf: @TypeOf(values) = undefined; var buf: @TypeOf(values) = undefined;
std.mem.copy(u32, buf[0..len], values[0..len]); @memcpy(buf[0..len], values[0..len]);
std.sort.sort(u32, buf[0..len], {}, std.sort.asc(u32)); std.sort.sort(u32, buf[0..len], {}, std.sort.asc(u32));
break :blk buf; break :blk buf;
@ -279,7 +279,7 @@ pub fn draw(state: *State, tex_id: GLuint, cpu: *Arm7tdmi) void {
var items: [20]Event = undefined; var items: [20]Event = undefined;
const len = scheduler.queue.len; const len = scheduler.queue.len;
std.mem.copy(Event, &items, scheduler.queue.items); @memcpy(&items, scheduler.queue.items);
std.sort.sort(Event, items[0..len], {}, widgets.eventDesc(Event)); std.sort.sort(Event, items[0..len], {}, widgets.eventDesc(Event));
for (items[0..len]) |event| { for (items[0..len]) |event| {

View File

@ -260,7 +260,7 @@ pub const FrameBuffer = struct {
pub fn init(allocator: Allocator, comptime len: comptime_int) !Self { pub fn init(allocator: Allocator, comptime len: comptime_int) !Self {
const buf = try allocator.alloc(u8, len * 2); const buf = try allocator.alloc(u8, len * 2);
std.mem.set(u8, buf, 0); @memset(buf, 0);
return .{ return .{
// Front and Back Framebuffers // Front and Back Framebuffers
@ -272,7 +272,7 @@ pub const FrameBuffer = struct {
} }
pub fn reset(self: *Self) void { pub fn reset(self: *Self) void {
std.mem.set(u8, self.buf, 0); @memset(self.buf, 0);
self.current = 0; self.current = 0;
} }