summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-02-24 00:51:37 +0000
committerJens Arnold <amiconn@rockbox.org>2006-02-24 00:51:37 +0000
commit40d99f434e50a1d3ad19750e663fead7cf08872e (patch)
treebdbf18247f4073292a41da0811fbf6e03872a551 /apps
parent0b489779cee2297e66f999dc68261fa1df9f452f (diff)
downloadrockbox-40d99f434e50a1d3ad19750e663fead7cf08872e.tar.gz
rockbox-40d99f434e50a1d3ad19750e663fead7cf08872e.zip
Made chessbox work on archos recorders and Ondios as an overlay. * Proper button handling for Ondio. * Some cleanup of the plugin SOURCES file.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8822 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/SOURCES65
-rw-r--r--apps/plugins/chessbox/Makefile15
-rwxr-xr-xapps/plugins/chessbox/archos.lds46
-rw-r--r--apps/plugins/chessbox/chessbox.c22
4 files changed, 110 insertions, 38 deletions
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index 190d625829..a3bfa07296 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -4,9 +4,11 @@ battery_test.c
4chessclock.c 4chessclock.c
5credits.c 5credits.c
6cube.c 6cube.c
7dict.c
7favorites.c 8favorites.c
8firmware_flash.c 9firmware_flash.c
9logo.c 10logo.c
11metronome.c
10mosaique.c 12mosaique.c
11rockbox_flash.c 13rockbox_flash.c
12search.c 14search.c
@@ -16,23 +18,20 @@ stats.c
16stopwatch.c 18stopwatch.c
17vbrfix.c 19vbrfix.c
18viewer.c 20viewer.c
19dict.c
20metronome.c
21 21
22#ifndef IRIVER_IFP7XX_SERIES /* Temporarily disable plugins for iFP7xx */ 22#ifndef IRIVER_IFP7XX_SERIES /* Temporarily disable plugins for iFP7xx */
23#ifdef HAVE_LCD_BITMAP /* Recorder/Ondio models only */ 23#ifdef HAVE_LCD_BITMAP /* Not for the Player */
24 24
25/* Plugins needing the grayscale lib */ 25#if CONFIG_LCD != LCD_IPOD2BPP /* Plugins needing the grayscale lib */
26#if CONFIG_LCD != LCD_IPOD2BPP
27#ifndef HAVE_LCD_COLOR 26#ifndef HAVE_LCD_COLOR
27grayscale.c
28fire.c 28fire.c
29#endif 29#endif
30plasma.c
31jpeg.c 30jpeg.c
32mandelbrot.c 31mandelbrot.c
32plasma.c
33#endif 33#endif
34 34
35solitaire.c
36bejeweled.c 35bejeweled.c
37bounce.c 36bounce.c
38#if (LCD_WIDTH != 138) && (LCD_WIDTH != 128) 37#if (LCD_WIDTH != 138) && (LCD_WIDTH != 128)
@@ -43,19 +42,15 @@ calculator.c
43chip8.c 42chip8.c
44demystify.c 43demystify.c
45flipit.c 44flipit.c
46grayscale.c
47minesweeper.c 45minesweeper.c
48oscillograph.c 46oscillograph.c
49oscilloscope.c 47oscilloscope.c
50pong.c 48pong.c
51rockblox.c 49rockblox.c
52#if (CONFIG_KEYPAD == RECORDER_PAD) && !defined(SIMULATOR)
53/* loader, only needed for Archos */
54rockboy.c
55#endif
56sliding_puzzle.c 50sliding_puzzle.c
57snake.c 51snake.c
58snake2.c 52snake2.c
53solitaire.c
59sokoban.c 54sokoban.c
60star.c 55star.c
61starfield.c 56starfield.c
@@ -67,38 +62,42 @@ sudoku.c
67video.c 62video.c
68#endif 63#endif
69vu_meter.c 64vu_meter.c
65#if CONFIG_KEYPAD == RECORDER_PAD /* Recorder models only for now */
66wormlet.c
67#endif
70 68
71#ifdef CONFIG_RTC 69#ifdef CONFIG_RTC
72#if CONFIG_KEYPAD == RECORDER_PAD 70#if CONFIG_KEYPAD == RECORDER_PAD /* Recorder models only for now */
73/* Recorder models only for now */
74calendar.c 71calendar.c
75clock.c 72clock.c
76#endif 73#endif
77#endif /* #ifdef CONFIG_RTC */ 74#endif /* CONFIG_RTC */
78 75
79#if CONFIG_KEYPAD != ONDIO_PAD 76#if (MEM <= 8) && !defined(SIMULATOR) /* loaders, only needed for Archos */
80/* gradually bring in the ones not working yet */ 77chessbox.c
81wormlet.c 78#if CONFIG_KEYPAD == RECORDER_PAD
82#endif /* #if CONFIG_KEYPAD != ONDIO_PAD */ 79rockboy.c
83#endif /*#ifdef HAVE_LCD_BITMAP */ 80#endif
81#endif
84 82
85#ifdef HAVE_LCD_CHARCELLS /* Player model only */ 83#endif /* HAVE_LCD_BITMAP */
84
85#ifdef HAVE_LCD_CHARCELLS /* Player model only */
86euroconverter.c 86euroconverter.c
87jackpot.c 87jackpot.c
88nim.c 88nim.c
89#endif /* #ifdef HAVE_LCD_CHARCELLS */ 89#endif /* HAVE_LCD_CHARCELLS */
90
91#ifndef HAVE_MMC
92/* not for Ondio, has no remote control pin */
93alpine_cdc.c
94#endif
95 90
96#if CONFIG_CODEC == SWCODEC /* software codec platforms */ 91#if CONFIG_CODEC == SWCODEC /* software codec platforms */
97mp3_encoder.c
98iriverify.c 92iriverify.c
99wav2wv.c 93mp3_encoder.c
100midi2wav.c 94midi2wav.c
101#else 95wav2wv.c
96#else /* hardware codec platforms */
97#ifndef HAVE_MMC /* not for Ondio, has no remote control pin */
98alpine_cdc.c
99#endif
102splitedit.c 100splitedit.c
101#endif /* CONFIG_CODEC */
102
103#endif /* iFP7xx */ 103#endif /* iFP7xx */
104#endif
diff --git a/apps/plugins/chessbox/Makefile b/apps/plugins/chessbox/Makefile
index 05b6d8f6a7..7fe3e7115a 100644
--- a/apps/plugins/chessbox/Makefile
+++ b/apps/plugins/chessbox/Makefile
@@ -9,7 +9,7 @@
9 9
10INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \ 10INCLUDES = -I$(APPSDIR) -I.. -I. -I$(FIRMDIR)/include -I$(FIRMDIR)/export \
11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR) 11 -I$(FIRMDIR)/common -I$(FIRMDIR)/drivers -I$(OUTDIR) -I$(BUILDDIR)
12CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \ 12CFLAGS = $(GCCOPTS) -O2 $(INCLUDES) $(TARGET) $(EXTRA_DEFINES) \
13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN 13 -DTARGET_ID=$(TARGET_ID) -DMEM=${MEMORYSIZE} -DPLUGIN
14 14
15ifdef APPEXTRA 15ifdef APPEXTRA
@@ -24,8 +24,17 @@ SOURCES = $(SRC)
24OBJS := $(SRC:%.c=$(OBJDIR)/%.o) 24OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
25DIRS = . 25DIRS = .
26 26
27LDS := ../plugin.lds 27ifndef SIMVER
28OUTPUT = $(OUTDIR)/chessbox.rock 28ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
29 LDS := archos.lds
30 OUTPUT = $(OUTDIR)/chessbox.ovl
31else ## iRiver target
32 LDS := ../plugin.lds
33 OUTPUT = $(OUTDIR)/chessbox.rock
34endif
35else ## simulators
36 OUTPUT = $(OUTDIR)/chessbox.rock
37endif
29 38
30all: $(OUTPUT) 39all: $(OUTPUT)
31 40
diff --git a/apps/plugins/chessbox/archos.lds b/apps/plugins/chessbox/archos.lds
new file mode 100755
index 0000000000..693acd6335
--- /dev/null
+++ b/apps/plugins/chessbox/archos.lds
@@ -0,0 +1,46 @@
1#include "config.h"
2
3/* linker script for rockboy as an overlay,
4 * only used/ necessary for SH-based archos targets */
5
6OUTPUT_FORMAT(elf32-sh)
7
8#define DRAMORIG 0x09000000
9#define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
10
11#define OVERLAY_LENGTH 0x20000
12#define OVERLAY_ORIGIN (DRAMORIG + (MEMORYSIZE * 0x100000) - PLUGIN_LENGTH - OVERLAY_LENGTH)
13
14MEMORY
15{
16 OVERLAY_RAM : ORIGIN = OVERLAY_ORIGIN, LENGTH = OVERLAY_LENGTH
17}
18
19SECTIONS
20{
21 .header : {
22 _plugin_start_addr = .;
23 *(.header)
24 } > OVERLAY_RAM
25
26 .text : {
27 *(.text)
28 } > OVERLAY_RAM
29
30 .rodata : {
31 *(.rodata)
32 *(.rodata.str1.1)
33 *(.rodata.str1.4)
34 } > OVERLAY_RAM
35
36 .data : {
37 *(.data)
38 } > OVERLAY_RAM
39
40 .bss : {
41 *(.bss)
42 *(COMMON)
43 . = ALIGN(0x4);
44 _plugin_end_addr = .;
45 } > OVERLAY_RAM
46}
diff --git a/apps/plugins/chessbox/chessbox.c b/apps/plugins/chessbox/chessbox.c
index 0d145ec00a..092de1825a 100644
--- a/apps/plugins/chessbox/chessbox.c
+++ b/apps/plugins/chessbox/chessbox.c
@@ -89,12 +89,14 @@ PLUGIN_HEADER
89#define CB_QUIT BUTTON_OFF 89#define CB_QUIT BUTTON_OFF
90 90
91#elif CONFIG_KEYPAD == ONDIO_PAD 91#elif CONFIG_KEYPAD == ONDIO_PAD
92#define CB_SELECT_PRE BUTTON_MENU
92#define CB_SELECT (BUTTON_MENU|BUTTON_REL) 93#define CB_SELECT (BUTTON_MENU|BUTTON_REL)
93#define CB_UP BUTTON_UP 94#define CB_UP BUTTON_UP
94#define CB_DOWN BUTTON_DOWN 95#define CB_DOWN BUTTON_DOWN
95#define CB_LEFT BUTTON_LEFT 96#define CB_LEFT BUTTON_LEFT
96#define CB_RIGHT BUTTON_RIGHT 97#define CB_RIGHT BUTTON_RIGHT
97#define CB_PLAY BUTTON_MENU 98#define CB_PLAY_PRE BUTTON_MENU
99#define CB_PLAY (BUTTON_MENU|BUTTON_REPEAT)
98#define CB_LEVEL (BUTTON_MENU|BUTTON_OFF) 100#define CB_LEVEL (BUTTON_MENU|BUTTON_OFF)
99#define CB_QUIT BUTTON_OFF 101#define CB_QUIT BUTTON_OFF
100 102
@@ -133,6 +135,12 @@ PLUGIN_HEADER
133/*#define COMMAND_RESTART 4*/ 135/*#define COMMAND_RESTART 4*/
134#define COMMAND_QUIT 5 136#define COMMAND_QUIT 5
135 137
138/* GCC wants this to be present for some targets */
139void* memcpy(void* dst, const void* src, size_t size)
140{
141 return rb->memcpy(dst, src, size);
142}
143
136/* ---- Get the board column and row (e2 f.e.) for a physical x y ---- */ 144/* ---- Get the board column and row (e2 f.e.) for a physical x y ---- */
137void xy2cr ( short x, short y, short *c, short *r ) { 145void xy2cr ( short x, short y, short *c, short *r ) {
138 if (computer == black ) { 146 if (computer == black ) {
@@ -286,7 +294,7 @@ void cb_levelup ( void ) {
286struct cb_command cb_getcommand (void) { 294struct cb_command cb_getcommand (void) {
287 static short x = 4 , y = 4 ; 295 static short x = 4 , y = 4 ;
288 short c , r , l; 296 short c , r , l;
289 int button = BUTTON_NONE; 297 int button, lastbutton = BUTTON_NONE;
290 int marked = false , from_marked = false ; 298 int marked = false , from_marked = false ;
291 short marked_x = 0 , marked_y = 0 ; 299 short marked_x = 0 , marked_y = 0 ;
292 struct cb_command result = { 0, {0,0,0,0,0}, 0 }; 300 struct cb_command result = { 0, {0,0,0,0,0}, 0 };
@@ -306,6 +314,10 @@ struct cb_command cb_getcommand (void) {
306 result.type = COMMAND_LEVEL; 314 result.type = COMMAND_LEVEL;
307 return result; 315 return result;
308 case CB_PLAY: 316 case CB_PLAY:
317#ifdef CB_PLAY_PRE
318 if (lastbutton != CB_PLAY_PRE)
319 break;
320#endif
309 result.type = COMMAND_PLAY; 321 result.type = COMMAND_PLAY;
310 return result; 322 return result;
311 case CB_UP: 323 case CB_UP:
@@ -369,6 +381,10 @@ struct cb_command cb_getcommand (void) {
369 } 381 }
370 break; 382 break;
371 case CB_SELECT: 383 case CB_SELECT:
384#ifdef CB_SELECT_PRE
385 if (lastbutton != CB_SELECT_PRE)
386 break;
387#endif
372 if ( !marked ) { 388 if ( !marked ) {
373 xy2cr ( x , y , &c , &r ); 389 xy2cr ( x , y , &c , &r );
374 l = locn[r][c]; 390 l = locn[r][c];
@@ -396,6 +412,8 @@ struct cb_command cb_getcommand (void) {
396 } 412 }
397 break; 413 break;
398 } 414 }
415 if (button != BUTTON_NONE)
416 lastbutton = button;
399 } 417 }
400 418
401} 419}