T-bit masking fix (bus write)

This commit is contained in:
folkert van heusden 2022-06-14 21:59:35 +02:00
parent e7c50e9380
commit 669c9dab71

View file

@ -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;