diff --git a/Processors/6502Mk2/6502Mk2.hpp b/Processors/6502Mk2/6502Mk2.hpp index 2339f97e9..14b6cb974 100644 --- a/Processors/6502Mk2/6502Mk2.hpp +++ b/Processors/6502Mk2/6502Mk2.hpp @@ -126,20 +126,12 @@ public: private: uint8_t result_; - friend struct WriteableReader; #ifndef NDEBUG bool did_write_ = false; #endif }; -struct WriteableReader { - static void assign(uint8_t &lhs, const Writeable rhs) { - lhs = rhs; - } - static void assign(const uint8_t &, const Writeable) {} -}; - template struct Value; template struct Value> { using type = Writeable &; diff --git a/Processors/6502Mk2/Implementation/6502.hpp b/Processors/6502Mk2/Implementation/6502.hpp index 67e42cdc4..08ec65539 100644 --- a/Processors/6502Mk2/Implementation/6502.hpp +++ b/Processors/6502Mk2/Implementation/6502.hpp @@ -29,6 +29,13 @@ void Processor::run_for(const Cycles cycles) { Storage::cycles_ += cycles; if(Storage::cycles_ <= Cycles(0)) return; + struct WriteableReader { + static void assign(uint8_t &lhs, const Data::Writeable rhs) { + lhs = rhs; + } + static void assign(const uint8_t &, const Data::Writeable) {} + }; + #define restore_point() (__COUNTER__ + int(ResumePoint::Max) + int(AddressingMode::Max)) #define join(a, b) a##b @@ -62,7 +69,7 @@ void Processor::run_for(const Cycles cycles) { } else { \ Data::Writeable target; \ Storage::cycles_ -= Storage::bus_handler_.template perform(addr, target); \ - Data::WriteableReader::assign(value, target); \ + WriteableReader::assign(value, target); \ } \ } else { \ Storage::cycles_ -= Storage::bus_handler_.template perform(addr, value); \