summaryrefslogtreecommitdiff
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
parentdb9fe1ba23b5e5f3a9f6c946f159316f2b85941e (diff)
downloadrockbox-c2480c33f7a11ad0f6188afdda7e29e433e91844.tar.gz
rockbox-c2480c33f7a11ad0f6188afdda7e29e433e91844.zip
Invadrox: Add support for 640x480 screens.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22151 a1c6a512-1295-4272-9138-f99709370657
-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)
783 oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL); 783 oldbars = viewportmanager_set_statusbar(VP_SB_HIDE_ALL);
784 784
785#ifdef HAVE_TOUCHSCREEN 785#ifdef HAVE_TOUCHSCREEN
786 enum touchscreen_mode old_mode = touchscreen_get_mode();
787
788 touchscreen_set_mode(TOUCHSCREEN_BUTTON); 786 touchscreen_set_mode(TOUCHSCREEN_BUTTON);
789#endif 787#endif
790 788
791 rc = hdr->entry_point(parameter); 789 rc = hdr->entry_point(parameter);
792 790
791 /* Go back to the global setting in case the plugin changed it */
793#ifdef HAVE_TOUCHSCREEN 792#ifdef HAVE_TOUCHSCREEN
794 touchscreen_set_mode(old_mode); 793 touchscreen_set_mode(global_settings.touch_mode);
795#endif 794#endif
796 795
797 viewportmanager_set_statusbar(oldbars); 796 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
291 291
292/* Invadrox */ 292/* Invadrox */
293#if defined HAVE_LCD_COLOR 293#if defined HAVE_LCD_COLOR
294#if LCD_WIDTH >= 480 294#if LCD_WIDTH >= 640
295invadrox_aliens.24x24x16.bmp 295invadrox_alien_explode.37x20x16.bmp
296invadrox_alien_explode.13x7x16.bmp 296invadrox_aliens.68x68x16.bmp
297invadrox_ships.16x24x16.bmp 297invadrox_ships.46x69x16.bmp
298invadrox_bombs.9x42x16.bmp 298invadrox_bombs.27x126x16.bmp
299invadrox_shield.22x16x16.bmp 299invadrox_shield.64x47x16.bmp
300invadrox_ufo.16x7x16.bmp 300invadrox_ufo.46x20x16.bmp
301invadrox_ufo_explode.21x8x16.bmp 301invadrox_ufo_explode.61x23x16.bmp
302invadrox_numbers.50x7x16.bmp 302invadrox_numbers.140x19x16.bmp
303#if LCD_WIDTH == 480 303#if LCD_WIDTH == 480
304invadrox_background.480x640x16.bmp 304invadrox_background.480x640x16.bmp
305#elif LCD_WIDTH == 640 305#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 @@
29#include "lib/highscore.h" 29#include "lib/highscore.h"
30#include "lib/helper.h" 30#include "lib/helper.h"
31 31
32/* bitmaps */
33#include "pluginbitmaps/invadrox_background.h"
34
35/* get dimensions for later use from the bitmaps */
36#include "pluginbitmaps/invadrox_aliens.h"
37#include "pluginbitmaps/invadrox_ships.h"
38#include "pluginbitmaps/invadrox_bombs.h"
39#include "pluginbitmaps/invadrox_alien_explode.h"
40#include "pluginbitmaps/invadrox_shield.h"
41#include "pluginbitmaps/invadrox_ufo.h"
42#include "pluginbitmaps/invadrox_ufo_explode.h"
43#include "pluginbitmaps/invadrox_numbers.h"
44#include "pluginbitmaps/invadrox_fire.h"
45#define ALIEN_WIDTH (BMPWIDTH_invadrox_aliens/2)
46#define ALIEN_HEIGHT (BMPHEIGHT_invadrox_aliens/3)
47#define SHIP_WIDTH BMPWIDTH_invadrox_ships
48#define SHIP_HEIGHT (BMPHEIGHT_invadrox_ships/3)
49#define BOMB_WIDTH (BMPWIDTH_invadrox_bombs/3)
50#define BOMB_HEIGHT (BMPHEIGHT_invadrox_bombs/6)
51#define ALIEN_EXPLODE_WIDTH BMPWIDTH_invadrox_alien_explode
52#define ALIEN_EXPLODE_HEIGHT BMPHEIGHT_invadrox_alien_explode
53#define SHIELD_WIDTH BMPWIDTH_invadrox_shield
54#define SHIELD_HEIGHT BMPHEIGHT_invadrox_shield
55#define UFO_WIDTH BMPWIDTH_invadrox_ufo
56#define UFO_HEIGHT BMPHEIGHT_invadrox_ufo
57#define UFO_EXPLODE_WIDTH BMPWIDTH_invadrox_ufo_explode
58#define UFO_EXPLODE_HEIGHT BMPHEIGHT_invadrox_ufo_explode
59#define NUMBERS_WIDTH (BMPWIDTH_invadrox_numbers/10)
60#define FONT_HEIGHT BMPHEIGHT_invadrox_numbers
61#define FIRE_WIDTH BMPWIDTH_invadrox_fire
62#define FIRE_HEIGHT BMPHEIGHT_invadrox_fire
63
32PLUGIN_HEADER 64PLUGIN_HEADER
33 65
34/* Original graphics is only 1bpp so it should be portable 66/* Original graphics is only 1bpp so it should be portable
@@ -186,8 +218,30 @@ PLUGIN_HEADER
186#define MAX_LIVES 8 218#define MAX_LIVES 8
187 219
188 220
221/* m:robe 500 defines */
222#if ((LCD_WIDTH == 640) && (LCD_HEIGHT == 480)) || \
223 ((LCD_WIDTH == 480) && (LCD_HEIGHT == 640))
224
225/* Original arcade game size 224x240, 1bpp with
226 * red overlay at top and green overlay at bottom.
227 *
228 * M:Robe 500: 640x480x16
229 * ======================
230 */
231
232#define ARCADISH_GRAPHICS
233#define PLAYFIELD_X 48
234#define SHIP_Y (PLAYFIELD_Y - 2 * SHIP_HEIGHT)
235#define ALIEN_START_Y (UFO_Y + ALIEN_HEIGHT)
236#define SCORENUM_X (PLAYFIELD_X + NUMBERS_WIDTH)
237#define SCORENUM_Y (SCORE_Y + FONT_HEIGHT + 2)
238#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING)
239#define SHIELD_Y (PLAYFIELD_Y - 5 * SHIP_HEIGHT)
240#define LIVES_X 10
241#define MAX_Y 18
242
189/* iPod Video defines */ 243/* iPod Video defines */
190#if (LCD_WIDTH == 320) && (LCD_HEIGHT == 240) 244#elif (LCD_WIDTH == 320) && (LCD_HEIGHT == 240)
191 245
192/* Original arcade game size 224x240, 1bpp with 246/* Original arcade game size 224x240, 1bpp with
193 * red overlay at top and green overlay at bottom. 247 * red overlay at top and green overlay at bottom.
@@ -226,10 +280,8 @@ PLUGIN_HEADER
226#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING) 280#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING)
227#define SHIELD_Y (PLAYFIELD_Y - 6 * SHIP_HEIGHT) 281#define SHIELD_Y (PLAYFIELD_Y - 6 * SHIP_HEIGHT)
228#define LIVES_X 10 282#define LIVES_X 10
229#define MAX_X 95
230#define MAX_Y 18 283#define MAX_Y 18
231 284
232
233#elif (LCD_WIDTH == 176) && (LCD_HEIGHT == 220) 285#elif (LCD_WIDTH == 176) && (LCD_HEIGHT == 220)
234 286
235/* Sandisk Sansa e200: 176x220x16 287/* Sandisk Sansa e200: 176x220x16
@@ -271,7 +323,6 @@ PLUGIN_HEADER
271#define SCORENUM_Y (SCORE_Y + 2 * FONT_HEIGHT) 323#define SCORENUM_Y (SCORE_Y + 2 * FONT_HEIGHT)
272#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING) 324#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING)
273#define LIVES_X 8 325#define LIVES_X 8
274#define MAX_X 75
275#define MAX_Y 18 326#define MAX_Y 18
276 327
277 328
@@ -325,7 +376,6 @@ PLUGIN_HEADER
325#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING) 376#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING)
326#define SHIELD_Y (SHIP_Y - SHIP_HEIGHT - SHIELD_HEIGHT) 377#define SHIELD_Y (SHIP_Y - SHIP_HEIGHT - SHIELD_HEIGHT)
327#define LIVES_X 8 378#define LIVES_X 8
328#define MAX_X 75
329#define MAX_Y 18 379#define MAX_Y 18
330 380
331#elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) 381#elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128)
@@ -378,7 +428,6 @@ PLUGIN_HEADER
378#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING) 428#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING)
379#define SHIELD_Y (SHIP_Y - SHIP_HEIGHT - SHIELD_HEIGHT) 429#define SHIELD_Y (SHIP_Y - SHIP_HEIGHT - SHIELD_HEIGHT)
380#define LIVES_X 0 430#define LIVES_X 0
381#define MAX_X 75
382#define MAX_Y 18 431#define MAX_Y 18
383 432
384 433
@@ -421,7 +470,6 @@ PLUGIN_HEADER
421#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING) 470#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 1 - 6 * NUMBERS_WIDTH - 5 * NUM_SPACING)
422#define SHIELD_Y (PLAYFIELD_Y - 6 * SHIP_HEIGHT) 471#define SHIELD_Y (PLAYFIELD_Y - 6 * SHIP_HEIGHT)
423#define LIVES_X 10 472#define LIVES_X 10
424#define MAX_X 95
425#define MAX_Y 18 473#define MAX_Y 18
426 474
427#elif (LCD_WIDTH == 220) && (LCD_HEIGHT == 176) 475#elif (LCD_WIDTH == 220) && (LCD_HEIGHT == 176)
@@ -458,7 +506,6 @@ PLUGIN_HEADER
458#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING) 506#define HISCORENUM_X (LCD_WIDTH - PLAYFIELD_X - 4 * NUMBERS_WIDTH - 3 * NUM_SPACING)
459#define SHIELD_Y (PLAYFIELD_Y - 5 * SHIP_HEIGHT) 507#define SHIELD_Y (PLAYFIELD_Y - 5 * SHIP_HEIGHT)
460#define LIVES_X 8 508#define LIVES_X 8
461#define MAX_X 95
462#define MAX_Y 15 509#define MAX_Y 15
463 510
464 511
@@ -466,37 +513,7 @@ PLUGIN_HEADER
466 #error INVADROX: Unsupported LCD type 513 #error INVADROX: Unsupported LCD type
467#endif 514#endif
468 515
469/* bitmaps */ 516#define MAX_X ((LCD_WIDTH-LIVES_X*2-PLAYFIELD_X*2 - ALIEN_WIDTH)/2 - 1)
470#include "pluginbitmaps/invadrox_background.h"
471
472/* get dimensions for later use from the bitmaps */
473#include "pluginbitmaps/invadrox_aliens.h"
474#include "pluginbitmaps/invadrox_ships.h"
475#include "pluginbitmaps/invadrox_bombs.h"
476#include "pluginbitmaps/invadrox_alien_explode.h"
477#include "pluginbitmaps/invadrox_shield.h"
478#include "pluginbitmaps/invadrox_ufo.h"
479#include "pluginbitmaps/invadrox_ufo_explode.h"
480#include "pluginbitmaps/invadrox_numbers.h"
481#include "pluginbitmaps/invadrox_fire.h"
482#define ALIEN_WIDTH (BMPWIDTH_invadrox_aliens/2)
483#define ALIEN_HEIGHT (BMPHEIGHT_invadrox_aliens/3)
484#define SHIP_WIDTH BMPWIDTH_invadrox_ships
485#define SHIP_HEIGHT (BMPHEIGHT_invadrox_ships/3)
486#define BOMB_WIDTH (BMPWIDTH_invadrox_bombs/3)
487#define BOMB_HEIGHT (BMPHEIGHT_invadrox_bombs/6)
488#define ALIEN_EXPLODE_WIDTH BMPWIDTH_invadrox_alien_explode
489#define ALIEN_EXPLODE_HEIGHT BMPHEIGHT_invadrox_alien_explode
490#define SHIELD_WIDTH BMPWIDTH_invadrox_shield
491#define SHIELD_HEIGHT BMPHEIGHT_invadrox_shield
492#define UFO_WIDTH BMPWIDTH_invadrox_ufo
493#define UFO_HEIGHT BMPHEIGHT_invadrox_ufo
494#define UFO_EXPLODE_WIDTH BMPWIDTH_invadrox_ufo_explode
495#define UFO_EXPLODE_HEIGHT BMPHEIGHT_invadrox_ufo_explode
496#define NUMBERS_WIDTH (BMPWIDTH_invadrox_numbers/10)
497#define FONT_HEIGHT BMPHEIGHT_invadrox_numbers
498#define FIRE_WIDTH BMPWIDTH_invadrox_fire
499#define FIRE_HEIGHT BMPHEIGHT_invadrox_fire
500 517
501/* Defines common to each "graphic type" */ 518/* Defines common to each "graphic type" */
502#ifdef ARCADISH_GRAPHICS 519#ifdef ARCADISH_GRAPHICS
@@ -569,8 +586,8 @@ PLUGIN_HEADER
569 * Physical y is at y * ALIEN_HEIGHT 586 * Physical y is at y * ALIEN_HEIGHT
570 */ 587 */
571struct alien { 588struct alien {
572 unsigned char x; /* x-coordinate (0 - 95) */ 589 int x; /* x-coordinate (0 - 95) */
573 unsigned char y; /* y-coordinate (0 - 18) */ 590 int y; /* y-coordinate (0 - 18) */
574 unsigned char type; /* 0 (Kang), 1 (Kodos), 2 (Serak) */ 591 unsigned char type; /* 0 (Kang), 1 (Kodos), 2 (Serak) */
575 unsigned char state; /* Dead, alive or bomber */ 592 unsigned char state; /* Dead, alive or bomber */
576}; 593};