From c331d1542941c2077ef5dc3b58b420931a8f5d97 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 16 Jun 2021 22:25:00 -0400 Subject: [PATCH] Makes space to allow for 64kb EXOS ROMs. I think some of the later ROMs have a more thorough memory test, which might provide better detail on whatever's going on here. --- Machines/Enterprise/Enterprise.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Machines/Enterprise/Enterprise.cpp b/Machines/Enterprise/Enterprise.cpp index c9a0151ab..79a65293e 100644 --- a/Machines/Enterprise/Enterprise.cpp +++ b/Machines/Enterprise/Enterprise.cpp @@ -76,6 +76,7 @@ class ConcreteMachine: } const auto &exos = roms.find(exos_name)->second; + exos_.fill(0xff); memcpy(exos_.data(), exos.data(), std::min(exos_.size(), exos.size())); // Take a reasonable guess at the initial memory configuration: @@ -192,7 +193,7 @@ class ConcreteMachine: private: // MARK: - Memory layout std::array ram_; - std::array exos_; + std::array exos_; const uint8_t min_ram_slot_ = 0xff - 3; const uint8_t *read_pointers_[4] = {nullptr, nullptr, nullptr, nullptr}; @@ -202,7 +203,7 @@ class ConcreteMachine: template void page(uint8_t offset) { pages_[slot] = offset; - if(offset < 2) { + if(offset < exos_.size() / 0x4000) { page(&exos_[offset * 0x4000], nullptr); return; }