diff --git a/src/processor/memory.rs b/src/processor/memory.rs index aefe531..2da3666 100644 --- a/src/processor/memory.rs +++ b/src/processor/memory.rs @@ -1,6 +1,10 @@ use self::mmio::{Apu, Gpu, Joypad, Serial}; pub use self::rom::Rom; -use crate::{processor::SplitRegister, util::set_bit, verbose_println, Cpu}; +use crate::{ + processor::SplitRegister, + util::{clear_bit, set_bit}, + verbose_println, Cpu, +}; use gilrs::Gilrs; use minifb::{Key, Window}; @@ -241,6 +245,9 @@ impl Cpu { if gpu_interrupts.lcd_stat { self.memory.set(0xFF0F, set_bit(self.memory.get(0xFF0F), 1)); + } else { + self.memory + .set(0xFF0F, clear_bit(self.memory.get(0xFF0F), 1)); } } }