From f2cc0721c7b646f2edbeac61cb94c5f008d1821b Mon Sep 17 00:00:00 2001 From: Rekai Musuka Date: Sat, 1 Jan 2022 03:42:20 -0600 Subject: [PATCH] chore: run zig fmt --- src/cpu.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/cpu.zig b/src/cpu.zig index 452d602..4c37c1a 100644 --- a/src/cpu.zig +++ b/src/cpu.zig @@ -131,7 +131,7 @@ const CPSR = struct { pub fn set_v(self: *@This(), set: bool) void { self.set_bit(28, set); } - + pub fn i(self: *const @This()) bool { return self.inner >> 7 & 0x01 == 0x01; } @@ -159,15 +159,15 @@ const CPSR = struct { pub fn mode(self: *const @This()) Mode { return self.inner & 0x1F; } - + pub fn set_mode(_: *@This(), _: Mode) void { std.debug.panic("TODO: Implement set_mode for CPSR", .{}); } - + fn set_bit(self: *@This(), comptime bit: usize, set: bool) void { const set_val = @as(u32, @boolToInt(set)) << bit; const mask = ~(@as(u32, 1) << bit); - + self.inner = (self.inner & mask) | set_val; } };