diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-01-29 20:49:43 +0000 |
---|---|---|
committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-01-29 20:49:43 +0000 |
commit | 36c71a60ca82f9777fbdd239f63f62ccf68cf3f5 (patch) | |
tree | 06518f1485a9899da1015445623256721435323e | |
parent | d4b99fdfe06bf5f30f4c3a68f08aedaaa6f432f9 (diff) | |
download | rockbox-36c71a60ca82f9777fbdd239f63f62ccf68cf3f5.tar.gz rockbox-36c71a60ca82f9777fbdd239f63f62ccf68cf3f5.zip |
Get checkwps working again
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19880 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/gui/wps_parser.c | 15 | ||||
-rw-r--r-- | apps/recorder/bmp.c | 3 | ||||
-rw-r--r-- | firmware/export/button.h | 4 | ||||
-rw-r--r-- | firmware/export/font.h | 2 | ||||
-rw-r--r-- | tools/checkwps/Makefile | 3 | ||||
-rw-r--r-- | tools/checkwps/checkwps.c | 52 | ||||
-rw-r--r-- | tools/checkwps/checkwps.h | 8 |
7 files changed, 66 insertions, 21 deletions
diff --git a/apps/gui/wps_parser.c b/apps/gui/wps_parser.c index acf161b6bb..0cc3ced06a 100644 --- a/apps/gui/wps_parser.c +++ b/apps/gui/wps_parser.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <stdio.h> | 22 | #include <stdio.h> |
23 | #include <string.h> | 23 | #include <string.h> |
24 | #include <stdlib.h> | 24 | #include <stdlib.h> |
25 | #include "gwps.h" | ||
26 | #include "file.h" | 25 | #include "file.h" |
27 | #include "misc.h" | 26 | #include "misc.h" |
28 | #include "plugin.h" | 27 | #include "plugin.h" |
@@ -32,30 +31,24 @@ | |||
32 | #include "proxy.h" | 31 | #include "proxy.h" |
33 | #include "settings.h" | 32 | #include "settings.h" |
34 | #include "sysfont.h" | 33 | #include "sysfont.h" |
35 | #include "gwps.h" | ||
36 | #include "font.h" | ||
37 | #include "bmp.h" | ||
38 | #include "backdrop.h" | ||
39 | #include "ctype.h" | ||
40 | #else | 34 | #else |
41 | #include "checkwps.h" | 35 | #include "checkwps.h" |
42 | #define SYSFONT_HEIGHT 8 | 36 | #include "audio.h" |
43 | #define DEBUGF printf | 37 | #define DEBUGF printf |
44 | #endif /*WPSEDITOR*/ | 38 | #endif /*WPSEDITOR*/ |
45 | #define FONT_SYSFIXED 0 | ||
46 | #define FONT_UI 1 | ||
47 | #else | 39 | #else |
48 | #include "debug.h" | 40 | #include "debug.h" |
49 | #endif /*__PCTOOL__*/ | 41 | #endif /*__PCTOOL__*/ |
50 | 42 | ||
51 | #ifndef __PCTOOL__ | ||
52 | #include <ctype.h> | 43 | #include <ctype.h> |
53 | #include <stdbool.h> | 44 | #include <stdbool.h> |
54 | #include <string.h> | 45 | #include <string.h> |
55 | #include "font.h" | 46 | #include "font.h" |
56 | 47 | ||
57 | #include "gwps.h" | 48 | #include "gwps.h" |
49 | #ifndef __PCTOOL__ | ||
58 | #include "settings.h" | 50 | #include "settings.h" |
51 | #endif | ||
59 | #include "settings_list.h" | 52 | #include "settings_list.h" |
60 | 53 | ||
61 | #ifdef HAVE_LCD_BITMAP | 54 | #ifdef HAVE_LCD_BITMAP |
@@ -64,8 +57,6 @@ | |||
64 | 57 | ||
65 | #include "backdrop.h" | 58 | #include "backdrop.h" |
66 | 59 | ||
67 | #endif | ||
68 | |||
69 | #define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps" | 60 | #define WPS_DEFAULTCFG WPS_DIR "/rockbox_default.wps" |
70 | #define RWPS_DEFAULTCFG WPS_DIR "/rockbox_default.rwps" | 61 | #define RWPS_DEFAULTCFG WPS_DIR "/rockbox_default.rwps" |
71 | 62 | ||
diff --git a/apps/recorder/bmp.c b/apps/recorder/bmp.c index d6d836a6c5..3fb8a4d6c1 100644 --- a/apps/recorder/bmp.c +++ b/apps/recorder/bmp.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #endif | 47 | #endif |
48 | #include "lcd.h" | 48 | #include "lcd.h" |
49 | #include "file.h" | 49 | #include "file.h" |
50 | #include "bmp.h" | ||
50 | #ifdef HAVE_REMOTE_LCD | 51 | #ifdef HAVE_REMOTE_LCD |
51 | #include "lcd-remote.h" | 52 | #include "lcd-remote.h" |
52 | #endif | 53 | #endif |
@@ -58,9 +59,9 @@ | |||
58 | #ifndef __PCTOOL__ | 59 | #ifndef __PCTOOL__ |
59 | #include "config.h" | 60 | #include "config.h" |
60 | #include "system.h" | 61 | #include "system.h" |
61 | #include "bmp.h" | ||
62 | #include "resize.h" | 62 | #include "resize.h" |
63 | #else | 63 | #else |
64 | #include "checkwps.h" | ||
64 | #undef DEBUGF | 65 | #undef DEBUGF |
65 | #define DEBUGF(...) | 66 | #define DEBUGF(...) |
66 | #endif | 67 | #endif |
diff --git a/firmware/export/button.h b/firmware/export/button.h index 0b4c8fd2b0..ebfc1272cb 100644 --- a/firmware/export/button.h +++ b/firmware/export/button.h | |||
@@ -68,11 +68,11 @@ int button_apply_acceleration(const unsigned int data); | |||
68 | #define BUTTON_TOUCHSCREEN 0x08000000 | 68 | #define BUTTON_TOUCHSCREEN 0x08000000 |
69 | 69 | ||
70 | #ifdef HAVE_TOUCHSCREEN | 70 | #ifdef HAVE_TOUCHSCREEN |
71 | #if !defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \ | 71 | #if (!defined(BUTTON_TOPLEFT) || !defined(BUTTON_TOPMIDDLE) \ |
72 | || !defined(BUTTON_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \ | 72 | || !defined(BUTTON_TOPRIGHT) || !defined(BUTTON_MIDLEFT) \ |
73 | || !defined(BUTTON_CENTER) || !defined(BUTTON_MIDRIGHT) \ | 73 | || !defined(BUTTON_CENTER) || !defined(BUTTON_MIDRIGHT) \ |
74 | || !defined(BUTTON_BOTTOMLEFT) || !defined(BUTTON_BOTTOMMIDDLE) \ | 74 | || !defined(BUTTON_BOTTOMLEFT) || !defined(BUTTON_BOTTOMMIDDLE) \ |
75 | || !defined(BUTTON_BOTTOMRIGHT) | 75 | || !defined(BUTTON_BOTTOMRIGHT)) && !defined(__PCTOOL__) |
76 | #error Touchscreen button mode BUTTON_* defines not set up correctly | 76 | #error Touchscreen button mode BUTTON_* defines not set up correctly |
77 | #endif | 77 | #endif |
78 | enum touchscreen_mode { | 78 | enum touchscreen_mode { |
diff --git a/firmware/export/font.h b/firmware/export/font.h index 75b012d722..d17fa18b8b 100644 --- a/firmware/export/font.h +++ b/firmware/export/font.h | |||
@@ -62,11 +62,13 @@ | |||
62 | * must be available at system startup. | 62 | * must be available at system startup. |
63 | * Fonts are specified in firmware/font.c. | 63 | * Fonts are specified in firmware/font.c. |
64 | */ | 64 | */ |
65 | #ifndef __PCTOOL__ | ||
65 | enum { | 66 | enum { |
66 | FONT_SYSFIXED, /* system fixed pitch font*/ | 67 | FONT_SYSFIXED, /* system fixed pitch font*/ |
67 | FONT_UI, /* system porportional font*/ | 68 | FONT_UI, /* system porportional font*/ |
68 | MAXFONTS | 69 | MAXFONTS |
69 | }; | 70 | }; |
71 | #endif | ||
70 | 72 | ||
71 | /* | 73 | /* |
72 | * .fnt loadable font file format definition | 74 | * .fnt loadable font file format definition |
diff --git a/tools/checkwps/Makefile b/tools/checkwps/Makefile index cde80b0dde..1bdf3580f9 100644 --- a/tools/checkwps/Makefile +++ b/tools/checkwps/Makefile | |||
@@ -27,9 +27,10 @@ COMMON=$(ROOT)/apps/gui/wps_parser.c \ | |||
27 | INCLUDE=-I $(ROOT)/apps/gui \ | 27 | INCLUDE=-I $(ROOT)/apps/gui \ |
28 | -I $(ROOT)/firmware/export \ | 28 | -I $(ROOT)/firmware/export \ |
29 | -I $(ROOT)/apps \ | 29 | -I $(ROOT)/apps \ |
30 | -I $(ROOT)/apps/recorder \ | ||
30 | -I . | 31 | -I . |
31 | 32 | ||
32 | CFLAGS = -g -D__PCTOOL__ -DDEBUG -DROCKBOX_DIR_LEN=9 -DWPS_DIR=\".\" | 33 | CFLAGS = -g -D__PCTOOL__ -DDEBUG -DROCKBOX_DIR_LEN=9 -DWPS_DIR=\".\" |
33 | 34 | ||
34 | all: | 35 | all: |
35 | @echo To build, run the buildall.sh script | 36 | @echo To build, run the buildall.sh script |
diff --git a/tools/checkwps/checkwps.c b/tools/checkwps/checkwps.c index 2981303701..17098d2b06 100644 --- a/tools/checkwps/checkwps.c +++ b/tools/checkwps/checkwps.c | |||
@@ -25,14 +25,16 @@ | |||
25 | #include "config.h" | 25 | #include "config.h" |
26 | #include "gwps.h" | 26 | #include "gwps.h" |
27 | #include "checkwps.h" | 27 | #include "checkwps.h" |
28 | 28 | #include "resize.h" | |
29 | #define MIN(x,y) ((x) > (y) ? (y) : (x)) | ||
30 | 29 | ||
31 | bool debug_wps = true; | 30 | bool debug_wps = true; |
32 | int wps_verbose_level = 0; | 31 | int wps_verbose_level = 0; |
33 | 32 | ||
34 | int errno; | 33 | int errno; |
35 | 34 | ||
35 | const struct settings_list *settings; | ||
36 | const int nb_settings = 0; | ||
37 | |||
36 | /* static endianness conversion */ | 38 | /* static endianness conversion */ |
37 | #define SWAP_16(x) ((typeof(x))(unsigned short)(((unsigned short)(x) >> 8) | \ | 39 | #define SWAP_16(x) ((typeof(x))(unsigned short)(((unsigned short)(x) >> 8) | \ |
38 | ((unsigned short)(x) << 8))) | 40 | ((unsigned short)(x) << 8))) |
@@ -55,6 +57,20 @@ unsigned short letoh16(unsigned short x) | |||
55 | } | 57 | } |
56 | } | 58 | } |
57 | 59 | ||
60 | unsigned short letoh32(unsigned short x) | ||
61 | { | ||
62 | unsigned short n = 0x1234; | ||
63 | unsigned char* ch = (unsigned char*)&n; | ||
64 | |||
65 | if (*ch == 0x34) | ||
66 | { | ||
67 | /* Little-endian */ | ||
68 | return x; | ||
69 | } else { | ||
70 | return SWAP_32(x); | ||
71 | } | ||
72 | } | ||
73 | |||
58 | unsigned int htole32(unsigned int x) | 74 | unsigned int htole32(unsigned int x) |
59 | { | 75 | { |
60 | unsigned short n = 0x1234; | 76 | unsigned short n = 0x1234; |
@@ -109,6 +125,38 @@ bool load_remote_wps_backdrop(const char* filename) | |||
109 | return true; | 125 | return true; |
110 | } | 126 | } |
111 | 127 | ||
128 | int recalc_dimension(struct dim *dst, struct dim *src) | ||
129 | { | ||
130 | return 0; | ||
131 | } | ||
132 | |||
133 | int resize_on_load(struct bitmap *bm, bool dither, struct dim *src, | ||
134 | struct rowset *rset, unsigned char *buf, unsigned int len, | ||
135 | const struct custom_format *format, | ||
136 | struct img_part* (*store_part)(void *args), | ||
137 | void *args) | ||
138 | { | ||
139 | return 0; | ||
140 | } | ||
141 | |||
142 | int audio_status(void) | ||
143 | { | ||
144 | return 0; | ||
145 | } | ||
146 | |||
147 | struct mp3entry* audio_current_track(void) | ||
148 | { | ||
149 | return NULL; | ||
150 | } | ||
151 | |||
152 | void audio_stop(void) | ||
153 | { | ||
154 | } | ||
155 | |||
156 | void audio_play(long offset) | ||
157 | { | ||
158 | } | ||
159 | |||
112 | static char pluginbuf[PLUGIN_BUFFER_SIZE]; | 160 | static char pluginbuf[PLUGIN_BUFFER_SIZE]; |
113 | 161 | ||
114 | static unsigned dummy_func2(void) | 162 | static unsigned dummy_func2(void) |
diff --git a/tools/checkwps/checkwps.h b/tools/checkwps/checkwps.h index fa3b425500..2ba8f5f59e 100644 --- a/tools/checkwps/checkwps.h +++ b/tools/checkwps/checkwps.h | |||
@@ -23,20 +23,22 @@ | |||
23 | #define _CHECKWPS_H_ | 23 | #define _CHECKWPS_H_ |
24 | #include <stdio.h> | 24 | #include <stdio.h> |
25 | #include <stdlib.h> | 25 | #include <stdlib.h> |
26 | #include <stdbool.h> | ||
26 | #include <fcntl.h> | 27 | #include <fcntl.h> |
27 | 28 | ||
28 | /* subset of global_settings needed to build checkwps. */ | 29 | /* subset of global_settings needed to build checkwps. */ |
29 | struct user_settings { | 30 | struct user_settings { |
30 | bool statusbar; | 31 | bool statusbar; |
31 | #ifdef HAVE_LCD_COLOR | ||
32 | int bg_color; /* background color native format */ | 32 | int bg_color; /* background color native format */ |
33 | int fg_color; /* foreground color native format */ | 33 | int fg_color; /* foreground color native format */ |
34 | #endif | ||
35 | }; | 34 | }; |
36 | 35 | ||
37 | extern struct user_settings global_settings; | 36 | extern struct user_settings global_settings; |
38 | 37 | ||
38 | #define FONT_SYSFIXED 0 | ||
39 | #define FONT_UI 1 | ||
40 | #define SYSFONT_HEIGHT 8 | ||
39 | 41 | ||
40 | 42 | #define MIN(x,y) ((x) > (y) ? (y) : (x)) | |
41 | 43 | ||
42 | #endif | 44 | #endif |