Style nits
authorcbransden <chris.bransden@objectway.com>
Fri, 13 May 2016 16:50:34 +0000 (17:50 +0100)
committercbransden <chris.bransden@objectway.com>
Fri, 13 May 2016 17:30:03 +0000 (18:30 +0100)
frontend/libretro.c
frontend/plugin.c
include/psemu_plugin_defs.h
libpcsxcore/plugins.c
maemo/hildon.c
plugins/dfinput/main.c

index 6e859c7..bdce90e 100644 (file)
@@ -1312,8 +1312,7 @@ static void update_variables(bool in_flight)
 
 void retro_run(void)
 {
-
-   int i;
+    int i;
 
        input_poll_cb();
 
@@ -1321,17 +1320,14 @@ void retro_run(void)
        if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
                update_variables(true);
 
-       // reset all keystate, query from libretro for keystate
+       // reset all keystate, query libretro for keystate
        int j;
-       for(i=0;i<8;i++){
+       for(i = 0; i < 8; i++) {
                in_keystate[i] = 0;
-               // query from libretro for keystate
-               for (j = 0; j < RETRO_PSX_MAP_LEN; j++){
+               // query libretro for keystate
+               for (j = 0; j < RETRO_PSX_MAP_LEN; j++)
                        if (input_state_cb(i, RETRO_DEVICE_JOYPAD, 0, j))
                                in_keystate[i] |= retro_psx_map[j];
-               }
-
-               //printf("%i : %i\n",i , input_state_cb(i, RETRO_ENVIRONMENT_GET_INPUT_DEVICE_CAPABILITIES, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X));
 
                if (in_type[i] == PSE_PAD_TYPE_ANALOGPAD)
                {
index 53ecac9..5663e6d 100644 (file)
@@ -52,12 +52,13 @@ extern int  CALLBACK SPUplayCDDAchannel(short *, int);
 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) {
+    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];
         pad->rightJoyX = in_analog_right[pad_index][0];
@@ -74,12 +75,13 @@ 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) {
+    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];
index 7232d03..034f21b 100644 (file)
@@ -191,10 +191,10 @@ typedef struct
 
 typedef struct
 {
-       // controler type - fill it withe predefined values above
+       // controller type - fill it withe predefined values above
        unsigned char controllerType;
 
-       //0 : No multitap between psx and pad
+       //0 : no multitap between psx and pad
        //1 : multitap between psx and pad on port 1
        //2 : multitap between psx and pad on port 2
        int portMultitap;
index 1369b1c..8d3a00e 100644 (file)
@@ -384,62 +384,62 @@ static int bufcount, bufc;
 \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
@@ -515,49 +515,44 @@ unsigned char _PADpoll(unsigned char value) {
     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
index 6fbdcf5..7e9cd9f 100644 (file)
@@ -484,31 +484,31 @@ inline void key_press_event(int key2,int type)
                        switch (psxkey1){
                                case DKEY_CROSS:
                                        in_state_gun |= SACTION_GUN_A;
-                                       break;
+                                       break;          
                                case DKEY_CIRCLE:
                                        in_state_gun |= SACTION_GUN_B;
-                                       break;
+                                       break;          
                                case DKEY_TRIANGLE:
                                        in_state_gun |= SACTION_GUN_TRIGGER2;
-                                       break;
+                                       break;          
                                case DKEY_SQUARE:
                                        in_state_gun |= SACTION_GUN_TRIGGER;
-                                       break;
+                                       break;          
                        }
                }else if (type == 2) {
                        switch (psxkey1){
                                case DKEY_CROSS:
                                        in_state_gun &= ~SACTION_GUN_A;
-                                       break;
+                                       break;          
                                case DKEY_CIRCLE:
                                        in_state_gun &= ~SACTION_GUN_B;
-                                       break;
+                                       break;          
                                case DKEY_TRIANGLE:
                                        in_state_gun &= ~SACTION_GUN_TRIGGER2;
-                                       break;
+                                       break;          
                                case DKEY_SQUARE:
                                        in_state_gun &= ~SACTION_GUN_TRIGGER;
-                                       break;
+                                       break;          
                        }
                }
        }else{
@@ -533,7 +533,7 @@ inline void key_press_event(int key2,int type)
                                                in_a1[1] = 255;
                                                break;
                                }
-                       }
+       }
                }
                else if (type == 2) {
                if (psxkey1 >= 0)
@@ -554,7 +554,7 @@ inline void key_press_event(int key2,int type)
                                }
                        }
                emu_set_action(SACTION_NONE);
-               }
+       }
        }
 }
 
@@ -599,7 +599,7 @@ int maemo_init(int *argc, char ***argv)
                }
                fclose(pFile);
        }
-
+       
        switch (in_type1){
                case PSE_PAD_TYPE_GUNCON:
                        memset(cornerActions, 0, sizeof(cornerActions));
@@ -610,7 +610,7 @@ int maemo_init(int *argc, char ***argv)
                        break;
                case PSE_PAD_TYPE_ANALOGPAD:
                        printf("Controller set to analog (SCPH-1150)\n");
-                       break;
+                       break;  
        }
 
        if (in_enable_vibration)
@@ -664,7 +664,7 @@ int maemo_init(int *argc, char ***argv)
 
        if (bKeepDisplayOn){
                if (pthread_create(&display_thread, NULL, displayThread, NULL))
-                       printf("Failed to create display thread.\n");
+                       printf("Failed to create display thread.\n");           
        }
 
        pl_rearmed_cbs.only_16bpp = 1;
index 15ea07c..c3adedd 100644 (file)
@@ -58,8 +58,6 @@ void dfinput_activate(void)
 {
        PadDataS pad;
 
-
-
        PAD1_readPort1(&pad);
        select_pad(1);