\r
static unsigned long wait_for_input(unsigned int interesting)\r
{\r
- unsigned int ret;\r
- static int repeats = 0, wait = 50;\r
+ unsigned long ret;\r
+ static int repeats = 0, wait = 20;\r
int release = 0, i;\r
\r
- if (repeats == 2 || repeats == 4) wait /= 2;\r
- if (repeats == 6) wait = 15;\r
+ if (repeats == 2) wait = 3;\r
+ else if (repeats == 4) wait = 2;\r
+ else if (repeats == 6) wait = 1;\r
\r
- for (i = 0; i < 6 && inp_prev == Framework_PollGetButtons(); i++) {\r
+ for (i = 0; i < wait && inp_prev == Framework_PollGetButtons(); i++) {\r
if (i == 0) repeats++;\r
- Sleep(wait);\r
+ Sleep(30);\r
}\r
\r
while ( !((ret = Framework_PollGetButtons()) & interesting) ) {\r
\r
if (release || ret != inp_prev) {\r
repeats = 0;\r
- wait = 50;\r
+ wait = 20;\r
}\r
+ if (wait > 6 && (ret&(BTN_UP|BTN_LEFT|BTN_DOWN|BTN_RIGHT)))\r
+ wait = 6;\r
inp_prev = ret;\r
\r
// we don't need diagonals in menus\r
static unsigned long wait_for_input(unsigned long interesting)\r
{\r
unsigned long ret;\r
- static int repeats = 0, wait = 6;\r
+ static int repeats = 0, wait = 20;\r
int release = 0, i;\r
\r
if (repeats == 2) wait = 3;\r
\r
if (release || ret != inp_prev) {\r
repeats = 0;\r
- wait = 6;\r
+ wait = 20;\r
}\r
+ if (wait > 6 && (ret&(GP2X_UP|GP2X_LEFT|GP2X_DOWN|GP2X_RIGHT)))\r
+ wait = 6;\r
inp_prev = ret;\r
inp_prevjoy = 0;\r
\r
static unsigned long wait_for_input(unsigned int interesting, int is_key_config)
{
unsigned int ret;
- static int repeats = 0, wait = 6;
+ static int repeats = 0, wait = 20;
int release = 0, count, i;
if (!is_key_config)
if (release || ret != inp_prev) {
repeats = 0;
- wait = 6;
+ wait = 20;
}
inp_prev = ret;
if (!is_key_config)
ret |= (ret & 0xf0000000) >> 24; // use analog as d-pad
+ if (wait > 6 && (ret&(BTN_UP|BTN_LEFT|BTN_DOWN|BTN_RIGHT)))
+ wait = 6;
// we don't need diagonals in menus
if ((ret&BTN_UP) && (ret&BTN_LEFT)) ret &= ~BTN_LEFT;