fix timers bug

This commit is contained in:
Denis-Cosmin NUTIU 2024-12-07 22:52:42 +02:00
parent db2c360df3
commit 7e956277ac
2 changed files with 5 additions and 4 deletions

1
.gitignore vendored
View file

@ -1 +1,2 @@
/target /target
/proprietary_roms

View file

@ -142,7 +142,7 @@ where
if self.delay_timer > 0 { if self.delay_timer > 0 {
self.delay_timer -= 1 self.delay_timer -= 1
} }
if self.sound_timer > 0 { if self.delay_timer > 0 {
self.delay_timer -= 1 self.delay_timer -= 1
} else { } else {
self.do_beep() self.do_beep()
@ -362,13 +362,13 @@ where
self.index_register = 0xF0 + (self.registers[vx as usize] & 0x0F) as u16; self.index_register = 0xF0 + (self.registers[vx as usize] & 0x0F) as u16;
} }
ProcessorInstruction::BinaryCodedDecimalConversion(vx) => { ProcessorInstruction::BinaryCodedDecimalConversion(vx) => {
// todo!("must implement") todo!("must implement")
} }
ProcessorInstruction::LoadMemory(vx) => { ProcessorInstruction::LoadMemory(vx) => {
// todo!("must implement") todo!("must implement")
} }
ProcessorInstruction::StoreMemory(vx) => { ProcessorInstruction::StoreMemory(vx) => {
// todo!("must implement") todo!("must implement")
} }
_ => { _ => {
warn!("Unknown instruction: {:04x}, skipping.", instruction); warn!("Unknown instruction: {:04x}, skipping.", instruction);