MCPcopy Create free account
hub / github.com/AppleWin/AppleWin / JoyReadPosition

Function JoyReadPosition

source/Joystick.cpp:679–691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

677static const double PDL_CNTR_INTERVAL = 2816.0 / 255.0; // 11.04 (From KEGS)
678
679BYTE __stdcall JoyReadPosition(WORD programcounter, WORD address, BYTE, BYTE, ULONG nExecutedCycles)
680{
681 CpuCalcCycles(nExecutedCycles);
682
683 BOOL nPdlCntrActive = g_nCumulativeCycles <= g_paddleInactiveCycle[address & 3];
684
685 // If no joystick connected, then this is always active (GH#778) && no copy-protection dongle connected
686 const UINT joyNum = (address & 2) ? 1 : 0; // $C064..$C067
687 if (joyinfo[joytype[joyNum]] == DEVICE_NONE && CopyProtectionDonglePDL(address & 3) < 0)
688 nPdlCntrActive = TRUE;
689
690 return MemReadFloatingBus(nPdlCntrActive, nExecutedCycles);
691}
692
693//===========================================================================
694void JoyReset()

Callers 1

IORead_C06xFunction · 0.85

Calls 3

CpuCalcCyclesFunction · 0.85
CopyProtectionDonglePDLFunction · 0.85
MemReadFloatingBusFunction · 0.70

Tested by

no test coverage detected