From d3f250a51601414e3bb8f2e4fc3029a408fae868 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Sat, 6 Feb 2021 10:27:17 +0100 Subject: [PATCH] fixed QuadTari multiplexing timing (fixes #766) --- src/emucore/Joystick.cxx | 3 +-- src/emucore/tia/TIA.cxx | 4 ++-- src/emucore/tia/TIA.hxx | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/emucore/Joystick.cxx b/src/emucore/Joystick.cxx index 6974cfdf1..1c18045b9 100644 --- a/src/emucore/Joystick.cxx +++ b/src/emucore/Joystick.cxx @@ -110,8 +110,7 @@ void Joystick::updateDigitalAxes() setPin(DigitalPin::One, myEvent.get(myUpEvent) == 0); setPin(DigitalPin::Two, myEvent.get(myDownEvent) == 0); setPin(DigitalPin::Three, myEvent.get(myLeftEvent) == 0); - setPin(DigitalPin::Four, myEvent.get(myRightEvent) != 1); - cerr << myEvent.get(myRightEvent) << endl; + setPin(DigitalPin::Four, myEvent.get(myRightEvent) == 0); } //// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index 119e55340..7c291a3ed 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -2009,14 +2009,14 @@ void TIA::updateDumpPorts(uInt8 value) if(myArePortsDumped != newIsDumped) { myArePortsDumped = newIsDumped; - myDumpPortsTimestamp = myTimestamp; + myDumpPortsCycles = mySystem->cycles() + Delay::vblank; } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Int64 TIA::dumpPortsCycles() { - return (myTimestamp - myDumpPortsTimestamp) / 3; + return mySystem->cycles() - myDumpPortsCycles; } #ifdef DEBUGGER_SUPPORT diff --git a/src/emucore/tia/TIA.hxx b/src/emucore/tia/TIA.hxx index 6367e5667..11de48d48 100644 --- a/src/emucore/tia/TIA.hxx +++ b/src/emucore/tia/TIA.hxx @@ -920,7 +920,7 @@ class TIA : public Device /** * The number of CPU clocks since the last dump ports state change. */ - uInt64 myDumpPortsTimestamp{0}; + uInt64 myDumpPortsCycles{0}; /** * The current dump ports state.