From ff8539565f9926babd9ebb4b66b2f5ff7197ce21 Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Tue, 22 Mar 2022 10:20:20 +0100 Subject: [PATCH] MMR0 (bits 10 & 11 always 0) fix --- bus.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/bus.cpp b/bus.cpp index d9975dc..d0f3cfa 100644 --- a/bus.cpp +++ b/bus.cpp @@ -206,12 +206,8 @@ uint16_t bus::read(const uint16_t a, const bool word_mode, const bool use_prev) } else { if (a == 0177572) { - uint16_t t = (run_mode << 5) | // kernel == 00 - ((c -> getRegister(7) >> 13) << 1) | // page nr - 0 // MMU enabled - ; - D(fprintf(stderr, "read MMU MMR0 %o\n", t);) - return t; + D(fprintf(stderr, "read MMR0\n");) + return MMR0; } if (a == 0177574) { // MMR1 @@ -433,7 +429,7 @@ uint16_t bus::write(const uint16_t a, const bool word_mode, uint16_t value, cons if (a == 0177572) { // MMR0 D(fprintf(stderr, "write set MMR0: %o\n", value);) - MMR0 = value; + MMR0 = value & ~(3 << 10); // bit 10 & 11 always read as 0 return MMR0; }