summaryrefslogtreecommitdiff
path: root/apps/plugins
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 /apps/plugins
parent3ab686e07ea2da66f32cb31894ebda08a614ef06 (diff)
downloadrockbox-df1f0d642946d125b03b83209f4c5a6fd4b156b3.zip
rockbox-df1f0d642946d125b03b83209f4c5a6fd4b156b3.tar.gz
rockbox-df1f0d642946d125b03b83209f4c5a6fd4b156b3.tar.bz2
rockbox-df1f0d642946d125b03b83209f4c5a6fd4b156b3.tar.xz
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
Diffstat (limited to 'apps/plugins')
-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
6 files changed, 38 insertions, 32 deletions
diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS
index 6cdc865..c01f760 100644
--- a/apps/plugins/SUBDIRS
+++ b/apps/plugins/SUBDIRS
@@ -16,9 +16,7 @@ rockboy
/* For all targets with a bitmap display */
#ifdef HAVE_LCD_BITMAP
-#ifndef SANSA_C200
chessbox
-#endif
sudoku
reversi
#endif
diff --git a/apps/plugins/bitmaps/native/SOURCES b/apps/plugins/bitmaps/native/SOURCES
index 02eead8..aa36caa 100644
--- a/apps/plugins/bitmaps/native/SOURCES
+++ b/apps/plugins/bitmaps/native/SOURCES
@@ -103,10 +103,10 @@ chessbox_pieces.240x240x16.bmp
chessbox_pieces.176x176x16.bmp
#elif (LCD_WIDTH >= 128) && (LCD_HEIGHT >= 128) & (LCD_DEPTH > 1)
chessbox_pieces.128x128x2.bmp
-#elif (LCD_WIDTH >= 128) && (LCD_HEIGHT >= 128)
-chessbox_pieces.128x128x1.bmp
#elif (LCD_WIDTH >= 104) && (LCD_HEIGHT >= 104) & (LCD_DEPTH > 1)
chessbox_pieces.104x104x2.bmp
+#elif (LCD_WIDTH >= 80) && (LCD_HEIGHT >= 80) & (LCD_DEPTH > 1)
+chessbox_pieces.80x80x16.bmp
#elif (LCD_WIDTH == 112) && (LCD_HEIGHT == 64) & (LCD_DEPTH == 1)
chessbox_pieces.80x64x1.bmp
#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 0000000..67ef683
--- /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 bb85d40..fd665b0 100644
--- a/apps/plugins/chessbox/Makefile
+++ b/apps/plugins/chessbox/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$(BUILDDIR)/pluginbitmaps -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) \
+ -I$(BUILDDIR)
CFLAGS = $(INCLUDES) $(GCCOPTS) -O2 $(TARGET) $(EXTRA_DEFINES) \
-DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c
index 2ff808d..9b0b79b 100644
--- a/apps/plugins/chessbox/chessbox.c
+++ b/apps/plugins/chessbox/chessbox.c
@@ -196,37 +196,29 @@ PLUGIN_HEADER
#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
+#elif CONFIG_KEYPAD == SANSA_C200_PAD
+#define CB_SELECT BUTTON_SELECT
+#define CB_UP BUTTON_UP
+#define CB_DOWN BUTTON_DOWN
+#define CB_LEFT BUTTON_LEFT
+#define CB_RIGHT BUTTON_RIGHT
+#define CB_PLAY BUTTON_VOL_UP
+#define CB_LEVEL BUTTON_REC
+#define CB_MENU BUTTON_POWER
+
+#define CB_SCROLL_UP (BUTTON_UP|BUTTON_REPEAT)
+#define CB_SCROLL_DOWN (BUTTON_DOWN|BUTTON_REPEAT)
+#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
+#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
+
#else
#error CHESSBOX: Unsupported keypad
#endif
-/* use 30x30 tiles */
-#if (LCD_HEIGHT >= 240) && (LCD_WIDTH >= 240)
-#define TILE_WIDTH 30
-#define TILE_HEIGHT 30
-/* use 22x22 tiles */
-#elif (LCD_HEIGHT >= 176) && (LCD_WIDTH >= 176)
-#define TILE_WIDTH 22
-#define TILE_HEIGHT 22
-/* use 16x16 tiles */
-#elif (LCD_HEIGHT >= 128) && (LCD_WIDTH >= 128)
-#define TILE_WIDTH 16
-#define TILE_HEIGHT 16
-/* use 13x13 tiles */
-#elif (LCD_HEIGHT >= 104) && (LCD_WIDTH >= 104)
-#define TILE_WIDTH 13
-#define TILE_HEIGHT 13
-/* use 10x8 tiles , only for the archoses */
-#elif (LCD_HEIGHT == 64) && (LCD_WIDTH == 112)
-#define TILE_WIDTH 10
-#define TILE_HEIGHT 8
-/* use 8x8 tiles */
-#elif (LCD_HEIGHT >= 64) && (LCD_WIDTH >= 64)
-#define TILE_WIDTH 8
-#define TILE_HEIGHT 8
-#else
- #error CHESSBOX: Unsupported LCD
-#endif
+/* Tile size defined by the assigned bitmap */
+#include "chessbox_pieces.h"
+#define TILE_WIDTH BMPWIDTH_chessbox_pieces
+#define TILE_HEIGHT (BMPHEIGHT_chessbox_pieces/26)
/* Calculate Offsets */
#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 3780e32..ab32153 100644
--- a/apps/plugins/chessbox/chessbox_pgn.c
+++ b/apps/plugins/chessbox/chessbox_pgn.c
@@ -184,6 +184,21 @@
#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
+#elif CONFIG_KEYPAD == SANSA_C200_PAD
+#define CB_SELECT BUTTON_SELECT
+#define CB_UP BUTTON_UP
+#define CB_DOWN BUTTON_DOWN
+#define CB_LEFT BUTTON_LEFT
+#define CB_RIGHT BUTTON_RIGHT
+#define CB_PLAY BUTTON_VOL_UP
+#define CB_LEVEL BUTTON_REC
+#define CB_MENU BUTTON_POWER
+
+#define CB_SCROLL_UP (BUTTON_UP|BUTTON_REPEAT)
+#define CB_SCROLL_DOWN (BUTTON_DOWN|BUTTON_REPEAT)
+#define CB_SCROLL_LEFT (BUTTON_LEFT|BUTTON_REPEAT)
+#define CB_SCROLL_RIGHT (BUTTON_RIGHT|BUTTON_REPEAT)
+
#else
#error CHESSBOX: Unsupported keypad
#endif