Fix minor warnings and debug log
This commit is contained in:
@@ -1729,7 +1729,12 @@ impl Cpu {
|
||||
0xEA => inst!("NOP", 1, || {
|
||||
log!("{addr:04X}: NOP");
|
||||
}),
|
||||
_ => todo!("ins: 0x{:04X}: 0x{ins:X}, {params:X?}", self.pc - 1),
|
||||
// _ => todo!("ins: 0x{:04X}: 0x{ins:X}, {params:X?}", self.pc - 1),
|
||||
_ => {
|
||||
println!("ins: 0x{:04X}: 0x{ins:X}, {params:X?}", self.pc - 1);
|
||||
self.halt();
|
||||
ExecState::Done
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1936,7 +1941,9 @@ impl Cpu {
|
||||
}
|
||||
|
||||
pub fn reset(&mut self, mem: &mut CpuMem<'_>) {
|
||||
let debug_log = self.debug_log.enabled();
|
||||
*self = Self::init();
|
||||
if debug_log { self.debug_log.enable(); }
|
||||
self.pc = u16::from_le_bytes([mem.read(0xFFFC), mem.read(0xFFFD)]);
|
||||
self.sp = 0xFD;
|
||||
self.status.set_interrupt_disable(true);
|
||||
|
||||
Reference in New Issue
Block a user