From 193c5df75d3b6d9e3442e42fa26fd8ccc4c5e3aa Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Wed, 24 Dec 2014 11:43:28 -0500 Subject: XWorld: cleanup - Comment keymaps.h - Tie XWORLD_DEBUG into ROCKBOX_HAS_LOGF to ease debugging - Fix up the manual a little bit Change-Id: I12cfb58001199036cd67dbaa27f164e6790a199d Reviewed-on: http://gerrit.rockbox.org/1084 Reviewed-by: Michael Giacomelli --- apps/plugins/xworld/keymaps.h | 34 ++++++++++++++++++++++------------ apps/plugins/xworld/sys.c | 4 ++-- apps/plugins/xworld/util.h | 6 +++++- apps/plugins/xworld/xworld.c | 2 +- 4 files changed, 30 insertions(+), 16 deletions(-) (limited to 'apps/plugins/xworld') diff --git a/apps/plugins/xworld/keymaps.h b/apps/plugins/xworld/keymaps.h index 54021a8981..78d93604a8 100644 --- a/apps/plugins/xworld/keymaps.h +++ b/apps/plugins/xworld/keymaps.h @@ -21,8 +21,8 @@ #ifndef _XWORLD_KEYMAPS_H #define _XWORLD_KEYMAPS_H -#endif +/* Handle the "nice" targets that have directional buttons with normal names */ #if (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) || \ (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) || \ (CONFIG_KEYPAD == PHILIPS_SA9200_PAD) || \ @@ -63,15 +63,15 @@ #define BTN_PAUSE BUTTON_SELECT #endif -#if (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) || \ - (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) || \ - (CONFIG_KEYPAD == PHILIPS_SA9200_PAD) || \ - (CONFIG_KEYPAD == CREATIVE_ZENXFI2_PAD) || \ - (CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD) || \ - (CONFIG_KEYPAD == SANSA_CONNECT_PAD) || \ - (CONFIG_KEYPAD == SANSA_C200_PAD) || \ - (CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD) || \ - (CONFIG_KEYPAD == ONDAVX747_PAD) +#if (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) || \ + (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) || \ + (CONFIG_KEYPAD == PHILIPS_SA9200_PAD) || \ + (CONFIG_KEYPAD == CREATIVE_ZENXFI2_PAD) || \ + (CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD) || \ + (CONFIG_KEYPAD == SANSA_CONNECT_PAD) || \ + (CONFIG_KEYPAD == SANSA_C200_PAD) || \ + (CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD) || \ + (CONFIG_KEYPAD == ONDAVX747_PAD) #define BTN_FIRE BUTTON_VOL_UP #define BTN_PAUSE BUTTON_VOL_DOWN @@ -124,8 +124,11 @@ (CONFIG_KEYPAD == GIGABEAT_S_PAD) #define BTN_FIRE BUTTON_VOL_UP #define BTN_PAUSE BUTTON_MENU +/* #if CONFIG_KEYPAD == PHILIPS_HDD1630_PAD */ #endif +/* ... and now for the bad ones that don't have + * standard names for the directional buttons */ #elif (CONFIG_KEYPAD == PBELL_VIBE500_PAD) #define BTN_UP BUTTON_OK #define BTN_DOWN BUTTON_CANCEL @@ -185,12 +188,19 @@ #define BTN_LEFT BUTTON_LEFT #define BTN_RIGHT BUTTON_RIGHT -#if (CONFIG_KEYPAD == MROBE500_PAD) || (CONFIG_KEYPAD == ONDAVX777_PAD) +#if (CONFIG_KEYPAD == MROBE500_PAD) || \ + (CONFIG_KEYPAD == ONDAVX777_PAD) #define BTN_PAUSE BUTTON_BOTTOMLEFT -#elif CONFIG_KEYPAD == !COWON_D2_PAD || !DX50_PAD || !ONDAVX777_PAD +#elif (CONFIG_KEYPAD == !COWON_D2_PAD) || \ + (CONFIG_KEYPAD != !DX50_PAD) || \ + (CONFIG_KEYMAP != ONDAVX777_PAD) #define BTN_FIRE BUTTON_BOTTOMLEFT #define BTN_PAUSE BUTTON_TOPLEFT +#endif +/* HAVE_TOUCHSCREEN */ #endif + +/* _XWORLD_KEYMAPS_H */ #endif diff --git a/apps/plugins/xworld/sys.c b/apps/plugins/xworld/sys.c index 0af13efd11..14c928f067 100644 --- a/apps/plugins/xworld/sys.c +++ b/apps/plugins/xworld/sys.c @@ -787,13 +787,13 @@ void sys_sleep(struct System* sys, uint32_t duration) { (void) sys; /* duration is in ms */ - rb->sleep(duration / 10); + rb->sleep(duration / (1000/HZ)); } uint32_t sys_getTimeStamp(struct System* sys) { (void) sys; - return (uint32_t) (*rb->current_tick) * 10; + return (uint32_t) (*rb->current_tick * (1000/HZ)); } static int16_t rb_soundbuf [MAX_SOUNDBUF_SIZE] IBSS_ATTR; diff --git a/apps/plugins/xworld/util.h b/apps/plugins/xworld/util.h index 8852335661..bacb149da9 100644 --- a/apps/plugins/xworld/util.h +++ b/apps/plugins/xworld/util.h @@ -25,12 +25,16 @@ #include "intern.h" -/* #define XWORLD_DEBUG */ +#ifdef ROCKBOX_HAS_LOGF +#define XWORLD_DEBUG +#endif #ifdef XWORLD_DEBUG #define debug(m,f,...) debug_real(m, f, ##__VA_ARGS__) +#define XWORLD_DEBUGMASK ~0 #else #define debug(m,f,...) +#define XWORLD_DEBUGMASK 0 #endif enum { diff --git a/apps/plugins/xworld/xworld.c b/apps/plugins/xworld/xworld.c index 932ff1c3e1..b0e701cec3 100644 --- a/apps/plugins/xworld/xworld.c +++ b/apps/plugins/xworld/xworld.c @@ -36,7 +36,7 @@ enum plugin_status plugin_start(const void* parameter) /* no trailing slashes */ const char *dataPath = "/.rockbox/xworld"; const char *savePath = "/.rockbox/xworld"; - g_debugMask = 0; + g_debugMask = XWORLD_DEBUGMASK; engine_create(&e, &sys, dataPath, savePath); engine_init(&e); -- cgit v1.2.3