X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=platform%2Fgizmondo%2Fmenu.c;fp=platform%2Fgizmondo%2Fmenu.c;h=9e1994ddbe2c9c615c09ba38591d55411e22103a;hb=385760631f8c75fff0882f8764dbcca9c898e896;hp=1c74589af0d03411d90142d68da1cacd8c6e1742;hpb=52250671ae14d00dfcb52d137f73c9b565493279;p=picodrive.git diff --git a/platform/gizmondo/menu.c b/platform/gizmondo/menu.c index 1c74589..9e1994d 100644 --- a/platform/gizmondo/menu.c +++ b/platform/gizmondo/menu.c @@ -48,16 +48,17 @@ static unsigned int inp_prev = 0; static unsigned long wait_for_input(unsigned int interesting) { - unsigned int ret; - static int repeats = 0, wait = 50; + unsigned long ret; + static int repeats = 0, wait = 20; int release = 0, i; - if (repeats == 2 || repeats == 4) wait /= 2; - if (repeats == 6) wait = 15; + if (repeats == 2) wait = 3; + else if (repeats == 4) wait = 2; + else if (repeats == 6) wait = 1; - for (i = 0; i < 6 && inp_prev == Framework_PollGetButtons(); i++) { + for (i = 0; i < wait && inp_prev == Framework_PollGetButtons(); i++) { if (i == 0) repeats++; - Sleep(wait); + Sleep(30); } while ( !((ret = Framework_PollGetButtons()) & interesting) ) { @@ -67,8 +68,10 @@ static unsigned long wait_for_input(unsigned int interesting) if (release || ret != inp_prev) { repeats = 0; - wait = 50; + wait = 20; } + if (wait > 6 && (ret&(BTN_UP|BTN_LEFT|BTN_DOWN|BTN_RIGHT))) + wait = 6; inp_prev = ret; // we don't need diagonals in menus