diff options
Diffstat (limited to 'apps/plugins')
18 files changed, 217 insertions, 98 deletions
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index ad056630b0..e291cc455d 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES | |||
@@ -38,9 +38,8 @@ solitaire.c | |||
38 | bejeweled.c | 38 | bejeweled.c |
39 | #endif | 39 | #endif |
40 | bounce.c | 40 | bounce.c |
41 | /* H300, H100 and iPod Nano/Color/Video only */ | 41 | #if (LCD_WIDTH != 138) && (LCD_WIDTH != 128) |
42 | #if ((LCD_WIDTH >= 176) && (LCD_HEIGHT >= 132) && (LCD_DEPTH == 16)) || \ | 42 | /* These need adjusting for the Mini's and iRiver if'p screen */ |
43 | ((LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && (LCD_DEPTH==2)) | ||
44 | brickmania.c | 43 | brickmania.c |
45 | #endif | 44 | #endif |
46 | calculator.c | 45 | calculator.c |
diff --git a/apps/plugins/bitmaps/mono/SOURCES b/apps/plugins/bitmaps/mono/SOURCES index e69de29bb2..954090468d 100644 --- a/apps/plugins/bitmaps/mono/SOURCES +++ b/apps/plugins/bitmaps/mono/SOURCES | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifdef HAVE_LCD_BITMAP | ||
2 | |||
3 | /* BrickMania */ | ||
4 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) | ||
5 | |||
6 | brickmania_bricks.112x64x1.bmp | ||
7 | brickmania_ball.112x64x1.bmp | ||
8 | brickmania_help.112x64x1.bmp | ||
9 | brickmania_no_resume.112x64x1.bmp | ||
10 | brickmania_pads.112x64x1.bmp | ||
11 | brickmania_powerups.112x64x1.bmp | ||
12 | brickmania_quit.112x64x1.bmp | ||
13 | brickmania_resume.112x64x1.bmp | ||
14 | brickmania_sel_help.112x64x1.bmp | ||
15 | brickmania_sel_resume.112x64x1.bmp | ||
16 | brickmania_sel_quit.112x64x1.bmp | ||
17 | brickmania_sel_start.112x64x1.bmp | ||
18 | brickmania_start.112x64x1.bmp | ||
19 | |||
20 | #endif | ||
21 | |||
22 | #endif /* HAVE_LCD_BITMAP */ | ||
diff --git a/apps/plugins/bitmaps/mono/brickmania_ball.112x64x1.bmp b/apps/plugins/bitmaps/mono/brickmania_ball.112x64x1.bmp new file mode 100755 index 0000000000..221b13b774 --- /dev/null +++ b/apps/plugins/bitmaps/mono/brickmania_ball.112x64x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/brickmania_bricks.112x64x1.bmp b/apps/plugins/bitmaps/mono/brickmania_bricks.112x64x1.bmp new file mode 100755 index 0000000000..fba374d480 --- /dev/null +++ b/apps/plugins/bitmaps/mono/brickmania_bricks.112x64x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/brickmania_gameover.112x64x1.bmp b/apps/plugins/bitmaps/mono/brickmania_gameover.112x64x1.bmp new file mode 100755 index 0000000000..73afc2bfbb --- /dev/null +++ b/apps/plugins/bitmaps/mono/brickmania_gameover.112x64x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/brickmania_help.112x64x1.bmp b/apps/plugins/bitmaps/mono/brickmania_help.112x64x1.bmp new file mode 100755 index 0000000000..0d69adeeba --- /dev/null +++ b/apps/plugins/bitmaps/mono/brickmania_help.112x64x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/brickmania_no_resume.112x64x1.bmp b/apps/plugins/bitmaps/mono/brickmania_no_resume.112x64x1.bmp new file mode 100755 index 0000000000..1c8391346c --- /dev/null +++ b/apps/plugins/bitmaps/mono/brickmania_no_resume.112x64x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/brickmania_pads.112x64x1.bmp b/apps/plugins/bitmaps/mono/brickmania_pads.112x64x1.bmp new file mode 100755 index 0000000000..85e5ff1d72 --- /dev/null +++ b/apps/plugins/bitmaps/mono/brickmania_pads.112x64x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/brickmania_powerups.112x64x1.bmp b/apps/plugins/bitmaps/mono/brickmania_powerups.112x64x1.bmp new file mode 100755 index 0000000000..66cca0a6d8 --- /dev/null +++ b/apps/plugins/bitmaps/mono/brickmania_powerups.112x64x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/brickmania_quit.112x64x1.bmp b/apps/plugins/bitmaps/mono/brickmania_quit.112x64x1.bmp new file mode 100755 index 0000000000..3b66731189 --- /dev/null +++ b/apps/plugins/bitmaps/mono/brickmania_quit.112x64x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/brickmania_resume.112x64x1.bmp b/apps/plugins/bitmaps/mono/brickmania_resume.112x64x1.bmp new file mode 100755 index 0000000000..1e1dd0899f --- /dev/null +++ b/apps/plugins/bitmaps/mono/brickmania_resume.112x64x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/brickmania_sel_help.112x64x1.bmp b/apps/plugins/bitmaps/mono/brickmania_sel_help.112x64x1.bmp new file mode 100755 index 0000000000..c4bf13c247 --- /dev/null +++ b/apps/plugins/bitmaps/mono/brickmania_sel_help.112x64x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/brickmania_sel_quit.112x64x1.bmp b/apps/plugins/bitmaps/mono/brickmania_sel_quit.112x64x1.bmp new file mode 100755 index 0000000000..356d4535cf --- /dev/null +++ b/apps/plugins/bitmaps/mono/brickmania_sel_quit.112x64x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/brickmania_sel_resume.112x64x1.bmp b/apps/plugins/bitmaps/mono/brickmania_sel_resume.112x64x1.bmp new file mode 100755 index 0000000000..19836b5817 --- /dev/null +++ b/apps/plugins/bitmaps/mono/brickmania_sel_resume.112x64x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/brickmania_sel_start.112x64x1.bmp b/apps/plugins/bitmaps/mono/brickmania_sel_start.112x64x1.bmp new file mode 100755 index 0000000000..ac17d39e69 --- /dev/null +++ b/apps/plugins/bitmaps/mono/brickmania_sel_start.112x64x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/mono/brickmania_start.112x64x1.bmp b/apps/plugins/bitmaps/mono/brickmania_start.112x64x1.bmp new file mode 100755 index 0000000000..a805ba0b9c --- /dev/null +++ b/apps/plugins/bitmaps/mono/brickmania_start.112x64x1.bmp | |||
Binary files differ | |||
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES index 080cf4eedc..380022ceb1 100644 --- a/apps/plugins/bitmaps/native/SOURCES +++ b/apps/plugins/bitmaps/native/SOURCES | |||
@@ -61,7 +61,7 @@ brickmania_sel_start.220x176x16.bmp | |||
61 | brickmania_start.220x176x16.bmp | 61 | brickmania_start.220x176x16.bmp |
62 | brickmania_break.220x176x16.bmp | 62 | brickmania_break.220x176x16.bmp |
63 | 63 | ||
64 | #elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && (LCD_DEPTH == 2) | 64 | #elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) |
65 | brickmania_ball.160x128x2.bmp | 65 | brickmania_ball.160x128x2.bmp |
66 | brickmania_bricks.160x128x2.bmp | 66 | brickmania_bricks.160x128x2.bmp |
67 | brickmania_gameover.160x128x2.bmp | 67 | brickmania_gameover.160x128x2.bmp |
diff --git a/apps/plugins/brickmania.c b/apps/plugins/brickmania.c index 156cad6c89..527d0aace0 100644 --- a/apps/plugins/brickmania.c +++ b/apps/plugins/brickmania.c | |||
@@ -33,11 +33,37 @@ PLUGIN_HEADER | |||
33 | #define UP BUTTON_UP | 33 | #define UP BUTTON_UP |
34 | #define DOWN BUTTON_DOWN | 34 | #define DOWN BUTTON_DOWN |
35 | 35 | ||
36 | /* H100 and H300 don't have scroll events */ | 36 | /* Only iPod have scroll events */ |
37 | #define SCROLL_FWD(x) (0) | 37 | #define SCROLL_FWD(x) (0) |
38 | #define SCROLL_BACK(x) (0) | 38 | #define SCROLL_BACK(x) (0) |
39 | 39 | ||
40 | #elif (CONFIG_KEYPAD == IPOD_4G_PAD) | 40 | #elif CONFIG_KEYPAD == ONDIO_PAD |
41 | |||
42 | #define QUIT BUTTON_OFF | ||
43 | #define LEFT BUTTON_LEFT | ||
44 | #define RIGHT BUTTON_RIGHT | ||
45 | #define SELECT BUTTON_MENU | ||
46 | #define UP BUTTON_UP | ||
47 | #define DOWN BUTTON_DOWN | ||
48 | |||
49 | /* Only iPod have scroll events */ | ||
50 | #define SCROLL_FWD(x) (0) | ||
51 | #define SCROLL_BACK(x) (0) | ||
52 | |||
53 | #elif CONFIG_KEYPAD == RECORDER_PAD | ||
54 | |||
55 | #define QUIT BUTTON_OFF | ||
56 | #define LEFT BUTTON_LEFT | ||
57 | #define RIGHT BUTTON_RIGHT | ||
58 | #define SELECT BUTTON_PLAY | ||
59 | #define UP BUTTON_UP | ||
60 | #define DOWN BUTTON_DOWN | ||
61 | |||
62 | /* Only iPod have scroll events */ | ||
63 | #define SCROLL_FWD(x) (0) | ||
64 | #define SCROLL_BACK(x) (0) | ||
65 | |||
66 | #elif (CONFIG_KEYPAD == IPOD_3G_PAD) || (CONFIG_KEYPAD == IPOD_4G_PAD) | ||
41 | 67 | ||
42 | #define QUIT BUTTON_MENU | 68 | #define QUIT BUTTON_MENU |
43 | #define LEFT BUTTON_LEFT | 69 | #define LEFT BUTTON_LEFT |
@@ -49,6 +75,19 @@ PLUGIN_HEADER | |||
49 | #define SCROLL_FWD(x) ((x) & BUTTON_SCROLL_FWD) | 75 | #define SCROLL_FWD(x) ((x) & BUTTON_SCROLL_FWD) |
50 | #define SCROLL_BACK(x) ((x) & BUTTON_SCROLL_BACK) | 76 | #define SCROLL_BACK(x) ((x) & BUTTON_SCROLL_BACK) |
51 | 77 | ||
78 | #elif CONFIG_KEYPAD == IAUDIO_X5_PAD /* grayscale at the moment */ | ||
79 | |||
80 | #define QUIT BUTTON_POWER | ||
81 | #define LEFT BUTTON_LEFT | ||
82 | #define RIGHT BUTTON_RIGHT | ||
83 | #define SELECT BUTTON_PLAY | ||
84 | #define UP BUTTON_UP | ||
85 | #define DOWN BUTTON_DOWN | ||
86 | |||
87 | /* Only iPod have scroll events */ | ||
88 | #define SCROLL_FWD(x) (0) | ||
89 | #define SCROLL_BACK(x) (0) | ||
90 | |||
52 | #else | 91 | #else |
53 | #error Unsupported keypad | 92 | #error Unsupported keypad |
54 | #endif | 93 | #endif |
@@ -56,10 +95,12 @@ PLUGIN_HEADER | |||
56 | static struct plugin_api* rb; | 95 | static struct plugin_api* rb; |
57 | 96 | ||
58 | /* External bitmaps */ | 97 | /* External bitmaps */ |
59 | extern const fb_data brickmania_ball[]; | 98 | #if (LCD_WIDTH != 112) && (LCD_HEIGHT != 64) |
99 | extern const fb_data brickmania_menu_bg[]; | ||
60 | extern const fb_data brickmania_gameover[]; | 100 | extern const fb_data brickmania_gameover[]; |
101 | #endif | ||
102 | extern const fb_data brickmania_ball[]; | ||
61 | extern const fb_data brickmania_help[]; | 103 | extern const fb_data brickmania_help[]; |
62 | extern const fb_data brickmania_menu_bg[]; | ||
63 | extern const fb_data brickmania_no_resume[]; | 104 | extern const fb_data brickmania_no_resume[]; |
64 | extern const fb_data brickmania_quit[]; | 105 | extern const fb_data brickmania_quit[]; |
65 | extern const fb_data brickmania_resume[]; | 106 | extern const fb_data brickmania_resume[]; |
@@ -68,7 +109,9 @@ extern const fb_data brickmania_sel_quit[]; | |||
68 | extern const fb_data brickmania_sel_resume[]; | 109 | extern const fb_data brickmania_sel_resume[]; |
69 | extern const fb_data brickmania_sel_start[]; | 110 | extern const fb_data brickmania_sel_start[]; |
70 | extern const fb_data brickmania_start[]; | 111 | extern const fb_data brickmania_start[]; |
112 | #ifdef HAVE_LCD_COLOR | ||
71 | extern const fb_data brickmania_break[]; | 113 | extern const fb_data brickmania_break[]; |
114 | #endif | ||
72 | 115 | ||
73 | /* normal, glue, fire */ | 116 | /* normal, glue, fire */ |
74 | extern const fb_data brickmania_pads[]; | 117 | extern const fb_data brickmania_pads[]; |
@@ -100,36 +143,22 @@ extern const fb_data brickmania_bricks[]; | |||
100 | #define BRICK_HEIGHT 8 | 143 | #define BRICK_HEIGHT 8 |
101 | #define BRICK_WIDTH 21 | 144 | #define BRICK_WIDTH 21 |
102 | #define BALL 5 | 145 | #define BALL 5 |
146 | #define HALFBALL 3 | ||
103 | #define LEFTMARGIN 5 | 147 | #define LEFTMARGIN 5 |
104 | #define TOPMARGIN 30 | 148 | #define TOPMARGIN 30 |
105 | 149 | ||
106 | #define BMPHEIGHT_help 19 | 150 | #define BMPHEIGHT_start 20 |
107 | #define BMPWIDTH_help 37 | 151 | #define BMPWIDTH_start 112 |
108 | |||
109 | #define BMPHEIGHT_sel_help 19 | ||
110 | #define BMPWIDTH_sel_help 37 | ||
111 | 152 | ||
112 | #define BMPHEIGHT_resume 17 | 153 | #define BMPHEIGHT_resume 17 |
113 | #define BMPWIDTH_resume 96 | 154 | #define BMPWIDTH_resume 96 |
114 | 155 | ||
115 | #define BMPHEIGHT_no_resume 17 | 156 | #define BMPHEIGHT_help 19 |
116 | #define BMPWIDTH_no_resume 96 | 157 | #define BMPWIDTH_help 37 |
117 | 158 | ||
118 | #define BMPHEIGHT_quit 19 | 159 | #define BMPHEIGHT_quit 19 |
119 | #define BMPWIDTH_quit 33 | 160 | #define BMPWIDTH_quit 33 |
120 | 161 | ||
121 | #define BMPHEIGHT_sel_quit 19 | ||
122 | #define BMPWIDTH_sel_quit 33 | ||
123 | |||
124 | #define BMPHEIGHT_sel_resume 17 | ||
125 | #define BMPWIDTH_sel_resume 96 | ||
126 | |||
127 | #define BMPHEIGHT_sel_start 20 | ||
128 | #define BMPWIDTH_sel_start 112 | ||
129 | |||
130 | #define BMPHEIGHT_start 20 | ||
131 | #define BMPWIDTH_start 112 | ||
132 | |||
133 | #define BMPHEIGHT_powerup 6 | 162 | #define BMPHEIGHT_powerup 6 |
134 | #define BMPWIDTH_powerup 10 | 163 | #define BMPWIDTH_powerup 10 |
135 | 164 | ||
@@ -152,7 +181,7 @@ extern const fb_data brickmania_bricks[]; | |||
152 | #define STRINGPOS_navi 150 | 181 | #define STRINGPOS_navi 150 |
153 | #define STRINGPOS_flipsides 150 | 182 | #define STRINGPOS_flipsides 150 |
154 | 183 | ||
155 | #elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && (LCD_DEPTH==2) | 184 | #elif (LCD_WIDTH == 160) && (LCD_HEIGHT == 128) |
156 | /* The time (in ms) for one iteration through the game loop - decrease this | 185 | /* The time (in ms) for one iteration through the game loop - decrease this |
157 | to speed up the game - note that current_tick is (currently) only accurate | 186 | to speed up the game - note that current_tick is (currently) only accurate |
158 | to 10ms. | 187 | to 10ms. |
@@ -165,36 +194,22 @@ extern const fb_data brickmania_bricks[]; | |||
165 | #define BRICK_HEIGHT 7 | 194 | #define BRICK_HEIGHT 7 |
166 | #define BRICK_WIDTH 15 | 195 | #define BRICK_WIDTH 15 |
167 | #define BALL 5 | 196 | #define BALL 5 |
197 | #define HALFBALL 3 | ||
168 | #define LEFTMARGIN 5 | 198 | #define LEFTMARGIN 5 |
169 | #define TOPMARGIN 21 | 199 | #define TOPMARGIN 21 |
170 | 200 | ||
171 | #define BMPHEIGHT_help 15 | 201 | #define BMPHEIGHT_start 16 |
172 | #define BMPWIDTH_help 30 | 202 | #define BMPWIDTH_start 88 |
173 | |||
174 | #define BMPHEIGHT_sel_help 15 | ||
175 | #define BMPWIDTH_sel_help 30 | ||
176 | 203 | ||
177 | #define BMPHEIGHT_resume 14 | 204 | #define BMPHEIGHT_resume 14 |
178 | #define BMPWIDTH_resume 78 | 205 | #define BMPWIDTH_resume 78 |
179 | 206 | ||
180 | #define BMPHEIGHT_no_resume 14 | 207 | #define BMPHEIGHT_help 15 |
181 | #define BMPWIDTH_no_resume 78 | 208 | #define BMPWIDTH_help 30 |
182 | 209 | ||
183 | #define BMPHEIGHT_quit 17 | 210 | #define BMPHEIGHT_quit 17 |
184 | #define BMPWIDTH_quit 30 | 211 | #define BMPWIDTH_quit 30 |
185 | 212 | ||
186 | #define BMPHEIGHT_sel_quit 17 | ||
187 | #define BMPWIDTH_sel_quit 30 | ||
188 | |||
189 | #define BMPHEIGHT_sel_resume 14 | ||
190 | #define BMPWIDTH_sel_resume 78 | ||
191 | |||
192 | #define BMPHEIGHT_sel_start 16 | ||
193 | #define BMPWIDTH_sel_start 88 | ||
194 | |||
195 | #define BMPHEIGHT_start 16 | ||
196 | #define BMPWIDTH_start 88 | ||
197 | |||
198 | #define BMPHEIGHT_powerup 6 | 213 | #define BMPHEIGHT_powerup 6 |
199 | #define BMPWIDTH_powerup 10 | 214 | #define BMPWIDTH_powerup 10 |
200 | 215 | ||
@@ -212,11 +227,60 @@ extern const fb_data brickmania_bricks[]; | |||
212 | #define HIGHSCORE_XPOS 7 | 227 | #define HIGHSCORE_XPOS 7 |
213 | #define HIGHSCORE_YPOS 36 | 228 | #define HIGHSCORE_YPOS 36 |
214 | 229 | ||
215 | #define STRINGPOS_finsh 100 | 230 | #define STRINGPOS_finsh 110 |
216 | #define STRINGPOS_congrats 110 | 231 | #define STRINGPOS_congrats 100 |
217 | #define STRINGPOS_navi 100 | 232 | #define STRINGPOS_navi 100 |
218 | #define STRINGPOS_flipsides 100 | 233 | #define STRINGPOS_flipsides 100 |
219 | 234 | ||
235 | #elif (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) | ||
236 | /* The time (in ms) for one iteration through the game loop - decrease this | ||
237 | to speed up the game - note that current_tick is (currently) only accurate | ||
238 | to 10ms. | ||
239 | */ | ||
240 | #define CYCLETIME 75 | ||
241 | |||
242 | #define PAD_WIDTH 30 | ||
243 | #define PAD_HEIGHT 3 | ||
244 | #define PAD_POS_Y LCD_HEIGHT - 5 | ||
245 | #define BRICK_HEIGHT 4 | ||
246 | #define BRICK_WIDTH 11 | ||
247 | #define BALL 3 | ||
248 | #define HALFBALL 2 | ||
249 | #define LEFTMARGIN 1 | ||
250 | #define TOPMARGIN 10 | ||
251 | |||
252 | #define BMPHEIGHT_start 9 | ||
253 | #define BMPWIDTH_start 80 | ||
254 | |||
255 | #define BMPHEIGHT_resume 7 | ||
256 | #define BMPWIDTH_resume 71 | ||
257 | |||
258 | #define BMPHEIGHT_help 9 | ||
259 | #define BMPWIDTH_help 26 | ||
260 | |||
261 | #define BMPHEIGHT_quit 9 | ||
262 | #define BMPWIDTH_quit 25 | ||
263 | |||
264 | |||
265 | #define BMPHEIGHT_powerup 6 | ||
266 | #define BMPWIDTH_powerup 7 | ||
267 | |||
268 | #define BMPXOFS_start 12 | ||
269 | #define BMPYOFS_start 20 | ||
270 | #define BMPXOFS_resume 18 | ||
271 | #define BMPYOFS_resume 31 | ||
272 | #define BMPXOFS_help 39 | ||
273 | #define BMPYOFS_help 42 | ||
274 | #define BMPXOFS_quit 40 | ||
275 | #define BMPYOFS_quit 53 | ||
276 | #define HIGHSCORE_XPOS 0 | ||
277 | #define HIGHSCORE_YPOS 0 | ||
278 | |||
279 | #define STRINGPOS_finsh 54 | ||
280 | #define STRINGPOS_congrats 44 | ||
281 | #define STRINGPOS_navi 44 | ||
282 | #define STRINGPOS_flipsides 44 | ||
283 | |||
220 | #elif (LCD_WIDTH == 176) && (LCD_HEIGHT == 132) && (LCD_DEPTH==16) | 284 | #elif (LCD_WIDTH == 176) && (LCD_HEIGHT == 132) && (LCD_DEPTH==16) |
221 | /* The time (in ms) for one iteration through the game loop - decrease this | 285 | /* The time (in ms) for one iteration through the game loop - decrease this |
222 | to speed up the game - note that current_tick is (currently) only accurate | 286 | to speed up the game - note that current_tick is (currently) only accurate |
@@ -230,36 +294,22 @@ extern const fb_data brickmania_bricks[]; | |||
230 | #define BRICK_HEIGHT 7 | 294 | #define BRICK_HEIGHT 7 |
231 | #define BRICK_WIDTH 17 | 295 | #define BRICK_WIDTH 17 |
232 | #define BALL 5 | 296 | #define BALL 5 |
297 | #define HALFBALL 3 | ||
233 | #define LEFTMARGIN 3 | 298 | #define LEFTMARGIN 3 |
234 | #define TOPMARGIN 21 | 299 | #define TOPMARGIN 21 |
235 | 300 | ||
236 | #define BMPHEIGHT_help 14 | 301 | #define BMPHEIGHT_start 16 |
237 | #define BMPWIDTH_help 28 | 302 | #define BMPWIDTH_start 89 |
238 | |||
239 | #define BMPHEIGHT_sel_help 14 | ||
240 | #define BMPWIDTH_sel_help 28 | ||
241 | 303 | ||
242 | #define BMPHEIGHT_resume 13 | 304 | #define BMPHEIGHT_resume 13 |
243 | #define BMPWIDTH_resume 76 | 305 | #define BMPWIDTH_resume 76 |
244 | 306 | ||
245 | #define BMPHEIGHT_no_resume 13 | 307 | #define BMPHEIGHT_help 14 |
246 | #define BMPWIDTH_no_resume 76 | 308 | #define BMPWIDTH_help 28 |
247 | 309 | ||
248 | #define BMPHEIGHT_quit 14 | 310 | #define BMPHEIGHT_quit 14 |
249 | #define BMPWIDTH_quit 25 | 311 | #define BMPWIDTH_quit 25 |
250 | 312 | ||
251 | #define BMPHEIGHT_sel_quit 14 | ||
252 | #define BMPWIDTH_sel_quit 25 | ||
253 | |||
254 | #define BMPHEIGHT_sel_resume 13 | ||
255 | #define BMPWIDTH_sel_resume 76 | ||
256 | |||
257 | #define BMPHEIGHT_sel_start 16 | ||
258 | #define BMPWIDTH_sel_start 89 | ||
259 | |||
260 | #define BMPHEIGHT_start 16 | ||
261 | #define BMPWIDTH_start 89 | ||
262 | |||
263 | #define BMPHEIGHT_powerup 6 | 313 | #define BMPHEIGHT_powerup 6 |
264 | #define BMPWIDTH_powerup 10 | 314 | #define BMPWIDTH_powerup 10 |
265 | 315 | ||
@@ -277,7 +327,7 @@ extern const fb_data brickmania_bricks[]; | |||
277 | #define HIGHSCORE_XPOS 7 | 327 | #define HIGHSCORE_XPOS 7 |
278 | #define HIGHSCORE_YPOS 36 | 328 | #define HIGHSCORE_YPOS 36 |
279 | 329 | ||
280 | #define STRINGPOS_finsh 100 | 330 | #define STRINGPOS_finsh 110 |
281 | #define STRINGPOS_congrats 110 | 331 | #define STRINGPOS_congrats 110 |
282 | #define STRINGPOS_navi 100 | 332 | #define STRINGPOS_navi 100 |
283 | #define STRINGPOS_flipsides 100 | 333 | #define STRINGPOS_flipsides 100 |
@@ -691,9 +741,13 @@ void sleep (int secs) { | |||
691 | if (vscore<score) { | 741 | if (vscore<score) { |
692 | vscore++; | 742 | vscore++; |
693 | rb->snprintf(s, sizeof(s), "%d", vscore); | 743 | rb->snprintf(s, sizeof(s), "%d", vscore); |
694 | rb->lcd_getstringsize(s, &sw, NULL); | 744 | rb->lcd_getstringsize(s, &sw, &w); |
745 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) | ||
746 | rb->lcd_putsxy(LCD_WIDTH/2-sw/2, 0, s); | ||
747 | #else | ||
695 | rb->lcd_putsxy(LCD_WIDTH/2-sw/2, 2, s); | 748 | rb->lcd_putsxy(LCD_WIDTH/2-sw/2, 2, s); |
696 | rb->lcd_update(); | 749 | #endif |
750 | rb->lcd_update_rect(0,0,LCD_WIDTH,w+2); | ||
697 | } else { | 751 | } else { |
698 | if (count==0) count=*rb->current_tick+HZ*secs; | 752 | if (count==0) count=*rb->current_tick+HZ*secs; |
699 | if (*rb->current_tick>=count) | 753 | if (*rb->current_tick>=count) |
@@ -712,13 +766,15 @@ int game_menu(int when) | |||
712 | int button,cur=0; | 766 | int button,cur=0; |
713 | char str[10]; | 767 | char str[10]; |
714 | rb->lcd_clear_display(); | 768 | rb->lcd_clear_display(); |
715 | rb->lcd_bitmap(brickmania_menu_bg,0,0,BMPWIDTH_menu,BMPHEIGHT_menu); | 769 | #if (LCD_WIDTH != 112) && (LCD_HEIGHT != 64) |
770 | rb->lcd_bitmap(brickmania_menu_bg,0,0,BMPWIDTH_menu,BMPHEIGHT_menu); | ||
771 | #endif | ||
716 | while (true) { | 772 | while (true) { |
717 | for(i=0;i<MENU_LENGTH;i++) { | 773 | for(i=0;i<MENU_LENGTH;i++) { |
718 | if (cur==0) | 774 | if (cur==0) |
719 | rb->lcd_bitmap(brickmania_sel_start, | 775 | rb->lcd_bitmap(brickmania_sel_start, |
720 | BMPXOFS_start,BMPYOFS_start, | 776 | BMPXOFS_start,BMPYOFS_start, |
721 | BMPWIDTH_sel_start,BMPHEIGHT_sel_start); | 777 | BMPWIDTH_start,BMPHEIGHT_start); |
722 | else | 778 | else |
723 | rb->lcd_bitmap(brickmania_start,BMPXOFS_start,BMPYOFS_start, | 779 | rb->lcd_bitmap(brickmania_start,BMPXOFS_start,BMPYOFS_start, |
724 | BMPWIDTH_start,BMPHEIGHT_start); | 780 | BMPWIDTH_start,BMPHEIGHT_start); |
@@ -727,7 +783,7 @@ int game_menu(int when) | |||
727 | if (cur==1) | 783 | if (cur==1) |
728 | rb->lcd_bitmap(brickmania_sel_resume, | 784 | rb->lcd_bitmap(brickmania_sel_resume, |
729 | BMPXOFS_resume,BMPYOFS_resume, | 785 | BMPXOFS_resume,BMPYOFS_resume, |
730 | BMPWIDTH_sel_resume,BMPHEIGHT_sel_resume); | 786 | BMPWIDTH_resume,BMPHEIGHT_resume); |
731 | else | 787 | else |
732 | rb->lcd_bitmap(brickmania_resume, | 788 | rb->lcd_bitmap(brickmania_resume, |
733 | BMPXOFS_resume,BMPYOFS_resume, | 789 | BMPXOFS_resume,BMPYOFS_resume, |
@@ -736,20 +792,20 @@ int game_menu(int when) | |||
736 | } else { | 792 | } else { |
737 | rb->lcd_bitmap(brickmania_no_resume, | 793 | rb->lcd_bitmap(brickmania_no_resume, |
738 | BMPXOFS_resume,BMPYOFS_resume, | 794 | BMPXOFS_resume,BMPYOFS_resume, |
739 | BMPWIDTH_no_resume,BMPHEIGHT_no_resume); | 795 | BMPWIDTH_resume,BMPHEIGHT_resume); |
740 | } | 796 | } |
741 | 797 | ||
742 | 798 | ||
743 | if (cur==2) | 799 | if (cur==2) |
744 | rb->lcd_bitmap(brickmania_sel_help,BMPXOFS_help,BMPYOFS_help, | 800 | rb->lcd_bitmap(brickmania_sel_help,BMPXOFS_help,BMPYOFS_help, |
745 | BMPWIDTH_sel_help,BMPHEIGHT_sel_help); | 801 | BMPWIDTH_help,BMPHEIGHT_help); |
746 | else | 802 | else |
747 | rb->lcd_bitmap(brickmania_help,BMPXOFS_help,BMPYOFS_help, | 803 | rb->lcd_bitmap(brickmania_help,BMPXOFS_help,BMPYOFS_help, |
748 | BMPWIDTH_help,BMPHEIGHT_help); | 804 | BMPWIDTH_help,BMPHEIGHT_help); |
749 | 805 | ||
750 | if (cur==3) | 806 | if (cur==3) |
751 | rb->lcd_bitmap(brickmania_sel_quit,BMPXOFS_quit,BMPYOFS_quit, | 807 | rb->lcd_bitmap(brickmania_sel_quit,BMPXOFS_quit,BMPYOFS_quit, |
752 | BMPWIDTH_sel_quit,BMPHEIGHT_sel_quit); | 808 | BMPWIDTH_quit,BMPHEIGHT_quit); |
753 | else | 809 | else |
754 | rb->lcd_bitmap(brickmania_quit,BMPXOFS_quit,BMPYOFS_quit, | 810 | rb->lcd_bitmap(brickmania_quit,BMPXOFS_quit,BMPYOFS_quit, |
755 | BMPWIDTH_quit,BMPHEIGHT_quit); | 811 | BMPWIDTH_quit,BMPHEIGHT_quit); |
@@ -791,6 +847,7 @@ int game_menu(int when) | |||
791 | }; | 847 | }; |
792 | break; | 848 | break; |
793 | 849 | ||
850 | case RIGHT: | ||
794 | case SELECT: | 851 | case SELECT: |
795 | if (cur==0) { | 852 | if (cur==0) { |
796 | score=0; | 853 | score=0; |
@@ -857,7 +914,15 @@ int help(int when) | |||
857 | rb->lcd_putsxy(1+xoffset, 5*(h+2)+yoffset,"Controls"); | 914 | rb->lcd_putsxy(1+xoffset, 5*(h+2)+yoffset,"Controls"); |
858 | #endif | 915 | #endif |
859 | rb->lcd_putsxy(1+xoffset, 6*(h+2)+yoffset,"< & > Move the paddle"); | 916 | rb->lcd_putsxy(1+xoffset, 6*(h+2)+yoffset,"< & > Move the paddle"); |
917 | #if CONFIG_KEYPAD == ONDIO_PAD | ||
918 | rb->lcd_putsxy(1+xoffset, 7*(h+2)+yoffset,"MENU Releases the ball/Fire!"); | ||
919 | #elif CONFIG_KEYPAD == RECORDER_PAD | ||
920 | rb->lcd_putsxy(1+xoffset, 7*(h+2)+yoffset,"PLAY Releases the ball/Fire!"); | ||
921 | #elif CONFIG_KEYPAD == IRIVER_H300_PAD | ||
860 | rb->lcd_putsxy(1+xoffset, 7*(h+2)+yoffset,"NAVI Releases the ball/Fire!"); | 922 | rb->lcd_putsxy(1+xoffset, 7*(h+2)+yoffset,"NAVI Releases the ball/Fire!"); |
923 | #else | ||
924 | rb->lcd_putsxy(1+xoffset, 7*(h+2)+yoffset,"SELECT Releases the ball/Fire!"); | ||
925 | #endif | ||
861 | rb->lcd_putsxy(1+xoffset, 8*(h+2)+yoffset,"STOP Opens menu/Quit"); | 926 | rb->lcd_putsxy(1+xoffset, 8*(h+2)+yoffset,"STOP Opens menu/Quit"); |
862 | #ifdef HAVE_LCD_COLOR | 927 | #ifdef HAVE_LCD_COLOR |
863 | rb->lcd_set_foreground(LCD_RGBPACK(245,0,0)); | 928 | rb->lcd_set_foreground(LCD_RGBPACK(245,0,0)); |
@@ -954,7 +1019,7 @@ int fire_space(void) | |||
954 | 1019 | ||
955 | int game_loop(void){ | 1020 | int game_loop(void){ |
956 | int j,i,k,bricky,brickx; | 1021 | int j,i,k,bricky,brickx; |
957 | char s[20]; | 1022 | char s[30]; |
958 | int sec_count=0,num_count=10; | 1023 | int sec_count=0,num_count=10; |
959 | int end; | 1024 | int end; |
960 | 1025 | ||
@@ -1007,24 +1072,47 @@ int game_loop(void){ | |||
1007 | rb->lcd_getstringsize(s, &sw, NULL); | 1072 | rb->lcd_getstringsize(s, &sw, NULL); |
1008 | rb->lcd_putsxy(LCD_WIDTH/2-2, STRINGPOS_flipsides, s); | 1073 | rb->lcd_putsxy(LCD_WIDTH/2-2, STRINGPOS_flipsides, s); |
1009 | } | 1074 | } |
1010 | 1075 | ||
1011 | /* write life num */ | 1076 | /* write life num */ |
1077 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) | ||
1078 | rb->snprintf(s, sizeof(s), "L:%d", life); | ||
1079 | rb->lcd_putsxy(0, 0, s); | ||
1080 | #else | ||
1012 | rb->snprintf(s, sizeof(s), "Life: %d", life); | 1081 | rb->snprintf(s, sizeof(s), "Life: %d", life); |
1013 | rb->lcd_putsxy(2, 2, s); | 1082 | rb->lcd_putsxy(2, 2, s); |
1014 | 1083 | #endif | |
1084 | |||
1085 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) | ||
1086 | rb->snprintf(s, sizeof(s), "L%d", cur_level+1); | ||
1087 | rb->lcd_getstringsize(s, &sw, NULL); | ||
1088 | rb->lcd_putsxy(LCD_WIDTH-sw, 0, s); | ||
1089 | #else | ||
1015 | rb->snprintf(s, sizeof(s), "Level %d", cur_level+1); | 1090 | rb->snprintf(s, sizeof(s), "Level %d", cur_level+1); |
1016 | rb->lcd_getstringsize(s, &sw, NULL); | 1091 | rb->lcd_getstringsize(s, &sw, NULL); |
1017 | rb->lcd_putsxy(LCD_WIDTH-sw-2, 2, s); | 1092 | rb->lcd_putsxy(LCD_WIDTH-sw-2, 2, s); |
1093 | #endif | ||
1018 | 1094 | ||
1019 | if (vscore<score) vscore++; | 1095 | if (vscore<score) vscore++; |
1020 | rb->snprintf(s, sizeof(s), "%d", vscore); | 1096 | rb->snprintf(s, sizeof(s), "%d", vscore); |
1021 | rb->lcd_getstringsize(s, &sw, NULL); | 1097 | rb->lcd_getstringsize(s, &sw, NULL); |
1098 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) | ||
1099 | rb->lcd_putsxy(LCD_WIDTH/2-sw/2, 0, s); | ||
1100 | #else | ||
1022 | rb->lcd_putsxy(LCD_WIDTH/2-sw/2, 2, s); | 1101 | rb->lcd_putsxy(LCD_WIDTH/2-sw/2, 2, s); |
1102 | #endif | ||
1023 | 1103 | ||
1024 | /* continue game */ | 1104 | /* continue game */ |
1025 | if (con_game== 1 && start_game!=1) { | 1105 | if (con_game== 1 && start_game!=1) { |
1026 | rb->lcd_getstringsize("Press NAVI To Continue", &sw, NULL); | 1106 | #if CONFIG_KEYPAD == ONDIO_PAD |
1027 | rb->lcd_putsxy(LCD_WIDTH/2-sw/2, STRINGPOS_navi, "Press NAVI to continue"); | 1107 | rb->snprintf(s, sizeof(s), "MENU To Continue"); |
1108 | #elif CONFIG_KEYPAD == IRIVER_H300_PAD | ||
1109 | rb->snprintf(s, sizeof(s), "Press NAVI To Continue"); | ||
1110 | #else | ||
1111 | rb->snprintf(s, sizeof(s), "Press SELECT To Continue"); | ||
1112 | #endif | ||
1113 | rb->lcd_getstringsize(s, &sw, NULL); | ||
1114 | rb->lcd_putsxy(LCD_WIDTH/2-sw/2, STRINGPOS_navi, s); | ||
1115 | |||
1028 | sec_count=*rb->current_tick+HZ; | 1116 | sec_count=*rb->current_tick+HZ; |
1029 | } | 1117 | } |
1030 | 1118 | ||
@@ -1052,8 +1140,8 @@ int game_loop(void){ | |||
1052 | brick[i*10+j].powertop+=2; | 1140 | brick[i*10+j].powertop+=2; |
1053 | rb->lcd_bitmap_part(brickmania_powerups,0, | 1141 | rb->lcd_bitmap_part(brickmania_powerups,0, |
1054 | BMPHEIGHT_powerup*brick[i*10+j].power, | 1142 | BMPHEIGHT_powerup*brick[i*10+j].power, |
1055 | BMPWIDTH_powerup,LEFTMARGIN+j*BRICK_WIDTH+5, | 1143 | BMPWIDTH_powerup,LEFTMARGIN+j*BRICK_WIDTH+(BRICK_WIDTH/2-BMPWIDTH_powerup/2), |
1056 | brick[i*10+j].powertop, 10, 6); | 1144 | brick[i*10+j].powertop, BMPWIDTH_powerup, BMPHEIGHT_powerup); |
1057 | } | 1145 | } |
1058 | } | 1146 | } |
1059 | 1147 | ||
@@ -1140,19 +1228,19 @@ int game_loop(void){ | |||
1140 | for(k=0;k<used_balls;k++) { | 1228 | for(k=0;k<used_balls;k++) { |
1141 | if (ball[k].pos_y <100) { | 1229 | if (ball[k].pos_y <100) { |
1142 | if (brick[i*10+j].used==1) { | 1230 | if (brick[i*10+j].used==1) { |
1143 | if ((ball[k].pos_x+ball[k].x+3 >= brickx && ball[k].pos_x+ball[k].x+3 <= brickx+BRICK_WIDTH) && ((bricky-4<ball[k].pos_y+BALL && bricky>ball[k].pos_y+BALL) || (bricky+4>ball[k].pos_y+BALL+BALL && bricky<ball[k].pos_y+BALL+BALL)) && (ball[k].y >0)){ | 1231 | if ((ball[k].pos_x+ball[k].x+HALFBALL >= brickx && ball[k].pos_x+ball[k].x+HALFBALL <= brickx+BRICK_WIDTH) && ((bricky-4<ball[k].pos_y+BALL && bricky>ball[k].pos_y+BALL) || (bricky+4>ball[k].pos_y+BALL+BALL && bricky<ball[k].pos_y+BALL+BALL)) && (ball[k].y >0)){ |
1144 | ball[k].tempy=bricky-ball[k].pos_y-BALL; | 1232 | ball[k].tempy=bricky-ball[k].pos_y-BALL; |
1145 | } else if ((ball[k].pos_x+ball[k].x+3 >= brickx && ball[k].pos_x+ball[k].x+3 <= brickx+BRICK_WIDTH) && ((bricky+BRICK_HEIGHT+4>ball[k].pos_y && bricky+BRICK_HEIGHT<ball[k].pos_y) || (bricky+BRICK_HEIGHT-4<ball[k].pos_y-BALL && bricky+BRICK_HEIGHT>ball[k].pos_y-BALL)) && (ball[k].y <0)){ | 1233 | } else if ((ball[k].pos_x+ball[k].x+HALFBALL >= brickx && ball[k].pos_x+ball[k].x+HALFBALL <= brickx+BRICK_WIDTH) && ((bricky+BRICK_HEIGHT+4>ball[k].pos_y && bricky+BRICK_HEIGHT<ball[k].pos_y) || (bricky+BRICK_HEIGHT-4<ball[k].pos_y-BALL && bricky+BRICK_HEIGHT>ball[k].pos_y-BALL)) && (ball[k].y <0)){ |
1146 | ball[k].tempy=-(ball[k].pos_y-(bricky+BRICK_HEIGHT)); | 1234 | ball[k].tempy=-(ball[k].pos_y-(bricky+BRICK_HEIGHT)); |
1147 | } | 1235 | } |
1148 | 1236 | ||
1149 | if ((ball[k].pos_y+3 >= bricky && ball[k].pos_y+3 <= bricky+BRICK_HEIGHT) && ((brickx-4<ball[k].pos_x+BALL && brickx>ball[k].pos_x+BALL) || (brickx+4>ball[k].pos_x+BALL+BALL && brickx<ball[k].pos_x+BALL+BALL)) && (ball[k].x >0)) { | 1237 | if ((ball[k].pos_y+HALFBALL >= bricky && ball[k].pos_y+HALFBALL <= bricky+BRICK_HEIGHT) && ((brickx-4<ball[k].pos_x+BALL && brickx>ball[k].pos_x+BALL) || (brickx+4>ball[k].pos_x+BALL+BALL && brickx<ball[k].pos_x+BALL+BALL)) && (ball[k].x >0)) { |
1150 | ball[k].tempx=brickx-ball[k].pos_x-BALL; | 1238 | ball[k].tempx=brickx-ball[k].pos_x-BALL; |
1151 | } else if ((ball[k].pos_y+ball[k].y+3 >= bricky && ball[k].pos_y+ball[k].y+3 <= bricky+BRICK_HEIGHT) && ((brickx+BRICK_WIDTH+4>ball[k].pos_x && brickx+BRICK_WIDTH<ball[k].pos_x) || (brickx+BRICK_WIDTH-4<ball[k].pos_x-BALL && brickx+BRICK_WIDTH>ball[k].pos_x-BALL)) && (ball[k].x <0)) { | 1239 | } else if ((ball[k].pos_y+ball[k].y+HALFBALL >= bricky && ball[k].pos_y+ball[k].y+HALFBALL <= bricky+BRICK_HEIGHT) && ((brickx+BRICK_WIDTH+4>ball[k].pos_x && brickx+BRICK_WIDTH<ball[k].pos_x) || (brickx+BRICK_WIDTH-4<ball[k].pos_x-BALL && brickx+BRICK_WIDTH>ball[k].pos_x-BALL)) && (ball[k].x <0)) { |
1152 | ball[k].tempx=-(ball[k].pos_x-(brickx+BRICK_WIDTH)); | 1240 | ball[k].tempx=-(ball[k].pos_x-(brickx+BRICK_WIDTH)); |
1153 | } | 1241 | } |
1154 | 1242 | ||
1155 | if ((ball[k].pos_x+3 >= brickx && ball[k].pos_x+3 <= brickx+BRICK_WIDTH) && ((bricky+BRICK_HEIGHT==ball[k].pos_y) || (bricky+BRICK_HEIGHT-6<=ball[k].pos_y && bricky+BRICK_HEIGHT>ball[k].pos_y)) && (ball[k].y <0)) { /* bottom line */ | 1243 | if ((ball[k].pos_x+HALFBALL >= brickx && ball[k].pos_x+HALFBALL <= brickx+BRICK_WIDTH) && ((bricky+BRICK_HEIGHT==ball[k].pos_y) || (bricky+BRICK_HEIGHT-6<=ball[k].pos_y && bricky+BRICK_HEIGHT>ball[k].pos_y)) && (ball[k].y <0)) { /* bottom line */ |
1156 | if (brick[i*10+j].hits > 0){ | 1244 | if (brick[i*10+j].hits > 0){ |
1157 | brick[i*10+j].hits--; | 1245 | brick[i*10+j].hits--; |
1158 | brick[i*10+j].hiteffect++; | 1246 | brick[i*10+j].hiteffect++; |
@@ -1165,7 +1253,7 @@ int game_loop(void){ | |||
1165 | } | 1253 | } |
1166 | 1254 | ||
1167 | ball[k].y = ball[k].y*-1; | 1255 | ball[k].y = ball[k].y*-1; |
1168 | } else if ((ball[k].pos_x+3 >= brickx && ball[k].pos_x+3 <= brickx+BRICK_WIDTH) && ((bricky==ball[k].pos_y+BALL) || (bricky+6>=ball[k].pos_y+BALL && bricky<ball[k].pos_y+BALL)) && (ball[k].y >0)) { /* top line */ | 1256 | } else if ((ball[k].pos_x+HALFBALL >= brickx && ball[k].pos_x+HALFBALL <= brickx+BRICK_WIDTH) && ((bricky==ball[k].pos_y+BALL) || (bricky+6>=ball[k].pos_y+BALL && bricky<ball[k].pos_y+BALL)) && (ball[k].y >0)) { /* top line */ |
1169 | if (brick[i*10+j].hits > 0){ | 1257 | if (brick[i*10+j].hits > 0){ |
1170 | brick[i*10+j].hits--; | 1258 | brick[i*10+j].hits--; |
1171 | brick[i*10+j].hiteffect++; | 1259 | brick[i*10+j].hiteffect++; |
@@ -1180,7 +1268,7 @@ int game_loop(void){ | |||
1180 | ball[k].y = ball[k].y*-1; | 1268 | ball[k].y = ball[k].y*-1; |
1181 | } | 1269 | } |
1182 | 1270 | ||
1183 | if ((ball[k].pos_y+3 >= bricky && ball[k].pos_y+3 <= bricky+BRICK_HEIGHT) && ((brickx==ball[k].pos_x+BALL) || (brickx+6>=ball[k].pos_x+BALL && brickx<ball[k].pos_x+BALL)) && (ball[k].x > 0)) { /* left line */ | 1271 | if ((ball[k].pos_y+HALFBALL >= bricky && ball[k].pos_y+HALFBALL <= bricky+BRICK_HEIGHT) && ((brickx==ball[k].pos_x+BALL) || (brickx+6>=ball[k].pos_x+BALL && brickx<ball[k].pos_x+BALL)) && (ball[k].x > 0)) { /* left line */ |
1184 | if (brick[i*10+j].hits > 0){ | 1272 | if (brick[i*10+j].hits > 0){ |
1185 | brick[i*10+j].hits--; | 1273 | brick[i*10+j].hits--; |
1186 | brick[i*10+j].hiteffect++; | 1274 | brick[i*10+j].hiteffect++; |
@@ -1193,7 +1281,7 @@ int game_loop(void){ | |||
1193 | } | 1281 | } |
1194 | ball[k].x = ball[k].x*-1; | 1282 | ball[k].x = ball[k].x*-1; |
1195 | 1283 | ||
1196 | } else if ((ball[k].pos_y+3 >= bricky && ball[k].pos_y+3 <= bricky+BRICK_HEIGHT) && ((brickx+BRICK_WIDTH==ball[k].pos_x) || (brickx+BRICK_WIDTH-6<=ball[k].pos_x && brickx+BRICK_WIDTH>ball[k].pos_x)) && (ball[k].x < 0)) { /* Right line */ | 1284 | } else if ((ball[k].pos_y+HALFBALL >= bricky && ball[k].pos_y+HALFBALL <= bricky+BRICK_HEIGHT) && ((brickx+BRICK_WIDTH==ball[k].pos_x) || (brickx+BRICK_WIDTH-6<=ball[k].pos_x && brickx+BRICK_WIDTH>ball[k].pos_x)) && (ball[k].x < 0)) { /* Right line */ |
1197 | if (brick[i*10+j].hits > 0){ | 1285 | if (brick[i*10+j].hits > 0){ |
1198 | brick[i*10+j].hits--; | 1286 | brick[i*10+j].hits--; |
1199 | brick[i*10+j].hiteffect++; | 1287 | brick[i*10+j].hiteffect++; |
@@ -1274,28 +1362,28 @@ int game_loop(void){ | |||
1274 | if ((ball[k].pos_y+BALL >= PAD_POS_Y && (ball[k].pos_x >= pad_pos_x && ball[k].pos_x <= pad_pos_x+PAD_WIDTH)) && | 1362 | if ((ball[k].pos_y+BALL >= PAD_POS_Y && (ball[k].pos_x >= pad_pos_x && ball[k].pos_x <= pad_pos_x+PAD_WIDTH)) && |
1275 | start_game != 1 && !ball[k].glue) { | 1363 | start_game != 1 && !ball[k].glue) { |
1276 | 1364 | ||
1277 | if ((ball[k].pos_x+3 >= pad_pos_x && ball[k].pos_x+3 <= pad_pos_x+(PAD_WIDTH/2/4)) || | 1365 | if ((ball[k].pos_x+HALFBALL >= pad_pos_x && ball[k].pos_x+HALFBALL <= pad_pos_x+(PAD_WIDTH/2/4)) || |
1278 | (ball[k].pos_x +3>= pad_pos_x+(PAD_WIDTH-(PAD_WIDTH/2/4)) && ball[k].pos_x+3 <= pad_pos_x+PAD_WIDTH)) { | 1366 | (ball[k].pos_x +HALFBALL>= pad_pos_x+(PAD_WIDTH-(PAD_WIDTH/2/4)) && ball[k].pos_x+HALFBALL <= pad_pos_x+PAD_WIDTH)) { |
1279 | 1367 | ||
1280 | ball[k].y = -2; | 1368 | ball[k].y = -2; |
1281 | if (ball[k].pos_x != 0 && ball[k].pos_x+BALL!=LCD_WIDTH) | 1369 | if (ball[k].pos_x != 0 && ball[k].pos_x+BALL!=LCD_WIDTH) |
1282 | ball[k].x = pad_check(6,0,ball[k].pos_x+2<=pad_pos_x+(PAD_WIDTH/2)?0:1,k); | 1370 | ball[k].x = pad_check(6,0,ball[k].pos_x+2<=pad_pos_x+(PAD_WIDTH/2)?0:1,k); |
1283 | 1371 | ||
1284 | } else if ((ball[k].pos_x+3 >= pad_pos_x+(PAD_WIDTH/2/4) && ball[k].pos_x+3 <= pad_pos_x+2*(PAD_WIDTH/2/4)) || | 1372 | } else if ((ball[k].pos_x+HALFBALL >= pad_pos_x+(PAD_WIDTH/2/4) && ball[k].pos_x+HALFBALL <= pad_pos_x+2*(PAD_WIDTH/2/4)) || |
1285 | (ball[k].pos_x+3 >= pad_pos_x+(PAD_WIDTH-2*(PAD_WIDTH/2/4)) && ball[k].pos_x+3 <= pad_pos_x+(PAD_WIDTH-(PAD_WIDTH/2/4)) )) { | 1373 | (ball[k].pos_x+HALFBALL >= pad_pos_x+(PAD_WIDTH-2*(PAD_WIDTH/2/4)) && ball[k].pos_x+HALFBALL <= pad_pos_x+(PAD_WIDTH-(PAD_WIDTH/2/4)) )) { |
1286 | 1374 | ||
1287 | ball[k].y = -3; | 1375 | ball[k].y = -3; |
1288 | if (ball[k].pos_x != 0 && ball[k].pos_x+BALL!=LCD_WIDTH) | 1376 | if (ball[k].pos_x != 0 && ball[k].pos_x+BALL!=LCD_WIDTH) |
1289 | ball[k].x = pad_check(4,0,ball[k].pos_x+2<=pad_pos_x+(PAD_WIDTH/2)?0:1,k); | 1377 | ball[k].x = pad_check(4,0,ball[k].pos_x+2<=pad_pos_x+(PAD_WIDTH/2)?0:1,k); |
1290 | 1378 | ||
1291 | } else if ((ball[k].pos_x+3 >= pad_pos_x+2*(PAD_WIDTH/2/4) && ball[k].pos_x+3 <= pad_pos_x+3*(PAD_WIDTH/2/4)) || | 1379 | } else if ((ball[k].pos_x+HALFBALL >= pad_pos_x+2*(PAD_WIDTH/2/4) && ball[k].pos_x+HALFBALL <= pad_pos_x+3*(PAD_WIDTH/2/4)) || |
1292 | (ball[k].pos_x+2 >= pad_pos_x+(PAD_WIDTH-3*(PAD_WIDTH/2/4)) && ball[k].pos_x+2 <= pad_pos_x+ ((PAD_WIDTH/2)-2*(PAD_WIDTH/2/4)) )) { | 1380 | (ball[k].pos_x+2 >= pad_pos_x+(PAD_WIDTH-3*(PAD_WIDTH/2/4)) && ball[k].pos_x+2 <= pad_pos_x+ ((PAD_WIDTH/2)-2*(PAD_WIDTH/2/4)) )) { |
1293 | 1381 | ||
1294 | ball[k].y = -4; | 1382 | ball[k].y = -4; |
1295 | if (ball[k].pos_x != 0 && ball[k].pos_x+BALL!=LCD_WIDTH) | 1383 | if (ball[k].pos_x != 0 && ball[k].pos_x+BALL!=LCD_WIDTH) |
1296 | ball[k].x = pad_check(3,0,ball[k].pos_x+2<=pad_pos_x+(PAD_WIDTH/2)?0:1,k); | 1384 | ball[k].x = pad_check(3,0,ball[k].pos_x+2<=pad_pos_x+(PAD_WIDTH/2)?0:1,k); |
1297 | 1385 | ||
1298 | } else if ((ball[k].pos_x+3 >= pad_pos_x+3*(PAD_WIDTH/2/4) && ball[k].pos_x+3 <= pad_pos_x+4*(PAD_WIDTH/2/4)-2) || | 1386 | } else if ((ball[k].pos_x+HALFBALL >= pad_pos_x+3*(PAD_WIDTH/2/4) && ball[k].pos_x+HALFBALL <= pad_pos_x+4*(PAD_WIDTH/2/4)-2) || |
1299 | (ball[k].pos_x+2 >= pad_pos_x+(PAD_WIDTH/2+2) && ball[k].pos_x+2 <= pad_pos_x+(PAD_WIDTH-3*(PAD_WIDTH/2/4)) )) { | 1387 | (ball[k].pos_x+2 >= pad_pos_x+(PAD_WIDTH/2+2) && ball[k].pos_x+2 <= pad_pos_x+(PAD_WIDTH-3*(PAD_WIDTH/2/4)) )) { |
1300 | 1388 | ||
1301 | ball[k].y = -4; | 1389 | ball[k].y = -4; |
@@ -1334,8 +1422,13 @@ int game_loop(void){ | |||
1334 | } else { | 1422 | } else { |
1335 | rb->lcd_getstringsize("Congratulations!", &sw, NULL); | 1423 | rb->lcd_getstringsize("Congratulations!", &sw, NULL); |
1336 | rb->lcd_putsxy(LCD_WIDTH/2-sw/2, STRINGPOS_congrats, "Congratulations!"); | 1424 | rb->lcd_putsxy(LCD_WIDTH/2-sw/2, STRINGPOS_congrats, "Congratulations!"); |
1425 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) | ||
1426 | rb->lcd_getstringsize("No more levels", &sw, NULL); | ||
1427 | rb->lcd_putsxy(LCD_WIDTH/2-sw/2, STRINGPOS_finsh, "No more levels"); | ||
1428 | #else | ||
1337 | rb->lcd_getstringsize("You have finished the game!", &sw, NULL); | 1429 | rb->lcd_getstringsize("You have finished the game!", &sw, NULL); |
1338 | rb->lcd_putsxy(LCD_WIDTH/2-sw/2, STRINGPOS_finsh, "You have finished the game!"); | 1430 | rb->lcd_putsxy(LCD_WIDTH/2-sw/2, STRINGPOS_finsh, "You have finished the game!"); |
1431 | #endif | ||
1339 | vscore=score; | 1432 | vscore=score; |
1340 | rb->lcd_update(); | 1433 | rb->lcd_update(); |
1341 | if (score>highscore) { | 1434 | if (score>highscore) { |
@@ -1401,6 +1494,7 @@ int game_loop(void){ | |||
1401 | 1494 | ||
1402 | 1495 | ||
1403 | switch(button) { | 1496 | switch(button) { |
1497 | case UP: | ||
1404 | case SELECT: | 1498 | case SELECT: |
1405 | if (start_game==1 && con_game!=1 && pad_type!=1) { | 1499 | if (start_game==1 && con_game!=1 && pad_type!=1) { |
1406 | for(k=0;k<used_balls;k++){ | 1500 | for(k=0;k<used_balls;k++){ |
@@ -1473,8 +1567,12 @@ int game_loop(void){ | |||
1473 | break; | 1567 | break; |
1474 | } | 1568 | } |
1475 | } else { | 1569 | } else { |
1570 | #if (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) | ||
1571 | rb->splash(HZ*2,true,"Game Over"); | ||
1572 | #else | ||
1476 | rb->lcd_bitmap(brickmania_gameover,LCD_WIDTH/2-55,LCD_HEIGHT-87,110,52); | 1573 | rb->lcd_bitmap(brickmania_gameover,LCD_WIDTH/2-55,LCD_HEIGHT-87,110,52); |
1477 | rb->lcd_update(); | 1574 | rb->lcd_update(); |
1575 | #endif | ||
1478 | if (score>highscore) { | 1576 | if (score>highscore) { |
1479 | sleep(2); | 1577 | sleep(2); |
1480 | highscore=score; | 1578 | highscore=score; |