Fix 02-interrupts test

This commit is contained in:
Franco Colmenarez 2021-11-05 14:32:37 -05:00
parent 6da1b022d8
commit 2bd74eddb4
2 changed files with 2 additions and 2 deletions

View File

@ -57,7 +57,7 @@ pub struct Bus {
impl Bus {
pub fn new() -> Self {
// let game_rom = match ROM::load_file("ignore/m3_scy_change.gb".to_string()) {
// let game_rom = match ROM::load_file("ignore/mooneye/acceptance/if_ie_registers.gb".to_string()) {
// let game_rom = match ROM::load_file("roms/cpu_instrs.gb".to_string()) {
// let game_rom = match ROM::load_file("roms/cpu_instrs_individual/01-special.gb".to_string()) {
let game_rom = match ROM::load_file("roms/cpu_instrs_individual/02-interrupts.gb".to_string()) {

View File

@ -915,7 +915,7 @@ impl CPU {
}
pub fn check_interrupts(&mut self, bus: &mut Bus) -> Option<Interrupt> {
if bus.read(INTERRUPT_ENABLE_ADDRESS) & bus.read(INTERRUPT_FLAG_ADDRESS) != 0 {
if (bus.read(INTERRUPT_ENABLE_ADDRESS) & 0b00011111) & (bus.read(INTERRUPT_FLAG_ADDRESS) & 0b00011111) != 0 {
self.is_halted = false;
}
if !self.ime {