From 60b513033f240d18d2aeff27e660e6dc91b557ee Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Fri, 17 Jun 2022 19:57:17 +0200 Subject: [PATCH] MMR0 fix --- bus.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bus.cpp b/bus.cpp index e56e953..9df590c 100644 --- a/bus.cpp +++ b/bus.cpp @@ -525,10 +525,12 @@ uint16_t bus::write(const uint16_t a, const bool word_mode, uint16_t value, cons if (a == 0177572) { // MMR0 DOLOG(debug, true, "write set MMR0: %o", value); - MMR0 = value & ~(3 << 10); // bit 10 & 11 always read as 0 + value &= ~(3 << 10); // bit 10 & 11 always read as 0 if (value & 1) - MMR0 = value & ~(7 << 13); // reset error bits + value &= ~(7 << 13); // reset error bits + + MMR0 = value; return MMR0; }