summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarianne Arnold <pixelma@rockbox.org>2007-10-19 09:05:18 +0000
committerMarianne Arnold <pixelma@rockbox.org>2007-10-19 09:05:18 +0000
commitdf1f0d642946d125b03b83209f4c5a6fd4b156b3 (patch)
treebc64bae935f263e2a529d85d3509343df11895f6
parent3ab686e07ea2da66f32cb31894ebda08a614ef06 (diff)
downloadrockbox-df1f0d642946d125b03b83209f4c5a6fd4b156b3.tar.gz
rockbox-df1f0d642946d125b03b83209f4c5a6fd4b156b3.zip
Chessbox: ported to c200, also simplify the tile size calculation (thanks to Jens). Just retrieve it from the assigned bmp (same as e.g. Sudoku does), so that there's no need to check for lcd resolution in two different places. Update the manual.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15202 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/SUBDIRS2
-rw-r--r--apps/plugins/bitmaps/native/SOURCES4
-rw-r--r--apps/plugins/bitmaps/native/chessbox_pieces.80x80x16.bmpbin0 -> 8374 bytes
-rw-r--r--apps/plugins/chessbox/Makefile3
-rw-r--r--apps/plugins/chessbox/chessbox.c46
-rw-r--r--apps/plugins/chessbox/chessbox_pgn.c15
-rw-r--r--manual/plugins/chessbox.tex7
7 files changed, 42 insertions, 35 deletions
diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS
index 6cdc8650df..c01f760ffd 100644
--- a/apps/plugins/SUBDIRS
+++ b/apps/plugins/SUBDIRS
@@ -16,9 +16,7 @@ rockboy
16 16
17/* For all targets with a bitmap display */ 17/* For all targets with a bitmap display */
18#ifdef HAVE_LCD_BITMAP 18#ifdef HAVE_LCD_BITMAP
19#ifndef SANSA_C200
20chessbox 19chessbox
21#endif
22sudoku 20sudoku
23reversi 21reversi
24#endif 22#endif
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index 02eead8160..aa36caa8cf 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -103,10 +103,10 @@ chessbox_pieces.240x240x16.bmp
103chessbox_pieces.176x176x16.bmp 103chessbox_pieces.176x176x16.bmp
104#elif (LCD_WIDTH >= 128) && (LCD_HEIGHT >= 128) & (LCD_DEPTH > 1) 104#elif (LCD_WIDTH >= 128) && (LCD_HEIGHT >= 128) & (LCD_DEPTH > 1)
105chessbox_pieces.128x128x2.bmp 105chessbox_pieces.128x128x2.bmp
106#elif (LCD_WIDTH >= 128) && (LCD_HEIGHT >= 128)
107chessbox_pieces.128x128x1.bmp
108#elif (LCD_WIDTH >= 104) && (LCD_HEIGHT >= 104) & (LCD_DEPTH > 1) 106#elif (LCD_WIDTH >= 104) && (LCD_HEIGHT >= 104) & (LCD_DEPTH > 1)
109chessbox_pieces.104x104x2.bmp 107chessbox_pieces.104x104x2.bmp
108#elif (LCD_WIDTH >= 80) && (LCD_HEIGHT >= 80) & (LCD_DEPTH > 1)
109chessbox_pieces.80x80x16.bmp
110#elif (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) & (LCD_DEPTH == 1) 110#elif (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) & (LCD_DEPTH == 1)
111chessbox_pieces.80x64x1.bmp 111chessbox_pieces.80x64x1.bmp
112#elif (LCD_WIDTH >= 64) && (LCD_HEIGHT >= 64) 112#elif (LCD_WIDTH >= 64) && (LCD_HEIGHT >= 64)
diff --git a/apps/plugins/bitmaps/native/chessbox_pieces.80x80x16.bmp b/apps/plugins/bitmaps/native/chessbox_pieces.80x80x16.bmp
new file mode 100644
index 0000000000..67ef683c3b
--- /dev/null
+++ b/apps/plugins/bitmaps/native/chessbox_pieces.80x80x16.bmp
Binary files differ
diff --git a/apps/plugins/chessbox/Makefile b/apps/plugins/chessbox/Makefile
index bb85d40751..fd665b00ea 100644
--- a/apps/plugins/chessbox/Makefile
+++ b/apps/plugins/chessbox/Makefile
@@ -8,7 +8,8 @@
8# 8#
9 9
10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ 10INCLUDES = -I$(APPSDIR) -I.. -I. $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) 11 -I$(BUILDDIR)/pluginbitmaps -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) \
12 -I$(BUILDDIR)
12CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \ 13CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN 14 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
14 15
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c
index 2ff808d52c..9b0b79bcda 100644
--- a/apps/plugins/chessbox/chessbox.c
+++ b/apps/plugins/chessbox/chessbox.c
@@ -196,37 +196,29 @@ PLUGIN_HEADER
196#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT) 196#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
197#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT) 197#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
198 198
199#elif CONFIG_KEYPAD == SANSA_C200_PAD
200#define CB_SELECT BUTTON_SELECT
201#define CB_UP BUTTON_UP
202#define CB_DOWN BUTTON_DOWN
203#define CB_LEFT BUTTON_LEFT
204#define CB_RIGHT BUTTON_RIGHT
205#define CB_PLAY BUTTON_VOL_UP
206#define CB_LEVEL BUTTON_REC
207#define CB_MENU BUTTON_POWER
208
209#define CB_SCROLL_UP (BUTTON_UP|BUTTON_REPEAT)
210#define CB_SCROLL_DOWN (BUTTON_DOWN|BUTTON_REPEAT)
211#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
212#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
213
199#else 214#else
200 #error CHESSBOX: Unsupported keypad 215 #error CHESSBOX: Unsupported keypad
201#endif 216#endif
202 217
203/* use 30x30 tiles */ 218/* Tile size defined by the assigned bitmap */
204#if (LCD_HEIGHT >= 240) && (LCD_WIDTH >= 240) 219#include "chessbox_pieces.h"
205#define TILE_WIDTH 30 220#define TILE_WIDTH BMPWIDTH_chessbox_pieces
206#define TILE_HEIGHT 30 221#define TILE_HEIGHT (BMPHEIGHT_chessbox_pieces/26)
207/* use 22x22 tiles */
208#elif (LCD_HEIGHT >= 176) && (LCD_WIDTH >= 176)
209#define TILE_WIDTH 22
210#define TILE_HEIGHT 22
211/* use 16x16 tiles */
212#elif (LCD_HEIGHT >= 128) && (LCD_WIDTH >= 128)
213#define TILE_WIDTH 16
214#define TILE_HEIGHT 16
215/* use 13x13 tiles */
216#elif (LCD_HEIGHT >= 104) && (LCD_WIDTH >= 104)
217#define TILE_WIDTH 13
218#define TILE_HEIGHT 13
219/* use 10x8 tiles , only for the archoses */
220#elif (LCD_HEIGHT == 64) && (LCD_WIDTH == 112)
221#define TILE_WIDTH 10
222#define TILE_HEIGHT 8
223/* use 8x8 tiles */
224#elif (LCD_HEIGHT >= 64) && (LCD_WIDTH >= 64)
225#define TILE_WIDTH 8
226#define TILE_HEIGHT 8
227#else
228 #error CHESSBOX: Unsupported LCD
229#endif
230 222
231/* Calculate Offsets */ 223/* Calculate Offsets */
232#define XOFS ((LCD_WIDTH-8*TILE_WIDTH)/2) 224#define XOFS ((LCD_WIDTH-8*TILE_WIDTH)/2)
diff --git a/apps/plugins/chessbox/chessbox_pgn.c b/apps/plugins/chessbox/chessbox_pgn.c
index 3780e32466..ab3215384f 100644
--- a/apps/plugins/chessbox/chessbox_pgn.c
+++ b/apps/plugins/chessbox/chessbox_pgn.c
@@ -184,6 +184,21 @@
184#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT) 184#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
185#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT) 185#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
186 186
187#elif CONFIG_KEYPAD == SANSA_C200_PAD
188#define CB_SELECT BUTTON_SELECT
189#define CB_UP BUTTON_UP
190#define CB_DOWN BUTTON_DOWN
191#define CB_LEFT BUTTON_LEFT
192#define CB_RIGHT BUTTON_RIGHT
193#define CB_PLAY BUTTON_VOL_UP
194#define CB_LEVEL BUTTON_REC
195#define CB_MENU BUTTON_POWER
196
197#define CB_SCROLL_UP (BUTTON_UP|BUTTON_REPEAT)
198#define CB_SCROLL_DOWN (BUTTON_DOWN|BUTTON_REPEAT)
199#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
200#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
201
187#else 202#else
188 #error CHESSBOX: Unsupported keypad 203 #error CHESSBOX: Unsupported keypad
189#endif 204#endif
diff --git a/manual/plugins/chessbox.tex b/manual/plugins/chessbox.tex
index 57caad21d4..883cc64a5c 100644
--- a/manual/plugins/chessbox.tex
+++ b/manual/plugins/chessbox.tex
@@ -29,7 +29,7 @@ the game.
29 & Move the cursor\\ 29 & Move the cursor\\
30 \opt{RECORDER_PAD}{\ButtonPlay} 30 \opt{RECORDER_PAD}{\ButtonPlay}
31 \opt{ONDIO_PAD}{\ButtonMenu} 31 \opt{ONDIO_PAD}{\ButtonMenu}
32 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,GIGABEAT_PAD} 32 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD,GIGABEAT_PAD}
33 {\ButtonSelect} 33 {\ButtonSelect}
34 \opt{IRIVER_H10_PAD}{\ButtonRew} 34 \opt{IRIVER_H10_PAD}{\ButtonRew}
35 & Select / Move piece\\ 35 & Select / Move piece\\
@@ -37,7 +37,7 @@ the game.
37 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonOff} 37 \opt{ONDIO_PAD}{\ButtonMenu+\ButtonOff}
38 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} 38 \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode}
39 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight} 39 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight}
40 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD}{\ButtonRec} 40 \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec}
41 \opt{IRIVER_H10_PAD}{\ButtonFF} 41 \opt{IRIVER_H10_PAD}{\ButtonFF}
42 \opt{GIGABEAT_PAD}{\ButtonMenu} 42 \opt{GIGABEAT_PAD}{\ButtonMenu}
43 & Change level\\ 43 & Change level\\
@@ -46,11 +46,12 @@ the game.
46 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay} 46 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay}
47 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD}{\ButtonPlay} 47 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD}{\ButtonPlay}
48 \opt{SANSA_E200_PAD}{\ButtonSelect+\ButtonRight} 48 \opt{SANSA_E200_PAD}{\ButtonSelect+\ButtonRight}
49 \opt{SANSA_C200_PAD}{\ButtonVolUp}
49 \opt{GIGABEAT_PAD}{\ButtonPower} 50 \opt{GIGABEAT_PAD}{\ButtonPower}
50 & Force play\\ 51 & Force play\\
51 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} 52 \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff}
52 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} 53 \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu}
53 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD}{\ButtonPower} 54 \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonPower}
54 \opt{GIGABEAT_PAD}{\ButtonA} 55 \opt{GIGABEAT_PAD}{\ButtonA}
55 & Show the menu\\ 56 & Show the menu\\
56 \end{btnmap} 57 \end{btnmap}