chore: run zig fmt
This commit is contained in:
parent
92a06e49c3
commit
f2cc0721c7
|
@ -131,7 +131,7 @@ const CPSR = struct {
|
||||||
pub fn set_v(self: *@This(), set: bool) void {
|
pub fn set_v(self: *@This(), set: bool) void {
|
||||||
self.set_bit(28, set);
|
self.set_bit(28, set);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn i(self: *const @This()) bool {
|
pub fn i(self: *const @This()) bool {
|
||||||
return self.inner >> 7 & 0x01 == 0x01;
|
return self.inner >> 7 & 0x01 == 0x01;
|
||||||
}
|
}
|
||||||
|
@ -159,15 +159,15 @@ const CPSR = struct {
|
||||||
pub fn mode(self: *const @This()) Mode {
|
pub fn mode(self: *const @This()) Mode {
|
||||||
return self.inner & 0x1F;
|
return self.inner & 0x1F;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn set_mode(_: *@This(), _: Mode) void {
|
pub fn set_mode(_: *@This(), _: Mode) void {
|
||||||
std.debug.panic("TODO: Implement set_mode for CPSR", .{});
|
std.debug.panic("TODO: Implement set_mode for CPSR", .{});
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_bit(self: *@This(), comptime bit: usize, set: bool) void {
|
fn set_bit(self: *@This(), comptime bit: usize, set: bool) void {
|
||||||
const set_val = @as(u32, @boolToInt(set)) << bit;
|
const set_val = @as(u32, @boolToInt(set)) << bit;
|
||||||
const mask = ~(@as(u32, 1) << bit);
|
const mask = ~(@as(u32, 1) << bit);
|
||||||
|
|
||||||
self.inner = (self.inner & mask) | set_val;
|
self.inner = (self.inner & mask) | set_val;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue