summaryrefslogtreecommitdiffstats
path: root/apps/plugins/flipit.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-08 09:47:40 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-11 16:37:17 -0400
commit2a471e288c16b91a7186a60b3fb84dd55a494c7a (patch)
tree3e746212c5fa69b59f61d19b6e29d11aa8a5e31b /apps/plugins/flipit.c
parent5efaa9ef8073bb216e3dcdbb4476f2fa7c672b76 (diff)
downloadrockbox-2a471e288c.tar.gz
rockbox-2a471e288c.tar.bz2
rockbox-2a471e288c.zip
New port: AIGO EROS Q / EROS K
The Q and K have a slightly different case, but the hardware under the shell is completely identical. These models are rebadged versions: * Hifiwalker H2 (== Q) * AGPTek H3 (== K) * Surfans F20 (== K) Other notes: * Significant improvements in the shared Hiby-platform launcher/loader * SD card can theoretically be hot-swapped now * Support external USB mass storage! * Some consolidation of Hiby-platform targets * Some consolidation of plugin keymaps Todo/known issues: * Keymaps need to be gone over properly * Convert to HAVE_SCROLLWHEEL? Change-Id: I5a8a4f22c38a5b69392ca7c0a8ad8c4e07d9523c
Diffstat (limited to 'apps/plugins/flipit.c')
-rw-r--r--apps/plugins/flipit.c56
1 files changed, 16 insertions, 40 deletions
diff --git a/apps/plugins/flipit.c b/apps/plugins/flipit.c
index 4fe0681417..a4d59fff3d 100644
--- a/apps/plugins/flipit.c
+++ b/apps/plugins/flipit.c
@@ -436,31 +436,7 @@
#define FLIPIT_STEP_BY_STEP (BUTTON_LEFT|BUTTON_VOLUP)
#define FLIPIT_TOGGLE BUTTON_SELECT
-#elif CONFIG_KEYPAD == XDUOO_X3_PAD
-
-#define FLIPIT_LEFT BUTTON_PREV
-#define FLIPIT_RIGHT BUTTON_NEXT
-#define FLIPIT_UP BUTTON_HOME
-#define FLIPIT_DOWN BUTTON_OPTION
-#define FLIPIT_QUIT BUTTON_POWER
-#define FLIPIT_SHUFFLE (BUTTON_HOME | BUTTON_PREV)
-#define FLIPIT_SOLVE (BUTTON_HOME | BUTTON_NEXT)
-#define FLIPIT_STEP_BY_STEP (BUTTON_HOME | BUTTON_PLAY)
-#define FLIPIT_TOGGLE BUTTON_PLAY
-
-#elif CONFIG_KEYPAD == XDUOO_X3II_PAD
-
-#define FLIPIT_LEFT BUTTON_PREV
-#define FLIPIT_RIGHT BUTTON_NEXT
-#define FLIPIT_UP BUTTON_HOME
-#define FLIPIT_DOWN BUTTON_OPTION
-#define FLIPIT_QUIT BUTTON_POWER
-#define FLIPIT_SHUFFLE (BUTTON_HOME | BUTTON_PREV)
-#define FLIPIT_SOLVE (BUTTON_HOME | BUTTON_NEXT)
-#define FLIPIT_STEP_BY_STEP (BUTTON_HOME | BUTTON_PLAY)
-#define FLIPIT_TOGGLE BUTTON_PLAY
-
-#elif CONFIG_KEYPAD == XDUOO_X20_PAD
+#elif CONFIG_KEYPAD == XDUOO_X3_PAD || CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD
#define FLIPIT_LEFT BUTTON_PREV
#define FLIPIT_RIGHT BUTTON_NEXT
@@ -484,7 +460,7 @@
#define FLIPIT_STEP_BY_STEP (BUTTON_HOME | BUTTON_PLAY)
#define FLIPIT_TOGGLE BUTTON_PLAY
-#elif CONFIG_KEYPAD == IHIFI_770_PAD
+#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD
#define FLIPIT_LEFT BUTTON_HOME
#define FLIPIT_RIGHT BUTTON_VOL_DOWN
@@ -496,16 +472,16 @@
#define FLIPIT_STEP_BY_STEP (BUTTON_POWER | BUTTON_PLAY)
#define FLIPIT_TOGGLE BUTTON_PLAY
-#elif CONFIG_KEYPAD == IHIFI_800_PAD
+#elif CONFIG_KEYPAD == EROSQ_PAD
-#define FLIPIT_LEFT BUTTON_HOME
-#define FLIPIT_RIGHT BUTTON_VOL_DOWN
+#define FLIPIT_LEFT BUTTON_SCROLL_BACK
+#define FLIPIT_RIGHT BUTTON_SCROLL_FWD
#define FLIPIT_UP BUTTON_PREV
#define FLIPIT_DOWN BUTTON_NEXT
#define FLIPIT_QUIT BUTTON_POWER
-#define FLIPIT_SHUFFLE (BUTTON_POWER | BUTTON_PREV)
-#define FLIPIT_SOLVE (BUTTON_POWER | BUTTON_NEXT)
-#define FLIPIT_STEP_BY_STEP (BUTTON_POWER | BUTTON_PLAY)
+#define FLIPIT_SHUFFLE BUTTON_MENU
+#define FLIPIT_SOLVE BUTTON_VOL_DOWN
+#define FLIPIT_STEP_BY_STEP BUTTON_VOL_UP
#define FLIPIT_TOGGLE BUTTON_PLAY
#else
@@ -562,8 +538,8 @@ static int cursor_pos, moves;
/* draw a spot at the coordinates (x,y), range of p is 0-19 */
static void draw_spot(int p)
{
- rb->lcd_bitmap_part( flipit_tokens, 0, spots[p] * TK_HEIGHT,
- STRIDE(SCREEN_MAIN, BMPWIDTH_flipit_tokens,
+ rb->lcd_bitmap_part( flipit_tokens, 0, spots[p] * TK_HEIGHT,
+ STRIDE(SCREEN_MAIN, BMPWIDTH_flipit_tokens,
BMPHEIGHT_flipit_tokens),
GRID_LEFT + (p%5) * (TK_WIDTH+TK_SPACE),
GRID_TOP + (p/5) * (TK_HEIGHT+TK_SPACE),
@@ -571,7 +547,7 @@ static void draw_spot(int p)
}
/* draw the cursor at the current cursor position */
-static void draw_cursor(void)
+static void draw_cursor(void)
{
#ifdef HAVE_LCD_COLOR
rb->lcd_bitmap_transparent( flipit_cursor,
@@ -612,7 +588,7 @@ static inline void clear_cursor(void)
}
/* check if the puzzle is finished */
-static bool flipit_finished(void)
+static bool flipit_finished(void)
{
int i;
for (i=0; i<20; i++)
@@ -653,7 +629,7 @@ static void flipit_toggle(void)
}
/* move the cursor in any direction */
-static void move_cursor(int x, int y)
+static void move_cursor(int x, int y)
{
if (!(flipit_finished())) {
clear_cursor();
@@ -665,7 +641,7 @@ static void move_cursor(int x, int y)
}
/* initialize the board */
-static void flipit_init(void)
+static void flipit_init(void)
{
int i;
@@ -690,7 +666,7 @@ static void flipit_init(void)
}
/* the main game loop */
-static bool flipit_loop(void)
+static bool flipit_loop(void)
{
int i;
int button;
@@ -775,7 +751,7 @@ static bool flipit_loop(void)
/*move cursor though the entire field*/
#ifdef FLIPIT_SCROLLWHEEL
case FLIPIT_PREV:
- case FLIPIT_PREV|BUTTON_REPEAT:
+ case FLIPIT_PREV|BUTTON_REPEAT:
if ((cursor_pos)%5 == 0) {
move_cursor(-1, -1);
}