From 5bad90a820aba663cb8c1294b78e487b3eca769c Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Tue, 21 Mar 2023 19:40:32 +0100 Subject: [PATCH] lock MMR2 when upper 3 bits of MMR0 are set (any of them) --- bus.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bus.cpp b/bus.cpp index 4309dc5..e167834 100644 --- a/bus.cpp +++ b/bus.cpp @@ -361,7 +361,8 @@ void bus::clearMMR0Bit(const int bit) void bus::setMMR2(const uint16_t value) { - MMR2 = value; + if ((MMR0 & 0xe000) == 0) + MMR2 = value; } void bus::check_odd_addressing(const uint16_t a, const int run_mode, const d_i_space_t space, const bool is_write)