From 669c9dab71422c3dfb8eac4a0bd3c21756e5ca1a Mon Sep 17 00:00:00 2001 From: folkert van heusden Date: Tue, 14 Jun 2022 21:59:35 +0200 Subject: [PATCH] T-bit masking fix (bus write) --- bus.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bus.cpp b/bus.cpp index 38b9d53..a1c80eb 100644 --- a/bus.cpp +++ b/bus.cpp @@ -407,13 +407,13 @@ uint16_t bus::write(const uint16_t a, const bool word_mode, uint16_t value, cons DOLOG(debug, true, "writeb PSW %s", a & 1 ? "MSB" : "LSB"); uint16_t vtemp = c -> getPSW(); - value &= ~16; // cannot set T bit via this - if (a & 1) vtemp = (vtemp & 0x00ff) | (value << 8); else vtemp = (vtemp & 0xff00) | value; + vtemp &= ~16; // cannot set T bit via this + c -> setPSW(vtemp, false); return value;