Skip to content

Commit

Permalink
Added IME flag and DI instruction
Browse files Browse the repository at this point in the history
  • Loading branch information
velllu committed Sep 6, 2023
1 parent af1d57c commit 0b464e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ impl GameBoy {
0xAD => { self.xor_r(OneByteRegister::L); (1, 1) },
0xAF => { self.xor_r(OneByteRegister::A); (1, 1) },

// Interrupt stuff
0xF3 => { self.flags.ime = true; (1, 1) },

_ => panic!("Opcode {:x} not implemented yet", opcode),
}
}
Expand Down
5 changes: 5 additions & 0 deletions src/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ pub struct Flags {
/// sets the zero flag
pub zero: bool,

/// IME, standing for "Interrupt Master Enable" is basically a switch on whether
/// interrupts should be handled or not
pub ime: bool,

// TODO: Document this other flags
pub substraction: bool,
pub half_carry: bool,
Expand All @@ -14,6 +18,7 @@ impl Flags {
pub(crate) fn new() -> Self {
Self {
zero: false,
ime: false,
substraction: false,
half_carry: false,
carry: false,
Expand Down

0 comments on commit 0b464e6

Please sign in to comment.