From: notaz Date: Sat, 1 Aug 2009 17:34:12 +0000 (+0000) Subject: fix Wiz timer drift and button name X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8af2da727390116fe2623fc2ddab7c164114b589;p=libpicofe.git fix Wiz timer drift and button name git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@725 be3aeb3a-fb24-0410-a615-afba39da0efa --- diff --git a/gp2x/in_gp2x.c b/gp2x/in_gp2x.c index 273c03b..ec50a36 100644 --- a/gp2x/in_gp2x.c +++ b/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/gp2x/soc_pollux.c b/gp2x/soc_pollux.c index b6ec9ab..2cda031 100644 --- a/gp2x/soc_pollux.c +++ b/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)