add support for 4 player inputs
[libpicofe.git] / menu.c
diff --git a/menu.c b/menu.c
index 50138f3..3cd69d2 100644 (file)
--- a/menu.c
+++ b/menu.c
@@ -1319,9 +1319,9 @@ static char *action_binds(int player_idx, int action_mask, int dev_id)
        type = IN_BINDTYPE_EMU;\r
        if (player_idx >= 0) {\r
                can_combo = 0;\r
-               type = IN_BINDTYPE_PLAYER12;\r
+               type = IN_BINDTYPE_PLAYER12 + (player_idx >> 1);\r
        }\r
-       if (player_idx == 1)\r
+       if (player_idx & 1)\r
                action_mask <<= 16;\r
 \r
        if (dev_id >= 0)\r
@@ -1459,9 +1459,11 @@ static void key_config_loop(const me_bind_action *opts, int opt_cnt, int player_
 \r
        dev_id = -1; // show all\r
        mask_shift = 0;\r
-       if (player_idx == 1)\r
+       if (player_idx & 1)\r
                mask_shift = 16;\r
-       bindtype = player_idx >= 0 ? IN_BINDTYPE_PLAYER12 : IN_BINDTYPE_EMU;\r
+       bindtype = IN_BINDTYPE_EMU;\r
+       if (player_idx >= 0)\r
+              bindtype = IN_BINDTYPE_PLAYER12 + (player_idx >> 1);\r
 \r
        for (;;)\r
        {\r