summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Mahone <andrew.mahone@gmail.com>2009-05-07 01:23:13 +0000
committerAndrew Mahone <andrew.mahone@gmail.com>2009-05-07 01:23:13 +0000
commit5621fd393a4445645b07bb2e89d89d23bb9a6473 (patch)
treeb2b46a056ea1ae599e0a99118ddacdf72a6dac4a
parent580b1a5c4b305c7cb320415267c5e1b88b053948 (diff)
downloadrockbox-5621fd393a4445645b07bb2e89d89d23bb9a6473.tar.gz
rockbox-5621fd393a4445645b07bb2e89d89d23bb9a6473.zip
Build pictureflow using overlay on lowmem targets, support JPEG AA in PF on all targets.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20864 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/SOURCES5
-rw-r--r--apps/plugins/SUBDIRS3
-rw-r--r--apps/plugins/pictureflow/SOURCES1
-rw-r--r--apps/plugins/pictureflow/pictureflow.c (renamed from apps/plugins/pictureflow.c)9
-rw-r--r--apps/plugins/pictureflow/pictureflow.make58
-rw-r--r--apps/recorder/albumart.c18
-rwxr-xr-xtools/buildzip.pl5
7 files changed, 79 insertions, 20 deletions
diff --git a/apps/plugins/SOURCES b/apps/plugins/SOURCES
index e8d76441b5..a695478e40 100644
--- a/apps/plugins/SOURCES
+++ b/apps/plugins/SOURCES
@@ -55,10 +55,6 @@ text_editor.c
55wavview.c 55wavview.c
56robotfindskitten.c 56robotfindskitten.c
57 57
58#if defined(HAVE_TAGCACHE)
59pictureflow.c
60#endif
61
62#ifdef HAVE_LCD_COLOR 58#ifdef HAVE_LCD_COLOR
63ppmviewer.c 59ppmviewer.c
64#endif 60#endif
@@ -109,6 +105,7 @@ zxbox.c
109/* overlay loader for Goban */ 105/* overlay loader for Goban */
110#if (PLUGIN_BUFFER_SIZE < 0x10000) && !defined(SIMULATOR) 106#if (PLUGIN_BUFFER_SIZE < 0x10000) && !defined(SIMULATOR)
111goban.c 107goban.c
108pictureflow.c
112#endif 109#endif
113 110
114/* not support recorder models for now */ 111/* not support recorder models for now */
diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS
index af5e1d0c0e..597df41b8f 100644
--- a/apps/plugins/SUBDIRS
+++ b/apps/plugins/SUBDIRS
@@ -16,6 +16,9 @@ rockboy
16 16
17/* For all targets with a bitmap display */ 17/* For all targets with a bitmap display */
18#ifdef HAVE_LCD_BITMAP 18#ifdef HAVE_LCD_BITMAP
19#ifdef HAVE_TAGCACHE
20pictureflow
21#endif
19chessbox 22chessbox
20jpeg 23jpeg
21sudoku 24sudoku
diff --git a/apps/plugins/pictureflow/SOURCES b/apps/plugins/pictureflow/SOURCES
new file mode 100644
index 0000000000..7d21cec526
--- /dev/null
+++ b/apps/plugins/pictureflow/SOURCES
@@ -0,0 +1 @@
pictureflow.c
diff --git a/apps/plugins/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index 7261d7a402..82dc9748ec 100644
--- a/apps/plugins/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -957,13 +957,8 @@ bool create_albumart_cache(void)
957 input_bmp.data = buf; 957 input_bmp.data = buf;
958 input_bmp.width = DISPLAY_WIDTH; 958 input_bmp.width = DISPLAY_WIDTH;
959 input_bmp.height = DISPLAY_HEIGHT; 959 input_bmp.height = DISPLAY_HEIGHT;
960#if PLUGIN_BUFFER_SIZE > 0x10000
961 ret = read_image_file(albumart_file, &input_bmp, 960 ret = read_image_file(albumart_file, &input_bmp,
962 buf_size, format, &format_transposed); 961 buf_size, format, &format_transposed);
963#else
964 ret = scaled_read_bmp_file(albumart_file, &input_bmp,
965 buf_size, format, &format_transposed);
966#endif
967 if (ret <= 0) { 962 if (ret <= 0) {
968 rb->splash(HZ, "Could not read bmp"); 963 rb->splash(HZ, "Could not read bmp");
969 continue; /* skip missing/broken files */ 964 continue; /* skip missing/broken files */
@@ -1648,7 +1643,7 @@ void render_slide(struct slide_data *slide, const int alpha)
1648 pixel -= pixelstep; 1643 pixel -= pixelstep;
1649 } 1644 }
1650 } 1645 }
1651 p = (bmp->height-DISPLAY_OFFS) * PFREAL_ONE; 1646 p = (bmp->height-DISPLAY_OFFS) * PFREAL_ONE;
1652 plim = MIN(sh * PFREAL_ONE, p + (LCD_HEIGHT/2) * dy); 1647 plim = MIN(sh * PFREAL_ONE, p + (LCD_HEIGHT/2) * dy);
1653 int plim2 = MIN(MIN(sh + REFLECT_HEIGHT, sh * 2) * PFREAL_ONE, 1648 int plim2 = MIN(MIN(sh + REFLECT_HEIGHT, sh * 2) * PFREAL_ONE,
1654 p + (LCD_HEIGHT/2) * dy); 1649 p + (LCD_HEIGHT/2) * dy);
@@ -2556,7 +2551,7 @@ enum plugin_status plugin_start(const void *parameter)
2556#ifdef HAVE_ADJUSTABLE_CPU_FREQ 2551#ifdef HAVE_ADJUSTABLE_CPU_FREQ
2557 rb->cpu_boost(true); 2552 rb->cpu_boost(true);
2558#endif 2553#endif
2559#if PLUGIN_BUFFER_SIZE > 0x10000 2554#if PLUGIN_BUFFER_SIZE > 0x10000 && 0
2560 buf = rb->plugin_get_buffer(&buf_size); 2555 buf = rb->plugin_get_buffer(&buf_size);
2561#else 2556#else
2562 buf = rb->plugin_get_audio_buffer(&buf_size); 2557 buf = rb->plugin_get_audio_buffer(&buf_size);
diff --git a/apps/plugins/pictureflow/pictureflow.make b/apps/plugins/pictureflow/pictureflow.make
new file mode 100644
index 0000000000..c1fb1f3957
--- /dev/null
+++ b/apps/plugins/pictureflow/pictureflow.make
@@ -0,0 +1,58 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10PICTUREFLOW_SRCDIR = $(APPSDIR)/plugins/pictureflow
11PICTUREFLOW_OBJDIR = $(BUILDDIR)/apps/plugins/pictureflow
12
13PICTUREFLOW_SRC := $(call preprocess, $(PICTUREFLOW_SRCDIR)/SOURCES)
14PICTUREFLOW_OBJ := $(call c2obj, $(PICTUREFLOW_SRC))
15
16OTHER_SRC += $(PICTUREFLOW_SRC)
17
18ifndef SIMVER
19ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
20 ### lowmem targets
21 ROCKS += $(PICTUREFLOW_OBJDIR)/pictureflow.ovl
22 PICTUREFLOW_OUTLDS = $(PICTUREFLOW_OBJDIR)/picutreflow.link
23 PICTUREFLOW_OVLFLAGS = -T$(PICTUREFLOW_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
24else
25 ### all other targets
26 ROCKS += $(PICTUREFLOW_OBJDIR)/pictureflow.rock
27endif
28else
29 ### simulator
30 ROCKS += $(PICTUREFLOW_OBJDIR)/pictureflow.rock
31endif
32
33ifeq ($(CPU),sh)
34# sh need to retain its' -Os
35PICTUREFLOWFLAGS = $(PLUGINFLAGS)
36else
37PICTUREFLOWFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O2
38endif
39
40$(PICTUREFLOW_OBJDIR)/pictureflow.rock: $(PICTUREFLOW_OBJ)
41
42$(PICTUREFLOW_OBJDIR)/pictureflow.refmap: $(PICTUREFLOW_OBJ)
43
44$(PICTUREFLOW_OUTLDS): $(PLUGIN_LDS) $(PICTUREFLOW_OBJDIR)/pictureflow.refmap
45 $(call PRINTS,PP $(@F))$(call preprocess2file,$<,$@,-DOVERLAY_OFFSET=$(shell \
46 $(TOOLSDIR)/ovl_offset.pl $(PICTUREFLOW_OBJDIR)/pictureflow.refmap))
47
48$(PICTUREFLOW_OBJDIR)/pictureflow.ovl: $(PICTUREFLOW_OBJ) $(PICTUREFLOW_OUTLDS)
49 $(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
50 $(filter %.o, $^) \
51 $(filter %.a, $+) \
52 -lgcc $(PICTUREFLOW_OVLFLAGS)
53 $(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@
54
55# special pattern rule for compiling pictureflow with extra flags
56$(PICTUREFLOW_OBJDIR)/%.o: $(PICTUREFLOW_SRCDIR)/%.c $(PLUGINBITMAPLIB) $(PICTUREFLOW_SRCDIR)/pictureflow.make
57 $(SILENT)mkdir -p $(dir $@)
58 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PICTUREFLOWFLAGS) -c $< -o $@
diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c
index da85f99bbc..24b01f9c52 100644
--- a/apps/recorder/albumart.c
+++ b/apps/recorder/albumart.c
@@ -91,7 +91,7 @@ static void fix_path_part(char* path, int offset, int count)
91 } 91 }
92} 92}
93 93
94#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) 94#if defined(HAVE_JPEG) || defined(PLUGIN)
95const char * extensions[] = { "jpeg", "jpg", "bmp" }; 95const char * extensions[] = { "jpeg", "jpg", "bmp" };
96int extension_lens[] = { 4, 3, 3 }; 96int extension_lens[] = { 4, 3, 3 };
97/* Try checking for several file extensions, return true if a file is found and 97/* Try checking for several file extensions, return true if a file is found and
@@ -134,7 +134,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
134 const char *artist; 134 const char *artist;
135 int dirlen; 135 int dirlen;
136 int albumlen; 136 int albumlen;
137#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) 137#if defined(HAVE_JPEG) || defined(PLUGIN)
138 int pathlen; 138 int pathlen;
139#endif 139#endif
140 140
@@ -153,7 +153,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
153 /* the first file we look for is one specific to the track playing */ 153 /* the first file we look for is one specific to the track playing */
154 strip_extension(path, sizeof(path) - strlen(size_string) - 4, trackname); 154 strip_extension(path, sizeof(path) - strlen(size_string) - 4, trackname);
155 strcat(path, size_string); 155 strcat(path, size_string);
156#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) 156#if defined(HAVE_JPEG) || defined(PLUGIN)
157 strcat(path, "."); 157 strcat(path, ".");
158 pathlen = strlen(path); 158 pathlen = strlen(path);
159 found = try_exts(path, pathlen); 159 found = try_exts(path, pathlen);
@@ -165,7 +165,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
165 { 165 {
166 /* if it doesn't exist, 166 /* if it doesn't exist,
167 * we look for a file specific to the track's album name */ 167 * we look for a file specific to the track's album name */
168#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) 168#if defined(HAVE_JPEG) || defined(PLUGIN)
169 pathlen = snprintf(path, sizeof(path), 169 pathlen = snprintf(path, sizeof(path),
170 "%s%s%s.", dir, id3->album, size_string); 170 "%s%s%s.", dir, id3->album, size_string);
171 fix_path_part(path, dirlen, albumlen); 171 fix_path_part(path, dirlen, albumlen);
@@ -181,7 +181,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
181 if (!found) 181 if (!found)
182 { 182 {
183 /* if it still doesn't exist, we look for a generic file */ 183 /* if it still doesn't exist, we look for a generic file */
184#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) 184#if defined(HAVE_JPEG) || defined(PLUGIN)
185 pathlen = snprintf(path, sizeof(path), 185 pathlen = snprintf(path, sizeof(path),
186 "%scover%s.", dir, size_string); 186 "%scover%s.", dir, size_string);
187 found = try_exts(path, pathlen); 187 found = try_exts(path, pathlen);
@@ -192,7 +192,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
192#endif 192#endif
193 } 193 }
194 194
195#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) 195#if defined(HAVE_JPEG) || defined(PLUGIN)
196 if (!found) 196 if (!found)
197 { 197 {
198 snprintf (path, sizeof(path), "%sfolder.jpg", dir); 198 snprintf (path, sizeof(path), "%sfolder.jpg", dir);
@@ -205,7 +205,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
205 if (!found && artist && id3->album) 205 if (!found && artist && id3->album)
206 { 206 {
207 /* look in the albumart subdir of .rockbox */ 207 /* look in the albumart subdir of .rockbox */
208#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) 208#if defined(HAVE_JPEG) || defined(PLUGIN)
209 pathlen = snprintf(path, sizeof(path), 209 pathlen = snprintf(path, sizeof(path),
210 ROCKBOX_DIR "/albumart/%s-%s%s.", 210 ROCKBOX_DIR "/albumart/%s-%s%s.",
211 artist, 211 artist,
@@ -241,7 +241,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
241 { 241 {
242 /* we look in the parent directory 242 /* we look in the parent directory
243 * for a file specific to the track's album name */ 243 * for a file specific to the track's album name */
244#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) 244#if defined(HAVE_JPEG) || defined(PLUGIN)
245 pathlen = snprintf(path, sizeof(path), 245 pathlen = snprintf(path, sizeof(path),
246 "%s%s%s.", dir, id3->album, size_string); 246 "%s%s%s.", dir, id3->album, size_string);
247 fix_path_part(path, dirlen, albumlen); 247 fix_path_part(path, dirlen, albumlen);
@@ -258,7 +258,7 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
258 { 258 {
259 /* if it still doesn't exist, we look in the parent directory 259 /* if it still doesn't exist, we look in the parent directory
260 * for a generic file */ 260 * for a generic file */
261#if defined(HAVE_JPEG) || (defined(PLUGIN) && PLUGIN_BUFFER_SIZE > 0x10000) 261#if defined(HAVE_JPEG) || defined(PLUGIN)
262 pathlen = snprintf(path, sizeof(path), 262 pathlen = snprintf(path, sizeof(path),
263 "%scover%s.", dir, size_string); 263 "%scover%s.", dir, size_string);
264 found = try_exts(path, pathlen); 264 found = try_exts(path, pathlen);
diff --git a/tools/buildzip.pl b/tools/buildzip.pl
index ea902ddb9a..6b90dfa4a6 100755
--- a/tools/buildzip.pl
+++ b/tools/buildzip.pl
@@ -326,6 +326,11 @@ STOP
326 if ($line =~ /([^,]*),(.*)/) { 326 if ($line =~ /([^,]*),(.*)/) {
327 my ($plugin, $dir)=($1, $2); 327 my ($plugin, $dir)=($1, $2);
328 move("$rbdir/rocks/${plugin}.rock", "$rbdir/rocks/$dir/${plugin}.rock"); 328 move("$rbdir/rocks/${plugin}.rock", "$rbdir/rocks/$dir/${plugin}.rock");
329 if(-e "$rbdir/rocks/${plugin}.ovl") {
330 # if there's an "overlay" file for the .rock, move that as
331 # well
332 move("$rbdir/rocks/${plugin}.ovl", "$rbdir/rocks/$dir");
333 }
329 } 334 }
330 } 335 }
331 336