debug fix

This commit is contained in:
Patrick 2024-11-24 18:49:15 +01:00
parent ba271b85e2
commit 63f3139c75

View file

@ -27,10 +27,12 @@ impl ExampleCPU {
self.operands[0] = self.ram[self.execution_pointer as usize]; self.operands[0] = self.ram[self.execution_pointer as usize];
self.operands[1] = self.ram[(self.execution_pointer + 1) as usize]; self.operands[1] = self.ram[(self.execution_pointer + 1) as usize];
self.operands[2] = self.ram[(self.execution_pointer + 2) as usize]; self.operands[2] = self.ram[(self.execution_pointer + 2) as usize];
println!( if self.debug {
"0x{:02X} 0x{:02X} 0x{:02X}", println!(
self.operands[0], self.operands[1], self.operands[2] "0x{:02X} 0x{:02X} 0x{:02X}",
); self.operands[0], self.operands[1], self.operands[2]
);
}
match self.operands[0] { match self.operands[0] {
0x00 => self.nop(), 0x00 => self.nop(),
0x01 => self.load(), 0x01 => self.load(),