chore: rename CPSR u32 from val to raw

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-10-21 05:11:47 -03:00
parent 67bf975034
commit bbdcc0a8c2
1 changed files with 3 additions and 4 deletions

View File

@ -25,7 +25,7 @@ pub const Arm7tdmi = struct {
.r = [_]u32{0x00} ** 16, .r = [_]u32{0x00} ** 16,
.sch = scheduler, .sch = scheduler,
.bus = bus, .bus = bus,
.cpsr = .{ .val = 0x0000_00DF }, .cpsr = .{ .raw = 0x0000_00DF },
}; };
} }
@ -39,12 +39,11 @@ pub const Arm7tdmi = struct {
// TODO: Set sp_irq = 0x0300_7FA0, sp_svc = 0x0300_7FE0 // TODO: Set sp_irq = 0x0300_7FA0, sp_svc = 0x0300_7FE0
self.cpsr.val = 0x6000001F; self.cpsr.raw = 0x6000001F;
} }
pub inline fn step(self: *@This()) u64 { pub inline fn step(self: *@This()) u64 {
const opcode = self.fetch(); const opcode = self.fetch();
if (checkCond(&self.cpsr, opcode)) arm_lut[armIdx(opcode)](self, self.bus, opcode); if (checkCond(&self.cpsr, opcode)) arm_lut[armIdx(opcode)](self, self.bus, opcode);
return 1; return 1;
} }
@ -141,7 +140,7 @@ const CPSR = extern union {
c: Bit(u32, 29), c: Bit(u32, 29),
z: Bit(u32, 30), z: Bit(u32, 30),
n: Bit(u32, 31), n: Bit(u32, 31),
val: u32, raw: u32,
}; };
const Mode = enum(u5) { const Mode = enum(u5) {