X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fgp2x%2Fmenu.c;h=4b3201e5ce2a48e8f32f7e7ac199ccbf605ae7dc;hb=385a849102d74ac187a9c145d5df5fad9385fc1b;hp=0a4cb73b8fc8405a967bd8f92ccbf6852392f325;hpb=43e6eaad0b73b37907be3342e0fd4cf65919e9f6;p=picodrive.git diff --git a/platform/gp2x/menu.c b/platform/gp2x/menu.c index 0a4cb73..4b3201e 100644 --- a/platform/gp2x/menu.c +++ b/platform/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;