1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-27 22:30:49 +00:00

This should bring me up to absolute, y.

i.e. next is datasheet program 7.
This commit is contained in:
Thomas Harte 2020-10-04 19:02:47 -04:00
parent 8a83024962
commit 4ebf594b3b
2 changed files with 22 additions and 0 deletions

View File

@ -79,6 +79,12 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
bus_operation = MOS6502Esque::Read;
break;
case CycleFetchIncorrectDataAddress:
bus_address = incorrect_data_address_;
bus_value = &throwaway;
bus_operation = MOS6502Esque::Read;
break;
case CycleFetchIncrementData:
bus_address = data_address_;
bus_value = data_buffer_.next_input();
@ -163,6 +169,21 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
data_address_ = (instruction_buffer_.value + (x_.full & x_masks_[1])) & 0xffff;
break;
case OperationConstructAbsoluteLongX:
data_address_ = instruction_buffer_.value + (x_.full & x_masks_[1]);
break;
case OperationConstructAbsoluteXRead:
case OperationConstructAbsoluteX:
data_address_ = ((instruction_buffer_.value + (x_.full & x_masks_[1])) & 0xffff) | data_bank_;
incorrect_data_address_ = (data_address_ & 0xff) | (instruction_buffer_.value & 0xff00) | data_bank_;
// If the incorrect address isn't actually incorrect, skip its usage.
if(operation == OperationConstructAbsoluteXRead && data_address_ == incorrect_data_address_) {
++next_op_;
}
break;
//
// Performance.
//

View File

@ -264,6 +264,7 @@ struct ProcessorStorage {
};
Buffer instruction_buffer_, data_buffer_;
uint32_t data_address_;
uint32_t incorrect_data_address_;
std::vector<MicroOp> micro_ops_;
MicroOp *next_op_ = nullptr;