X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=menu.c;h=fd7fe5a346da8175a571d4fdfb703dd1385d59c3;hb=2d02d8d6fea2f8a0724d89d64d238da2aae84d94;hp=3cd69d2d2d94f64d420818ec997546ac90cc4a67;hpb=25cfdf0a342a64a01710c1b6fbe3b1b04f28975e;p=libpicofe.git diff --git a/menu.c b/menu.c index 3cd69d2..fd7fe5a 100644 --- a/menu.c +++ b/menu.c @@ -981,10 +981,9 @@ static int dirent_seek_char(struct dirent **namelist, int len, int sel, char c) { int i; - sel++; for (i = sel + 1; ; i++) { if (i >= len) - i = 1; + i = 0; if (i == sel) break; @@ -992,7 +991,7 @@ static int dirent_seek_char(struct dirent **namelist, int len, int sel, char c) break; } - return i - 1; + return i; } static const char *menu_loop_romsel(char *curr_path, int len, @@ -1320,9 +1319,9 @@ static char *action_binds(int player_idx, int action_mask, int dev_id) if (player_idx >= 0) { can_combo = 0; type = IN_BINDTYPE_PLAYER12 + (player_idx >> 1); + if (player_idx & 1) + action_mask <<= 16; } - if (player_idx & 1) - action_mask <<= 16; if (dev_id >= 0) dev = dev_last = dev_id; @@ -1459,11 +1458,12 @@ static void key_config_loop(const me_bind_action *opts, int opt_cnt, int player_ dev_id = -1; // show all mask_shift = 0; - if (player_idx & 1) - mask_shift = 16; - bindtype = IN_BINDTYPE_EMU; - if (player_idx >= 0) - bindtype = IN_BINDTYPE_PLAYER12 + (player_idx >> 1); + if (player_idx >= 0) { + if (player_idx & 1) + mask_shift = 16; + bindtype = IN_BINDTYPE_PLAYER12 + (player_idx >> 1); + } else + bindtype = IN_BINDTYPE_EMU; for (;;) {