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; }