PLA opcode should update the flags

This commit is contained in:
Sam M W 2023-04-15 21:44:05 +01:00
parent 26a2f51bc6
commit f0fc9829db
1 changed files with 8 additions and 0 deletions

View File

@ -435,6 +435,14 @@ impl<M: Bus> CPU<M> {
self.pull_from_stack();
let val: u8 = self.fetch_from_stack();
self.registers.accumulator = val as i8;
self.registers.status.set_with_mask(
Status::PS_ZERO | Status::PS_NEGATIVE,
Status::new(StatusArgs {
zero: val == 0,
negative: self.registers.accumulator < 0,
..StatusArgs::none()
}),
);
}
(Instruction::PLP, OpInput::UseImplied) => {
// Pull status