diff --git a/Machines/Acorn/Archimedes/MemoryController.hpp b/Machines/Acorn/Archimedes/MemoryController.hpp index c7155551f..a8661a98a 100644 --- a/Machines/Acorn/Archimedes/MemoryController.hpp +++ b/Machines/Acorn/Archimedes/MemoryController.hpp @@ -33,7 +33,11 @@ static_assert(BitMask<15, 14>::value == 49152); template struct MemoryController { MemoryController(InterruptObserverT &observer, ClockRateObserverT &clock_rate_observer) : - ioc_(observer, clock_rate_observer, ram_.data()) {} + ioc_(observer, clock_rate_observer, ram_.data()) { + read_zones_[0] = Zone::HighROM; // Temporarily put high ROM at address 0. + // TODO: could I just copy it in? Or, at least, + // could I detect at ROM loading time whether I can? + } int interrupt_mask() const { return ioc_.interrupt_mask(); @@ -150,11 +154,6 @@ struct MemoryController { break; case Zone::LogicallyMappedRAM: { - if(!has_moved_rom_) { // TODO: maintain this state in the zones table. - source = high_rom(address); - break; - } - const auto item = logical_ram(address, mode); if(!item) { return false; @@ -164,13 +163,12 @@ struct MemoryController { case Zone::LowROM: // logger.error().append("TODO: Low ROM read from %08x", address); - source = IntT(0); + source = IntT(~0); break; case Zone::HighROM: // Real test is: require A24=A25=0, then A25=1. - // TODO: as above, move this test into the zones tables. - has_moved_rom_ = true; + read_zones_[0] = Zone::LogicallyMappedRAM; source = high_rom(address); break; @@ -254,7 +252,7 @@ struct MemoryController { return *reinterpret_cast(&rom_[address & (rom_.size() - 1)]); } - const std::array read_zones_ = zones(true); + std::array read_zones_ = zones(true); const std::array write_zones_ = zones(false); // Control register values.