summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFranklin Wei <frankhwei536@gmail.com>2014-12-24 11:43:28 -0500
committerMichael Giacomelli <giac2000@hotmail.com>2014-12-28 02:48:42 +0100
commit193c5df75d3b6d9e3442e42fa26fd8ccc4c5e3aa (patch)
tree1afbe3a32d57b7689686a715de549a441efc0314
parente7c282fed754bfc4a2fbdc2e8e1a7598b5fae27c (diff)
downloadrockbox-193c5df75d3b6d9e3442e42fa26fd8ccc4c5e3aa.tar.gz
rockbox-193c5df75d3b6d9e3442e42fa26fd8ccc4c5e3aa.zip
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 <giac2000@hotmail.com>
-rw-r--r--apps/plugins/xworld/keymaps.h34
-rw-r--r--apps/plugins/xworld/sys.c4
-rw-r--r--apps/plugins/xworld/util.h6
-rw-r--r--apps/plugins/xworld/xworld.c2
-rw-r--r--manual/plugins/xworld.tex14
5 files changed, 38 insertions, 22 deletions
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 @@
21 21
22#ifndef _XWORLD_KEYMAPS_H 22#ifndef _XWORLD_KEYMAPS_H
23#define _XWORLD_KEYMAPS_H 23#define _XWORLD_KEYMAPS_H
24#endif
25 24
25/* Handle the "nice" targets that have directional buttons with normal names */
26#if (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) || \ 26#if (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) || \
27 (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) || \ 27 (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) || \
28 (CONFIG_KEYPAD == PHILIPS_SA9200_PAD) || \ 28 (CONFIG_KEYPAD == PHILIPS_SA9200_PAD) || \
@@ -63,15 +63,15 @@
63#define BTN_PAUSE BUTTON_SELECT 63#define BTN_PAUSE BUTTON_SELECT
64#endif 64#endif
65 65
66#if (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) || \ 66#if (CONFIG_KEYPAD == PHILIPS_HDD1630_PAD) || \
67 (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) || \ 67 (CONFIG_KEYPAD == PHILIPS_HDD6330_PAD) || \
68 (CONFIG_KEYPAD == PHILIPS_SA9200_PAD) || \ 68 (CONFIG_KEYPAD == PHILIPS_SA9200_PAD) || \
69 (CONFIG_KEYPAD == CREATIVE_ZENXFI2_PAD) || \ 69 (CONFIG_KEYPAD == CREATIVE_ZENXFI2_PAD) || \
70 (CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD) || \ 70 (CONFIG_KEYPAD == CREATIVE_ZENXFI3_PAD) || \
71 (CONFIG_KEYPAD == SANSA_CONNECT_PAD) || \ 71 (CONFIG_KEYPAD == SANSA_CONNECT_PAD) || \
72 (CONFIG_KEYPAD == SANSA_C200_PAD) || \ 72 (CONFIG_KEYPAD == SANSA_C200_PAD) || \
73 (CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD) || \ 73 (CONFIG_KEYPAD == SANSA_FUZEPLUS_PAD) || \
74 (CONFIG_KEYPAD == ONDAVX747_PAD) 74 (CONFIG_KEYPAD == ONDAVX747_PAD)
75#define BTN_FIRE BUTTON_VOL_UP 75#define BTN_FIRE BUTTON_VOL_UP
76#define BTN_PAUSE BUTTON_VOL_DOWN 76#define BTN_PAUSE BUTTON_VOL_DOWN
77 77
@@ -124,8 +124,11 @@
124 (CONFIG_KEYPAD == GIGABEAT_S_PAD) 124 (CONFIG_KEYPAD == GIGABEAT_S_PAD)
125#define BTN_FIRE BUTTON_VOL_UP 125#define BTN_FIRE BUTTON_VOL_UP
126#define BTN_PAUSE BUTTON_MENU 126#define BTN_PAUSE BUTTON_MENU
127/* #if CONFIG_KEYPAD == PHILIPS_HDD1630_PAD */
127#endif 128#endif
128 129
130/* ... and now for the bad ones that don't have
131 * standard names for the directional buttons */
129#elif (CONFIG_KEYPAD == PBELL_VIBE500_PAD) 132#elif (CONFIG_KEYPAD == PBELL_VIBE500_PAD)
130#define BTN_UP BUTTON_OK 133#define BTN_UP BUTTON_OK
131#define BTN_DOWN BUTTON_CANCEL 134#define BTN_DOWN BUTTON_CANCEL
@@ -185,12 +188,19 @@
185#define BTN_LEFT BUTTON_LEFT 188#define BTN_LEFT BUTTON_LEFT
186#define BTN_RIGHT BUTTON_RIGHT 189#define BTN_RIGHT BUTTON_RIGHT
187 190
188#if (CONFIG_KEYPAD == MROBE500_PAD) || (CONFIG_KEYPAD == ONDAVX777_PAD) 191#if (CONFIG_KEYPAD == MROBE500_PAD) || \
192 (CONFIG_KEYPAD == ONDAVX777_PAD)
189#define BTN_PAUSE BUTTON_BOTTOMLEFT 193#define BTN_PAUSE BUTTON_BOTTOMLEFT
190 194
191#elif CONFIG_KEYPAD == !COWON_D2_PAD || !DX50_PAD || !ONDAVX777_PAD 195#elif (CONFIG_KEYPAD == !COWON_D2_PAD) || \
196 (CONFIG_KEYPAD != !DX50_PAD) || \
197 (CONFIG_KEYMAP != ONDAVX777_PAD)
192#define BTN_FIRE BUTTON_BOTTOMLEFT 198#define BTN_FIRE BUTTON_BOTTOMLEFT
193#define BTN_PAUSE BUTTON_TOPLEFT 199#define BTN_PAUSE BUTTON_TOPLEFT
200#endif
194 201
202/* HAVE_TOUCHSCREEN */
195#endif 203#endif
204
205/* _XWORLD_KEYMAPS_H */
196#endif 206#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)
787{ 787{
788 (void) sys; 788 (void) sys;
789 /* duration is in ms */ 789 /* duration is in ms */
790 rb->sleep(duration / 10); 790 rb->sleep(duration / (1000/HZ));
791} 791}
792 792
793uint32_t sys_getTimeStamp(struct System* sys) 793uint32_t sys_getTimeStamp(struct System* sys)
794{ 794{
795 (void) sys; 795 (void) sys;
796 return (uint32_t) (*rb->current_tick) * 10; 796 return (uint32_t) (*rb->current_tick * (1000/HZ));
797} 797}
798 798
799static int16_t rb_soundbuf [MAX_SOUNDBUF_SIZE] IBSS_ATTR; 799static 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 @@
25 25
26#include "intern.h" 26#include "intern.h"
27 27
28/* #define XWORLD_DEBUG */ 28#ifdef ROCKBOX_HAS_LOGF
29#define XWORLD_DEBUG
30#endif
29 31
30#ifdef XWORLD_DEBUG 32#ifdef XWORLD_DEBUG
31#define debug(m,f,...) debug_real(m, f, ##__VA_ARGS__) 33#define debug(m,f,...) debug_real(m, f, ##__VA_ARGS__)
34#define XWORLD_DEBUGMASK ~0
32#else 35#else
33#define debug(m,f,...) 36#define debug(m,f,...)
37#define XWORLD_DEBUGMASK 0
34#endif 38#endif
35 39
36enum { 40enum {
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)
36 /* no trailing slashes */ 36 /* no trailing slashes */
37 const char *dataPath = "/.rockbox/xworld"; 37 const char *dataPath = "/.rockbox/xworld";
38 const char *savePath = "/.rockbox/xworld"; 38 const char *savePath = "/.rockbox/xworld";
39 g_debugMask = 0; 39 g_debugMask = XWORLD_DEBUGMASK;
40 40
41 engine_create(&e, &sys, dataPath, savePath); 41 engine_create(&e, &sys, dataPath, savePath);
42 engine_init(&e); 42 engine_init(&e);
diff --git a/manual/plugins/xworld.tex b/manual/plugins/xworld.tex
index 32e3ecbf78..4ea7559b6b 100644
--- a/manual/plugins/xworld.tex
+++ b/manual/plugins/xworld.tex
@@ -3,8 +3,10 @@
3In this cinematic, award winning platform game by Éric Chahi, you must evade capture 3In this cinematic, award winning platform game by Éric Chahi, you must evade capture
4and do your best to escape an alien planet. After an experiment goes awry the hero 4and do your best to escape an alien planet. After an experiment goes awry the hero
5must team up with an unlikely ally, when they both become fugitives on another world. 5must team up with an unlikely ally, when they both become fugitives on another world.
6XWorld requires the data files, bank* and memlist.bin, from the original "Another World" 6XWorld requires the data files, \fname{BANK*} and \fname{MEMLIST.BIN}, from the original ``Another World''
7PC game to be copied into the .rockbox/xworld/ directory before the game can be played. 7PC game to be copied into the \fname{.rockbox/xworld/} directory before the game can be played.
8
9Additionally, ``extra'' data files that modify the in-game strings and font can be placed in the \fname{.rockbox/xworld/} directory with the names \fname{xworld.strings} and \fname{xworld.font}, respectively.
8 10
9\begin{btnmap} 11\begin{btnmap}
10 % 12 %
@@ -37,9 +39,9 @@ PC game to be copied into the .rockbox/xworld/ directory before the game can be
37 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD% 39 ,GIGABEAT_S_PAD,MROBE100_PAD,PBELL_VIBE500_PAD,SANSA_FUZEPLUS_PAD%
38 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD% 40 ,SAMSUNG_YH92X_PAD,SAMSUNG_YH820_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD%
39 ,IRIVER_H10_PAD} 41 ,IRIVER_H10_PAD}
40 {\ButtonLeft / \ButtonRight} 42 {\ButtonLeft{} / \ButtonRight}
41 \opt{HAVE_TOUCHSCREEN}{\TouchMidLeft / \TouchMidRight} 43 \opt{HAVE_TOUCHSCREEN}{\TouchMidLeft{} / \TouchMidRight}
42 \opt{PBELL_VIBE500_PAD}{\ButtonMenu / \ButtonPlay} 44 \opt{PBELL_VIBE500_PAD}{\ButtonMenu{} / \ButtonPlay}
43 \opt{HAVEREMOTEKEYMAP}{& } 45 \opt{HAVEREMOTEKEYMAP}{& }
44 & Move Left and Right\\ 46 & Move Left and Right\\
45 % 47 %
@@ -75,7 +77,7 @@ PC game to be copied into the .rockbox/xworld/ directory before the game can be
75 \opt{HM801_PAD}{\ButtonNext} 77 \opt{HM801_PAD}{\ButtonNext}
76 \opt{PBELL_VIBE500_PAD}{\ButtonRec} 78 \opt{PBELL_VIBE500_PAD}{\ButtonRec}
77 \opt{IRIVER_H10_PAD}{\ButtonPlay} 79 \opt{IRIVER_H10_PAD}{\ButtonPlay}
78 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD}{\ButtonMenu / \ButtonSelect} 80 \opt{IPOD_4G_PAD,IPOD_3G_PAD,IPOD_1G2G_PAD}{\ButtonMenu{} / \ButtonSelect}
79 \opt{HAVEREMOTEKEYMAP}{& } 81 \opt{HAVEREMOTEKEYMAP}{& }
80 & Menu\\ 82 & Menu\\
81\end{btnmap} 83\end{btnmap}