diff --git a/Processors/65816/Implementation/65816Implementation.hpp b/Processors/65816/Implementation/65816Implementation.hpp index abc3adb12..f7f0666aa 100644 --- a/Processors/65816/Implementation/65816Implementation.hpp +++ b/Processors/65816/Implementation/65816Implementation.hpp @@ -106,6 +106,18 @@ template void Processor::run_for(const Cycles decrement_data_address(); break; + case CycleFetchBlockX: + read(((instruction_buffer_.value & 0xff00) << 8) | (x_.full & x_masks_[1]), data_buffer_.any_byte()); + break; + + case CycleFetchBlockY: + read(((instruction_buffer_.value & 0xff00) << 8) | (y_.full & x_masks_[1]), &throwaway); + break; + + case CycleStoreBlockY: + write(((instruction_buffer_.value & 0xff00) << 8) | (y_.full & x_masks_[1]), data_buffer_.any_byte()); + break; + #undef increment_data_address #undef decrement_data_address @@ -254,9 +266,25 @@ template void Processor::run_for(const Cycles instruction_buffer_.value = old_pc; } break; - case JSL: { + // + // Block moves. + // - } break; + case MVP: + data_bank_ = (instruction_buffer_.value & 0xff) << 16; + --x_.full; + --y_.full; + --a_.full; + if(a_.full) pc_ -= 3; + break; + + case MVN: + data_bank_ = (instruction_buffer_.value & 0xff) << 16; + ++x_.full; + ++y_.full; + --a_.full; + if(a_.full) pc_ -= 3; + break; default: assert(false); diff --git a/Processors/65816/Implementation/65816Storage.hpp b/Processors/65816/Implementation/65816Storage.hpp index b8dd19ff6..0baa015ba 100644 --- a/Processors/65816/Implementation/65816Storage.hpp +++ b/Processors/65816/Implementation/65816Storage.hpp @@ -253,6 +253,10 @@ struct ProcessorStorage { return byte(size); } + uint8_t *any_byte() { + return reinterpret_cast(&value); + } + private: uint8_t *byte(int pointer) { #if TARGET_RT_BIG_ENDIAN