diff --git a/OSBindings/Mac/Clock SignalTests/8088Tests.mm b/OSBindings/Mac/Clock SignalTests/8088Tests.mm index 7abe43f10..ea651ac1a 100644 --- a/OSBindings/Mac/Clock SignalTests/8088Tests.mm +++ b/OSBindings/Mac/Clock SignalTests/8088Tests.mm @@ -169,8 +169,15 @@ struct Memory { return *reinterpret_cast(&memory[address]); } + template struct ReturnType; + template struct ReturnType { using type = IntT; }; + template struct ReturnType { using type = IntT &; }; + template struct ReturnType { using type = IntT &; }; + template struct ReturnType { using type = IntT &; }; + // Entry point for the 8086; simply notes that memory was accessed. - template IntT &access([[maybe_unused]] InstructionSet::x86::Source segment, uint32_t address) { + template + typename ReturnType::type &access(InstructionSet::x86::Source segment, uint32_t address) { if constexpr (std::is_same_v) { // If this is a 16-bit access that runs past the end of the segment, it'll wrap back // to the start. So the 16-bit value will need to be a local cache. @@ -183,13 +190,6 @@ struct Memory { } auto &value = access(segment, address, Tag::Accessed); - // For testing purposes: if the CPU indicated it'll only be reading, copy the requested value into a temporary - // location so that any writes will be discarded. - if(type == AccessType::Read) { - *reinterpret_cast(&read_value_) = value; - return *reinterpret_cast(&read_value_); - } - // If the CPU has indicated a write, it should be safe to fuzz the value now. if(type == AccessType::Write) { value = IntT(~0); @@ -212,7 +212,6 @@ struct Memory { static constexpr uint32_t NoWriteBack = 0; // A low byte address of 0 can't require write-back. uint32_t write_back_address_[2] = {NoWriteBack, NoWriteBack}; uint16_t write_back_value_; - uint16_t read_value_; }; struct IO { template void out([[maybe_unused]] uint16_t port, [[maybe_unused]] IntT value) {}