From f742c35db2e201d7bcd0c6154f5fceb5f3407d3d Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 9 Aug 2006 20:31:38 +0000 Subject: Sudoku: * Changed the LCD size ifdef magic to ease adding of new LCD resolutions. * Added vertical layout option with the scratchpad at the bottom (Gigabeat). * New Bitmaps for iPod Mini, iPod Video and Gigabeat, and slightly modified bitmaps for Archos, by Marianne Arnold. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10504 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/SUBDIRS | 3 - apps/plugins/bitmaps/native/SOURCES | 18 +- .../bitmaps/native/sudoku_inverse.112x64x1.bmp | Bin 382 -> 302 bytes .../bitmaps/native/sudoku_inverse.138x110x2.bmp | Bin 0 -> 462 bytes .../bitmaps/native/sudoku_inverse.320x240x16.bmp | Bin 0 -> 8078 bytes .../bitmaps/native/sudoku_normal.112x64x1.bmp | Bin 382 -> 302 bytes .../bitmaps/native/sudoku_normal.138x110x2.bmp | Bin 0 -> 462 bytes .../bitmaps/native/sudoku_normal.320x240x16.bmp | Bin 0 -> 8078 bytes .../bitmaps/native/sudoku_start.112x64x1.bmp | Bin 382 -> 302 bytes .../bitmaps/native/sudoku_start.138x110x2.bmp | Bin 0 -> 1266 bytes .../bitmaps/native/sudoku_start.320x240x16.bmp | Bin 0 -> 8078 bytes apps/plugins/sudoku/Makefile | 3 +- apps/plugins/sudoku/sudoku.c | 231 +++++++++++++-------- 13 files changed, 167 insertions(+), 88 deletions(-) create mode 100755 apps/plugins/bitmaps/native/sudoku_inverse.138x110x2.bmp create mode 100755 apps/plugins/bitmaps/native/sudoku_inverse.320x240x16.bmp create mode 100755 apps/plugins/bitmaps/native/sudoku_normal.138x110x2.bmp create mode 100755 apps/plugins/bitmaps/native/sudoku_normal.320x240x16.bmp create mode 100755 apps/plugins/bitmaps/native/sudoku_start.138x110x2.bmp create mode 100755 apps/plugins/bitmaps/native/sudoku_start.320x240x16.bmp (limited to 'apps') diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS index d45283c1d5..73771713bd 100644 --- a/apps/plugins/SUBDIRS +++ b/apps/plugins/SUBDIRS @@ -16,11 +16,8 @@ rockboy /* For all targets with a bitmap display */ #ifdef HAVE_LCD_BITMAP chessbox -#if (LCD_WIDTH != 138) -/* This needs adjusting for the iPod Mini */ sudoku #endif -#endif /* For all the colour targets and iriver H1x0 */ #if defined(HAVE_LCD_COLOR) || defined(IRIVER_H100_SERIES) diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES index 54cd6fd569..98c3eef443 100644 --- a/apps/plugins/bitmaps/native/SOURCES +++ b/apps/plugins/bitmaps/native/SOURCES @@ -175,19 +175,35 @@ solitaire_suitsi.15x16x1.bmp #endif /* Sudoku */ +#if LCD_WIDTH >= LCD_HEIGHT #if (LCD_WIDTH == 112) && (LCD_HEIGHT==64) && (LCD_DEPTH == 1) sudoku_start.112x64x1.bmp sudoku_normal.112x64x1.bmp sudoku_inverse.112x64x1.bmp +#elif (LCD_WIDTH == 138) && (LCD_HEIGHT == 110) && (LCD_DEPTH >= 2) +sudoku_start.138x110x2.bmp +sudoku_normal.138x110x2.bmp +sudoku_inverse.138x110x2.bmp #elif ((LCD_WIDTH == 160) && (LCD_HEIGHT == 128) && (LCD_DEPTH >= 2)) || \ ((LCD_WIDTH == 176) && (LCD_HEIGHT == 132) && (LCD_DEPTH >= 2)) sudoku_start.160x128x2.bmp sudoku_normal.160x128x2.bmp sudoku_inverse.160x128x2.bmp -#elif (LCD_WIDTH >= 220) && (LCD_HEIGHT >= 176) && (LCD_DEPTH == 16) +#elif (LCD_WIDTH == 220) && (LCD_HEIGHT == 176) && (LCD_DEPTH == 16) sudoku_start.220x176x16.bmp sudoku_normal.220x176x16.bmp sudoku_inverse.220x176x16.bmp +#elif (LCD_WIDTH >= 320) && (LCD_HEIGHT >= 240) && (LCD_DEPTH == 16) +sudoku_start.320x240x16.bmp +sudoku_normal.320x240x16.bmp +sudoku_inverse.320x240x16.bmp +#endif +#else +#if (LCD_WIDTH >= 240) && (LCD_HEIGHT >= 320) && (LCD_DEPTH == 16) +sudoku_start.320x240x16.bmp +sudoku_normal.320x240x16.bmp +sudoku_inverse.320x240x16.bmp +#endif #endif /* Brickmania */ diff --git a/apps/plugins/bitmaps/native/sudoku_inverse.112x64x1.bmp b/apps/plugins/bitmaps/native/sudoku_inverse.112x64x1.bmp index 161a43e78c..f5e8977904 100644 Binary files a/apps/plugins/bitmaps/native/sudoku_inverse.112x64x1.bmp and b/apps/plugins/bitmaps/native/sudoku_inverse.112x64x1.bmp differ diff --git a/apps/plugins/bitmaps/native/sudoku_inverse.138x110x2.bmp b/apps/plugins/bitmaps/native/sudoku_inverse.138x110x2.bmp new file mode 100755 index 0000000000..601b16a20d Binary files /dev/null and b/apps/plugins/bitmaps/native/sudoku_inverse.138x110x2.bmp differ diff --git a/apps/plugins/bitmaps/native/sudoku_inverse.320x240x16.bmp b/apps/plugins/bitmaps/native/sudoku_inverse.320x240x16.bmp new file mode 100755 index 0000000000..2fdf3657ab Binary files /dev/null and b/apps/plugins/bitmaps/native/sudoku_inverse.320x240x16.bmp differ diff --git a/apps/plugins/bitmaps/native/sudoku_normal.112x64x1.bmp b/apps/plugins/bitmaps/native/sudoku_normal.112x64x1.bmp index 09b1342f94..54719a9ee8 100644 Binary files a/apps/plugins/bitmaps/native/sudoku_normal.112x64x1.bmp and b/apps/plugins/bitmaps/native/sudoku_normal.112x64x1.bmp differ diff --git a/apps/plugins/bitmaps/native/sudoku_normal.138x110x2.bmp b/apps/plugins/bitmaps/native/sudoku_normal.138x110x2.bmp new file mode 100755 index 0000000000..2bce01b5bd Binary files /dev/null and b/apps/plugins/bitmaps/native/sudoku_normal.138x110x2.bmp differ diff --git a/apps/plugins/bitmaps/native/sudoku_normal.320x240x16.bmp b/apps/plugins/bitmaps/native/sudoku_normal.320x240x16.bmp new file mode 100755 index 0000000000..6f888cb86c Binary files /dev/null and b/apps/plugins/bitmaps/native/sudoku_normal.320x240x16.bmp differ diff --git a/apps/plugins/bitmaps/native/sudoku_start.112x64x1.bmp b/apps/plugins/bitmaps/native/sudoku_start.112x64x1.bmp index 09b1342f94..54719a9ee8 100644 Binary files a/apps/plugins/bitmaps/native/sudoku_start.112x64x1.bmp and b/apps/plugins/bitmaps/native/sudoku_start.112x64x1.bmp differ diff --git a/apps/plugins/bitmaps/native/sudoku_start.138x110x2.bmp b/apps/plugins/bitmaps/native/sudoku_start.138x110x2.bmp new file mode 100755 index 0000000000..2d5aa76870 Binary files /dev/null and b/apps/plugins/bitmaps/native/sudoku_start.138x110x2.bmp differ diff --git a/apps/plugins/bitmaps/native/sudoku_start.320x240x16.bmp b/apps/plugins/bitmaps/native/sudoku_start.320x240x16.bmp new file mode 100755 index 0000000000..bd4d7c4ee2 Binary files /dev/null and b/apps/plugins/bitmaps/native/sudoku_start.320x240x16.bmp differ diff --git a/apps/plugins/sudoku/Makefile b/apps/plugins/sudoku/Makefile index eef05124f9..8a1d8b189d 100644 --- a/apps/plugins/sudoku/Makefile +++ b/apps/plugins/sudoku/Makefile @@ -8,7 +8,8 @@ # INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ - -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) + -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) \ + -I$(BUILDDIR)/pluginbitmaps CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN diff --git a/apps/plugins/sudoku/sudoku.c b/apps/plugins/sudoku/sudoku.c index 12924e8fe6..191f985e3b 100644 --- a/apps/plugins/sudoku/sudoku.c +++ b/apps/plugins/sudoku/sudoku.c @@ -64,6 +64,14 @@ Example ".ss" file, and one with a saved state: #include "sudoku.h" #include "generator.h" +/* The bitmaps */ +#include "sudoku_normal.h" +#include "sudoku_inverse.h" +#include "sudoku_start.h" + +#define BITMAP_HEIGHT (BMPHEIGHT_sudoku_normal/10) +#define BITMAP_STRIDE BMPWIDTH_sudoku_normal + PLUGIN_HEADER /* here is a global api struct pointer. while not strictly necessary, @@ -72,11 +80,6 @@ PLUGIN_HEADER struct plugin_api* rb; -/* The bitmaps */ -extern const fb_data sudoku_normal[]; -extern const fb_data sudoku_start[]; -extern const fb_data sudoku_inverse[]; - /* Default game - used to initialise sudoku.ss if it doesn't exist. */ static const char default_game[9][9] = { @@ -93,80 +96,103 @@ static const char default_game[9][9] = { '0','0','0', '4','0','8', '0','5','0' }, }; -#if ((LCD_HEIGHT==128) && (LCD_WIDTH==160)) || \ - ((LCD_HEIGHT==132) && (LCD_WIDTH==176)) -/* For iriver H1x0 - 160x128, 9 cells @ 12x12 with 14 border lines*/ +#if LCD_HEIGHT <= LCD_WIDTH /* Horizontal layout, scratchpad at the left */ -/* Internal dimensions of a cell */ -#define CELL_WIDTH 12 -#define CELL_HEIGHT 12 +#if (LCD_HEIGHT==64) && (LCD_WIDTH==112) +/* Archos Recorders and Ondios - 112x64, 9 cells @ 8x6 with 10 border lines */ -#define BOARD_WIDTH (CELL_WIDTH*9+10+4) -#define BOARD_HEIGHT (CELL_HEIGHT*9+10+4) +/* Internal dimensions of a cell */ +#define CELL_WIDTH 8 +#define CELL_HEIGHT 6 +#define SMALL_BOARD -#define XOFS (((LCD_WIDTH-BOARD_WIDTH)/2)+10) -#define YOFS ((LCD_HEIGHT-BOARD_HEIGHT)/2) +#elif (LCD_HEIGHT==110) && (LCD_WIDTH==138) +/* iPod Mini - 138x110, 9 cells @ 10x10 with 14 border lines */ -#define XOFSSCRATCHPAD 3 +/* Internal dimensions of a cell */ +#define CELL_WIDTH 10 +#define CELL_HEIGHT 10 -/* Locations of each cell */ -static unsigned char cellxpos[9]={ 2, 15, 28, 42, 55, 68, 82, 95, 108 }; -static unsigned char cellypos[9]={ 2, 15, 28, 42, 55, 68, 82, 95, 108 }; +#elif ((LCD_HEIGHT==128) && (LCD_WIDTH==160)) || \ + ((LCD_HEIGHT==132) && (LCD_WIDTH==176)) +/* iAudio X5, Iriver H1x0, iPod G3, G4 - 160x128; */ +/* iPod Nano - 176x132, 9 cells @ 12x12 with 14 border lines */ -/* The height of one cell in the bitmap */ -#define BITMAP_HEIGHT 12 -#define BITMAP_STRIDE 12 +/* Internal dimensions of a cell */ +#define CELL_WIDTH 12 +#define CELL_HEIGHT 12 -#elif (LCD_HEIGHT==64) && (LCD_WIDTH==112) -/* For Archos Recorder, FM and Ondio (112x64): - 9 cells @ 8x6 with 10 border lines -*/ +#elif (LCD_HEIGHT==176) && (LCD_WIDTH==220) +/* Iriver h300, iPod Color/Photo - 220x176, 9 cells @ 16x16 with 14 border lines */ /* Internal dimensions of a cell */ -#define CELL_WIDTH 8 -#define CELL_HEIGHT 6 - -#define BOARD_WIDTH (CELL_WIDTH*9+10) -#define BOARD_HEIGHT (CELL_HEIGHT*9+10) +#define CELL_WIDTH 16 +#define CELL_HEIGHT 16 -#define XOFS (((LCD_WIDTH-BOARD_WIDTH)/2)+7) -#define YOFS ((LCD_HEIGHT-BOARD_HEIGHT)/2) +#elif (LCD_HEIGHT>=240) && (LCD_WIDTH>=320) +/* iPod Video - 320x240, 9 cells @ 25x25 with 14 border lines */ -#define XOFSSCRATCHPAD 2 +/* Internal dimensions of a cell */ +#define CELL_WIDTH 25 +#define CELL_HEIGHT 25 -/* Locations of each cell */ -static unsigned char cellxpos[9]={ 1, 10, 19, 28, 37, 46, 55, 64, 73 }; -static unsigned char cellypos[9]={ 1, 8, 15, 22, 29, 36, 43, 50, 57 }; +#else + #error SUDOKU: Unsupported LCD size +#endif -/* The height of one cell in the bitmap */ -#define BITMAP_HEIGHT 8 -#define BITMAP_STRIDE 8 +#else /* Vertical layout, scratchpad at the bottom */ +#define VERTICAL_LAYOUT -#elif (LCD_HEIGHT>=176) && (LCD_WIDTH>=220) -/* iriver h300 */ +#if (LCD_HEIGHT>=320) && (LCD_WIDTH>=240) +/* Gigabeat - 240x320, 9 cells @ 16x16 with 14 border lines */ /* Internal dimensions of a cell */ -#define CELL_WIDTH 16 -#define CELL_HEIGHT 16 +#define CELL_WIDTH 25 +#define CELL_HEIGHT 25 -#define BOARD_WIDTH (CELL_WIDTH*9+10+4) -#define BOARD_HEIGHT (CELL_HEIGHT*9+10+4) - -#define XOFS (((LCD_WIDTH-BOARD_WIDTH)/2)+15) -#define YOFS ((LCD_HEIGHT-BOARD_HEIGHT)/2) - -#define XOFSSCRATCHPAD 10 +#else + #error SUDOKU: Unsupported LCD size +#endif -/* Locations of each cell */ -static unsigned char cellxpos[9]={ 2, 19, 36, 54, 71, 88, 106, 123, 140 }; -static unsigned char cellypos[9]={ 2, 19, 36, 54, 71, 88, 106, 123, 140 }; +#endif /* Layout */ -/* The height of one cell in the bitmap */ -#define BITMAP_HEIGHT 16 -#define BITMAP_STRIDE 16 +/* Size dependent build-time calculations */ +#ifdef SMALL_BOARD +#define BOARD_WIDTH (CELL_WIDTH*9+10) +#define BOARD_HEIGHT (CELL_HEIGHT*9+10) +static unsigned char cellxpos[9]={ + 1, (CELL_WIDTH+2), (2*CELL_WIDTH+3), + (3*CELL_WIDTH+4), (4*CELL_WIDTH+5), (5*CELL_WIDTH+6), + (6*CELL_WIDTH+7), (7*CELL_WIDTH+8), (8*CELL_WIDTH+9) +}; +static unsigned char cellypos[9]={ + 1, (CELL_HEIGHT+2), (2*CELL_HEIGHT+3), + (3*CELL_HEIGHT+4), (4*CELL_HEIGHT+5), (5*CELL_HEIGHT+6), + (6*CELL_HEIGHT+7), (7*CELL_HEIGHT+8), (8*CELL_HEIGHT+9) +}; +#else /* !SMALL_BOARD */ +#define BOARD_WIDTH (CELL_WIDTH*9+10+4) +#define BOARD_HEIGHT (CELL_HEIGHT*9+10+4) +static unsigned char cellxpos[9]={ + 2, (CELL_WIDTH +3), (2*CELL_WIDTH +4), + (3*CELL_WIDTH +6), (4*CELL_WIDTH +7), (5*CELL_WIDTH +8), + (6*CELL_WIDTH+10), (7*CELL_WIDTH+11), (8*CELL_WIDTH+12) +}; +static unsigned char cellypos[9]={ + 2, (CELL_HEIGHT +3), (2*CELL_HEIGHT +4), + (3*CELL_HEIGHT +6), (4*CELL_HEIGHT +7), (5*CELL_HEIGHT +8), + (6*CELL_HEIGHT+10), (7*CELL_HEIGHT+11), (8*CELL_HEIGHT+12) +}; +#endif +#ifdef VERTICAL_LAYOUT +#define XOFS ((LCD_WIDTH-BOARD_WIDTH)/2) +#define YOFS ((LCD_HEIGHT-(BOARD_HEIGHT+CELL_HEIGHT*2+2))/2) +#define YOFSSCRATCHPAD (YOFS+BOARD_HEIGHT+CELL_WIDTH) #else - #error SUDOKU: Unsupported LCD size +#define XOFSSCRATCHPAD ((LCD_WIDTH-(BOARD_WIDTH+CELL_WIDTH*2+2))/2) +#define XOFS (XOFSSCRATCHPAD+CELL_WIDTH*2+2) +#define YOFS ((LCD_HEIGHT-BOARD_HEIGHT)/2) #endif /****** Solver routine by Tom Shackell @@ -760,7 +786,26 @@ void display_board(struct sudoku_state_t* state) /* Draw the gridlines - differently for different targets */ -#if LCD_HEIGHT > 64 +#ifdef SMALL_BOARD + /* Small targets - draw dotted/single lines */ + for (r=0;r<9;r++) { + if ((r % 3)==0) { + /* Solid Line */ + rb->lcd_hline(XOFS,XOFS+BOARD_WIDTH-1,YOFS+cellypos[r]-1); + rb->lcd_vline(XOFS+cellxpos[r]-1,YOFS,YOFS+BOARD_HEIGHT-1); + } else { + /* Dotted line */ + for (c=XOFS;clcd_drawpixel(c,YOFS+cellypos[r]-1); + } + for (c=YOFS;clcd_drawpixel(XOFS+cellxpos[r]-1,c); + } + } + } + rb->lcd_hline(XOFS,XOFS+BOARD_WIDTH-1,YOFS+cellypos[8]+CELL_HEIGHT); + rb->lcd_vline(XOFS+cellxpos[8]+CELL_WIDTH,YOFS,YOFS+BOARD_HEIGHT-1); +#else /* Large targets - draw single/double lines */ for (r=0;r<9;r++) { rb->lcd_hline(XOFS,XOFS+BOARD_WIDTH-1,YOFS+cellypos[r]-1); @@ -774,41 +819,53 @@ void display_board(struct sudoku_state_t* state) rb->lcd_hline(XOFS,XOFS+BOARD_WIDTH-1,YOFS+cellypos[8]+CELL_HEIGHT+1); rb->lcd_vline(XOFS+cellxpos[8]+CELL_WIDTH,YOFS,YOFS+BOARD_HEIGHT-1); rb->lcd_vline(XOFS+cellxpos[8]+CELL_WIDTH+1,YOFS,YOFS+BOARD_HEIGHT-1); -#elif (LCD_HEIGHT==64) - /* Small targets - draw dotted/single lines */ +#endif + +#ifdef SUDOKU_BUTTON_POSSIBLE +#ifdef VERTICAL_LAYOUT + rb->lcd_hline(XOFS,XOFS+BOARD_WIDTH-1,YOFSSCRATCHPAD); + rb->lcd_hline(XOFS,XOFS+BOARD_WIDTH-1,YOFSSCRATCHPAD+CELL_HEIGHT+1); for (r=0;r<9;r++) { +#ifdef SMALL_BOARD + /* Small targets - draw dotted/single lines */ if ((r % 3)==0) { /* Solid Line */ - rb->lcd_hline(XOFS,XOFS+BOARD_WIDTH-1,YOFS+cellypos[r]-1); - rb->lcd_vline(XOFS+cellxpos[r]-1,YOFS,YOFS+BOARD_HEIGHT-1); + rb->lcd_vline(XOFS+cellxpos[r]-1,YOFSSCRATCHPAD, + YOFSSCRATCHPAD+CELL_HEIGHT+1); } else { /* Dotted line */ - for (c=XOFS;clcd_drawpixel(c,YOFS+cellypos[r]-1); - } - for (c=YOFS;clcd_drawpixel(XOFS+cellxpos[r]-1,c); } } - } - rb->lcd_hline(XOFS,XOFS+BOARD_WIDTH-1,YOFS+cellypos[8]+CELL_HEIGHT); - rb->lcd_vline(XOFS+cellxpos[8]+CELL_WIDTH,YOFS,YOFS+BOARD_HEIGHT-1); #else -#error SUDOKU: Unsupported LCD height + /* Large targets - draw single/double lines */ + rb->lcd_vline(XOFS+cellxpos[r]-1,YOFSSCRATCHPAD, + YOFSSCRATCHPAD+CELL_HEIGHT+1); + if ((r % 3)==0) + rb->lcd_vline(XOFS+cellxpos[r]-2,YOFSSCRATCHPAD, + YOFSSCRATCHPAD+CELL_HEIGHT+1); #endif - -#ifdef SUDOKU_BUTTON_POSSIBLE + if ((r>0) && state->possiblevals[state->y][state->x]&(1<<(r))) + rb->lcd_bitmap_part(sudoku_normal,0,BITMAP_HEIGHT*r,BITMAP_STRIDE, + XOFS+cellxpos[r-1],YOFSSCRATCHPAD+1, + CELL_WIDTH,CELL_HEIGHT); + } + rb->lcd_vline(XOFS+cellxpos[8]+CELL_WIDTH,YOFSSCRATCHPAD, + YOFSSCRATCHPAD+CELL_HEIGHT+1); +#ifndef SMALL_BOARD + rb->lcd_vline(XOFS+cellxpos[8]+CELL_WIDTH+1,YOFSSCRATCHPAD, + YOFSSCRATCHPAD+CELL_HEIGHT+1); +#endif + if (state->possiblevals[state->y][state->x]&(1<<(r))) + rb->lcd_bitmap_part(sudoku_normal,0,BITMAP_HEIGHT*r,BITMAP_STRIDE, + XOFS+cellxpos[8],YOFSSCRATCHPAD+1, + CELL_WIDTH,CELL_HEIGHT); +#else /* Horizontal layout */ rb->lcd_vline(XOFSSCRATCHPAD,YOFS,YOFS+BOARD_HEIGHT-1); rb->lcd_vline(XOFSSCRATCHPAD+CELL_WIDTH+1,YOFS,YOFS+BOARD_HEIGHT-1); for (r=0;r<9;r++) { -#if LCD_HEIGHT > 64 - /* Large targets - draw single/double lines */ - rb->lcd_hline(XOFSSCRATCHPAD,XOFSSCRATCHPAD+CELL_WIDTH+1, - YOFS+cellypos[r]-1); - if ((r % 3)==0) - rb->lcd_hline(XOFSSCRATCHPAD,XOFSSCRATCHPAD+CELL_WIDTH+1, - YOFS+cellypos[r]-2); -#elif LCD_HEIGHT == 64 +#ifdef SMALL_BOARD /* Small targets - draw dotted/single lines */ if ((r % 3)==0) { /* Solid Line */ @@ -820,6 +877,13 @@ void display_board(struct sudoku_state_t* state) rb->lcd_drawpixel(c,YOFS+cellypos[r]-1); } } +#else + /* Large targets - draw single/double lines */ + rb->lcd_hline(XOFSSCRATCHPAD,XOFSSCRATCHPAD+CELL_WIDTH+1, + YOFS+cellypos[r]-1); + if ((r % 3)==0) + rb->lcd_hline(XOFSSCRATCHPAD,XOFSSCRATCHPAD+CELL_WIDTH+1, + YOFS+cellypos[r]-2); #endif if ((r>0) && state->possiblevals[state->y][state->x]&(1<<(r))) rb->lcd_bitmap_part(sudoku_normal,0,BITMAP_HEIGHT*r,BITMAP_STRIDE, @@ -828,7 +892,7 @@ void display_board(struct sudoku_state_t* state) } rb->lcd_hline(XOFSSCRATCHPAD,XOFSSCRATCHPAD+CELL_WIDTH+1, YOFS+cellypos[8]+CELL_HEIGHT); -#if LCD_HEIGHT > 64 +#ifndef SMALL_BOARD rb->lcd_hline(XOFSSCRATCHPAD,XOFSSCRATCHPAD+CELL_WIDTH+1, YOFS+cellypos[8]+CELL_HEIGHT+1); #endif @@ -836,7 +900,8 @@ void display_board(struct sudoku_state_t* state) rb->lcd_bitmap_part(sudoku_normal,0,BITMAP_HEIGHT*r,BITMAP_STRIDE, XOFSSCRATCHPAD+1,YOFS+cellypos[8], CELL_WIDTH,CELL_HEIGHT); -#endif +#endif /* Layout */ +#endif /* SUDOKU_BUTTON_POSSIBLE */ /* Draw the numbers */ for (r=0;r<9;r++) { -- cgit v1.2.3