From db44b15c379da3ab11d7632ab1cc3b6e6d1dc646 Mon Sep 17 00:00:00 2001 From: tomcw Date: Tue, 28 Feb 2023 20:42:53 +0000 Subject: [PATCH] For Phasor (native/Echo+ modes) improve support for null AY chip-select case --- source/Mockingboard.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/Mockingboard.cpp b/source/Mockingboard.cpp index 2c69c065..92f432a8 100644 --- a/source/Mockingboard.cpp +++ b/source/Mockingboard.cpp @@ -216,7 +216,9 @@ void MockingboardCard::WriteToORB(BYTE subunit) if (nAY_CS == 0) { SY6522& r6522 = m_MBSubUnit[subunit].sy6522; - r6522.SetRegORA(r6522.GetReg(SY6522::rDDRA) ^ 0xff); // direction '0' = input, and empirically it floats high (so DDRA=0x00 will read 0xFF as input) + BYTE ora = r6522.GetReg(SY6522::rORA); + ora |= r6522.GetReg(SY6522::rDDRA) ^ 0xff; // for any DDRA bits set as input (logical 0), then set them in ORA + r6522.SetRegORA(ora); // empirically bus floats high (or pull-up?) if no AY chip-selected (so DDRA=0x00 will read 0xFF as input) } } else