fix Wiz timer drift and button name
authornotaz <notasas@gmail.com>
Sat, 1 Aug 2009 17:34:12 +0000 (17:34 +0000)
committernotaz <notasas@gmail.com>
Sat, 1 Aug 2009 17:34:12 +0000 (17:34 +0000)
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@725 be3aeb3a-fb24-0410-a615-afba39da0efa

platform/gp2x/in_gp2x.c
platform/gp2x/soc_pollux.c

index 273c03b..ec50a36 100644 (file)
@@ -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
index b6ec9ab..2cda031 100644 (file)
@@ -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)