\r
//PadDataS padd1, padd2;\r
unsigned char _PADstartPollMultitap(PadDataS padd[4]) {\r
- int i=0;\r
- int decallage=2;\r
+ int i = 0;\r
+ int offset = 2;\r
bufc = 0;\r
PadDataS pad;\r
- for(i=0;i<4;i++){\r
- decallage = 2 + (i*8);\r
+ for(i = 0; i < 4; i++) {\r
+ offset = 2 + (i * 8);\r
pad = padd[i];\r
switch (pad.controllerType) {\r
case PSE_PAD_TYPE_MOUSE:\r
- multitappar[decallage+1] = 0x12;\r
- multitappar[decallage+2] = 0x5a;\r
- multitappar[decallage+3] = pad.buttonStatus & 0xff;\r
- multitappar[decallage+4] = pad.buttonStatus >> 8;\r
- multitappar[decallage+5] = pad.moveX;\r
- multitappar[decallage+6] = pad.moveY;\r
+ multitappar[offset + 1] = 0x12;\r
+ multitappar[offset + 2] = 0x5a;\r
+ multitappar[offset + 3] = pad.buttonStatus & 0xff;\r
+ multitappar[offset + 4] = pad.buttonStatus >> 8;\r
+ multitappar[offset + 5] = pad.moveX;\r
+ multitappar[offset + 6] = pad.moveY;\r
\r
break;\r
case PSE_PAD_TYPE_NEGCON: // npc101/npc104(slph00001/slph00069)\r
- multitappar[decallage+1] = 0x23;\r
- multitappar[decallage+2] = 0x5a;\r
- multitappar[decallage+3] = pad.buttonStatus & 0xff;\r
- multitappar[decallage+4] = pad.buttonStatus >> 8;\r
- multitappar[decallage+5] = pad.rightJoyX;\r
- multitappar[decallage+6] = pad.rightJoyY;\r
- multitappar[decallage+7] = pad.leftJoyX;\r
- multitappar[decallage+8] = pad.leftJoyY;\r
+ multitappar[offset + 1] = 0x23;\r
+ multitappar[offset + 2] = 0x5a;\r
+ multitappar[offset + 3] = pad.buttonStatus & 0xff;\r
+ multitappar[offset + 4] = pad.buttonStatus >> 8;\r
+ multitappar[offset + 5] = pad.rightJoyX;\r
+ multitappar[offset + 6] = pad.rightJoyY;\r
+ multitappar[offset + 7] = pad.leftJoyX;\r
+ multitappar[offset + 8] = pad.leftJoyY;\r
\r
break;\r
case PSE_PAD_TYPE_ANALOGPAD: // scph1150\r
- multitappar[decallage+1] = 0x73;\r
- multitappar[decallage+2] = 0x5a;\r
- multitappar[decallage+3] = pad.buttonStatus & 0xff;\r
- multitappar[decallage+4] = pad.buttonStatus >> 8;\r
- multitappar[decallage+5] = pad.rightJoyX;\r
- multitappar[decallage+6] = pad.rightJoyY;\r
- multitappar[decallage+7] = pad.leftJoyX;\r
- multitappar[decallage+8] = pad.leftJoyY;\r
+ multitappar[offset + 1] = 0x73;\r
+ multitappar[offset + 2] = 0x5a;\r
+ multitappar[offset + 3] = pad.buttonStatus & 0xff;\r
+ multitappar[offset + 4] = pad.buttonStatus >> 8;\r
+ multitappar[offset + 5] = pad.rightJoyX;\r
+ multitappar[offset + 6] = pad.rightJoyY;\r
+ multitappar[offset + 7] = pad.leftJoyX;\r
+ multitappar[offset + 8] = pad.leftJoyY;\r
\r
break;\r
case PSE_PAD_TYPE_ANALOGJOY: // scph1110\r
- multitappar[decallage+1] = 0x53;\r
- multitappar[decallage+2] = 0x5a;\r
- multitappar[decallage+3] = pad.buttonStatus & 0xff;\r
- multitappar[decallage+4] = pad.buttonStatus >> 8;\r
- multitappar[decallage+5] = pad.rightJoyX;\r
- multitappar[decallage+6] = pad.rightJoyY;\r
- multitappar[decallage+7] = pad.leftJoyX;\r
- multitappar[decallage+8] = pad.leftJoyY;\r
+ multitappar[offset + 1] = 0x53;\r
+ multitappar[offset + 2] = 0x5a;\r
+ multitappar[offset + 3] = pad.buttonStatus & 0xff;\r
+ multitappar[offset + 4] = pad.buttonStatus >> 8;\r
+ multitappar[offset + 5] = pad.rightJoyX;\r
+ multitappar[offset + 6] = pad.rightJoyY;\r
+ multitappar[offset + 7] = pad.leftJoyX;\r
+ multitappar[offset + 8] = pad.leftJoyY;\r
\r
break;\r
case PSE_PAD_TYPE_STANDARD:\r
default:\r
- multitappar[decallage+1] = 0x41;\r
- multitappar[decallage+2] = 0x5a;\r
- multitappar[decallage+3] = pad.buttonStatus & 0xff;\r
- multitappar[decallage+4] = pad.buttonStatus >> 8;\r
+ multitappar[offset + 1] = 0x41;\r
+ multitappar[offset + 2] = 0x5a;\r
+ multitappar[offset + 3] = pad.buttonStatus & 0xff;\r
+ multitappar[offset + 4] = pad.buttonStatus >> 8;\r
}\r
}\r
\r
return buf[bufc++];\r
}\r
\r
-// rafraichissement de l'état des boutons sur port 1,\r
-// int pad dans le code d'origine ne sert a rien...\r
+// refresh the button state on port 1.\r
+// int pad is not needed.\r
unsigned char CALLBACK PAD1__startPoll(int pad) {\r
- //first call the pad provide if a multitap is connected between the psx and himself\r
- if(multitap1 == -1){\r
+ // first call the pad provide if a multitap is connected between the psx and himself\r
+ if(multitap1 == -1)\r
+ {\r
PadDataS padd;\r
- PAD1_readPort1(&padd,0);\r
+ PAD1_readPort1(&padd, 0);\r
multitap1 = padd.portMultitap;\r
}\r
// just one pad is on port 1 : NO MULTITAP\r
- if (multitap1 == 0){\r
+ if (multitap1 == 0)\r
+ {\r
PadDataS padd;\r
- PAD1_readPort1(&padd,0);\r
+ PAD1_readPort1(&padd, 0);\r
return _PADstartPoll(&padd);\r
- }else{\r
- //a multitap is plugged : refresh all pad.\r
+ } else {\r
+ // a multitap is plugged : refresh all pad.\r
int i=0;\r
PadDataS padd[4];\r
- for(i=0;i<4;i++){\r
- PAD1_readPort1(&padd[i],i);\r
+ for(i = 0; i < 4; i++) {\r
+ PAD1_readPort1(&padd[i], i);\r
}\r
return _PADstartPollMultitap(padd);\r
}\r
}\r
\r
unsigned char CALLBACK PAD1__poll(unsigned char value) {\r
-// if(value !=0){\r
-// int i;\r
-// printf("%2x %c\n", value, value);\r
-// for (i = 0; i < 35; i++) {\r
-// printf("%2x", buf[i]);\r
-// }\r
-// printf("\n");\r
-// }\r
- if(multitap1==0){\r
+ if (multitap1 == 0)\r
+ {\r
return _PADpoll(value);\r
- }else{\r
- if(value==42){\r
+ } else {\r
+ if(value == 42) {\r
unsigned char bufmultitap[256];\r
memcpy(bufmultitap, multitappar, 3);\r
bufcount = 2;\r
return bufmultitap[bufc++];\r
- }else{\r
+ } else {\r
return _PADpoll(value);\r
}\r
}\r