From 63f3139c75fb5a2086163d3dba795c50b2f57b3c Mon Sep 17 00:00:00 2001 From: Patrick Date: Sun, 24 Nov 2024 18:49:15 +0100 Subject: [PATCH] debug fix --- src/devices/mod.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/devices/mod.rs b/src/devices/mod.rs index ea16c4d..2fa6b12 100644 --- a/src/devices/mod.rs +++ b/src/devices/mod.rs @@ -27,10 +27,12 @@ impl ExampleCPU { self.operands[0] = self.ram[self.execution_pointer as usize]; self.operands[1] = self.ram[(self.execution_pointer + 1) as usize]; self.operands[2] = self.ram[(self.execution_pointer + 2) as usize]; - println!( - "0x{:02X} 0x{:02X} 0x{:02X}", - self.operands[0], self.operands[1], self.operands[2] - ); + if self.debug { + println!( + "0x{:02X} 0x{:02X} 0x{:02X}", + self.operands[0], self.operands[1], self.operands[2] + ); + } match self.operands[0] { 0x00 => self.nop(), 0x01 => self.load(),