feat(bus): add Io Struct

Also, add more information to all panic messages
This commit is contained in:
2022-01-02 14:40:49 -06:00
parent 01d6399dfb
commit 1c42d1795a
6 changed files with 109 additions and 50 deletions

View File

@@ -71,7 +71,7 @@ fn checkCond(cpsr: *const CPSR, opcode: u32) bool {
0xC => !cpsr.z.read() and (cpsr.n.read() == cpsr.z.read()), // GT - Greater than
0xD => cpsr.z.read() or (cpsr.n.read() != cpsr.v.read()), // LE - Less than or equal
0xE => true, // AL - Always
0xF => std.debug.panic("0xF is a reserved condition field", .{}),
0xF => std.debug.panic("[CPU] 0xF is a reserved condition field", .{}),
};
}
@@ -145,7 +145,7 @@ const Mode = enum(u5) {
fn undefinedInstruction(_: *Arm7tdmi, _: *Bus, opcode: u32) void {
const id = armIdx(opcode);
std.debug.panic("[0x{X:}] 0x{X:} is an illegal opcode", .{ id, opcode });
std.debug.panic("[CPU] {{0x{X:}}} 0x{X:} is an illegal opcode", .{ id, opcode });
}
fn comptimeBranch(comptime L: bool) InstrFn {