From df1f0d642946d125b03b83209f4c5a6fd4b156b3 Mon Sep 17 00:00:00 2001 From: Marianne Arnold Date: Fri, 19 Oct 2007 09:05:18 +0000 Subject: [PATCH] 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 --- apps/plugins/SUBDIRS | 2 - apps/plugins/bitmaps/native/SOURCES | 4 +- .../native/chessbox_pieces.80x80x16.bmp | Bin 0 -> 8374 bytes apps/plugins/chessbox/Makefile | 3 +- apps/plugins/chessbox/chessbox.c | 46 ++++++++---------- apps/plugins/chessbox/chessbox_pgn.c | 15 ++++++ manual/plugins/chessbox.tex | 7 +-- 7 files changed, 42 insertions(+), 35 deletions(-) create mode 100644 apps/plugins/bitmaps/native/chessbox_pieces.80x80x16.bmp 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 /* 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 02eead8160..aa36caa8cf 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 0000000000000000000000000000000000000000..67ef683c3b64d040f0742ac60826545e74187ac5 GIT binary patch literal 8374 zcmeH}F>Yi>3`9qg1p#*E$l-=QfuUp*<%SX^3Uv#Gj&%cHz(??9d=o*7_4}-;8g}`$F4wcQ0q%$qAbYHQsqiL=+}ZVm7=x@R{eOZ;d`_yYkl?B z5mQ`CmkY>z31WDYtMMmtFX8(YW;a})7zI-WL+y;KRe2jdu5r~I!~4WJ`zXINC;PO% z(wx)O6ng4#fy`g^6R+Km&c|-|V?yG(J^|`y1Prw^u2$u3+_=V7a18Gg=j@~W&YbK~ z|4Ce2<2iiIf~#EP+MkMRe+?J8cczL;6dwO-y;q0v21VQz4F#@tA0S{lQQYo_?UoQzvP-^H z9r-jA$jM+V{mD*Bz&4+&ZGB`r(!JF_tuKPpQ1de!EBXPMpA;qH>Y$866Ouy5@aRMO zh>I2+cf@Hp={MqdNy%^oUB}s5AK8v{Z?#9YkLgQ{hMNEPTG0>4e9gosghdxz)iMq- zlVRX~3=i4cn(iOCG^ex9YOG(Q9{#=*SizV|q0kuV-fE9(AJbQAP?p7Htmp@1{;Hoh zsy8(Fj_vo__^0rYQ^JPdvwn{2%`@}&TAs<-VE_F6lk7;O|3bDNwTREBwf_@@-x9eC z&S&lB<_0b}Pveh|kN5ZY3hP%m;u9jU@iDUyLb!ecZ9aWslc-N@!?jC2$+FSIt39fn zvx?F1RX?&CUf!VJf;02&?JdJ;i^lmiKRi4r45Ec=d_us9uo|v_V#4){X!Ge4l0WA_hS+p5X>{UZ#hJ$bU=y{y2I56-e+o2=Me z>T$m5{^=7u&L0&hx9mS)H%{xDfthLg{njpmmv{Jhkb4Z*E|XjR*$QE1p7b*x1an#n z7J|uAWegIrDT>jU|LXm#35UmcKH7g0a7P?3DFF%koH4UM43S6t6#o=XSyEW9)KAZD zwE22Cb~~TxeB~OCGBHM+v4UXWjyPUY0upq6O#K%OdAxXX8HrG6T9qs`aD zu}|wOsk=C`9oM^$#eBFUjt5O`F$7jH=BfK}ihl~HJ}IpK=>5yFN<@}@eS{4toCVrBlS_^8~<<39bXRs literal 0 HcmV?d00001 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 @@ # 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 2ff808d52c..9b0b79bcda 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 3780e32466..ab3215384f 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 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. & Move the cursor\\ \opt{RECORDER_PAD}{\ButtonPlay} \opt{ONDIO_PAD}{\ButtonMenu} - \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,GIGABEAT_PAD} + \opt{IRIVER_H100_PAD,IRIVER_H300_PAD,IPOD_4G_PAD,IPOD_3G_PAD,IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD,GIGABEAT_PAD} {\ButtonSelect} \opt{IRIVER_H10_PAD}{\ButtonRew} & Select / Move piece\\ @@ -37,7 +37,7 @@ the game. \opt{ONDIO_PAD}{\ButtonMenu+\ButtonOff} \opt{IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonMode} \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonRight} - \opt{IAUDIO_X5_PAD,SANSA_E200_PAD}{\ButtonRec} + \opt{IAUDIO_X5_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonRec} \opt{IRIVER_H10_PAD}{\ButtonFF} \opt{GIGABEAT_PAD}{\ButtonMenu} & Change level\\ @@ -46,11 +46,12 @@ the game. \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonPlay} \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD}{\ButtonPlay} \opt{SANSA_E200_PAD}{\ButtonSelect+\ButtonRight} + \opt{SANSA_C200_PAD}{\ButtonVolUp} \opt{GIGABEAT_PAD}{\ButtonPower} & Force play\\ \opt{RECORDER_PAD,ONDIO_PAD,IRIVER_H100_PAD,IRIVER_H300_PAD}{\ButtonOff} \opt{IPOD_4G_PAD,IPOD_3G_PAD}{\ButtonSelect+\ButtonMenu} - \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD}{\ButtonPower} + \opt{IAUDIO_X5_PAD,IRIVER_H10_PAD,SANSA_E200_PAD,SANSA_C200_PAD}{\ButtonPower} \opt{GIGABEAT_PAD}{\ButtonA} & Show the menu\\ \end{btnmap}