diff options
author | Antoine Cellerier <dionoea@videolan.org> | 2007-06-05 21:49:51 +0000 |
---|---|---|
committer | Antoine Cellerier <dionoea@videolan.org> | 2007-06-05 21:49:51 +0000 |
commit | cdc295dcae2edd0f79047948070af0c60697515f (patch) | |
tree | 467e694939350f381f4c4c5ea509af6b02957b41 /apps | |
parent | 89fee25454ee2afaca3b50300349603a95864da0 (diff) | |
download | rockbox-cdc295dcae2edd0f79047948070af0c60697515f.tar.gz rockbox-cdc295dcae2edd0f79047948070af0c60697515f.zip |
Add recorder and ondio support to Xobox.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13566 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/SOURCES | 2 | ||||
-rw-r--r-- | apps/plugins/xobox.c | 112 |
2 files changed, 90 insertions, 24 deletions
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES index 11e425fc1e..4da5d86301 100644 --- a/apps/plugins/SOURCES +++ b/apps/plugins/SOURCES | |||
@@ -97,8 +97,8 @@ rockboy.c | |||
97 | /* not support recorder models for now */ | 97 | /* not support recorder models for now */ |
98 | #if (LCD_WIDTH > 112) && (LCD_HEIGHT > 64) | 98 | #if (LCD_WIDTH > 112) && (LCD_HEIGHT > 64) |
99 | fireworks.c | 99 | fireworks.c |
100 | xobox.c | ||
101 | #endif | 100 | #endif |
101 | xobox.c | ||
102 | spacerocks.c | 102 | spacerocks.c |
103 | #if LCD_DEPTH >= 16 | 103 | #if LCD_DEPTH >= 16 |
104 | rockpaint.c | 104 | rockpaint.c |
diff --git a/apps/plugins/xobox.c b/apps/plugins/xobox.c index 08665abbf2..5ceb326892 100644 --- a/apps/plugins/xobox.c +++ b/apps/plugins/xobox.c | |||
@@ -30,7 +30,6 @@ PLUGIN_HEADER | |||
30 | #define PAUSE BUTTON_MODE | 30 | #define PAUSE BUTTON_MODE |
31 | #define UP BUTTON_UP | 31 | #define UP BUTTON_UP |
32 | #define DOWN BUTTON_DOWN | 32 | #define DOWN BUTTON_DOWN |
33 | #define SELECT BUTTON_SELECT | ||
34 | 33 | ||
35 | #define RC_QUIT BUTTON_RC_STOP | 34 | #define RC_QUIT BUTTON_RC_STOP |
36 | 35 | ||
@@ -42,7 +41,6 @@ PLUGIN_HEADER | |||
42 | #define PAUSE BUTTON_ON | 41 | #define PAUSE BUTTON_ON |
43 | #define UP BUTTON_UP | 42 | #define UP BUTTON_UP |
44 | #define DOWN BUTTON_DOWN | 43 | #define DOWN BUTTON_DOWN |
45 | #define SELECT BUTTON_SELECT | ||
46 | 44 | ||
47 | #elif (CONFIG_KEYPAD == IPOD_3G_PAD) || \ | 45 | #elif (CONFIG_KEYPAD == IPOD_3G_PAD) || \ |
48 | (CONFIG_KEYPAD == IPOD_4G_PAD) | 46 | (CONFIG_KEYPAD == IPOD_4G_PAD) |
@@ -51,7 +49,6 @@ PLUGIN_HEADER | |||
51 | #define LEFT BUTTON_LEFT | 49 | #define LEFT BUTTON_LEFT |
52 | #define RIGHT BUTTON_RIGHT | 50 | #define RIGHT BUTTON_RIGHT |
53 | #define PAUSE BUTTON_SELECT | 51 | #define PAUSE BUTTON_SELECT |
54 | #define SELECT BUTTON_SELECT | ||
55 | #define MENU_UP BUTTON_SCROLL_FWD | 52 | #define MENU_UP BUTTON_SCROLL_FWD |
56 | #define MENU_DOWN BUTTON_SCROLL_BACK | 53 | #define MENU_DOWN BUTTON_SCROLL_BACK |
57 | #define UP BUTTON_MENU | 54 | #define UP BUTTON_MENU |
@@ -62,7 +59,6 @@ PLUGIN_HEADER | |||
62 | #define QUIT BUTTON_POWER | 59 | #define QUIT BUTTON_POWER |
63 | #define LEFT BUTTON_LEFT | 60 | #define LEFT BUTTON_LEFT |
64 | #define RIGHT BUTTON_RIGHT | 61 | #define RIGHT BUTTON_RIGHT |
65 | #define SELECT BUTTON_SELECT | ||
66 | #define UP BUTTON_UP | 62 | #define UP BUTTON_UP |
67 | #define DOWN BUTTON_DOWN | 63 | #define DOWN BUTTON_DOWN |
68 | #define PAUSE BUTTON_PLAY | 64 | #define PAUSE BUTTON_PLAY |
@@ -72,7 +68,6 @@ PLUGIN_HEADER | |||
72 | #define QUIT BUTTON_POWER | 68 | #define QUIT BUTTON_POWER |
73 | #define LEFT BUTTON_LEFT | 69 | #define LEFT BUTTON_LEFT |
74 | #define RIGHT BUTTON_RIGHT | 70 | #define RIGHT BUTTON_RIGHT |
75 | #define SELECT BUTTON_SELECT | ||
76 | #define UP BUTTON_UP | 71 | #define UP BUTTON_UP |
77 | #define DOWN BUTTON_DOWN | 72 | #define DOWN BUTTON_DOWN |
78 | #define PAUSE BUTTON_A | 73 | #define PAUSE BUTTON_A |
@@ -82,7 +77,6 @@ PLUGIN_HEADER | |||
82 | #define QUIT BUTTON_POWER | 77 | #define QUIT BUTTON_POWER |
83 | #define LEFT BUTTON_LEFT | 78 | #define LEFT BUTTON_LEFT |
84 | #define RIGHT BUTTON_RIGHT | 79 | #define RIGHT BUTTON_RIGHT |
85 | #define SELECT BUTTON_SELECT | ||
86 | #define UP BUTTON_UP | 80 | #define UP BUTTON_UP |
87 | #define DOWN BUTTON_DOWN | 81 | #define DOWN BUTTON_DOWN |
88 | #define PAUSE BUTTON_REC | 82 | #define PAUSE BUTTON_REC |
@@ -93,11 +87,28 @@ PLUGIN_HEADER | |||
93 | #define QUIT BUTTON_POWER | 87 | #define QUIT BUTTON_POWER |
94 | #define LEFT BUTTON_LEFT | 88 | #define LEFT BUTTON_LEFT |
95 | #define RIGHT BUTTON_RIGHT | 89 | #define RIGHT BUTTON_RIGHT |
96 | #define SELECT BUTTON_REW | ||
97 | #define UP BUTTON_SCROLL_UP | 90 | #define UP BUTTON_SCROLL_UP |
98 | #define DOWN BUTTON_SCROLL_DOWN | 91 | #define DOWN BUTTON_SCROLL_DOWN |
99 | #define PAUSE BUTTON_PLAY | 92 | #define PAUSE BUTTON_PLAY |
100 | 93 | ||
94 | #elif CONFIG_KEYPAD == RECORDER_PAD | ||
95 | |||
96 | #define QUIT BUTTON_OFF | ||
97 | #define LEFT BUTTON_LEFT | ||
98 | #define RIGHT BUTTON_RIGHT | ||
99 | #define DOWN BUTTON_DOWN | ||
100 | #define UP BUTTON_UP | ||
101 | #define PAUSE BUTTON_PLAY | ||
102 | |||
103 | #elif CONFIG_KEYPAD == ONDIO_PAD | ||
104 | |||
105 | #define QUIT BUTTON_OFF | ||
106 | #define LEFT BUTTON_LEFT | ||
107 | #define RIGHT BUTTON_RIGHT | ||
108 | #define DOWN BUTTON_DOWN | ||
109 | #define UP BUTTON_UP | ||
110 | #define PAUSE BUTTON_MENU | ||
111 | |||
101 | #else | 112 | #else |
102 | #error Unsupported keypad | 113 | #error Unsupported keypad |
103 | #endif | 114 | #endif |
@@ -138,7 +149,14 @@ PLUGIN_HEADER | |||
138 | #define MOVE_UL ( DIR_U | DIR_L ) | 149 | #define MOVE_UL ( DIR_U | DIR_L ) |
139 | #define MOVE_UUL ( DIR_UU | DIR_L ) | 150 | #define MOVE_UUL ( DIR_UU | DIR_L ) |
140 | 151 | ||
141 | #define CUBE_SIZE 8 /* 8x22=176 */ | 152 | #if (LCD_WIDTH>112) && (LCD_HEIGHT>64) |
153 | # define CUBE_SIZE 8 /* 8x22=176 */ | ||
154 | # define pos(a) ((a)>>3) | ||
155 | #else | ||
156 | # define CUBE_SIZE 4 | ||
157 | # define pos(a) ((a)>>2) | ||
158 | #endif | ||
159 | |||
142 | #define STARTING_QIXES 2 | 160 | #define STARTING_QIXES 2 |
143 | #define MAX_LEVEL 10 | 161 | #define MAX_LEVEL 10 |
144 | #define MAX_QIXES MAX_LEVEL+STARTING_QIXES | 162 | #define MAX_QIXES MAX_LEVEL+STARTING_QIXES |
@@ -151,16 +169,23 @@ PLUGIN_HEADER | |||
151 | #define CLR_RED LCD_RGBPACK(255,0,0) /* used to imply danger */ | 169 | #define CLR_RED LCD_RGBPACK(255,0,0) /* used to imply danger */ |
152 | #define CLR_LTBLUE LCD_RGBPACK(125, 145, 180) /* used for frame and filling */ | 170 | #define CLR_LTBLUE LCD_RGBPACK(125, 145, 180) /* used for frame and filling */ |
153 | #define PLR_COL LCD_WHITE /* color used for the player */ | 171 | #define PLR_COL LCD_WHITE /* color used for the player */ |
154 | #else | 172 | #elif LCD_DEPTH>=2 |
155 | #define CLR_RED LCD_DARKGRAY /* used to imply danger */ | 173 | #define CLR_RED LCD_DARKGRAY /* used to imply danger */ |
156 | #define CLR_LTBLUE LCD_LIGHTGRAY /* used for frame and filling */ | 174 | #define CLR_LTBLUE LCD_LIGHTGRAY /* used for frame and filling */ |
157 | #define PLR_COL LCD_BLACK /* color used for the player */ | 175 | #define PLR_COL LCD_BLACK /* color used for the player */ |
158 | #endif | 176 | #endif |
159 | 177 | ||
178 | #if LCD_DEPTH>=2 | ||
160 | #define EMPTIED LCD_BLACK /* empty spot */ | 179 | #define EMPTIED LCD_BLACK /* empty spot */ |
161 | #define FILLED CLR_LTBLUE /* filled spot */ | 180 | #define FILLED CLR_LTBLUE /* filled spot */ |
162 | #define TRAIL CLR_RED /* the red trail of the player */ | 181 | #define TRAIL CLR_RED /* the red trail of the player */ |
163 | #define QIX LCD_WHITE | 182 | #define QIX LCD_WHITE |
183 | #else | ||
184 | #define EMPTIED 0 | ||
185 | #define FILLED 1 | ||
186 | #define TRAIL 2 | ||
187 | #define QIX 3 | ||
188 | #endif | ||
164 | #define UNCHECKED 0 | 189 | #define UNCHECKED 0 |
165 | #define CHECKED 1 | 190 | #define CHECKED 1 |
166 | #define PAINTED -1 | 191 | #define PAINTED -1 |
@@ -184,6 +209,7 @@ static bool quit = false; | |||
184 | static unsigned int board[BOARD_H][BOARD_W]; | 209 | static unsigned int board[BOARD_H][BOARD_W]; |
185 | static int testboard[BOARD_H][BOARD_W]; | 210 | static int testboard[BOARD_H][BOARD_W]; |
186 | 211 | ||
212 | #if CUBE_SIZE == 8 | ||
187 | /* | 213 | /* |
188 | 00011000 0x18 - 11100111 0xe7 | 214 | 00011000 0x18 - 11100111 0xe7 |
189 | 00111100 0x3c - 11100111 0xe7 | 215 | 00111100 0x3c - 11100111 0xe7 |
@@ -198,6 +224,20 @@ const unsigned char pics[2][8] = { | |||
198 | {0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x3c, 0x18}, /* Alien (QIX) */ | 224 | {0x18, 0x3c, 0x7e, 0xff, 0xff, 0x7e, 0x3c, 0x18}, /* Alien (QIX) */ |
199 | {0xe7, 0xe7, 0xc3, 0x00, 0x00, 0xc3, 0xe7, 0xe7} /* Player (XONIX) */ | 225 | {0xe7, 0xe7, 0xc3, 0x00, 0x00, 0xc3, 0xe7, 0xe7} /* Player (XONIX) */ |
200 | }; | 226 | }; |
227 | #elif CUBE_SIZE == 4 | ||
228 | /* | ||
229 | 01100000 0x18 - 10010000 0xe7 | ||
230 | 11110100 0x3c - 01100000 0xe7 | ||
231 | 11110000 0x7e - 01100000 0xc3 | ||
232 | 01100000 0xff - 10010000 0x00 | ||
233 | */ | ||
234 | const unsigned char pics[2][4] = { | ||
235 | {0x60, 0xf0, 0xf0, 0x60}, /* Alien (QIX) */ | ||
236 | {0x90, 0x60, 0x60, 0x90} /* Player (XONIX) */ | ||
237 | }; | ||
238 | #else | ||
239 | #error Incorrect CUBE_SIZE value. | ||
240 | #endif | ||
201 | 241 | ||
202 | static struct qix | 242 | static struct qix |
203 | { | 243 | { |
@@ -226,13 +266,6 @@ static struct pos | |||
226 | } stack[STACK_SIZE]; | 266 | } stack[STACK_SIZE]; |
227 | static int stackPointer; | 267 | static int stackPointer; |
228 | 268 | ||
229 | #define div(a,b) (((a)/(b))) | ||
230 | #if CUBE_SIZE == 8 | ||
231 | # define pos(a) ((a)>>3) | ||
232 | #else | ||
233 | # define pos(a) div((a),CUBE_SIZE) | ||
234 | #endif | ||
235 | |||
236 | static inline bool pop (struct pos *p) | 269 | static inline bool pop (struct pos *p) |
237 | { | 270 | { |
238 | if (stackPointer > 0) { | 271 | if (stackPointer > 0) { |
@@ -368,7 +401,11 @@ static void refresh_board (void) | |||
368 | int i, j; | 401 | int i, j; |
369 | char str[25]; | 402 | char str[25]; |
370 | 403 | ||
404 | #if LCD_DEPTH>=2 | ||
371 | rb->lcd_set_background (LCD_BLACK); | 405 | rb->lcd_set_background (LCD_BLACK); |
406 | #else | ||
407 | rb->lcd_clear_display (); | ||
408 | #endif | ||
372 | for (j = 0; j < BOARD_H; j++) | 409 | for (j = 0; j < BOARD_H; j++) |
373 | { | 410 | { |
374 | unsigned last_color = board[j][0]; | 411 | unsigned last_color = board[j][0]; |
@@ -376,7 +413,11 @@ static void refresh_board (void) | |||
376 | for (i = 1; i < BOARD_W; i++) { | 413 | for (i = 1; i < BOARD_W; i++) { |
377 | if( last_color != board[j][i] ) | 414 | if( last_color != board[j][i] ) |
378 | { | 415 | { |
416 | #if LCD_DEPTH>=2 | ||
379 | rb->lcd_set_foreground (last_color); | 417 | rb->lcd_set_foreground (last_color); |
418 | #else | ||
419 | if (last_color != EMPTIED) | ||
420 | #endif | ||
380 | rb->lcd_fillrect (BOARD_X + CUBE_SIZE * (last_i), | 421 | rb->lcd_fillrect (BOARD_X + CUBE_SIZE * (last_i), |
381 | BOARD_Y + CUBE_SIZE * j, | 422 | BOARD_Y + CUBE_SIZE * j, |
382 | CUBE_SIZE * (i - last_i), CUBE_SIZE ); | 423 | CUBE_SIZE * (i - last_i), CUBE_SIZE ); |
@@ -384,14 +425,22 @@ static void refresh_board (void) | |||
384 | last_i = i; | 425 | last_i = i; |
385 | } | 426 | } |
386 | } | 427 | } |
428 | #if LCD_DEPTH>=2 | ||
387 | rb->lcd_set_foreground (last_color); | 429 | rb->lcd_set_foreground (last_color); |
430 | #else | ||
431 | if (last_color != EMPTIED) | ||
432 | #endif | ||
388 | rb->lcd_fillrect (BOARD_X + CUBE_SIZE * (last_i), | 433 | rb->lcd_fillrect (BOARD_X + CUBE_SIZE * (last_i), |
389 | BOARD_Y + CUBE_SIZE * j, | 434 | BOARD_Y + CUBE_SIZE * j, |
390 | CUBE_SIZE * (i - last_i), CUBE_SIZE); | 435 | CUBE_SIZE * (i - last_i), CUBE_SIZE); |
391 | } | 436 | } |
392 | 437 | ||
438 | #if LCD_DEPTH>=2 | ||
393 | rb->lcd_set_foreground (LCD_BLACK); | 439 | rb->lcd_set_foreground (LCD_BLACK); |
394 | rb->lcd_set_background (CLR_LTBLUE); | 440 | rb->lcd_set_background (CLR_LTBLUE); |
441 | #else | ||
442 | rb->lcd_set_drawmode (DRMODE_COMPLEMENT); | ||
443 | #endif | ||
395 | rb->snprintf (str, sizeof (str), "Level %d", player.level + 1); | 444 | rb->snprintf (str, sizeof (str), "Level %d", player.level + 1); |
396 | rb->lcd_putsxy (BOARD_X, BOARD_Y, str); | 445 | rb->lcd_putsxy (BOARD_X, BOARD_Y, str); |
397 | rb->snprintf (str, sizeof (str), "%d%%", percentage_cache); | 446 | rb->snprintf (str, sizeof (str), "%d%%", percentage_cache); |
@@ -399,22 +448,37 @@ static void refresh_board (void) | |||
399 | rb->snprintf (str, sizeof (str), "Score: %d", player.score); | 448 | rb->snprintf (str, sizeof (str), "Score: %d", player.score); |
400 | rb->lcd_putsxy (BOARD_X, BOARD_Y + CUBE_SIZE * BOARD_H - 8, str); | 449 | rb->lcd_putsxy (BOARD_X, BOARD_Y + CUBE_SIZE * BOARD_H - 8, str); |
401 | rb->snprintf (str, sizeof (str), "%d Lives", player.lives); | 450 | rb->snprintf (str, sizeof (str), "%d Lives", player.lives); |
451 | #if LCD_DEPTH>=2 | ||
402 | rb->lcd_putsxy (BOARD_X + CUBE_SIZE * BOARD_W - 60, | 452 | rb->lcd_putsxy (BOARD_X + CUBE_SIZE * BOARD_W - 60, |
403 | BOARD_Y + CUBE_SIZE * BOARD_H - 8, str); | 453 | BOARD_Y + CUBE_SIZE * BOARD_H - 8, str); |
454 | #else | ||
455 | rb->lcd_putsxy (BOARD_X + CUBE_SIZE * BOARD_W - 40, | ||
456 | BOARD_Y + CUBE_SIZE * BOARD_H - 8, str); | ||
457 | #endif | ||
404 | 458 | ||
459 | #if LCD_DEPTH>=2 | ||
405 | rb->lcd_set_foreground (PLR_COL); | 460 | rb->lcd_set_foreground (PLR_COL); |
406 | rb->lcd_set_background (board[player.j][player.i]); | 461 | rb->lcd_set_background (board[player.j][player.i]); |
462 | #else | ||
463 | rb->lcd_set_drawmode (DRMODE_SOLID); | ||
464 | #endif | ||
407 | rb->lcd_mono_bitmap (pics[PIC_PLAYER], player.i * CUBE_SIZE + BOARD_X, | 465 | rb->lcd_mono_bitmap (pics[PIC_PLAYER], player.i * CUBE_SIZE + BOARD_X, |
408 | player.j * CUBE_SIZE + BOARD_Y, CUBE_SIZE, CUBE_SIZE); | 466 | player.j * CUBE_SIZE + BOARD_Y, CUBE_SIZE, CUBE_SIZE); |
409 | 467 | ||
468 | #if LCD_DEPTH>=2 | ||
410 | rb->lcd_set_background (EMPTIED); | 469 | rb->lcd_set_background (EMPTIED); |
411 | rb->lcd_set_drawmode (DRMODE_FG); | ||
412 | rb->lcd_set_foreground (LCD_WHITE); | 470 | rb->lcd_set_foreground (LCD_WHITE); |
471 | rb->lcd_set_drawmode (DRMODE_FG); | ||
472 | #else | ||
473 | rb->lcd_set_drawmode (DRMODE_SOLID|DRMODE_INVERSEVID); | ||
474 | #endif | ||
413 | for (j = 0; j < player.level + STARTING_QIXES; j++) | 475 | for (j = 0; j < player.level + STARTING_QIXES; j++) |
414 | rb->lcd_mono_bitmap (pics[PIC_QIX], qixes[j].x + BOARD_X, | 476 | rb->lcd_mono_bitmap (pics[PIC_QIX], qixes[j].x + BOARD_X, |
415 | qixes[j].y + BOARD_Y, CUBE_SIZE, CUBE_SIZE); | 477 | qixes[j].y + BOARD_Y, CUBE_SIZE, CUBE_SIZE); |
416 | rb->lcd_set_drawmode (DRMODE_SOLID); | 478 | #if LCD_DEPTH>=2 |
417 | rb->lcd_set_foreground (LCD_BLACK); | 479 | rb->lcd_set_foreground (LCD_BLACK); |
480 | #endif | ||
481 | rb->lcd_set_drawmode (DRMODE_SOLID); | ||
418 | 482 | ||
419 | rb->lcd_update (); | 483 | rb->lcd_update (); |
420 | } | 484 | } |
@@ -608,7 +672,7 @@ static void die (void) | |||
608 | static inline bool line_check_lt (int newx, int newy) | 672 | static inline bool line_check_lt (int newx, int newy) |
609 | { | 673 | { |
610 | int i = 0; | 674 | int i = 0; |
611 | for (i = 3; i < CUBE_SIZE - 3; i++) { | 675 | for (i = ((CUBE_SIZE/2)-1); i < CUBE_SIZE - ((CUBE_SIZE/2)-1); i++) { |
612 | if (getpixel (newx, newy + i) != FILLED) | 676 | if (getpixel (newx, newy + i) != FILLED) |
613 | return false; | 677 | return false; |
614 | } | 678 | } |
@@ -617,7 +681,7 @@ static inline bool line_check_lt (int newx, int newy) | |||
617 | static inline bool line_check_rt (int newx, int newy) | 681 | static inline bool line_check_rt (int newx, int newy) |
618 | { | 682 | { |
619 | int i = 0; | 683 | int i = 0; |
620 | for (i = 3; i < CUBE_SIZE - 3; i++) { | 684 | for (i = ((CUBE_SIZE/2)-1); i < CUBE_SIZE - ((CUBE_SIZE/2)-1); i++) { |
621 | if (getpixel (newx + CUBE_SIZE - 1, newy + i) != FILLED) | 685 | if (getpixel (newx + CUBE_SIZE - 1, newy + i) != FILLED) |
622 | return false; | 686 | return false; |
623 | } | 687 | } |
@@ -626,7 +690,7 @@ static inline bool line_check_rt (int newx, int newy) | |||
626 | static inline bool line_check_up (int newx, int newy) | 690 | static inline bool line_check_up (int newx, int newy) |
627 | { | 691 | { |
628 | int i = 0; | 692 | int i = 0; |
629 | for (i = 3; i < CUBE_SIZE - 3; i++) { | 693 | for (i = ((CUBE_SIZE/2)-1); i < CUBE_SIZE - ((CUBE_SIZE/2)-1); i++) { |
630 | if (getpixel (newx + i, newy) != FILLED) | 694 | if (getpixel (newx + i, newy) != FILLED) |
631 | return false; | 695 | return false; |
632 | } | 696 | } |
@@ -635,7 +699,7 @@ static inline bool line_check_up (int newx, int newy) | |||
635 | static inline bool line_check_dn (int newx, int newy) | 699 | static inline bool line_check_dn (int newx, int newy) |
636 | { | 700 | { |
637 | int i = 0; | 701 | int i = 0; |
638 | for (i = 3; i < CUBE_SIZE - 3; i++) { | 702 | for (i = ((CUBE_SIZE/2)-1); i < CUBE_SIZE - ((CUBE_SIZE/2)-1); i++) { |
639 | if (getpixel (newx + i, newy + CUBE_SIZE - 1) != FILLED) | 703 | if (getpixel (newx + i, newy + CUBE_SIZE - 1) != FILLED) |
640 | return false; | 704 | return false; |
641 | } | 705 | } |
@@ -757,7 +821,7 @@ static int game_menu (void) | |||
757 | #ifdef HAVE_LCD_COLOR | 821 | #ifdef HAVE_LCD_COLOR |
758 | rb->lcd_set_foreground (rb->global_settings->fg_color); | 822 | rb->lcd_set_foreground (rb->global_settings->fg_color); |
759 | rb->lcd_set_background (rb->global_settings->bg_color); | 823 | rb->lcd_set_background (rb->global_settings->bg_color); |
760 | #else | 824 | #elif LCD_DEPTH>=2 |
761 | rb->lcd_set_foreground(LCD_BLACK); | 825 | rb->lcd_set_foreground(LCD_BLACK); |
762 | rb->lcd_set_background(LCD_WHITE); | 826 | rb->lcd_set_background(LCD_WHITE); |
763 | #endif | 827 | #endif |
@@ -877,7 +941,9 @@ enum plugin_status plugin_start (struct plugin_api *api, void *parameter) | |||
877 | rb = api; | 941 | rb = api; |
878 | 942 | ||
879 | rb->lcd_setfont (FONT_SYSFIXED); | 943 | rb->lcd_setfont (FONT_SYSFIXED); |
944 | #if LCD_DEPTH>=2 | ||
880 | rb->lcd_set_backdrop(NULL); | 945 | rb->lcd_set_backdrop(NULL); |
946 | #endif | ||
881 | 947 | ||
882 | /* Permanently enable the backlight (unless the user has turned it off) */ | 948 | /* Permanently enable the backlight (unless the user has turned it off) */ |
883 | if (rb->global_settings->backlight_timeout > 0) | 949 | if (rb->global_settings->backlight_timeout > 0) |