From 400bf7b1c692532d2bf6c45c30328c62e53782f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20Magalh=C3=A3es?= <joamag@gmail.com>
Date: Sat, 25 Mar 2023 15:46:07 +0000
Subject: [PATCH] feat: small interrupt optimization

---
 src/cpu.rs | 2 +-
 src/pad.rs | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cpu.rs b/src/cpu.rs
index 237ef622..8f9b95ff 100644
--- a/src/cpu.rs
+++ b/src/cpu.rs
@@ -127,7 +127,7 @@ impl Cpu {
             self.halted = false;
         }
 
-        if self.ime {
+        if self.ime && self.mmu.ie != 0x00 {
             // @TODO aggregate all of this interrupts in the MMU, as there's
             // a lot of redundant code involved in here which complicates the
             // readability and maybe performance of this code
diff --git a/src/pad.rs b/src/pad.rs
index f99e0a85..a36940a8 100644
--- a/src/pad.rs
+++ b/src/pad.rs
@@ -115,7 +115,7 @@ impl Pad {
         }
 
         // signals that a JoyPad interrupt is pending to be
-        // handled as a key pressed has been done
+        // handled as a key press has been performed
         self.int_pad = true;
     }
 
-- 
GitLab