X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2Fmenu.c;h=05d0903570b66d0858622bcd8da69cf545ed9ce2;hb=446b090ceade65a57b2f97493d6670ffb236a747;hp=0a4cb73b8fc8405a967bd8f92ccbf6852392f325;hpb=e1cd546fc7ec6f3c83a5b0f50e2d4ea93b139e3c;p=libpicofe.git diff --git a/gp2x/menu.c b/gp2x/menu.c index 0a4cb73..05d0903 100644 --- a/gp2x/menu.c +++ b/gp2x/menu.c @@ -46,16 +46,16 @@ static int inp_prevjoy = 0; static unsigned long wait_for_input(unsigned long interesting) { unsigned long ret; - static int repeats = 0, wait = 50*1000; + static int repeats = 0, wait = 6; int release = 0, i; - if (repeats == 2 || repeats == 4) wait /= 2; - if (repeats == 6) wait = 15 * 1000; + if (repeats == 2) wait = 3; + else if (repeats == 4) wait = 2; + else if (repeats == 6) wait = 1; - for (i = 0; i < 6 && inp_prev == gp2x_joystick_read(1); i++) { + for (i = 0; i < wait && inp_prev == gp2x_joystick_read(1); i++) { if (i == 0) repeats++; - if (wait >= 30*1000) usleep(wait); // usleep sleeps for ~30ms minimum - else spend_cycles(wait * currentConfig.CPUclock); + usleep(30000); } while ( !((ret = gp2x_joystick_read(1)) & interesting) ) { @@ -65,7 +65,7 @@ static unsigned long wait_for_input(unsigned long interesting) if (release || ret != inp_prev) { repeats = 0; - wait = 50*1000; + wait = 6; } inp_prev = ret; inp_prevjoy = 0; @@ -1545,6 +1545,7 @@ static void menu_loop_root(void) if (rom_loaded) { if(savestate_menu_loop(1)) continue; + while (gp2x_joystick_read(1) & GP2X_B) usleep(50*1000); engineState = PGS_Running; return; } @@ -1552,6 +1553,7 @@ static void menu_loop_root(void) case MA_MAIN_RESET_GAME: if (rom_loaded) { emu_ResetGame(); + while (gp2x_joystick_read(1) & GP2X_B) usleep(50*1000); engineState = PGS_Running; return; }