From 06b5c027d38401234e9198aec44a78d4f33a7a5c Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Tue, 21 Mar 2023 15:07:51 +0100 Subject: [PATCH] do not run trap when 4 upper bits of MMR0 are set (any of them), also set bit 12 when there is a case for traping --- bus.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bus.cpp b/bus.cpp index 81b0818..a4d07e5 100644 --- a/bus.cpp +++ b/bus.cpp @@ -435,9 +435,11 @@ uint32_t bus::calculate_physical_address(const int run_mode, const uint16_t a, c if (do_trap) { DOLOG(debug, true, "TRAP(0250) (throw 1) for access_control %d on address %06o", access_control, a); - if (MMR0 & (1 << 9)) + if ((MMR0 & (1 << 9)) && (MMR0 & 0xf000) == 0) c->schedule_trap(0250); // invalid address + MMR0 |= 1 << 12; // set trap-flag + if (is_write) pages[run_mode][d][apf].pdr |= 1 << 7;