diff options
author | alexis-puska | 2016-05-12 01:45:26 +0200 |
---|---|---|
committer | cbransden | 2016-05-13 18:29:58 +0100 |
commit | 29f3675b9b2f24b8a16db73588b8b04d628eabd8 (patch) | |
tree | 026cbda2436e123ae3fabb6285e84ee3e753cc70 /frontend | |
parent | ace14ab3172ad90809a3cc5e8fe67d5cac9e294b (diff) | |
download | pcsx_rearmed-29f3675b9b2f24b8a16db73588b8b04d628eabd8.tar.gz pcsx_rearmed-29f3675b9b2f24b8a16db73588b8b04d628eabd8.tar.bz2 pcsx_rearmed-29f3675b9b2f24b8a16db73588b8b04d628eabd8.zip |
second implementation of multitap
add game/core option to enabled or disabled multitap.
Test with micro machine V3 and 5 devices, 2 multitap enabled, all
device react good i can’t test the 6 7 8 select player but i can select
8 gamer. The 2 multitap works fine.
i detect a bug, when we change the game pad type to analog, the library
crash, see it next time
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/libretro.c | 4 | ||||
-rw-r--r-- | frontend/plugin.c | 30 | ||||
-rw-r--r-- | frontend/plugin_lib.c | 2 | ||||
-rw-r--r-- | frontend/plugin_lib.h | 4 |
4 files changed, 26 insertions, 14 deletions
diff --git a/frontend/libretro.c b/frontend/libretro.c index 4486b95..361695c 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -58,8 +58,8 @@ int in_type[8]; int in_analog_left[8][2] = {{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 }}; int in_analog_right[8][2] = {{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 }}; unsigned short in_keystate[8]; -int multitap1; -int multitap2; +int multitap1 = 0; +int multitap2 = 0; int in_enable_vibration = 1; /* PSX max resolution is 640x512, but with enhancement it's 1024x512 */ diff --git a/frontend/plugin.c b/frontend/plugin.c index d713452..cf93df8 100644 --- a/frontend/plugin.c +++ b/frontend/plugin.c @@ -49,10 +49,14 @@ 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->controllerType = in_type[pad_index]; pad->buttonStatus = ~in_keystate[pad_index]; + if(multitap1==1){ + pad->portMultitap=1; + }else{ + pad->portMultitap=0; + } if (in_type[pad_index] == PSE_PAD_TYPE_ANALOGPAD || in_type[pad_index] == PSE_PAD_TYPE_NEGCON) { pad->leftJoyX = in_analog_left[pad_index][0]; pad->leftJoyY = in_analog_left[pad_index][1]; @@ -62,15 +66,19 @@ static long PADreadPort1(PadDataS *pad, int pad_index) return 0; } -static long PADreadPort2(PadDataS *pad) -{ - pad->controllerType = in_type[4]; - pad->buttonStatus = ~in_keystate[4]; - if (in_type[4] == PSE_PAD_TYPE_ANALOGPAD || in_type[4] == PSE_PAD_TYPE_NEGCON) { - pad->leftJoyX = in_analog_left[4][0]; - pad->leftJoyY = in_analog_left[4][1]; - pad->rightJoyX = in_analog_right[4][0]; - pad->rightJoyY = in_analog_right[4][1]; +static long PADreadPort2(PadDataS *pad, int pad_index) { + pad->controllerType = in_type[pad_index]; + pad->buttonStatus = ~in_keystate[pad_index]; + if(multitap2==1){ + pad->portMultitap=2; + }else{ + pad->portMultitap=0; + } + if (in_type[pad_index] == PSE_PAD_TYPE_ANALOGPAD || in_type[pad_index] == PSE_PAD_TYPE_NEGCON) { + pad->leftJoyX = in_analog_left[pad_index][0]; + pad->leftJoyY = in_analog_left[pad_index][1]; + pad->rightJoyX = in_analog_right[pad_index][0]; + pad->rightJoyY = in_analog_right[pad_index][1]; } return 0; } diff --git a/frontend/plugin_lib.c b/frontend/plugin_lib.c index ff3518e..ad2f49b 100644 --- a/frontend/plugin_lib.c +++ b/frontend/plugin_lib.c @@ -37,6 +37,8 @@ #define HUD_HEIGHT 10 int in_type[8]; +int multitap1; +int multitap2; int in_analog_left[8][2] = {{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 }}; int in_analog_right[8][2] = {{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 },{ 127, 127 }}; int in_adev[2] = { -1, -1 }, in_adev_axis[2][2] = {{ 0, 1 }, { 0, 1 }}; diff --git a/frontend/plugin_lib.h b/frontend/plugin_lib.h index 50fcf9e..ad27fc2 100644 --- a/frontend/plugin_lib.h +++ b/frontend/plugin_lib.h @@ -17,8 +17,10 @@ enum { DKEY_CROSS, DKEY_SQUARE, }; -extern int in_state_gun; +extern int in_state_gun; extern int in_type[8]; +extern int multitap1; +extern int multitap2; extern int in_analog_left[8][2]; extern int in_analog_right[8][2]; unsigned short in_keystate[8]; |