From 5a2424d725bc011cec5347e7772d693703ae7690 Mon Sep 17 00:00:00 2001 From: dinkc64 <12570148+dinkc64@users.noreply.github.com> Date: Wed, 27 Aug 2014 18:30:18 +0000 Subject: [PATCH] irem d_m92 clear opposites --- src/burn/drv/irem/d_m92.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/burn/drv/irem/d_m92.cpp b/src/burn/drv/irem/d_m92.cpp index cea1aec95..772b82959 100644 --- a/src/burn/drv/irem/d_m92.cpp +++ b/src/burn/drv/irem/d_m92.cpp @@ -1979,9 +1979,19 @@ static INT32 DrvReDraw() return 0; } +static inline void DrvClearOpposites(UINT8* nJoystickInputs) +{ + if ((*nJoystickInputs & 0x03) == 0x03) { + *nJoystickInputs &= ~0x03; + } + if ((*nJoystickInputs & 0x0c) == 0x0c) { + *nJoystickInputs &= ~0x0c; + } +} + static void compile_inputs() { - memset (DrvInput, 0, 5); + memset (DrvInput, 0, sizeof(DrvInput)); for (INT32 i = 0; i < 8; i++) { DrvInput[0] |= (DrvJoy1[i] & 1) << i; @@ -1990,6 +2000,10 @@ static void compile_inputs() DrvInput[3] |= (DrvJoy4[i] & 1) << i; DrvInput[4] |= (DrvButton[i] & 1) << i; } + + // Clear Opposites + DrvClearOpposites(&DrvInput[0]); + DrvClearOpposites(&DrvInput[1]); } static void scanline_interrupts(INT32 prev, INT32 segment, INT32 scanline)