konami jailbreak: game sporadically crashes when played w/keyboard

This commit is contained in:
dinkc64 2017-10-03 02:44:59 +00:00
parent 2dea2fb564
commit 62554257a3
1 changed files with 12 additions and 0 deletions

View File

@ -517,6 +517,16 @@ static INT32 DrvDraw()
return 0;
}
static inline void DrvClearOpposites(UINT8* nJoystickInputs) // active low version
{
if ((*nJoystickInputs & 0x03) == 0x00) {
*nJoystickInputs |= 0x03;
}
if ((*nJoystickInputs & 0x0c) == 0x00) {
*nJoystickInputs |= 0x0c;
}
}
static INT32 DrvFrame()
{
watchdog++;
@ -537,6 +547,8 @@ static INT32 DrvFrame()
DrvInputs[1] ^= (DrvJoy2[i] & 1) << i;
DrvInputs[2] ^= (DrvJoy3[i] & 1) << i;
}
DrvClearOpposites(&DrvInputs[1]);
DrvClearOpposites(&DrvInputs[2]);
}
INT32 nInterleave = 9;