summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-08-04 05:22:10 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-08-04 05:22:10 +0000
commitc2480c33f7a11ad0f6188afdda7e29e433e91844 (patch)
treef70c254570d62c69a2ce09ad89d3859647c8fe13 /apps
parentdb9fe1ba23b5e5f3a9f6c946f159316f2b85941e (diff)
downloadrockbox-c2480c33f7a11ad0f6188afdda7e29e433e91844.tar.gz
rockbox-c2480c33f7a11ad0f6188afdda7e29e433e91844.tar.bz2
rockbox-c2480c33f7a11ad0f6188afdda7e29e433e91844.zip
Invadrox: Add support for 640x480 screens.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22151 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugin.c5
-rw-r--r--apps/plugins/bitmaps/native/SOURCES18
-rw-r--r--apps/plugins/bitmaps/native/invadrox_alien_explode.37x20x16.bmpbin0 -> 2294 bytes
-rw-r--r--apps/plugins/bitmaps/native/invadrox_aliens.68x68x16.bmpbin0 -> 13926 bytes
-rw-r--r--apps/plugins/bitmaps/native/invadrox_background.480x640x16.bmpbin0 -> 921654 bytes
-rw-r--r--apps/plugins/bitmaps/native/invadrox_background.640x480x16.bmpbin0 -> 921654 bytes
-rw-r--r--apps/plugins/bitmaps/native/invadrox_bombs.27x126x16.bmpbin0 -> 10638 bytes
-rw-r--r--apps/plugins/bitmaps/native/invadrox_numbers.140x19x16.bmpbin0 -> 8034 bytes
-rw-r--r--apps/plugins/bitmaps/native/invadrox_shield.64x47x16.bmpbin0 -> 9078 bytes
-rw-r--r--apps/plugins/bitmaps/native/invadrox_ships.46x69x16.bmpbin0 -> 9714 bytes
-rw-r--r--apps/plugins/bitmaps/native/invadrox_ufo.46x20x16.bmpbin0 -> 2854 bytes
-rw-r--r--apps/plugins/bitmaps/native/invadrox_ufo_explode.61x23x16.bmpbin0 -> 4286 bytes
-rw-r--r--apps/plugins/invadrox.c99
13 files changed, 69 insertions, 53 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index d66cccbc85..92df51dbac 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -783,15 +783,14 @@ int plugin_load(const char* plugin, const void* parameter)
oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL);
#ifdef HAVE_TOUCHSCREEN
- enum touchscreen_mode old_mode = touchscreen_get_mode();
-
touchscreen_set_mode(TOUCHSCREEN_BUTTON);
#endif
rc = hdr->entry_point(parameter);
+ /* Go back to the global setting in case the plugin changed it */
#ifdef HAVE_TOUCHSCREEN
- touchscreen_set_mode(old_mode);
+ touchscreen_set_mode(global_settings.touch_mode);
#endif
viewportmanager_set_statusbar(oldbars);
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index 4d98b7e4e6..4d4cee074a 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -291,15 +291,15 @@ flipit_tokens.16x26x1.bmp
/* Invadrox */
#if defined HAVE_LCD_COLOR
-#if LCD_WIDTH >= 480
-invadrox_aliens.24x24x16.bmp
-invadrox_alien_explode.13x7x16.bmp
-invadrox_ships.16x24x16.bmp
-invadrox_bombs.9x42x16.bmp
-invadrox_shield.22x16x16.bmp
-invadrox_ufo.16x7x16.bmp
-invadrox_ufo_explode.21x8x16.bmp
-invadrox_numbers.50x7x16.bmp
+#if LCD_WIDTH >= 640
+invadrox_alien_explode.37x20x16.bmp
+invadrox_aliens.68x68x16.bmp
+invadrox_ships.46x69x16.bmp
+invadrox_bombs.27x126x16.bmp
+invadrox_shield.64x47x16.bmp
+invadrox_ufo.46x20x16.bmp
+invadrox_ufo_explode.61x23x16.bmp
+invadrox_numbers.140x19x16.bmp
#if LCD_WIDTH == 480
invadrox_background.480x640x16.bmp
#elif LCD_WIDTH == 640
diff --git a/apps/plugins/bitmaps/native/invadrox_alien_explode.37x20x16.bmp b/apps/plugins/bitmaps/native/invadrox_alien_explode.37x20x16.bmp
new file mode 100644
index 0000000000..9e7108a377
--- /dev/null
+++ b/apps/plugins/bitmaps/native/invadrox_alien_explode.37x20x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/invadrox_aliens.68x68x16.bmp b/apps/plugins/bitmaps/native/invadrox_aliens.68x68x16.bmp
new file mode 100644
index 0000000000..ec87dd5169
--- /dev/null
+++ b/apps/plugins/bitmaps/native/invadrox_aliens.68x68x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/invadrox_background.480x640x16.bmp b/apps/plugins/bitmaps/native/invadrox_background.480x640x16.bmp
new file mode 100644
index 0000000000..39032da4e8
--- /dev/null
+++ b/apps/plugins/bitmaps/native/invadrox_background.480x640x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/invadrox_background.640x480x16.bmp b/apps/plugins/bitmaps/native/invadrox_background.640x480x16.bmp
new file mode 100644
index 0000000000..2175a40a00
--- /dev/null
+++ b/apps/plugins/bitmaps/native/invadrox_background.640x480x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/invadrox_bombs.27x126x16.bmp b/apps/plugins/bitmaps/native/invadrox_bombs.27x126x16.bmp
new file mode 100644
index 0000000000..f88b967820
--- /dev/null
+++ b/apps/plugins/bitmaps/native/invadrox_bombs.27x126x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/invadrox_numbers.140x19x16.bmp b/apps/plugins/bitmaps/native/invadrox_numbers.140x19x16.bmp
new file mode 100644
index 0000000000..daccbb815f
--- /dev/null
+++ b/apps/plugins/bitmaps/native/invadrox_numbers.140x19x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/invadrox_shield.64x47x16.bmp b/apps/plugins/bitmaps/native/invadrox_shield.64x47x16.bmp
new file mode 100644
index 0000000000..de2cbf1749
--- /dev/null
+++ b/apps/plugins/bitmaps/native/invadrox_shield.64x47x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/invadrox_ships.46x69x16.bmp b/apps/plugins/bitmaps/native/invadrox_ships.46x69x16.bmp
new file mode 100644
index 0000000000..e21c2b5a2d
--- /dev/null
+++ b/apps/plugins/bitmaps/native/invadrox_ships.46x69x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/invadrox_ufo.46x20x16.bmp b/apps/plugins/bitmaps/native/invadrox_ufo.46x20x16.bmp
new file mode 100644
index 0000000000..eae1ccf7a3
--- /dev/null
+++ b/apps/plugins/bitmaps/native/invadrox_ufo.46x20x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/invadrox_ufo_explode.61x23x16.bmp b/apps/plugins/bitmaps/native/invadrox_ufo_explode.61x23x16.bmp
new file mode 100644
index 0000000000..91505999c8
--- /dev/null
+++ b/apps/plugins/bitmaps/native/invadrox_ufo_explode.61x23x16.bmp
Binary files differ
diff --git a/apps/plugins/invadrox.c b/apps/plugins/invadrox.c
index 3fa983b12e..19b2b670a4 100644
--- a/apps/plugins/invadrox.c
+++ b/apps/plugins/invadrox.c
@@ -29,6 +29,38 @@
#include "lib/highscore.h"
#include "lib/helper.h"
+/* bitmaps */
+#include "pluginbitmaps/invadrox_background.h"
+
+/* get dimensions for later use from the bitmaps */
+#include "pluginbitmaps/invadrox_aliens.h"
+#include "pluginbitmaps/invadrox_ships.h"
+#include "pluginbitmaps/invadrox_bombs.h"
+#include "pluginbitmaps/invadrox_alien_explode.h"
+#include "pluginbitmaps/invadrox_shield.h"
+#include "pluginbitmaps/invadrox_ufo.h"
+#include "pluginbitmaps/invadrox_ufo_explode.h"
+#include "pluginbitmaps/invadrox_numbers.h"
+#include "pluginbitmaps/invadrox_fire.h"
+#define ALIEN_WIDTH (BMPWIDTH_invadrox_aliens/2)
+#define ALIEN_HEIGHT (BMPHEIGHT_invadrox_aliens/3)
+#define SHIP_WIDTH BMPWIDTH_invadrox_ships
+#define SHIP_HEIGHT (BMPHEIGHT_invadrox_ships/3)
+#define BOMB_WIDTH (BMPWIDTH_invadrox_bombs/3)
+#define BOMB_HEIGHT (BMPHEIGHT_invadrox_bombs/6)
+#define ALIEN_EXPLODE_WIDTH BMPWIDTH_invadrox_alien_explode
+#define ALIEN_EXPLODE_HEIGHT BMPHEIGHT_invadrox_alien_explode
+#define SHIELD_WIDTH BMPWIDTH_invadrox_shield
+#define SHIELD_HEIGHT BMPHEIGHT_invadrox_shield
+#define UFO_WIDTH BMPWIDTH_invadrox_ufo
+#define UFO_HEIGHT BMPHEIGHT_invadrox_ufo
+#define UFO_EXPLODE_WIDTH BMPWIDTH_invadrox_ufo_explode
+#define UFO_EXPLODE_HEIGHT BMPHEIGHT_invadrox_ufo_explode
+#define NUMBERS_WIDTH (BMPWIDTH_invadrox_numbers/10)
+#define FONT_HEIGHT BMPHEIGHT_invadrox_numbers
+#define FIRE_WIDTH BMPWIDTH_invadrox_fire
+#define FIRE_HEIGHT BMPHEIGHT_invadrox_fire
+
PLUGIN_HEADER
/* Original graphics is only 1bpp so it should be portable
@@ -186,8 +218,30 @@ PLUGIN_HEADER
#define MAX_LIVES 8
+/* m:robe 500 defines */
+#if ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \
+ ((LCD_WIDTH == 480) && (LCD_HEIGHT == 640))
+
+/* Original arcade game size 224x240, 1bpp with
+ * red overlay at top and green overlay at bottom.
+ *
+ * M:Robe 500: 640x480x16
+ * ======================
+ */
+
+#define ARCADISH_GRAPHICS
+#define PLAYFIELD_X 48
+#define SHIP_Y (PLAYFIELD_Y - 2 * SHIP_HEIGHT)
+#define ALIEN_START_Y (UFO_Y + ALIEN_HEIGHT)
+#define SCORENUM_X (PLAYFIELD_X + NUMBERS_WIDTH)
+#define SCORENUM_Y (SCORE_Y + FONT_HEIGHT + 2)
+#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING)
+#define SHIELD_Y (PLAYFIELD_Y - 5 * SHIP_HEIGHT)
+#define LIVES_X 10
+#define MAX_Y 18
+
/* iPod Video defines */
-#if (LCD_WIDTH == 320) && (LCD_HEIGHT == 240)
+#elif (LCD_WIDTH == 320) && (LCD_HEIGHT == 240)
/* Original arcade game size 224x240, 1bpp with
* red overlay at top and green overlay at bottom.
@@ -226,10 +280,8 @@ PLUGIN_HEADER
#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING)
#define SHIELD_Y (PLAYFIELD_Y - 6 * SHIP_HEIGHT)
#define LIVES_X 10
-#define MAX_X 95
#define MAX_Y 18
-
#elif (LCD_WIDTH == 176) && (LCD_HEIGHT == 220)
/* Sandisk Sansa e200: 176x220x16
@@ -271,7 +323,6 @@ PLUGIN_HEADER
#define SCORENUM_Y (SCORE_Y + 2 * FONT_HEIGHT)
#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING)
#define LIVES_X 8
-#define MAX_X 75
#define MAX_Y 18
@@ -325,7 +376,6 @@ PLUGIN_HEADER
#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING)
#define SHIELD_Y (SHIP_Y - SHIP_HEIGHT - SHIELD_HEIGHT)
#define LIVES_X 8
-#define MAX_X 75
#define MAX_Y 18
#elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128)
@@ -378,7 +428,6 @@ PLUGIN_HEADER
#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING)
#define SHIELD_Y (SHIP_Y - SHIP_HEIGHT - SHIELD_HEIGHT)
#define LIVES_X 0
-#define MAX_X 75
#define MAX_Y 18
@@ -421,7 +470,6 @@ PLUGIN_HEADER
#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING)
#define SHIELD_Y (PLAYFIELD_Y - 6 * SHIP_HEIGHT)
#define LIVES_X 10
-#define MAX_X 95
#define MAX_Y 18
#elif (LCD_WIDTH == 220) && (LCD_HEIGHT == 176)
@@ -458,7 +506,6 @@ PLUGIN_HEADER
#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING)
#define SHIELD_Y (PLAYFIELD_Y - 5 * SHIP_HEIGHT)
#define LIVES_X 8
-#define MAX_X 95
#define MAX_Y 15
@@ -466,37 +513,7 @@ PLUGIN_HEADER
#error INVADROX: Unsupported LCD type
#endif
-/* bitmaps */
-#include "pluginbitmaps/invadrox_background.h"
-
-/* get dimensions for later use from the bitmaps */
-#include "pluginbitmaps/invadrox_aliens.h"
-#include "pluginbitmaps/invadrox_ships.h"
-#include "pluginbitmaps/invadrox_bombs.h"
-#include "pluginbitmaps/invadrox_alien_explode.h"
-#include "pluginbitmaps/invadrox_shield.h"
-#include "pluginbitmaps/invadrox_ufo.h"
-#include "pluginbitmaps/invadrox_ufo_explode.h"
-#include "pluginbitmaps/invadrox_numbers.h"
-#include "pluginbitmaps/invadrox_fire.h"
-#define ALIEN_WIDTH (BMPWIDTH_invadrox_aliens/2)
-#define ALIEN_HEIGHT (BMPHEIGHT_invadrox_aliens/3)
-#define SHIP_WIDTH BMPWIDTH_invadrox_ships
-#define SHIP_HEIGHT (BMPHEIGHT_invadrox_ships/3)
-#define BOMB_WIDTH (BMPWIDTH_invadrox_bombs/3)
-#define BOMB_HEIGHT (BMPHEIGHT_invadrox_bombs/6)
-#define ALIEN_EXPLODE_WIDTH BMPWIDTH_invadrox_alien_explode
-#define ALIEN_EXPLODE_HEIGHT BMPHEIGHT_invadrox_alien_explode
-#define SHIELD_WIDTH BMPWIDTH_invadrox_shield
-#define SHIELD_HEIGHT BMPHEIGHT_invadrox_shield
-#define UFO_WIDTH BMPWIDTH_invadrox_ufo
-#define UFO_HEIGHT BMPHEIGHT_invadrox_ufo
-#define UFO_EXPLODE_WIDTH BMPWIDTH_invadrox_ufo_explode
-#define UFO_EXPLODE_HEIGHT BMPHEIGHT_invadrox_ufo_explode
-#define NUMBERS_WIDTH (BMPWIDTH_invadrox_numbers/10)
-#define FONT_HEIGHT BMPHEIGHT_invadrox_numbers
-#define FIRE_WIDTH BMPWIDTH_invadrox_fire
-#define FIRE_HEIGHT BMPHEIGHT_invadrox_fire
+#define MAX_X ((LCD_WIDTH-LIVES_X*2-PLAYFIELD_X*2 - ALIEN_WIDTH)/2 - 1)
/* Defines common to each "graphic type" */
#ifdef ARCADISH_GRAPHICS
@@ -569,8 +586,8 @@ PLUGIN_HEADER
* Physical y is at y * ALIEN_HEIGHT
*/
struct alien {
- unsigned char x; /* x-coordinate (0 - 95) */
- unsigned char y; /* y-coordinate (0 - 18) */
+ int x; /* x-coordinate (0 - 95) */
+ int y; /* y-coordinate (0 - 18) */
unsigned char type; /* 0 (Kang), 1 (Kodos), 2 (Serak) */
unsigned char state; /* Dead, alive or bomber */
};