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:
parent
3112376943
commit
5a97c09238
@ -64,7 +64,7 @@ struct LazyFlags {
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint8_t get() const {
|
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() {
|
LazyFlags() {
|
||||||
|
@ -415,7 +415,7 @@ template <typename BusHandler, bool uses_ready_line> void Processor<BusHandler,
|
|||||||
case OperationPrepareException:
|
case OperationPrepareException:
|
||||||
data_buffer_.value = uint32_t((registers_.pc << 8) | get_flags());
|
data_buffer_.value = uint32_t((registers_.pc << 8) | get_flags());
|
||||||
if(registers_.emulation_flag) {
|
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;
|
data_buffer_.size = 3;
|
||||||
registers_.data_bank = 0;
|
registers_.data_bank = 0;
|
||||||
++next_op_;
|
++next_op_;
|
||||||
@ -563,11 +563,6 @@ template <typename BusHandler, bool uses_ready_line> void Processor<BusHandler,
|
|||||||
case PHP:
|
case PHP:
|
||||||
data_buffer_.value = get_flags();
|
data_buffer_.value = get_flags();
|
||||||
data_buffer_.size = 1;
|
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;
|
break;
|
||||||
|
|
||||||
case NOP: break;
|
case NOP: break;
|
||||||
|
Loading…
Reference in New Issue
Block a user