From 62231708d7a6d7e37b30e2c3680cdc6d28ebc86f Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Wed, 21 Oct 2020 21:16:42 -0400 Subject: [PATCH] `read_pages_` can be `const`. --- Machines/Apple/AppleII/AppleII.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Machines/Apple/AppleII/AppleII.cpp b/Machines/Apple/AppleII/AppleII.cpp index 34d8ad874..e0dbdae27 100644 --- a/Machines/Apple/AppleII/AppleII.cpp +++ b/Machines/Apple/AppleII/AppleII.cpp @@ -37,6 +37,7 @@ namespace II { #define is_iie() ((model == Analyser::Static::AppleII::Target::Model::IIe) || (model == Analyser::Static::AppleII::Target::Model::EnhancedIIe)) template class ConcreteMachine: + public Apple::II::Machine, public MachineTypes::TimedMachine, public MachineTypes::ScanProducer, public MachineTypes::AudioProducer, @@ -46,7 +47,6 @@ template class ConcreteMachine: public CPU::MOS6502::BusHandler, public Inputs::Keyboard, public Configurable::Device, - public Apple::II::Machine, public Activity::Source, public Apple::II::Card::Delegate { private: @@ -175,7 +175,7 @@ template class ConcreteMachine: to paging every 6502 page of memory independently. It makes the paging events more expensive, but hopefully more clear. */ - uint8_t *read_pages_[256]; // each is a pointer to the 256-block of memory the CPU should read when accessing that page of memory + const uint8_t *read_pages_[256]; // each is a pointer to the 256-block of memory the CPU should read when accessing that page of memory uint8_t *write_pages_[256]; // as per read_pages_, but this is where the CPU should write. If a pointer is nullptr, don't write. void page(int start, int end, uint8_t *read, uint8_t *write) { for(int position = start; position < end; ++position) { @@ -227,13 +227,13 @@ template class ConcreteMachine: bool alternative_zero_page_ = false; void set_zero_page_paging() { if(alternative_zero_page_) { - read_pages_[0] = aux_ram_; + write_pages_[0] = aux_ram_; } else { - read_pages_[0] = ram_; + write_pages_[0] = ram_; } - read_pages_[1] = read_pages_[0] + 256; - write_pages_[0] = read_pages_[0]; - write_pages_[1] = read_pages_[1]; + write_pages_[1] = write_pages_[0] + 256; + read_pages_[0] = write_pages_[0]; + read_pages_[1] = write_pages_[1]; } bool read_auxiliary_memory_ = false;