From f83ee97439138f4949a13fc3dec436e98ee8bfc3 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 7 Oct 2020 21:37:50 -0400 Subject: [PATCH] PHP pushes with the BRK flag set in emulation mode. --- Processors/65816/Implementation/65816Implementation.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Processors/65816/Implementation/65816Implementation.hpp b/Processors/65816/Implementation/65816Implementation.hpp index 50c924489..8fe4a34cb 100644 --- a/Processors/65816/Implementation/65816Implementation.hpp +++ b/Processors/65816/Implementation/65816Implementation.hpp @@ -383,9 +383,13 @@ template void Processor::run_for(const Cycles case PHP: data_buffer_.value = flags_.get(); + data_buffer_.size = 1; if(!emulation_flag_) { assert(false); // TODO: M and X. + } else { + // On the 6502, the break flag is set during a PHP. + data_buffer_.value |= Flag::Break; } break;