From 47f2ad193fb6f13efb277554794fa581e5d0a26e Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Fri, 17 Jun 2022 20:34:37 +0200 Subject: [PATCH] correction of protection of bits 1...7 --- bus.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bus.cpp b/bus.cpp index 56c5671..80e784b 100644 --- a/bus.cpp +++ b/bus.cpp @@ -308,6 +308,11 @@ void bus::setMMR0(int value) if (value & 1) value &= ~(7 << 13); // reset error bits + if (MMR0 & 0160000) { + if ((value & 1) == 0) + value &= 254; // bits 7...1 are protected + } + // TODO if bit 15/14/13 are set (either of them), then do not modify bit 1...7 MMR0 = value;