From d101ab3088c3a2f697fd13b35533e9240b50f64a Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Fri, 17 Jun 2022 19:51:53 +0200 Subject: [PATCH] MMR2 is locked when bits 0160000 in MMR0 are set (either of them) --- cpu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cpu.cpp b/cpu.cpp index 1e238af..83f75d6 100644 --- a/cpu.cpp +++ b/cpu.cpp @@ -2170,7 +2170,8 @@ void cpu::step_b() uint16_t temp_pc = getPC(); - b->setMMR2(temp_pc); + if ((b->getMMR1() & 0160000) == 0) + b->setMMR2(temp_pc); if (temp_pc & 1) busError();