even more instructions

This commit is contained in:
2026-08-19 15:52:22 +02:00
parent 22752d1f2b
commit dd38da6dea
6 changed files with 192 additions and 33 deletions
+8 -8
View File
@@ -63,16 +63,16 @@ impl fmt::Display for AccessType {
}
#[derive(Debug, Clone, Copy)]
pub enum Type {
UnhandledInstruction(Instruction),
pub enum Type<'a> {
UnhandledInstruction(&'a str, Instruction),
UnhandledMemoryAccess(u32, AccessType),
}
impl fmt::Display for Type {
impl<'a> fmt::Display for Type<'a> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let err_type = match self {
Type::UnhandledInstruction(instr) => {
format!("Unhandled instruction: {:02X}", instr.opcode())
Type::UnhandledInstruction(which_type, instr) => {
format!("Unhandled instruction: {which_type} {:02X}", instr.opcode())
}
Type::UnhandledMemoryAccess(addr, access) => {
format!("Unhandled addr @ {addr:08X} for {access}")
@@ -84,12 +84,12 @@ impl fmt::Display for Type {
}
#[derive(Debug, Clone, Copy)]
pub struct Error {
pub struct Error<'a> {
pub severity: Severity,
pub err_type: Type,
pub err_type: Type<'a>,
}
impl fmt::Display for Error {
impl<'a> fmt::Display for Error<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "[{}]: {}", self.severity, self.err_type)
}