From b8bb1b2814f1909645343abf73595fdcb011776d Mon Sep 17 00:00:00 2001 From: Themaister Date: Mon, 10 Jan 2011 08:55:34 +0100 Subject: [PATCH] Enable joyconfig to use more joypads. --- tools/ssnes-joyconfig.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tools/ssnes-joyconfig.c b/tools/ssnes-joyconfig.c index f47919c5fe..86d75411f1 100644 --- a/tools/ssnes-joyconfig.c +++ b/tools/ssnes-joyconfig.c @@ -216,11 +216,6 @@ static void parse_input(int argc, char *argv[]) fprintf(stderr, "Joypad number can't be less than 1!\n"); exit(1); } - else if (g_joypad > 2) - { - fprintf(stderr, "Joypad number can't be over 2! (1 or 2 allowed)\n"); - exit(1); - } break; case 'p': @@ -260,6 +255,15 @@ int main(int argc, char *argv[]) parse_input(argc, argv); config_file_t *conf = config_file_new(g_in_path); + if (!conf) + { + fprintf(stderr, "Couldn't open config file ...\n"); + return 1; + } + + config_set_int(conf, g_player == 1 ? "input_player1_joypad_index" : "input_player2_joypad_index", + g_joypad - 1); + get_binds(conf, g_player - 1, g_joypad - 1); config_file_write(conf, g_out_path); config_file_free(conf);