diff --git a/InstructionSets/ARM/Registers.hpp b/InstructionSets/ARM/Registers.hpp index c3158b5d2..5c7bba41a 100644 --- a/InstructionSets/ARM/Registers.hpp +++ b/InstructionSets/ARM/Registers.hpp @@ -231,7 +231,7 @@ struct Registers { // MARK: - Condition tests. /// @returns @c true if @c condition tests as true; @c false otherwise. - bool test(Condition condition) { + bool test(Condition condition) const { const auto ne = [&]() -> bool { return zero_result_; }; diff --git a/Machines/Acorn/Archimedes/Archimedes.cpp b/Machines/Acorn/Archimedes/Archimedes.cpp index b44dfecdc..b03138460 100644 --- a/Machines/Acorn/Archimedes/Archimedes.cpp +++ b/Machines/Acorn/Archimedes/Archimedes.cpp @@ -549,7 +549,7 @@ class ConcreteMachine: uint32_t advance_pipeline(uint32_t pc) { uint32_t instruction = 0; // Value should never be used; this avoids a spurious GCC warning. - const bool did_read = executor_.bus.read(pc, instruction, executor_.registers().mode(), false); + const bool did_read = executor_.bus.read(pc, instruction, executor_.registers().mode() == InstructionSet::ARM::Mode::User); return pipeline_.exchange( did_read ? instruction : Pipeline::SWI, did_read ? Pipeline::SWISubversion::None : Pipeline::SWISubversion::DataAbort); diff --git a/Machines/Acorn/Archimedes/MemoryController.hpp b/Machines/Acorn/Archimedes/MemoryController.hpp index 6e91b8ef2..48056e6a6 100644 --- a/Machines/Acorn/Archimedes/MemoryController.hpp +++ b/Machines/Acorn/Archimedes/MemoryController.hpp @@ -173,7 +173,7 @@ struct MemoryController { } template - bool read(uint32_t address, IntT &source, InstructionSet::ARM::Mode, bool trans) { + bool read(uint32_t address, IntT &source, bool trans) { switch (read_zones_[(address >> 21) & 31]) { case Zone::PhysicallyMappedRAM: if(trans) return false; @@ -212,6 +212,11 @@ struct MemoryController { return true; } + template + bool read(uint32_t address, IntT &source, InstructionSet::ARM::Mode, bool trans) { + return read(address, source, trans); + } + // // Expose various IOC-owned things. //