POP: Don't allow F.low to be set

This commit is contained in:
John 2024-07-09 01:06:47 -05:00
parent fad95d5046
commit f760b96d19

View File

@ -624,6 +624,9 @@ mod instructions {
} }
pub fn insn_pop(&mut self, reg: R16Stack, bus: &mut impl BusIO) -> IResult { pub fn insn_pop(&mut self, reg: R16Stack, bus: &mut impl BusIO) -> IResult {
self[reg].0 = self.pop16(bus)?; self[reg].0 = self.pop16(bus)?;
if let R16Stack::AF = reg {
self.af.wide_mut().0 &= 0xfff0; // lo flags should never be set
}
Ok(()) Ok(())
} }
} }