1
0
mirror of https://github.com/TomHarte/CLK.git synced 2026-01-23 01:16:10 +00:00

Unpublish WriteableReader.

This commit is contained in:
Thomas Harte
2025-10-27 17:01:29 -04:00
parent 7b4e71e6dd
commit bc5b7a6725
2 changed files with 8 additions and 9 deletions

View File

@@ -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 <BusOperation, typename Enable = void> struct Value;
template <BusOperation operation> struct Value<operation, std::enable_if_t<is_read(operation)>> {
using type = Writeable &;

View File

@@ -29,6 +29,13 @@ void Processor<model, Traits>::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<model, Traits>::run_for(const Cycles cycles) {
} else { \
Data::Writeable target; \
Storage::cycles_ -= Storage::bus_handler_.template perform<type>(addr, target); \
Data::WriteableReader::assign(value, target); \
WriteableReader::assign(value, target); \
} \
} else { \
Storage::cycles_ -= Storage::bus_handler_.template perform<type>(addr, value); \