1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2002 Vicentini Martin
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
23 /* variable button definitions */
24 #if CONFIG_KEYPAD == RECORDER_PAD
25 #define FLIPIT_LEFT BUTTON_LEFT
26 #define FLIPIT_RIGHT BUTTON_RIGHT
27 #define FLIPIT_UP BUTTON_UP
28 #define FLIPIT_DOWN BUTTON_DOWN
29 #define FLIPIT_QUIT BUTTON_OFF
30 #define FLIPIT_SHUFFLE BUTTON_F1
31 #define FLIPIT_SOLVE BUTTON_F2
32 #define FLIPIT_STEP_BY_STEP BUTTON_F3
33 #define FLIPIT_TOGGLE BUTTON_PLAY
35 #elif CONFIG_KEYPAD == ARCHOS_AV300_PAD
36 #define FLIPIT_LEFT BUTTON_LEFT
37 #define FLIPIT_RIGHT BUTTON_RIGHT
38 #define FLIPIT_UP BUTTON_UP
39 #define FLIPIT_DOWN BUTTON_DOWN
40 #define FLIPIT_QUIT BUTTON_OFF
41 #define FLIPIT_SHUFFLE BUTTON_F1
42 #define FLIPIT_SOLVE BUTTON_F2
43 #define FLIPIT_STEP_BY_STEP BUTTON_F3
44 #define FLIPIT_TOGGLE BUTTON_SELECT
46 #elif CONFIG_KEYPAD == PLAYER_PAD
47 #define FLIPIT_LEFT BUTTON_LEFT
48 #define FLIPIT_RIGHT BUTTON_RIGHT
49 #define FLIPIT_UP_PRE BUTTON_ON
50 #define FLIPIT_UP (BUTTON_ON | BUTTON_REL)
51 #define FLIPIT_DOWN BUTTON_MENU
52 #define FLIPIT_QUIT BUTTON_STOP
53 #define FLIPIT_SHUFFLE (BUTTON_ON | BUTTON_LEFT)
54 #define FLIPIT_SOLVE (BUTTON_ON | BUTTON_RIGHT)
55 #define FLIPIT_STEP_BY_STEP (BUTTON_ON | BUTTON_PLAY)
56 #define FLIPIT_TOGGLE BUTTON_PLAY
58 #elif CONFIG_KEYPAD == ONDIO_PAD
59 #define FLIPIT_LEFT BUTTON_LEFT
60 #define FLIPIT_RIGHT BUTTON_RIGHT
61 #define FLIPIT_UP BUTTON_UP
62 #define FLIPIT_DOWN BUTTON_DOWN
63 #define FLIPIT_QUIT BUTTON_OFF
64 #define FLIPIT_SHUFFLE (BUTTON_MENU | BUTTON_LEFT)
65 #define FLIPIT_SOLVE (BUTTON_MENU | BUTTON_UP)
66 #define FLIPIT_STEP_BY_STEP (BUTTON_MENU | BUTTON_RIGHT)
67 #define FLIPIT_TOGGLE_PRE BUTTON_MENU
68 #define FLIPIT_TOGGLE (BUTTON_MENU | BUTTON_REL)
70 #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
71 (CONFIG_KEYPAD == IRIVER_H300_PAD)
72 #define FLIPIT_LEFT BUTTON_LEFT
73 #define FLIPIT_RIGHT BUTTON_RIGHT
74 #define FLIPIT_UP BUTTON_UP
75 #define FLIPIT_DOWN BUTTON_DOWN
76 #define FLIPIT_QUIT BUTTON_OFF
77 #define FLIPIT_SHUFFLE BUTTON_MODE
78 #define FLIPIT_SOLVE BUTTON_ON
79 #define FLIPIT_STEP_BY_STEP BUTTON_REC
80 #define FLIPIT_TOGGLE_PRE BUTTON_SELECT
81 #define FLIPIT_TOGGLE (BUTTON_SELECT | BUTTON_REL)
83 #define FLIPIT_RC_QUIT BUTTON_RC_STOP
85 #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
86 (CONFIG_KEYPAD == IPOD_3G_PAD) || \
87 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
89 #define FLIPIT_SCROLLWHEEL
90 #define FLIPIT_LEFT BUTTON_LEFT
91 #define FLIPIT_RIGHT BUTTON_RIGHT
92 #define FLIPIT_UP BUTTON_MENU
93 #define FLIPIT_DOWN BUTTON_PLAY
94 #define FLIPIT_NEXT BUTTON_SCROLL_FWD
95 #define FLIPIT_PREV BUTTON_SCROLL_BACK
96 #define FLIPIT_QUIT (BUTTON_SELECT | BUTTON_MENU)
97 #define FLIPIT_SHUFFLE (BUTTON_SELECT | BUTTON_LEFT)
98 #define FLIPIT_SOLVE (BUTTON_SELECT | BUTTON_PLAY)
99 #define FLIPIT_STEP_BY_STEP (BUTTON_SELECT | BUTTON_RIGHT)
100 #define FLIPIT_TOGGLE_PRE BUTTON_SELECT
101 #define FLIPIT_TOGGLE (BUTTON_SELECT | BUTTON_REL)
103 #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
105 #define FLIPIT_LEFT BUTTON_LEFT
106 #define FLIPIT_RIGHT BUTTON_RIGHT
107 #define FLIPIT_UP BUTTON_UP
108 #define FLIPIT_DOWN BUTTON_DOWN
109 #define FLIPIT_QUIT BUTTON_POWER
110 #define FLIPIT_SHUFFLE BUTTON_REC
111 #define FLIPIT_SOLVE_PRE BUTTON_PLAY
112 #define FLIPIT_SOLVE (BUTTON_PLAY | BUTTON_REPEAT)
113 #define FLIPIT_STEP_PRE BUTTON_PLAY
114 #define FLIPIT_STEP_BY_STEP (BUTTON_PLAY | BUTTON_REL)
115 #define FLIPIT_TOGGLE BUTTON_SELECT
117 #elif CONFIG_KEYPAD == GIGABEAT_PAD
119 #define FLIPIT_LEFT BUTTON_LEFT
120 #define FLIPIT_RIGHT BUTTON_RIGHT
121 #define FLIPIT_UP BUTTON_UP
122 #define FLIPIT_DOWN BUTTON_DOWN
123 #define FLIPIT_QUIT BUTTON_POWER
124 #define FLIPIT_SHUFFLE BUTTON_MENU
125 #define FLIPIT_SOLVE BUTTON_VOL_UP
126 #define FLIPIT_STEP_BY_STEP BUTTON_VOL_DOWN
127 #define FLIPIT_TOGGLE BUTTON_SELECT
129 #elif CONFIG_KEYPAD == SANSA_E200_PAD
131 #define FLIPIT_SCROLLWHEEL
132 #define FLIPIT_LEFT BUTTON_LEFT
133 #define FLIPIT_RIGHT BUTTON_RIGHT
134 #define FLIPIT_UP BUTTON_UP
135 #define FLIPIT_DOWN BUTTON_DOWN
136 #define FLIPIT_NEXT BUTTON_SCROLL_FWD
137 #define FLIPIT_PREV BUTTON_SCROLL_BACK
138 #define FLIPIT_QUIT BUTTON_POWER
139 #define FLIPIT_SHUFFLE (BUTTON_REC | BUTTON_LEFT)
140 #define FLIPIT_SOLVE (BUTTON_REC | BUTTON_RIGHT)
141 #define FLIPIT_STEP_BY_STEP (BUTTON_REC | BUTTON_SELECT)
142 #define FLIPIT_TOGGLE BUTTON_SELECT
144 #elif CONFIG_KEYPAD == SANSA_C200_PAD
146 #define FLIPIT_LEFT BUTTON_LEFT
147 #define FLIPIT_RIGHT BUTTON_RIGHT
148 #define FLIPIT_UP BUTTON_UP
149 #define FLIPIT_DOWN BUTTON_DOWN
150 #define FLIPIT_QUIT BUTTON_POWER
151 #define FLIPIT_SHUFFLE (BUTTON_REC | BUTTON_LEFT)
152 #define FLIPIT_SOLVE (BUTTON_REC | BUTTON_RIGHT)
153 #define FLIPIT_STEP_BY_STEP (BUTTON_REC | BUTTON_SELECT)
154 #define FLIPIT_TOGGLE BUTTON_SELECT
156 #elif CONFIG_KEYPAD == IRIVER_H10_PAD
158 #define FLIPIT_LEFT BUTTON_LEFT
159 #define FLIPIT_RIGHT BUTTON_RIGHT
160 #define FLIPIT_UP BUTTON_SCROLL_UP
161 #define FLIPIT_DOWN BUTTON_SCROLL_DOWN
162 #define FLIPIT_QUIT BUTTON_POWER
163 #define FLIPIT_SHUFFLE (BUTTON_PLAY | BUTTON_LEFT)
164 #define FLIPIT_SOLVE (BUTTON_PLAY | BUTTON_RIGHT)
165 #define FLIPIT_STEP_BY_STEP (BUTTON_PLAY | BUTTON_SCROLL_UP)
166 #define FLIPIT_TOGGLE_PRE BUTTON_REW
167 #define FLIPIT_TOGGLE (BUTTON_REW | BUTTON_REL)
169 #elif CONFIG_KEYPAD == GIGABEAT_S_PAD
171 #define FLIPIT_LEFT BUTTON_LEFT
172 #define FLIPIT_RIGHT BUTTON_RIGHT
173 #define FLIPIT_UP BUTTON_UP
174 #define FLIPIT_DOWN BUTTON_DOWN
175 #define FLIPIT_QUIT BUTTON_BACK
176 #define FLIPIT_SHUFFLE BUTTON_MENU
177 #define FLIPIT_SOLVE BUTTON_VOL_UP
178 #define FLIPIT_STEP_BY_STEP BUTTON_VOL_DOWN
179 #define FLIPIT_TOGGLE BUTTON_SELECT
181 #elif CONFIG_KEYPAD == MROBE100_PAD
183 #define FLIPIT_LEFT BUTTON_LEFT
184 #define FLIPIT_RIGHT BUTTON_RIGHT
185 #define FLIPIT_UP BUTTON_UP
186 #define FLIPIT_DOWN BUTTON_DOWN
187 #define FLIPIT_QUIT BUTTON_POWER
188 #define FLIPIT_SHUFFLE BUTTON_MENU
189 #define FLIPIT_SOLVE BUTTON_PLAY
190 #define FLIPIT_STEP_BY_STEP BUTTON_DISPLAY
191 #define FLIPIT_TOGGLE BUTTON_SELECT
193 #elif CONFIG_KEYPAD == IAUDIO_M3_PAD
195 #define FLIPIT_LEFT BUTTON_RC_REW
196 #define FLIPIT_RIGHT BUTTON_RC_FF
197 #define FLIPIT_UP BUTTON_RC_VOL_UP
198 #define FLIPIT_DOWN BUTTON_RC_VOL_DOWN
199 #define FLIPIT_QUIT BUTTON_RC_REC
200 #define FLIPIT_SHUFFLE BUTTON_RC_MODE
201 #define FLIPIT_SOLVE_PRE BUTTON_RC_MENU
202 #define FLIPIT_SOLVE (BUTTON_RC_MENU|BUTTON_REPEAT)
203 #define FLIPIT_STEP_PRE BUTTON_RC_MENU
204 #define FLIPIT_STEP_BY_STEP (BUTTON_RC_MENU|BUTTON_REL)
205 #define FLIPIT_TOGGLE BUTTON_RC_PLAY
207 #define FLIPIT_RC_QUIT BUTTON_REC
209 #elif CONFIG_KEYPAD == COWOND2_PAD
211 #define FLIPIT_QUIT BUTTON_POWER
214 #error No keymap defined!
219 #define FLIPIT_LEFT BUTTON_MIDLEFT
222 #define FLIPIT_RIGHT BUTTON_MIDRIGHT
225 #define FLIPIT_UP BUTTON_TOPMIDDLE
228 #define FLIPIT_DOWN BUTTON_BOTTOMMIDDLE
231 #define FLIPIT_QUIT BUTTON_TOPLEFT
233 #ifndef FLIPIT_SHUFFLE
234 #define FLIPIT_SHUFFLE BUTTON_TOPRIGHT
237 #define FLIPIT_SOLVE BUTTON_BOTTOMLEFT
239 #ifndef FLIPIT_STEP_BY_STEP
240 #define FLIPIT_STEP_BY_STEP BUTTON_BOTTOMRIGHT
242 #ifndef FLIPIT_TOGGLE
243 #define FLIPIT_TOGGLE BUTTON_CENTER
247 static const struct plugin_api
* rb
;
248 static int spots
[20];
249 static int toggle
[20];
250 static int cursor_pos
, moves
;
252 #ifdef HAVE_LCD_BITMAP
254 #include "flipit_cursor.h"
255 #include "flipit_tokens.h"
257 #define PANEL_HEIGHT 12
258 #define TK_WIDTH BMPWIDTH_flipit_cursor
259 #define TK_HEIGHT BMPHEIGHT_flipit_cursor
260 #define TK_SPACE MAX(0, MIN((LCD_WIDTH - 5*TK_WIDTH)/4, \
261 (LCD_HEIGHT - PANEL_HEIGHT - 4*TK_HEIGHT)/4))
262 #define GRID_WIDTH (5*TK_WIDTH + 4*TK_SPACE)
263 #define GRID_LEFT ((LCD_WIDTH - GRID_WIDTH)/2)
264 #define GRID_HEIGHT (4*TK_HEIGHT + 4*TK_SPACE) /* includes grid-panel space */
265 #define GRID_TOP MAX(0, ((LCD_HEIGHT - PANEL_HEIGHT - GRID_HEIGHT)/2))
267 /* draw a spot at the coordinates (x,y), range of p is 0-19 */
268 static void draw_spot(int p
)
270 rb
->lcd_bitmap_part( flipit_tokens
, 0, spots
[p
] * TK_HEIGHT
, TK_WIDTH
,
271 GRID_LEFT
+ (p
%5) * (TK_WIDTH
+TK_SPACE
),
272 GRID_TOP
+ (p
/5) * (TK_HEIGHT
+TK_SPACE
),
273 TK_WIDTH
, TK_HEIGHT
);
276 /* draw the cursor at the current cursor position */
277 static void draw_cursor(void)
279 #ifdef HAVE_LCD_COLOR
280 rb
->lcd_bitmap_transparent( flipit_cursor
,
281 GRID_LEFT
+ (cursor_pos
%5) * (TK_WIDTH
+TK_SPACE
),
282 GRID_TOP
+ (cursor_pos
/5) * (TK_HEIGHT
+TK_SPACE
),
283 TK_WIDTH
, TK_HEIGHT
);
285 rb
->lcd_set_drawmode(DRMODE_FG
);
286 rb
->lcd_mono_bitmap( flipit_cursor
,
287 GRID_LEFT
+ (cursor_pos
%5) * (TK_WIDTH
+TK_SPACE
),
288 GRID_TOP
+ (cursor_pos
/5) * (TK_HEIGHT
+TK_SPACE
),
289 TK_WIDTH
, TK_HEIGHT
);
290 rb
->lcd_set_drawmode(DRMODE_SOLID
);
294 /* draw the info panel ... duh */
295 static void draw_info_panel(void)
299 rb
->lcd_set_drawmode( DRMODE_SOLID
|DRMODE_INVERSEVID
);
300 rb
->lcd_fillrect( GRID_LEFT
, GRID_TOP
+ 4*(TK_HEIGHT
+TK_SPACE
),
301 GRID_WIDTH
, PANEL_HEIGHT
);
302 rb
->lcd_set_drawmode( DRMODE_SOLID
);
303 rb
->lcd_drawrect( GRID_LEFT
, GRID_TOP
+ 4*(TK_HEIGHT
+TK_SPACE
),
304 GRID_WIDTH
, PANEL_HEIGHT
);
306 rb
->snprintf( s
, sizeof(s
), "Flips: %d", moves
);
307 rb
->lcd_putsxy( (LCD_WIDTH
- rb
->lcd_getstringsize(s
, NULL
, NULL
)) / 2,
308 GRID_TOP
+ 4*(TK_HEIGHT
+TK_SPACE
) + 2, s
);
311 #else /* HAVE_LCD_CHARCELLS */
313 static const unsigned char tk_pat
[4][7] = {
314 { 0x0e, 0x11, 0x0e, 0x00, 0x0e, 0x11, 0x0e }, /* white - white */
315 { 0x0e, 0x11, 0x0e, 0x00, 0x0e, 0x1f, 0x0e }, /* white - black */
316 { 0x0e, 0x1f, 0x0e, 0x00, 0x0e, 0x11, 0x0e }, /* black - white */
317 { 0x0e, 0x1f, 0x0e, 0x00, 0x0e, 0x1f, 0x0e } /* black - black */
320 static unsigned char cur_pat
[7];
321 static unsigned long gfx_chars
[5];
323 static void release_gfx(void)
327 for (i
= 0; i
< 5; i
++)
329 rb
->lcd_unlock_pattern(gfx_chars
[i
]);
332 static bool init_gfx(void)
336 for (i
= 0; i
< 5; i
++) {
337 if ((gfx_chars
[i
] = rb
->lcd_get_locked_pattern()) == 0) {
342 for (i
= 0; i
< 4; i
++)
343 rb
->lcd_define_pattern(gfx_chars
[i
], tk_pat
[i
]);
347 /* draw a spot at the coordinates (x,y), range of p is 0-19 */
348 static void draw_spot(int p
)
353 rb
->lcd_putc (p
%5, p
/10, gfx_chars
[2*spots
[p
]+spots
[p
+5]]);
356 /* draw the cursor at the current cursor position */
357 static void draw_cursor(void)
359 if ((cursor_pos
/5) & 1) {
360 rb
->memcpy( cur_pat
, tk_pat
[2*spots
[cursor_pos
-5]+spots
[cursor_pos
]], 7 );
365 rb
->memcpy( cur_pat
, tk_pat
[2*spots
[cursor_pos
]+spots
[cursor_pos
+5]], 7 );
369 rb
->lcd_define_pattern(gfx_chars
[4], cur_pat
);
370 rb
->lcd_putc( cursor_pos
%5, cursor_pos
/10, gfx_chars
[4] );
373 /* draw the info panel ... duh */
374 static void draw_info_panel(void)
378 rb
->lcd_puts( 6, 0, "Flips" );
379 rb
->snprintf( s
, sizeof(s
), "%d", moves
);
380 rb
->lcd_puts( 6, 1, s
);
385 /* clear the cursor where it is */
386 static inline void clear_cursor(void)
388 draw_spot( cursor_pos
);
391 /* check if the puzzle is finished */
392 static bool flipit_finished(void)
402 /* draws the toggled spots */
403 static void flipit_toggle(void)
405 spots
[cursor_pos
] = 1-spots
[cursor_pos
];
406 toggle
[cursor_pos
] = 1-toggle
[cursor_pos
];
407 draw_spot(cursor_pos
);
408 if (cursor_pos
%5 > 0) {
409 spots
[cursor_pos
-1] = 1-spots
[cursor_pos
-1];
410 draw_spot(cursor_pos
-1);
412 if (cursor_pos
%5 < 4) {
413 spots
[cursor_pos
+1] = 1-spots
[cursor_pos
+1];
414 draw_spot(cursor_pos
+1);
416 if (cursor_pos
/5 > 0) {
417 spots
[cursor_pos
-5] = 1-spots
[cursor_pos
-5];
418 draw_spot(cursor_pos
-5);
420 if (cursor_pos
/5 < 3) {
421 spots
[cursor_pos
+5] = 1-spots
[cursor_pos
+5];
422 draw_spot(cursor_pos
+5);
428 if (flipit_finished())
432 /* move the cursor in any direction */
433 static void move_cursor(int x
, int y
)
435 if (!(flipit_finished())) {
437 cursor_pos
= ( x
+ 5 + cursor_pos
%5 )%5
438 + ( ( y
+ 4 + cursor_pos
/5 )%4 )*5;
444 /* initialize the board */
445 static void flipit_init(void)
449 rb
->lcd_clear_display();
450 for (i
=0; i
<20; i
++) {
457 for (i
=0; i
<20; i
++) {
458 cursor_pos
= (rb
->rand() % 20);
469 /* the main game loop */
470 static bool flipit_loop(void)
474 int lastbutton
= BUTTON_NONE
;
478 button
= rb
->button_get(true);
480 #ifdef FLIPIT_RC_QUIT
484 /* get out of here */
488 /* mix up the pieces */
493 #ifdef FLIPIT_SOLVE_PRE
494 if (lastbutton
!= FLIPIT_SOLVE_PRE
)
497 /* solve the puzzle */
498 if (!flipit_finished()) {
511 case FLIPIT_STEP_BY_STEP
:
512 #ifdef FLIPIT_STEP_PRE
513 if (lastbutton
!= FLIPIT_STEP_PRE
)
516 if (!flipit_finished()) {
530 #ifdef FLIPIT_TOGGLE_PRE
531 if (lastbutton
!= FLIPIT_TOGGLE_PRE
)
534 /* toggle the pieces */
535 if (!flipit_finished()) {
549 /*move cursor though the entire field*/
550 #ifdef FLIPIT_SCROLLWHEEL
552 case FLIPIT_PREV
|BUTTON_REPEAT
:
553 if ((cursor_pos
)%5 == 0) {
562 case FLIPIT_NEXT
|BUTTON_REPEAT
:
563 if ((cursor_pos
+1)%5 == 0) {
573 if (lastbutton
!= FLIPIT_UP_PRE
)
584 if (rb
->default_event_handler(button
) == SYS_USB_CONNECTED
)
585 return PLUGIN_USB_CONNECTED
;
588 if (button
!= BUTTON_NONE
)
593 /* called function from outside */
594 enum plugin_status
plugin_start(const struct plugin_api
* api
, const void* parameter
)
601 #ifdef HAVE_LCD_COLOR
602 rb
->lcd_set_background(LCD_WHITE
);
603 rb
->lcd_set_foreground(LCD_BLACK
);
607 rb
->lcd_set_backdrop(NULL
);
610 rb
->splash(HZ
, "FlipIt!");
612 #ifdef HAVE_LCD_BITMAP
613 /* print instructions */
614 rb
->lcd_clear_display();
615 rb
->lcd_setfont(FONT_SYSFIXED
);
616 #if CONFIG_KEYPAD == RECORDER_PAD
617 rb
->lcd_putsxy(2, 8, "[OFF] to stop");
618 rb
->lcd_putsxy(2, 18, "[PLAY] toggle");
619 rb
->lcd_putsxy(2, 28, "[F1] shuffle");
620 rb
->lcd_putsxy(2, 38, "[F2] solution");
621 rb
->lcd_putsxy(2, 48, "[F3] step by step");
622 #elif CONFIG_KEYPAD == ONDIO_PAD
623 rb
->lcd_putsxy(2, 8, "[OFF] to stop");
624 rb
->lcd_putsxy(2, 18, "[MODE] toggle");
625 rb
->lcd_putsxy(2, 28, "[M-LEFT] shuffle");
626 rb
->lcd_putsxy(2, 38, "[M-UP] solution");
627 rb
->lcd_putsxy(2, 48, "[M-RIGHT] step by step");
628 #elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
629 (CONFIG_KEYPAD == IRIVER_H300_PAD)
630 rb
->lcd_putsxy(2, 8, "[STOP] to stop");
631 rb
->lcd_putsxy(2, 18, "[SELECT] toggle");
632 rb
->lcd_putsxy(2, 28, "[MODE] shuffle");
633 rb
->lcd_putsxy(2, 38, "[PLAY] solution");
634 rb
->lcd_putsxy(2, 48, "[REC] step by step");
635 #elif (CONFIG_KEYPAD == IPOD_4G_PAD) || \
636 (CONFIG_KEYPAD == IPOD_3G_PAD) || \
637 (CONFIG_KEYPAD == IPOD_1G2G_PAD)
638 rb
->lcd_putsxy(2, 8, "[S-MENU] to stop");
639 rb
->lcd_putsxy(2, 18, "[SELECT] toggle");
640 rb
->lcd_putsxy(2, 28, "[S-LEFT] shuffle");
641 rb
->lcd_putsxy(2, 38, "[S-PLAY] solution");
642 rb
->lcd_putsxy(2, 48, "[S-RIGHT] step by step");
643 #elif CONFIG_KEYPAD == IAUDIO_X5M5_PAD
644 rb
->lcd_putsxy(2, 8, "[POWER] to stop");
645 rb
->lcd_putsxy(2, 18, "[SELECT] toggle");
646 rb
->lcd_putsxy(2, 28, "[REC] shuffle");
647 rb
->lcd_putsxy(2, 38, "[PLAY..] solution");
648 rb
->lcd_putsxy(2, 48, "[PLAY] step by step");
649 #elif CONFIG_KEYPAD == GIGABEAT_PAD
650 rb
->lcd_putsxy(2, 8, "[POWER] to stop");
651 rb
->lcd_putsxy(2, 18, "[SELECT] toggle");
652 rb
->lcd_putsxy(2, 28, "[MENU] shuffle");
653 rb
->lcd_putsxy(2, 38, "[VOL+] solution");
654 rb
->lcd_putsxy(2, 48, "[VOL-] step by step");
655 #elif CONFIG_KEYPAD == IRIVER_H10_PAD
656 rb
->lcd_putsxy(2, 8, "[POWER] to stop");
657 rb
->lcd_putsxy(2, 18, "[REW] toggle");
658 rb
->lcd_putsxy(2, 28, "[PL-LEFT] shuffle");
659 rb
->lcd_putsxy(2, 38, "[PL-RIGHT] solution");
660 rb
->lcd_putsxy(2, 48, "[PL-UP] step by step");
661 #elif (CONFIG_KEYPAD == SANSA_E200_PAD) || \
662 (CONFIG_KEYPAD == SANSA_C200_PAD)
663 rb
->lcd_putsxy(2, 8, "[POWER] to stop");
664 rb
->lcd_putsxy(2, 18, "[SELECT] toggle");
665 rb
->lcd_putsxy(2, 28, "[REC-LEFT] shuffle");
666 rb
->lcd_putsxy(2, 38, "[REC-RIGHT] solution");
667 rb
->lcd_putsxy(2, 48, "[REC-SEL] step by step");
668 #elif CONFIG_KEYPAD == IAUDIO_M3_PAD
669 rb
->lcd_putsxy(2, 8, "[REC] to stop");
670 rb
->lcd_putsxy(2, 18, "[PLAY] toggle");
671 rb
->lcd_putsxy(2, 28, "[MODE] shuffle");
672 rb
->lcd_putsxy(2, 38, "[MENU..] solution");
673 rb
->lcd_putsxy(2, 48, "[MENU] step by step");
677 rb
->lcd_putsxy(2, 8, "[BOTTOMLEFT] to stop");
678 rb
->lcd_putsxy(2, 18, "[CENTRE] toggle");
679 rb
->lcd_putsxy(2, 28, "[TOPRIGHT] shuffle");
680 rb
->lcd_putsxy(2, 38, "[BOTTOMLEFT] solution");
681 rb
->lcd_putsxy(2, 48, "[BOTTOMRIGHT] step by step");
685 #else /* HAVE_LCD_CHARCELLS */
689 rb
->button_get_w_tmo(HZ
*3);
691 rb
->lcd_clear_display();
693 for (i
=0; i
<20; i
++) {
699 rb
->srand(*rb
->current_tick
);
702 #ifdef HAVE_LCD_CHARCELLS