From 783b30d78aa6586b0e44001f5d49ff2349b2bbee Mon Sep 17 00:00:00 2001 From: thrust26 Date: Fri, 5 Feb 2021 19:27:35 +0100 Subject: [PATCH] created branch --- src/emucore/Driving.cxx | 7 ++++--- src/emucore/Joystick.cxx | 5 ++--- src/emucore/QuadTari.cxx | 1 + src/emucore/tia/TIA.cxx | 3 +++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/emucore/Driving.cxx b/src/emucore/Driving.cxx index 2c6c61acc..5d48e6480 100644 --- a/src/emucore/Driving.cxx +++ b/src/emucore/Driving.cxx @@ -68,6 +68,10 @@ void Driving::update() updateDigitalAxes(); updateMouseAxes(); + + // Only consider the lower-most bits (corresponding to pins 1 & 2) + myGrayIndex = Int32(myCounter * SENSITIVITY / 4.0F) & 0b11; + updateStelladaptorAxes(); // Gray codes for rotation @@ -117,9 +121,6 @@ void Driving::updateDigitalAxes() --myCounter; else if(myEvent.get(myCWEvent) != 0 || d_axis > 16384) ++myCounter; - - // Only consider the lower-most bits (corresponding to pins 1 & 2) - myGrayIndex = Int32(myCounter * SENSITIVITY / 4.0F) & 0b11; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/Joystick.cxx b/src/emucore/Joystick.cxx index 6974cfdf1..3d6c1d06b 100644 --- a/src/emucore/Joystick.cxx +++ b/src/emucore/Joystick.cxx @@ -99,7 +99,7 @@ void Joystick::updateMouseButtons(bool& pressedLeft, bool& pressedRight) if(myControlID > -1) { pressedLeft |= (myEvent.get(Event::MouseButtonLeftValue) != 0); - pressedRight |= (pressedRight || myEvent.get(Event::MouseButtonRightValue) != 0); + pressedRight |= (myEvent.get(Event::MouseButtonRightValue) != 0); } } @@ -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/QuadTari.cxx b/src/emucore/QuadTari.cxx index afafb3fdd..25b13f332 100644 --- a/src/emucore/QuadTari.cxx +++ b/src/emucore/QuadTari.cxx @@ -122,6 +122,7 @@ bool QuadTari::read(DigitalPin pin) else // If bit 7 of VBlank is not set, read first, else second controller readFirst = !(mySystem.tia().registerValue(VBLANK) & 0x80); + cerr << mySystem.tia().dumpPortsCycles() << " "; if(readFirst) return myFirstController->read(pin); diff --git a/src/emucore/tia/TIA.cxx b/src/emucore/tia/TIA.cxx index 119e55340..8d4dc659f 100644 --- a/src/emucore/tia/TIA.cxx +++ b/src/emucore/tia/TIA.cxx @@ -1688,6 +1688,7 @@ void TIA::delayedWrite(uInt8 address, uInt8 value) case VBLANK: flushLineCache(); myFrameManager->setVblank(value & 0x02); + //updateDumpPorts(value); break; case HMOVE: @@ -2010,6 +2011,7 @@ void TIA::updateDumpPorts(uInt8 value) { myArePortsDumped = newIsDumped; myDumpPortsTimestamp = myTimestamp; + //myDumpPortsTimestamp = mySystem->cycles(); } } @@ -2017,6 +2019,7 @@ void TIA::updateDumpPorts(uInt8 value) Int64 TIA::dumpPortsCycles() { return (myTimestamp - myDumpPortsTimestamp) / 3; + //return mySystem->cycles() - myDumpPortsTimestamp; } #ifdef DEBUGGER_SUPPORT