summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBen Basha <benbasha@rockbox.org>2006-02-20 18:56:34 +0000
committerBen Basha <benbasha@rockbox.org>2006-02-20 18:56:34 +0000
commit265d1a0936eafa90c6f466795fe1f7826fe4af9c (patch)
tree73892cb8a90c311ccf61c37ed8b1cd6a6920ea78
parent5991f02e1ca1a28398b79cd850da65775700a17e (diff)
downloadrockbox-265d1a0936eafa90c6f466795fe1f7826fe4af9c.tar.gz
rockbox-265d1a0936eafa90c6f466795fe1f7826fe4af9c.zip
BrickMania for iPod Nano
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8750 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/SOURCES4
-rw-r--r--apps/plugins/bitmaps/native/SOURCES19
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_ball.176x132x16.bmpbin0 -> 134 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_break.176x132x16.bmpbin0 -> 1720 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_bricks.176x132x16.bmpbin0 -> 2604 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_gameover.176x132x16.bmpbin0 -> 17318 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_help.176x132x16.bmpbin0 -> 1232 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_menu_bg.176x132x16.bmpbin0 -> 69752 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_no_resume.176x132x16.bmpbin0 -> 3020 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_pads.176x132x16.bmpbin0 -> 1854 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_powerups.176x132x16.bmpbin0 -> 1400 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_quit.176x132x16.bmpbin0 -> 1120 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_resume.176x132x16.bmpbin0 -> 3020 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_sel_help.176x132x16.bmpbin0 -> 1232 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_sel_quit.176x132x16.bmpbin0 -> 1120 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_sel_resume.176x132x16.bmpbin0 -> 3020 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_sel_start.176x132x16.bmpbin0 -> 4344 bytes
-rwxr-xr-xapps/plugins/bitmaps/native/brickmania_start.176x132x16.bmpbin0 -> 4344 bytes
-rw-r--r--apps/plugins/brickmania.c78
19 files changed, 92 insertions, 9 deletions
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 3da7ad646b..c8939c6214 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -35,8 +35,8 @@ mandelbrot.c
solitaire.c
bejeweled.c
bounce.c
-/* H300 and iPod Color/Video only */
-#if ((LCD_WIDTH >= 220) && (LCD_HEIGHT >= 176) && (LCD_DEPTH == 16)) || ((LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && (LCD_DEPTH==2))
+/* H300, H100 and iPod Nano/Color/Video only */
+#if ((LCD_WIDTH >= 176) && (LCD_HEIGHT >= 132) && (LCD_DEPTH == 16)) || ((LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && (LCD_DEPTH==2))
brickmania.c
#endif
calculator.c
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index bf725c1a3b..080cf4eedc 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -78,6 +78,25 @@ brickmania_sel_quit.160x128x2.bmp
brickmania_sel_start.160x128x2.bmp
brickmania_start.160x128x2.bmp
brickmania_break.160x128x2.bmp
+
+#elif (LCD_WIDTH == 176) && (LCD_HEIGHT == 132) && (LCD_DEPTH == 16)
+brickmania_ball.176x132x16.bmp
+brickmania_bricks.176x132x16.bmp
+brickmania_gameover.176x132x16.bmp
+brickmania_help.176x132x16.bmp
+brickmania_menu_bg.176x132x16.bmp
+brickmania_no_resume.176x132x16.bmp
+brickmania_pads.176x132x16.bmp
+brickmania_powerups.176x132x16.bmp
+brickmania_quit.176x132x16.bmp
+brickmania_resume.176x132x16.bmp
+brickmania_sel_help.176x132x16.bmp
+brickmania_sel_resume.176x132x16.bmp
+brickmania_sel_quit.176x132x16.bmp
+brickmania_sel_start.176x132x16.bmp
+brickmania_start.176x132x16.bmp
+brickmania_break.176x132x16.bmp
+
#endif
#endif /* HAVE_LCD_BITMAP */
diff --git a/apps/plugins/bitmaps/native/brickmania_ball.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_ball.176x132x16.bmp
new file mode 100755
index 0000000000..97da97f4a7
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_ball.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_break.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_break.176x132x16.bmp
new file mode 100755
index 0000000000..179d76d77c
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_break.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_bricks.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_bricks.176x132x16.bmp
new file mode 100755
index 0000000000..2d2b90c712
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_bricks.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_gameover.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_gameover.176x132x16.bmp
new file mode 100755
index 0000000000..d004433b5f
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_gameover.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_help.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_help.176x132x16.bmp
new file mode 100755
index 0000000000..2eb711f16c
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_help.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_menu_bg.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_menu_bg.176x132x16.bmp
new file mode 100755
index 0000000000..3f54bcf63b
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_menu_bg.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_no_resume.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_no_resume.176x132x16.bmp
new file mode 100755
index 0000000000..7807b0480c
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_no_resume.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_pads.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_pads.176x132x16.bmp
new file mode 100755
index 0000000000..5bd1e5dc57
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_pads.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_powerups.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_powerups.176x132x16.bmp
new file mode 100755
index 0000000000..91ece1048d
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_powerups.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_quit.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_quit.176x132x16.bmp
new file mode 100755
index 0000000000..f75e1a6ce0
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_quit.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_resume.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_resume.176x132x16.bmp
new file mode 100755
index 0000000000..fbb9115f6b
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_resume.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_sel_help.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_sel_help.176x132x16.bmp
new file mode 100755
index 0000000000..ba9750a68c
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_sel_help.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_sel_quit.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_sel_quit.176x132x16.bmp
new file mode 100755
index 0000000000..e605a41835
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_sel_quit.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_sel_resume.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_sel_resume.176x132x16.bmp
new file mode 100755
index 0000000000..e5981c0143
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_sel_resume.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_sel_start.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_sel_start.176x132x16.bmp
new file mode 100755
index 0000000000..4d4c1d6e17
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_sel_start.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/bitmaps/native/brickmania_start.176x132x16.bmp b/apps/plugins/bitmaps/native/brickmania_start.176x132x16.bmp
new file mode 100755
index 0000000000..a7768eda86
--- /dev/null
+++ b/apps/plugins/bitmaps/native/brickmania_start.176x132x16.bmp
Binary files differ
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c
index ac6204ca8c..156cad6c89 100644
--- a/apps/plugins/brickmania.c
+++ b/apps/plugins/brickmania.c
@@ -89,7 +89,7 @@ extern const fb_data brickmania_bricks[];
to 10ms.
*/
#define CYCLETIME 30
-
+
/* Offsets for LCDS > 220x176 */
#define XOFS ((LCD_WIDTH-220)/2)
#define YOFS ((LCD_HEIGHT-176)/2)
@@ -217,6 +217,71 @@ extern const fb_data brickmania_bricks[];
#define STRINGPOS_navi 100
#define STRINGPOS_flipsides 100
+#elif (LCD_WIDTH == 176) && (LCD_HEIGHT == 132) && (LCD_DEPTH==16)
+/* The time (in ms) for one iteration through the game loop - decrease this
+ to speed up the game - note that current_tick is (currently) only accurate
+ to 10ms.
+*/
+#define CYCLETIME 30
+
+#define PAD_WIDTH 40
+#define PAD_HEIGHT 5
+#define PAD_POS_Y LCD_HEIGHT - 7
+#define BRICK_HEIGHT 7
+#define BRICK_WIDTH 17
+#define BALL 5
+#define LEFTMARGIN 3
+#define TOPMARGIN 21
+
+#define BMPHEIGHT_help 14
+#define BMPWIDTH_help 28
+
+#define BMPHEIGHT_sel_help 14
+#define BMPWIDTH_sel_help 28
+
+#define BMPHEIGHT_resume 13
+#define BMPWIDTH_resume 76
+
+#define BMPHEIGHT_no_resume 13
+#define BMPWIDTH_no_resume 76
+
+#define BMPHEIGHT_quit 14
+#define BMPWIDTH_quit 25
+
+#define BMPHEIGHT_sel_quit 14
+#define BMPWIDTH_sel_quit 25
+
+#define BMPHEIGHT_sel_resume 13
+#define BMPWIDTH_sel_resume 76
+
+#define BMPHEIGHT_sel_start 16
+#define BMPWIDTH_sel_start 89
+
+#define BMPHEIGHT_start 16
+#define BMPWIDTH_start 89
+
+#define BMPHEIGHT_powerup 6
+#define BMPWIDTH_powerup 10
+
+#define BMPHEIGHT_menu 132
+#define BMPWIDTH_menu 176
+
+#define BMPXOFS_start 44
+#define BMPYOFS_start 58
+#define BMPXOFS_resume 50
+#define BMPYOFS_resume 75
+#define BMPXOFS_help 74
+#define BMPYOFS_help 89
+#define BMPXOFS_quit 75
+#define BMPYOFS_quit 104
+#define HIGHSCORE_XPOS 7
+#define HIGHSCORE_YPOS 36
+
+#define STRINGPOS_finsh 100
+#define STRINGPOS_congrats 110
+#define STRINGPOS_navi 100
+#define STRINGPOS_flipsides 100
+
#else
#error Unsupported LCD Size
#endif
@@ -689,9 +754,8 @@ int game_menu(int when)
rb->lcd_bitmap(brickmania_quit,BMPXOFS_quit,BMPYOFS_quit,
BMPWIDTH_quit,BMPHEIGHT_quit);
}
-
+ rb->lcd_set_drawmode(DRMODE_FG);
/* high score */
- rb->lcd_setfont(FONT_SYSFIXED);
#ifdef HAVE_LCD_COLOR
rb->lcd_set_background(LCD_RGBPACK(0,0,140));
rb->lcd_set_foreground(LCD_WHITE);
@@ -701,7 +765,7 @@ int game_menu(int when)
rb->lcd_getstringsize("High Score", &sw, NULL);
rb->lcd_getstringsize(str, &w, NULL);
rb->lcd_putsxy(HIGHSCORE_XPOS+sw/2-w/2, HIGHSCORE_YPOS+9, str);
- rb->lcd_setfont(FONT_UI);
+ rb->lcd_set_drawmode(DRMODE_SOLID);
rb->lcd_update();
@@ -764,7 +828,6 @@ int help(int when)
int maxX=210;
while(true){
- rb->lcd_setfont(FONT_SYSFIXED);
#ifdef HAVE_LCD_COLOR
rb->lcd_set_background(LCD_BLACK);
rb->lcd_clear_display();
@@ -814,7 +877,6 @@ int help(int when)
button=rb->button_get(true);
switch (button) {
case QUIT:
- rb->lcd_setfont(FONT_UI);
switch (game_menu(when)) {
case 0:
cur_level=0;
@@ -1454,7 +1516,8 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
{
(void)parameter;
rb = api;
-
+
+ rb->lcd_setfont(FONT_SYSFIXED);
/* Permanently enable the backlight (unless the user has turned it off) */
if (rb->global_settings->backlight_timeout > 0)
rb->backlight_set_timeout(1);
@@ -1465,6 +1528,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
configfile_save(HIGH_SCORE,config,1,0);
/* Restore user's original backlight setting */
+ rb->lcd_setfont(FONT_UI);
rb->backlight_set_timeout(rb->global_settings->backlight_timeout);
return PLUGIN_OK;