diff options
Diffstat (limited to 'tools/checkwps')
-rw-r--r-- | tools/checkwps/Makefile | 25 | ||||
-rw-r--r-- | tools/checkwps/README | 23 | ||||
-rwxr-xr-x | tools/checkwps/buildall.sh | 8 | ||||
-rw-r--r-- | tools/checkwps/checkwps.c | 28 | ||||
-rwxr-xr-x | tools/checkwps/cleanall.sh | 7 | ||||
-rw-r--r-- | tools/checkwps/file.h | 7 | ||||
-rw-r--r-- | tools/checkwps/targets.txt | 33 |
7 files changed, 118 insertions, 13 deletions
diff --git a/tools/checkwps/Makefile b/tools/checkwps/Makefile index 70b6e0a963..069b1e4334 100644 --- a/tools/checkwps/Makefile +++ b/tools/checkwps/Makefile | |||
@@ -7,12 +7,25 @@ | |||
7 | # $Id$ | 7 | # $Id$ |
8 | # | 8 | # |
9 | 9 | ||
10 | all: checkwps | 10 | ROOT=../.. |
11 | 11 | ||
12 | checkwps: checkwps.c ../../apps/gui/wps_parser.c ../../apps/gui/wps_debug.c ../../firmware/common/ctype.c ../../apps/misc.c ../../apps/recorder/bmp.c | 12 | COMMON=$(ROOT)/apps/gui/wps_parser.c \ |
13 | $(SILENT)$(CC) -g -I ../../apps/gui -I../../firmware/export \ | 13 | $(ROOT)/apps/gui/wps_debug.c \ |
14 | -D__PCTOOL__ -DDEBUG -DROCKBOX_HAS_LOGF -DIPOD_COLOR -D ROCKBOX_DIR_LEN -D WPS_DIR=\".\" \ | 14 | $(ROOT)/apps/misc.c \ |
15 | -I../../apps -I../../firmware/target/arm/ipod -I../../firmware/include $+ -o $@ | 15 | $(ROOT)/apps/recorder/bmp.c |
16 | |||
17 | INCLUDE=-I $(ROOT)/apps/gui \ | ||
18 | -I $(ROOT)/firmware/export \ | ||
19 | -I $(ROOT)/apps \ | ||
20 | -I . | ||
21 | |||
22 | CFLAGS = -g -D__PCTOOL__ -DDEBUG -DROCKBOX_DIR_LEN=9 -DWPS_DIR=\".\" | ||
23 | |||
24 | all: checkwps.$(MODEL) | ||
25 | |||
26 | checkwps.$(MODEL): checkwps.c $(COMMON) | ||
27 | @echo CC [$(TARGET)] | ||
28 | @$(CC) $(INCLUDE) $(CFLAGS) $(COMMON) -D$(TARGET) checkwps.c -o $@ | ||
16 | 29 | ||
17 | clean: | 30 | clean: |
18 | rm -f cleanwps | 31 | rm -f checkwps.$(MODEL) |
diff --git a/tools/checkwps/README b/tools/checkwps/README new file mode 100644 index 0000000000..a94882fdff --- /dev/null +++ b/tools/checkwps/README | |||
@@ -0,0 +1,23 @@ | |||
1 | This directory contains the checkwps tool which can be used to | ||
2 | validate wps files outside of Rockbox. | ||
3 | |||
4 | checkwps uses the Rockbox WPS parser and is therefore built in | ||
5 | target-specific versions (to avoid making lots of changes to the core | ||
6 | code). | ||
7 | |||
8 | To compile | ||
9 | ---------- | ||
10 | |||
11 | Just run the ./buildall.sh script | ||
12 | |||
13 | |||
14 | To remove all compiled files | ||
15 | ---------------------------- | ||
16 | |||
17 | ./cleanall.sh | ||
18 | |||
19 | |||
20 | To add a new target | ||
21 | ------------------- | ||
22 | |||
23 | Add $target and $modelname from tools/configure to targets.txt | ||
diff --git a/tools/checkwps/buildall.sh b/tools/checkwps/buildall.sh new file mode 100755 index 0000000000..faec663ab8 --- /dev/null +++ b/tools/checkwps/buildall.sh | |||
@@ -0,0 +1,8 @@ | |||
1 | #!/bin/sh | ||
2 | cat targets.txt | ( | ||
3 | while read target model | ||
4 | do | ||
5 | rm -f checkwps.$model | ||
6 | make MODEL=$model TARGET=$target | ||
7 | done | ||
8 | ) | ||
diff --git a/tools/checkwps/checkwps.c b/tools/checkwps/checkwps.c index ddaaf49b73..1051244538 100644 --- a/tools/checkwps/checkwps.c +++ b/tools/checkwps/checkwps.c | |||
@@ -1,5 +1,7 @@ | |||
1 | #include <stdio.h> | 1 | #include <stdio.h> |
2 | #include <stdlib.h> | 2 | #include <stdlib.h> |
3 | #include <fcntl.h> | ||
4 | #include "config.h" | ||
3 | #include "gwps.h" | 5 | #include "gwps.h" |
4 | 6 | ||
5 | #define MIN(x,y) ((x) > (y) ? (y) : (x)) | 7 | #define MIN(x,y) ((x) > (y) ? (y) : (x)) |
@@ -20,7 +22,7 @@ int errno; | |||
20 | unsigned short letoh16(unsigned short x) | 22 | unsigned short letoh16(unsigned short x) |
21 | { | 23 | { |
22 | unsigned short n = 0x1234; | 24 | unsigned short n = 0x1234; |
23 | unsigned char* ch = &n; | 25 | unsigned char* ch = (unsigned char*)&n; |
24 | 26 | ||
25 | if (*ch == 0x34) | 27 | if (*ch == 0x34) |
26 | { | 28 | { |
@@ -34,7 +36,7 @@ unsigned short letoh16(unsigned short x) | |||
34 | unsigned int htole32(unsigned int x) | 36 | unsigned int htole32(unsigned int x) |
35 | { | 37 | { |
36 | unsigned short n = 0x1234; | 38 | unsigned short n = 0x1234; |
37 | unsigned char* ch = &n; | 39 | unsigned char* ch = (unsigned char*)&n; |
38 | 40 | ||
39 | if (*ch == 0x34) | 41 | if (*ch == 0x34) |
40 | { | 42 | { |
@@ -80,6 +82,11 @@ bool load_wps_backdrop(char* filename) | |||
80 | return true; | 82 | return true; |
81 | } | 83 | } |
82 | 84 | ||
85 | bool load_remote_wps_backdrop(char* filename) | ||
86 | { | ||
87 | return true; | ||
88 | } | ||
89 | |||
83 | static char pluginbuf[PLUGIN_BUFFER_SIZE]; | 90 | static char pluginbuf[PLUGIN_BUFFER_SIZE]; |
84 | 91 | ||
85 | static int dummy_func1(void) | 92 | static int dummy_func1(void) |
@@ -105,12 +112,17 @@ struct screen screens[NB_SCREENS] = | |||
105 | .width=LCD_WIDTH, | 112 | .width=LCD_WIDTH, |
106 | .height=LCD_HEIGHT, | 113 | .height=LCD_HEIGHT, |
107 | .depth=LCD_DEPTH, | 114 | .depth=LCD_DEPTH, |
115 | #ifdef HAVE_LCD_COLOR | ||
108 | .is_color=true, | 116 | .is_color=true, |
109 | .has_disk_led=false, | 117 | #else |
118 | .is_color=false, | ||
119 | #endif | ||
110 | .getxmargin=dummy_func1, | 120 | .getxmargin=dummy_func1, |
111 | .getymargin=dummy_func1, | 121 | .getymargin=dummy_func1, |
122 | #if LCD_DEPTH > 1 | ||
112 | .get_foreground=dummy_func2, | 123 | .get_foreground=dummy_func2, |
113 | .get_background=dummy_func2, | 124 | .get_background=dummy_func2, |
125 | #endif | ||
114 | }, | 126 | }, |
115 | #ifdef HAVE_REMOTE_LCD | 127 | #ifdef HAVE_REMOTE_LCD |
116 | { | 128 | { |
@@ -119,10 +131,12 @@ struct screen screens[NB_SCREENS] = | |||
119 | .height=LCD_REMOTE_HEIGHT, | 131 | .height=LCD_REMOTE_HEIGHT, |
120 | .depth=LCD_REMOTE_DEPTH, | 132 | .depth=LCD_REMOTE_DEPTH, |
121 | .is_color=false,/* No color remotes yet */ | 133 | .is_color=false,/* No color remotes yet */ |
122 | .getxmargin=dummy_func, | 134 | .getxmargin=dummy_func1, |
123 | .getymargin=dummy_func, | 135 | .getymargin=dummy_func1, |
124 | .get_foreground=dummy_func, | 136 | #if LCD_REMOTE_DEPTH > 1 |
125 | .get_background=dummy_func, | 137 | .get_foreground=dummy_func2, |
138 | .get_background=dummy_func2, | ||
139 | #endif | ||
126 | } | 140 | } |
127 | #endif | 141 | #endif |
128 | }; | 142 | }; |
diff --git a/tools/checkwps/cleanall.sh b/tools/checkwps/cleanall.sh new file mode 100755 index 0000000000..6cd1a90676 --- /dev/null +++ b/tools/checkwps/cleanall.sh | |||
@@ -0,0 +1,7 @@ | |||
1 | #!/bin/sh | ||
2 | cat targets.txt | ( | ||
3 | while read target model | ||
4 | do | ||
5 | rm -f checkwps.$model | ||
6 | done | ||
7 | ) | ||
diff --git a/tools/checkwps/file.h b/tools/checkwps/file.h new file mode 100644 index 0000000000..4256c1ee37 --- /dev/null +++ b/tools/checkwps/file.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef MAX_PATH | ||
2 | #define MAX_PATH 260 | ||
3 | #endif | ||
4 | |||
5 | /* Wrapper - required for O_RDONLY */ | ||
6 | |||
7 | #include <fcntl.h> | ||
diff --git a/tools/checkwps/targets.txt b/tools/checkwps/targets.txt new file mode 100644 index 0000000000..d2c54378d9 --- /dev/null +++ b/tools/checkwps/targets.txt | |||
@@ -0,0 +1,33 @@ | |||
1 | ARCHOS_RECORDER recorder | ||
2 | ARCHOS_FMRECORDER fmrecorder | ||
3 | ARCHOS_RECORDERV2 recorderv2 | ||
4 | ARCHOS_ONDIOSP ondiosp | ||
5 | ARCHOS_ONDIOFM ondiofm | ||
6 | IRIVER_H120 h120 | ||
7 | IRIVER_H300 h300 | ||
8 | IRIVER_H100 h100 | ||
9 | IRIVER_IFP7XX ifp7xx | ||
10 | IRIVER_H10 h10 | ||
11 | IRIVER_H10_5GB h10_5gb | ||
12 | IPOD_COLOR ipodcolor | ||
13 | IPOD_NANO ipodnano | ||
14 | IPOD_VIDEO ipodvideo | ||
15 | IPOD_3G ipod3g | ||
16 | IPOD_4G ipod4g | ||
17 | IPOD_MINI ipodmini | ||
18 | IPOD_MINI2G ipodmini2g | ||
19 | IPOD_1G2G ipod1g2g | ||
20 | IAUDIO_X5 x5 | ||
21 | IAUDIO_M5 m5 | ||
22 | COWON_D2 cowond2 | ||
23 | IAUDIO_M3 m3 | ||
24 | GIGABEAT_F gigabeatf | ||
25 | GIGABEAT_S gigabeats | ||
26 | MROBE_500 mrobe500 | ||
27 | MROBE_100 mrobe100 | ||
28 | LOGIK_DAX logikdax | ||
29 | CREATIVE_ZVM creativezvm | ||
30 | SANSA_E200 e200 | ||
31 | SANSA_E200 e200r | ||
32 | SANSA_C200 c200 | ||
33 | ELIO_TPJ1022 tpj1022 | ||