mirror of
https://github.com/TomHarte/CLK.git
synced 2024-07-05 10:28:58 +00:00
Knocks out some transfer operations.
I'm possibly only seven or eight away from being able to test with complete official-opcode-only 6502 code?
This commit is contained in:
parent
e068cbc103
commit
93b0839036
@ -51,7 +51,7 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
|
|||||||
|
|
||||||
case OperationDecode: {
|
case OperationDecode: {
|
||||||
// A VERY TEMPORARY piece of logging.
|
// A VERY TEMPORARY piece of logging.
|
||||||
printf("[%04x] %02x\n", pc_ - 1, instruction_buffer_.value);
|
printf("[%04x] %02x\n", pc_ - 2, instruction_buffer_.value); // pc_ - 1 would be correct but this matches a log I made of the 6502.
|
||||||
active_instruction_ = &instructions[instruction_buffer_.value];
|
active_instruction_ = &instructions[instruction_buffer_.value];
|
||||||
|
|
||||||
const auto size_flag = mx_flags_[active_instruction_->size_field];
|
const auto size_flag = mx_flags_[active_instruction_->size_field];
|
||||||
@ -306,6 +306,7 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
|
|||||||
|
|
||||||
case OperationPerform:
|
case OperationPerform:
|
||||||
switch(active_instruction_->operation) {
|
switch(active_instruction_->operation) {
|
||||||
|
|
||||||
//
|
//
|
||||||
// Loads, stores and transfers (and NOP).
|
// Loads, stores and transfers (and NOP).
|
||||||
//
|
//
|
||||||
@ -330,11 +331,43 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
|
|||||||
direct_ = ((instruction_buffer_.value) & 0xff) << 16;
|
direct_ = ((instruction_buffer_.value) & 0xff) << 16;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
// The below attempts to obey the 8/16-bit mixed transfer rules
|
||||||
|
// as documented in https://softpixel.com/~cwright/sianse/docs/65816NFO.HTM
|
||||||
|
|
||||||
case TXS:
|
case TXS:
|
||||||
// TODO: does this transfer in full when in 8-bit index mode?
|
s_ = x_.full & x_masks_[1];
|
||||||
LD(s_, x_.full, x_masks_);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TSX:
|
||||||
|
LD(x_, s_.full, x_masks_);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TXY:
|
||||||
|
LD(x_, y_.full, x_masks_);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TYX:
|
||||||
|
LD(y_, x_.full, x_masks_);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TAX:
|
||||||
|
LD(x_, a_.full, x_masks_);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TAY:
|
||||||
|
LD(x_, a_.full, x_masks_);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TXA:
|
||||||
|
LD(a_, x_.full, m_masks_);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TYA:
|
||||||
|
LD(a_, y_.full, m_masks_);
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
case STA:
|
case STA:
|
||||||
data_buffer_.value = a_.full & m_masks_[1];
|
data_buffer_.value = a_.full & m_masks_[1];
|
||||||
data_buffer_.size = 2 - m_flag();
|
data_buffer_.size = 2 - m_flag();
|
||||||
@ -558,11 +591,11 @@ template <typename BusHandler> void Processor<BusHandler>::run_for(const Cycles
|
|||||||
// PHP, PHD, PHK,
|
// PHP, PHD, PHK,
|
||||||
// TRB, TSB,
|
// TRB, TSB,
|
||||||
// REP, SEP,
|
// REP, SEP,
|
||||||
// TAX, TAY, TCD, TCS, TDC, TSC, TSX, TXA, TXS, TXY, TYA, TYX,
|
|
||||||
// XCE, XBA,
|
// XCE, XBA,
|
||||||
// STP, WAI,
|
// STP, WAI,
|
||||||
// RTI, RTL,
|
// RTI, RTL,
|
||||||
// BRK,
|
// BRK,
|
||||||
|
// TCD, TCS, TDC, TSC
|
||||||
|
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
|
Loading…
Reference in New Issue
Block a user