From 3328d53bb7d323f9009181e9308fad37a5b5d427 Mon Sep 17 00:00:00 2001 From: notaz Date: Sat, 1 Aug 2009 17:34:12 +0000 Subject: [PATCH] fix Wiz timer drift and button name git-svn-id: file:///home/notaz/opt/svn/PicoDrive@725 be3aeb3a-fb24-0410-a615-afba39da0efa --- platform/gp2x/in_gp2x.c | 3 ++- platform/gp2x/soc_pollux.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/platform/gp2x/in_gp2x.c b/platform/gp2x/in_gp2x.c index 273c03be..ec50a360 100644 --- a/platform/gp2x/in_gp2x.c +++ b/platform/gp2x/in_gp2x.c @@ -27,7 +27,7 @@ enum { BTN_UP = 0, BTN_LEFT = 2, BTN_DOWN = 4, BTN_RIGHT = 6, BTN_VOL_UP = 23, BTN_VOL_DOWN = 22, BTN_PUSH = 27 }; static const char * const in_gp2x_prefix = IN_PREFIX; -static const char * const in_gp2x_keys[IN_GP2X_NBUTTONS] = { +static const char *in_gp2x_keys[IN_GP2X_NBUTTONS] = { [0 ... IN_GP2X_NBUTTONS-1] = NULL, [BTN_UP] = "UP", [BTN_LEFT] = "LEFT", [BTN_DOWN] = "DOWN", [BTN_RIGHT] = "RIGHT", [BTN_START] = "START", [BTN_SELECT] = "SELECT", [BTN_L] = "L", [BTN_R] = "R", @@ -104,6 +104,7 @@ static void in_gp2x_probe(void) return; } in_gp2x_get_bits = in_gp2x_get_wiz_bits; + in_gp2x_keys[BTN_START] = "MENU"; break; default: #ifdef FAKE_IN_GP2X diff --git a/platform/gp2x/soc_pollux.c b/platform/gp2x/soc_pollux.c index b6ec9ab1..2cda031c 100644 --- a/platform/gp2x/soc_pollux.c +++ b/platform/gp2x/soc_pollux.c @@ -219,9 +219,10 @@ unsigned int gp2x_get_ticks_us_(void) unsigned int gp2x_get_ticks_ms_(void) { + /* approximate /= 1000 */ unsigned long long v64; - v64 = (unsigned long long)gp2x_get_ticks_us_() * 4195; - return v64 >> 22; + v64 = (unsigned long long)gp2x_get_ticks_us_() * 4294968; + return v64 >> 32; } static void timer_cleanup(void) -- 2.39.5