diff --git a/src/cpu.rs b/src/cpu.rs index 1b5e46a..28dcd69 100644 --- a/src/cpu.rs +++ b/src/cpu.rs @@ -624,6 +624,9 @@ mod instructions { } pub fn insn_pop(&mut self, reg: R16Stack, bus: &mut impl BusIO) -> IResult { self[reg].0 = self.pop16(bus)?; + if let R16Stack::AF = reg { + self.af.wide_mut().0 &= 0xfff0; // lo flags should never be set + } Ok(()) } }