summaryrefslogtreecommitdiffstats
path: root/apps/plugins/invadrox.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/invadrox.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/invadrox.c')
-rw-r--r--apps/plugins/invadrox.c63
1 files changed, 28 insertions, 35 deletions
diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c
index 5e3cb12163..57d6fabe8d 100644
--- a/apps/plugins/invadrox.c
+++ b/apps/plugins/invadrox.c
@@ -268,14 +268,7 @@ CONFIG_KEYPAD == MROBE500_PAD
#define QUIT BUTTON_POWER
#define FIRE BUTTON_MENU
-#elif CONFIG_KEYPAD == XDUOO_X3II_PAD
-
-#define QUIT BUTTON_POWER
-#define LEFT BUTTON_HOME
-#define RIGHT BUTTON_VOL_DOWN
-#define FIRE BUTTON_VOL_UP
-
-#elif CONFIG_KEYPAD == XDUOO_X20_PAD
+#elif CONFIG_KEYPAD == XDUOO_X3II_PAD || CONFIG_KEYPAD == XDUOO_X20_PAD
#define QUIT BUTTON_POWER
#define LEFT BUTTON_HOME
@@ -289,19 +282,19 @@ CONFIG_KEYPAD == MROBE500_PAD
#define RIGHT BUTTON_VOL_DOWN
#define FIRE BUTTON_VOL_UP
-#elif CONFIG_KEYPAD == IHIFI_770_PAD
+#elif CONFIG_KEYPAD == IHIFI_770_PAD || CONFIG_KEYPAD == IHIFI_800_PAD
#define QUIT BUTTON_POWER
#define LEFT BUTTON_HOME
#define RIGHT BUTTON_VOL_DOWN
#define FIRE BUTTON_VOL_UP
-#elif CONFIG_KEYPAD == IHIFI_800_PAD
+#elif CONFIG_KEYPAD == EROSQ_PAD
#define QUIT BUTTON_POWER
-#define LEFT BUTTON_HOME
-#define RIGHT BUTTON_VOL_DOWN
-#define FIRE BUTTON_VOL_UP
+#define LEFT BUTTON_SCROLL_BACK
+#define RIGHT BUTTON_SCROLL_FWD
+#define FIRE BUTTON_PLAY
#else
#error INVADROX: Unsupported keypad
@@ -829,8 +822,8 @@ static void draw_number(int x, int y, int num, int digits)
d = num % 10;
num = num / 10;
rb->lcd_bitmap_part(invadrox_numbers, d * NUMBERS_WIDTH, 0,
- STRIDE( SCREEN_MAIN,
- BMPWIDTH_invadrox_numbers,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_invadrox_numbers,
BMPHEIGHT_invadrox_numbers),
x + i * (NUMBERS_WIDTH + NUM_SPACING), y,
NUMBERS_WIDTH, FONT_HEIGHT);
@@ -861,17 +854,17 @@ static void draw_lives(void)
int i;
/* Lives num */
rb->lcd_bitmap_part(invadrox_numbers, lives * NUMBERS_WIDTH, 0,
- STRIDE( SCREEN_MAIN,
- BMPWIDTH_invadrox_numbers,
- BMPHEIGHT_invadrox_numbers),
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_invadrox_numbers,
+ BMPHEIGHT_invadrox_numbers),
PLAYFIELD_X + LIVES_X, PLAYFIELD_Y + 2,
NUMBERS_WIDTH, FONT_HEIGHT);
/* Ships */
for (i = 0; i < (lives - 1); i++) {
- rb->lcd_bitmap_part(invadrox_ships, 0, 0,
- STRIDE( SCREEN_MAIN,
- BMPWIDTH_invadrox_ships,
+ rb->lcd_bitmap_part(invadrox_ships, 0, 0,
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_invadrox_ships,
BMPHEIGHT_invadrox_ships),
PLAYFIELD_X + LIVES_X + SHIP_WIDTH + i * (SHIP_WIDTH + NUM_SPACING),
PLAYFIELD_Y + 1, SHIP_WIDTH, SHIP_HEIGHT);
@@ -893,11 +886,11 @@ static inline void draw_aliens(void)
int i;
for (i = 0; i < 5 * ALIENS; i++) {
- rb->lcd_bitmap_part(invadrox_aliens, aliens[i].x & 1 ? ALIEN_WIDTH : 0,
+ rb->lcd_bitmap_part(invadrox_aliens, aliens[i].x & 1 ? ALIEN_WIDTH : 0,
aliens[i].type * ALIEN_HEIGHT,
- STRIDE( SCREEN_MAIN,
- BMPWIDTH_invadrox_aliens,
- BMPHEIGHT_invadrox_aliens),
+ STRIDE( SCREEN_MAIN,
+ BMPWIDTH_invadrox_aliens,
+ BMPHEIGHT_invadrox_aliens),
PLAYFIELD_X + LIVES_X + aliens[i].x * ALIEN_SPEED,
ALIEN_START_Y + aliens[i].y * ALIEN_HEIGHT,
ALIEN_WIDTH, ALIEN_HEIGHT);
@@ -1035,11 +1028,11 @@ static bool move_aliens(void)
x = PLAYFIELD_X + LIVES_X + aliens[curr_alien].x * ALIEN_SPEED;
y = ALIEN_START_Y + aliens[curr_alien].y * ALIEN_HEIGHT;
rb->lcd_bitmap_part(invadrox_aliens,
- aliens[curr_alien].x & 1 ? ALIEN_WIDTH : 0,
+ aliens[curr_alien].x & 1 ? ALIEN_WIDTH : 0,
aliens[curr_alien].type * ALIEN_HEIGHT,
- STRIDE( SCREEN_MAIN,
+ STRIDE( SCREEN_MAIN,
BMPWIDTH_invadrox_aliens,
- BMPHEIGHT_invadrox_aliens),
+ BMPHEIGHT_invadrox_aliens),
x, y, ALIEN_WIDTH, ALIEN_HEIGHT);
if (!next_alien()) {
@@ -1068,9 +1061,9 @@ static inline void draw_ship(void)
/* Draw ship */
rb->lcd_bitmap_part(invadrox_ships, 0, ship_frame * SHIP_HEIGHT,
- STRIDE( SCREEN_MAIN,
+ STRIDE( SCREEN_MAIN,
BMPWIDTH_invadrox_ships,
- BMPHEIGHT_invadrox_ships),
+ BMPHEIGHT_invadrox_ships),
ship_x, SHIP_Y, SHIP_WIDTH, SHIP_HEIGHT);
if (ship_hit) {
/* Alternate between frame 1 and 2 during hit */
@@ -1095,7 +1088,7 @@ static inline void fire_alpha(int xc, int yc, unsigned color)
rb->lcd_set_foreground(color);
rb->lcd_set_drawmode(DRMODE_FG);
-
+
rb->lcd_mono_bitmap(invadrox_fire, xc - (FIRE_WIDTH/2), yc, FIRE_WIDTH, FIRE_HEIGHT);
rb->lcd_set_foreground(LCD_BLACK);
@@ -1311,9 +1304,9 @@ static inline void draw_bomb(int i)
{
rb->lcd_bitmap_part(invadrox_bombs, bombs[i].type * BOMB_WIDTH,
bombs[i].frame * BOMB_HEIGHT,
- STRIDE( SCREEN_MAIN,
+ STRIDE( SCREEN_MAIN,
BMPWIDTH_invadrox_bombs,
- BMPHEIGHT_invadrox_bombs),
+ BMPHEIGHT_invadrox_bombs),
bombs[i].x, bombs[i].y,
BOMB_WIDTH, BOMB_HEIGHT);
/* Advance frame */
@@ -1415,9 +1408,9 @@ static void move_bombs(void)
bombs[i].state = S_EXPLODE * 4;
bombs[i].target = TARGET_SHIP;
rb->lcd_bitmap_part(invadrox_ships, 0, 1 * SHIP_HEIGHT,
- STRIDE( SCREEN_MAIN,
+ STRIDE( SCREEN_MAIN,
BMPWIDTH_invadrox_ships,
- BMPHEIGHT_invadrox_ships),
+ BMPHEIGHT_invadrox_ships),
ship_x, SHIP_Y,
SHIP_WIDTH, SHIP_HEIGHT);
break;