From 24d64bf788a1eb2c633f66de1b3e1d198b5c90f4 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Thu, 4 Jan 2024 11:17:20 -0500 Subject: [PATCH] ROM is never shadowed; also add `assert`. --- Machines/Apple/AppleIIgs/MemoryMap.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Machines/Apple/AppleIIgs/MemoryMap.hpp b/Machines/Apple/AppleIIgs/MemoryMap.hpp index 92033f339..6d1820caf 100644 --- a/Machines/Apple/AppleIIgs/MemoryMap.hpp +++ b/Machines/Apple/AppleIIgs/MemoryMap.hpp @@ -70,6 +70,11 @@ class MemoryMap { } bool is_shadowed(const Region ®ion, uint32_t address) const { + // ROM is never shadowed. + if(!region.write) { + return false; + } + const auto physical = physical_address(region, address); assert(physical >= 0 && physical <= 0xff'ffff); return shadow_pages_[(physical >> 10) & 127] & shadow_banks_[physical >> 17];