created branch

This commit is contained in:
thrust26 2021-02-05 19:27:35 +01:00
parent 54f33da48d
commit 783b30d78a
4 changed files with 10 additions and 6 deletions

View File

@ -68,6 +68,10 @@ void Driving::update()
updateDigitalAxes(); updateDigitalAxes();
updateMouseAxes(); updateMouseAxes();
// Only consider the lower-most bits (corresponding to pins 1 & 2)
myGrayIndex = Int32(myCounter * SENSITIVITY / 4.0F) & 0b11;
updateStelladaptorAxes(); updateStelladaptorAxes();
// Gray codes for rotation // Gray codes for rotation
@ -117,9 +121,6 @@ void Driving::updateDigitalAxes()
--myCounter; --myCounter;
else if(myEvent.get(myCWEvent) != 0 || d_axis > 16384) else if(myEvent.get(myCWEvent) != 0 || d_axis > 16384)
++myCounter; ++myCounter;
// Only consider the lower-most bits (corresponding to pins 1 & 2)
myGrayIndex = Int32(myCounter * SENSITIVITY / 4.0F) & 0b11;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -99,7 +99,7 @@ void Joystick::updateMouseButtons(bool& pressedLeft, bool& pressedRight)
if(myControlID > -1) if(myControlID > -1)
{ {
pressedLeft |= (myEvent.get(Event::MouseButtonLeftValue) != 0); 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::One, myEvent.get(myUpEvent) == 0);
setPin(DigitalPin::Two, myEvent.get(myDownEvent) == 0); setPin(DigitalPin::Two, myEvent.get(myDownEvent) == 0);
setPin(DigitalPin::Three, myEvent.get(myLeftEvent) == 0); setPin(DigitalPin::Three, myEvent.get(myLeftEvent) == 0);
setPin(DigitalPin::Four, myEvent.get(myRightEvent) != 1); setPin(DigitalPin::Four, myEvent.get(myRightEvent) == 0);
cerr << myEvent.get(myRightEvent) << endl;
} }
//// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - //// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -122,6 +122,7 @@ bool QuadTari::read(DigitalPin pin)
else else
// If bit 7 of VBlank is not set, read first, else second controller // If bit 7 of VBlank is not set, read first, else second controller
readFirst = !(mySystem.tia().registerValue(VBLANK) & 0x80); readFirst = !(mySystem.tia().registerValue(VBLANK) & 0x80);
cerr << mySystem.tia().dumpPortsCycles() << " ";
if(readFirst) if(readFirst)
return myFirstController->read(pin); return myFirstController->read(pin);

View File

@ -1688,6 +1688,7 @@ void TIA::delayedWrite(uInt8 address, uInt8 value)
case VBLANK: case VBLANK:
flushLineCache(); flushLineCache();
myFrameManager->setVblank(value & 0x02); myFrameManager->setVblank(value & 0x02);
//updateDumpPorts(value);
break; break;
case HMOVE: case HMOVE:
@ -2010,6 +2011,7 @@ void TIA::updateDumpPorts(uInt8 value)
{ {
myArePortsDumped = newIsDumped; myArePortsDumped = newIsDumped;
myDumpPortsTimestamp = myTimestamp; myDumpPortsTimestamp = myTimestamp;
//myDumpPortsTimestamp = mySystem->cycles();
} }
} }
@ -2017,6 +2019,7 @@ void TIA::updateDumpPorts(uInt8 value)
Int64 TIA::dumpPortsCycles() Int64 TIA::dumpPortsCycles()
{ {
return (myTimestamp - myDumpPortsTimestamp) / 3; return (myTimestamp - myDumpPortsTimestamp) / 3;
//return mySystem->cycles() - myDumpPortsTimestamp;
} }
#ifdef DEBUGGER_SUPPORT #ifdef DEBUGGER_SUPPORT