From 7e956277ac76640ac1c10aa07029a18eb5635cb4 Mon Sep 17 00:00:00 2001 From: Denis-Cosmin NUTIU Date: Sat, 7 Dec 2024 22:52:42 +0200 Subject: [PATCH] fix timers bug --- .gitignore | 1 + src/emulator.rs | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index ea8c4bf..ea74a56 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +/proprietary_roms \ No newline at end of file diff --git a/src/emulator.rs b/src/emulator.rs index 7cabb03..949ebc4 100644 --- a/src/emulator.rs +++ b/src/emulator.rs @@ -142,7 +142,7 @@ where if self.delay_timer > 0 { self.delay_timer -= 1 } - if self.sound_timer > 0 { + if self.delay_timer > 0 { self.delay_timer -= 1 } else { self.do_beep() @@ -362,13 +362,13 @@ where self.index_register = 0xF0 + (self.registers[vx as usize] & 0x0F) as u16; } ProcessorInstruction::BinaryCodedDecimalConversion(vx) => { - // todo!("must implement") + todo!("must implement") } ProcessorInstruction::LoadMemory(vx) => { - // todo!("must implement") + todo!("must implement") } ProcessorInstruction::StoreMemory(vx) => { - // todo!("must implement") + todo!("must implement") } _ => { warn!("Unknown instruction: {:04x}, skipping.", instruction);