forked from len0rd/rockbox
* number of columns and rows can now be changed in menu
* remove trailing spaces git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6881 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
37c3d8b610
commit
2398b22549
1 changed files with 46 additions and 38 deletions
|
|
@ -185,9 +185,8 @@ typedef struct tile {
|
||||||
} tile;
|
} tile;
|
||||||
|
|
||||||
/* the height and width of the field */
|
/* the height and width of the field */
|
||||||
/* could be variable if malloc worked in the API :) */
|
int height = LCD_HEIGHT/8;
|
||||||
const int height = LCD_HEIGHT/8;
|
int width = LCD_WIDTH/8;
|
||||||
const int width = LCD_WIDTH/8;
|
|
||||||
|
|
||||||
/* the minefield */
|
/* the minefield */
|
||||||
tile minefield[LCD_HEIGHT/8][LCD_WIDTH/8];
|
tile minefield[LCD_HEIGHT/8][LCD_WIDTH/8];
|
||||||
|
|
@ -306,14 +305,17 @@ int minesweeper(void)
|
||||||
rb->lcd_puts(0,0,"Mine Sweeper");
|
rb->lcd_puts(0,0,"Mine Sweeper");
|
||||||
|
|
||||||
rb->snprintf(str, 20, "%d%% mines", p);
|
rb->snprintf(str, 20, "%d%% mines", p);
|
||||||
rb->lcd_puts(0,1,str);
|
rb->lcd_puts(0,2,str);
|
||||||
rb->lcd_puts(0,2,"down / up");
|
rb->lcd_puts(0,3,"down / up");
|
||||||
|
rb->snprintf(str, 20, "%d cols x %d rows", width, height);
|
||||||
|
rb->lcd_puts(0,4,str);
|
||||||
|
rb->lcd_puts(0,5,"left x right ");
|
||||||
#if CONFIG_KEYPAD == RECORDER_PAD
|
#if CONFIG_KEYPAD == RECORDER_PAD
|
||||||
rb->lcd_puts(0,4,"ON to start");
|
rb->lcd_puts(0,6,"ON to start");
|
||||||
#elif CONFIG_KEYPAD == ONDIO_PAD
|
#elif CONFIG_KEYPAD == ONDIO_PAD
|
||||||
rb->lcd_puts(0,4,"MODE to start");
|
rb->lcd_puts(0,6,"MODE to start");
|
||||||
#elif CONFIG_KEYPAD == IRIVER_H100_PAD
|
#elif CONFIG_KEYPAD == IRIVER_H100_PAD
|
||||||
rb->lcd_puts(0,4,"SELECT to start");
|
rb->lcd_puts(0,6,"SELECT to start");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
rb->lcd_update();
|
rb->lcd_update();
|
||||||
|
|
@ -322,15 +324,21 @@ int minesweeper(void)
|
||||||
button = rb->button_get(true);
|
button = rb->button_get(true);
|
||||||
switch(button){
|
switch(button){
|
||||||
case BUTTON_DOWN:
|
case BUTTON_DOWN:
|
||||||
case BUTTON_LEFT:
|
|
||||||
p = (p + 98)%100;
|
p = (p + 98)%100;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BUTTON_UP:
|
case BUTTON_UP:
|
||||||
case BUTTON_RIGHT:
|
|
||||||
p = (p + 2)%100;
|
p = (p + 2)%100;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case BUTTON_RIGHT:
|
||||||
|
height = height%(LCD_HEIGHT/8)+1;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BUTTON_LEFT:
|
||||||
|
width = width%(LCD_WIDTH/8)+1;
|
||||||
|
break;
|
||||||
|
|
||||||
case MINESWP_START:/* start playing */
|
case MINESWP_START:/* start playing */
|
||||||
i = 1;
|
i = 1;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue