mirror of https://github.com/PCSX2/pcsx2.git
input-rec: add back safeguard around controller input hook and dont deref null virtual pads
This commit is contained in:
parent
8fb09d07ed
commit
ef32b49e50
|
@ -149,7 +149,7 @@ void InputRecording::ControllerInterrupt(u8& data, u8& port, u16& bufCount, u8 b
|
||||||
}
|
}
|
||||||
// If the VirtualPad updated the PadData, we have to update the buffer
|
// If the VirtualPad updated the PadData, we have to update the buffer
|
||||||
// before sending it to the game
|
// before sending it to the game
|
||||||
else if (pads[port].virtualPad->IsShown() && pads[port].virtualPad->UpdateControllerData(bufIndex, pads[port].padData))
|
else if (pads[port].virtualPad && pads[port].virtualPad->IsShown() && pads[port].virtualPad->UpdateControllerData(bufIndex, pads[port].padData))
|
||||||
bufVal = pads[port].padData->PollControllerData(bufIndex);
|
bufVal = pads[port].padData->PollControllerData(bufIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,11 +205,14 @@ SIO_WRITE sioWriteController(u8 data)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
sio.buf[sio.bufCount] = PADpoll(data);
|
sio.buf[sio.bufCount] = PADpoll(data);
|
||||||
|
if (EmuConfig.EnableRecordingTools)
|
||||||
|
{
|
||||||
// Only examine controllers 1 / 2
|
// Only examine controllers 1 / 2
|
||||||
if (sio.slot[sio.port] == 0 || sio.slot[sio.port] == 1)
|
if (sio.slot[sio.port] == 0 || sio.slot[sio.port] == 1)
|
||||||
{
|
{
|
||||||
g_InputRecording.ControllerInterrupt(data, sio.port, sio.bufCount, sio.buf);
|
g_InputRecording.ControllerInterrupt(data, sio.port, sio.bufCount, sio.buf);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//Console.WriteLn( "SIO: sent = %02X From pad data = %02X bufCnt %08X ", data, sio.buf[sio.bufCount], sio.bufCount);
|
//Console.WriteLn( "SIO: sent = %02X From pad data = %02X bufCnt %08X ", data, sio.buf[sio.bufCount], sio.bufCount);
|
||||||
|
|
Loading…
Reference in New Issue