even more instructions
This commit is contained in:
+8
-8
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user