diff options
author | alexis-puska | 2016-06-18 14:01:50 +0200 |
---|---|---|
committer | alexis-puska | 2016-06-18 14:01:50 +0200 |
commit | e288923db915ae8e0facd2fe0be8ed866b4f2373 (patch) | |
tree | 8f7d8eea62a13bb868c68852019a22a2a837c53a /frontend | |
parent | 05311a18fb23799776f9552614ef4c5fb5d852fa (diff) | |
download | pcsx_rearmed-e288923db915ae8e0facd2fe0be8ed866b4f2373.tar.gz pcsx_rearmed-e288923db915ae8e0facd2fe0be8ed866b4f2373.tar.bz2 pcsx_rearmed-e288923db915ae8e0facd2fe0be8ed866b4f2373.zip |
suppress hack for crazy value on read port 2
pass pad index in pad datas structure.
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/plugin.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/frontend/plugin.c b/frontend/plugin.c index 5663e6d..8914519 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 ) |