mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-16 18:30:32 +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;
|
||||
|
||||
case OperationConstructDirectIndexedIndirect:
|
||||
data_address_ = (
|
||||
((registers_.direct + registers_.x.full + instruction_buffer_.value) & registers_.e_masks[1]) +
|
||||
(registers_.direct & registers_.e_masks[0])
|
||||
) & 0xffff;
|
||||
data_address_increment_mask_ = 0x00'ff'ff;
|
||||
|
||||
// Emulation mode plus DL = 0 is required for 6502-style functionality where
|
||||
// only the low byte is the result of the indirect calculation.
|
||||
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_;
|
||||
} else {
|
||||
data_address_ = (
|
||||
registers_.direct + registers_.x.full + instruction_buffer_.value
|
||||
) & 0xffff;
|
||||
}
|
||||
data_address_increment_mask_ = 0x00'ff'ff;
|
||||
continue;
|
||||
|
||||
case OperationConstructDirectIndirectIndexedLong:
|
||||
|
Loading…
x
Reference in New Issue
Block a user