X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=frontend%2Fplugin.c;h=89145197b6718556faeb06992ca2c37b4513ef56;hb=e288923db915ae8e0facd2fe0be8ed866b4f2373;hp=5663e6d9a1e4f2d5cbad18e6321cdf2dcaaac745;hpb=05311a18fb23799776f9552614ef4c5fb5d852fa;p=pcsx_rearmed.git diff --git a/frontend/plugin.c b/frontend/plugin.c index 5663e6d9..89145197 100644 --- a/frontend/plugin.c +++ b/frontend/plugin.c @@ -49,7 +49,8 @@ extern void CALLBACK SPUasync(unsigned int, unsigned int); extern int CALLBACK SPUplayCDDAchannel(short *, int); /* PAD */ -static long PADreadPort1(PadDataS *pad, int pad_index) { +static long PADreadPort1(PadDataS *pad) { + int pad_index = pad->requestPadIndex; pad->controllerType = in_type[pad_index]; pad->buttonStatus = ~in_keystate[pad_index]; if (multitap1 == 1) @@ -67,12 +68,9 @@ static long PADreadPort1(PadDataS *pad, int pad_index) { return 0; } -static long PADreadPort2(PadDataS *pad, int pad_index) { - /* Temporary hack to avoid segfault when pad_index is a crazy number */ - if (pad_index <= 1 || pad_index > 8) { - pad_index = 1; - } - +static long PADreadPort2(PadDataS *pad) { + int pad_index = pad->requestPadIndex; + pad->controllerType = in_type[pad_index]; pad->buttonStatus = ~in_keystate[pad_index]; if (multitap2 ==1 )