summaryrefslogtreecommitdiff
path: root/apps/plugins/jewels.c
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2005-12-14 01:31:37 +0000
committerDave Chapman <dave@dchapman.com>2005-12-14 01:31:37 +0000
commit54d44c893f0d0ed4403ae7af220224e6646f6dda (patch)
treeb5665adfe8b496dfbce73ce65d4f8151495b0c9b /apps/plugins/jewels.c
parentc75425511ea8d0bfdb77d4336117ec7114ef87c8 (diff)
iPod: Initial attempt at button mappings for plugins. All plugins now compile, but more work is needed with the more complex ones to make them iPod friendly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8233 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/jewels.c')
-rw-r--r--apps/plugins/jewels.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/apps/plugins/jewels.c b/apps/plugins/jewels.c
index 39d77324de..84bb306ed1 100644
--- a/apps/plugins/jewels.c
+++ b/apps/plugins/jewels.c
@@ -50,12 +50,16 @@ static unsigned jewel_color[8]={COLOR_BLACK, COLOR_RED, COLOR_ORANGE,
/* button definitions */
#if CONFIG_KEYPAD == RECORDER_PAD
+#define BEJEWELED_UP BUTTON_UP
+#define BEJEWELED_DOWN BUTTON_DOWN
#define BEJEWELED_QUIT BUTTON_OFF
#define BEJEWELED_START BUTTON_ON
#define BEJEWELED_SELECT BUTTON_PLAY
#define BEJEWELED_RESUME BUTTON_F1
#elif CONFIG_KEYPAD == ONDIO_PAD
+#define BEJEWELED_UP BUTTON_UP
+#define BEJEWELED_DOWN BUTTON_DOWN
#define BEJEWELED_QUIT BUTTON_OFF
#define BEJEWELED_START BUTTON_RIGHT
#define BEJEWELED_SELECT (BUTTON_MENU|BUTTON_REL)
@@ -63,11 +67,21 @@ static unsigned jewel_color[8]={COLOR_BLACK, COLOR_RED, COLOR_ORANGE,
#define BEJEWELED_RESUME (BUTTON_MENU|BUTTON_OFF)
#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
+#define BEJEWELED_UP BUTTON_UP
+#define BEJEWELED_DOWN BUTTON_DOWN
#define BEJEWELED_QUIT BUTTON_OFF
#define BEJEWELED_START BUTTON_ON
#define BEJEWELED_SELECT BUTTON_SELECT
#define BEJEWELED_RESUME BUTTON_MODE
+#elif (CONFIG_KEYPAD == IPOD_4G_PAD) || (CONFIG_KEYPAD == IPOD_NANO_PAD)
+#define BEJEWELED_UP BUTTON_SCROLL_BACK
+#define BEJEWELED_DOWN BUTTON_SCROLL_FWD
+#define BEJEWELED_QUIT BUTTON_MENU
+#define BEJEWELED_START BUTTON_PLAY
+#define BEJEWELED_SELECT BUTTON_SELECT
+#define BEJEWELED_RESUME (BUTTON_SELECT | BUTTON_PLAY)
+
#else
#error BEJEWELED: Unsupported keypad
#endif
@@ -1081,8 +1095,8 @@ static int bejeweled(struct game_context* bj) {
}
break;
- case BUTTON_DOWN: /* move cursor down */
- case (BUTTON_DOWN|BUTTON_REPEAT):
+ case BEJEWELED_DOWN: /* move cursor down */
+ case (BEJEWELED_DOWN|BUTTON_REPEAT):
if(selected) {
bj->score += bejeweled_swapjewels(bj, x, y, SWAP_DOWN);
selected = false;
@@ -1092,8 +1106,8 @@ static int bejeweled(struct game_context* bj) {
}
break;
- case BUTTON_UP: /* move cursor up */
- case (BUTTON_UP|BUTTON_REPEAT):
+ case BEJEWELED_UP: /* move cursor up */
+ case (BEJEWELED_UP|BUTTON_REPEAT):
if(selected) {
bj->score += bejeweled_swapjewels(bj, x, y, SWAP_UP);
selected = false;