1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-24 12:30:17 +00:00

Flip internal presumption on the BRK flag.

This commit is contained in:
Thomas Harte 2022-06-23 11:23:00 -04:00
parent 3112376943
commit 5a97c09238
2 changed files with 2 additions and 7 deletions

View File

@ -64,7 +64,7 @@ struct LazyFlags {
}
uint8_t get() const {
return carry | overflow | (inverse_interrupt ^ Flag::Interrupt) | (negative_result & 0x80) | (zero_result ? 0 : Flag::Zero) | Flag::Always | decimal;
return carry | overflow | (inverse_interrupt ^ Flag::Interrupt) | (negative_result & 0x80) | (zero_result ? 0 : Flag::Zero) | Flag::Always | Flag::Break | decimal;
}
LazyFlags() {

View File

@ -415,7 +415,7 @@ template <typename BusHandler, bool uses_ready_line> void Processor<BusHandler,
case OperationPrepareException:
data_buffer_.value = uint32_t((registers_.pc << 8) | get_flags());
if(registers_.emulation_flag) {
if(!exception_is_interrupt_) data_buffer_.value |= Flag::Break;
if(exception_is_interrupt_) data_buffer_.value &= ~Flag::Break;
data_buffer_.size = 3;
registers_.data_bank = 0;
++next_op_;
@ -563,11 +563,6 @@ template <typename BusHandler, bool uses_ready_line> void Processor<BusHandler,
case PHP:
data_buffer_.value = get_flags();
data_buffer_.size = 1;
if(registers_.emulation_flag) {
// On the 6502, the break flag is set during a PHP.
data_buffer_.value |= Flag::Break;
}
break;
case NOP: break;