mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-19 07:31:15 +00:00
Correct wrapping behaviour for (d, x).
This commit is contained in:
parent
e9347168e6
commit
0f1468adfd
@ -359,15 +359,20 @@ template <typename BusHandler, bool uses_ready_line> void Processor<BusHandler,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
case OperationConstructDirectIndexedIndirect:
|
case OperationConstructDirectIndexedIndirect:
|
||||||
data_address_ = (
|
// Emulation mode plus DL = 0 is required for 6502-style functionality where
|
||||||
((registers_.direct + registers_.x.full + instruction_buffer_.value) & registers_.e_masks[1]) +
|
// only the low byte is the result of the indirect calculation.
|
||||||
(registers_.direct & registers_.e_masks[0])
|
|
||||||
) & 0xffff;
|
|
||||||
data_address_increment_mask_ = 0x00'ff'ff;
|
|
||||||
|
|
||||||
if(!(registers_.direct&0xff)) {
|
if(!(registers_.direct&0xff)) {
|
||||||
|
data_address_ = (
|
||||||
|
((registers_.direct + registers_.x.full + instruction_buffer_.value) & registers_.e_masks[1]) +
|
||||||
|
(registers_.direct & registers_.e_masks[0])
|
||||||
|
) & 0xffff;
|
||||||
++next_op_;
|
++next_op_;
|
||||||
|
} else {
|
||||||
|
data_address_ = (
|
||||||
|
registers_.direct + registers_.x.full + instruction_buffer_.value
|
||||||
|
) & 0xffff;
|
||||||
}
|
}
|
||||||
|
data_address_increment_mask_ = 0x00'ff'ff;
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case OperationConstructDirectIndirectIndexedLong:
|
case OperationConstructDirectIndirectIndexedLong:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user