From 02bc2df0e8651d81185106649b204ca547e9a512 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Thu, 23 Feb 2023 16:39:04 +1100 Subject: [PATCH] silly mistake that i have literally made before --- src/processor/memory.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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)); } } }