From 348840a2aa691f88a50eb60db39e470d35ed9dee Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 19 Dec 2021 16:31:44 -0500 Subject: [PATCH] It's probably a net detriment to use a template in this scenario. --- Machines/Amiga/Chipset.cpp | 8 ++++---- Machines/Amiga/Chipset.hpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Machines/Amiga/Chipset.cpp b/Machines/Amiga/Chipset.cpp index 193d272f5..5a18a0422 100644 --- a/Machines/Amiga/Chipset.cpp +++ b/Machines/Amiga/Chipset.cpp @@ -816,7 +816,7 @@ void Chipset::perform(const CPU::MC68000::Microcycle &cycle) { } } -template void Chipset::write(uint32_t address, uint16_t value) { +void Chipset::write(uint32_t address, uint16_t value, bool allow_conversion) { #define ApplySetClear(target, mask) { \ if(value & 0x8000) { \ target |= (value & mask); \ @@ -828,7 +828,7 @@ template void Chipset::write(uint32_t address, uint16_t switch(address & ChipsetAddressMask) { default: // If there was nothing to write, perform a throwaway read. - if constexpr (allow_conversion) read(address); + if(allow_conversion) read(address, false); break; // Raster position. @@ -1083,12 +1083,12 @@ template void Chipset::write(uint32_t address, uint16_t #undef ApplySetClear } -template uint16_t Chipset::read(uint32_t address) { +uint16_t Chipset::read(uint32_t address, bool allow_conversion) { switch(address & ChipsetAddressMask) { default: // If there was nothing to read, perform a write. // TODO: Rather than 0xffff, should be whatever is left on the bus, vapour-lock style. - if constexpr (allow_conversion) write(address, 0xffff); + if(allow_conversion) write(address, 0xffff, false); return 0xffff; // Raster position. diff --git a/Machines/Amiga/Chipset.hpp b/Machines/Amiga/Chipset.hpp index e8668c106..9a4144212 100644 --- a/Machines/Amiga/Chipset.hpp +++ b/Machines/Amiga/Chipset.hpp @@ -108,8 +108,8 @@ class Chipset: private ClockingHint::Observer { friend class DMADeviceBase; // MARK: - Register read/write functions. - template uint16_t read(uint32_t address); - template void write(uint32_t address, uint16_t value); + uint16_t read(uint32_t address, bool allow_conversion = true); + void write(uint32_t address, uint16_t value, bool allow_conversion = true); static constexpr uint32_t ChipsetAddressMask = 0x1fe; friend class Copper;