summaryrefslogtreecommitdiffstats
path: root/apps/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins')
-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
5 files changed, 65 insertions, 11 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
wavview.c
robotfindskitten.c
-#if defined(HAVE_TAGCACHE)
-pictureflow.c
-#endif
-
#ifdef HAVE_LCD_COLOR
ppmviewer.c
#endif
@@ -109,6 +105,7 @@ zxbox.c
/* overlay loader for Goban */
#if (PLUGIN_BUFFER_SIZE < 0x10000) && !defined(SIMULATOR)
goban.c
+pictureflow.c
#endif
/* 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
/* For all targets with a bitmap display */
#ifdef HAVE_LCD_BITMAP
+#ifdef HAVE_TAGCACHE
+pictureflow
+#endif
chessbox
jpeg
sudoku
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)
input_bmp.data = buf;
input_bmp.width = DISPLAY_WIDTH;
input_bmp.height = DISPLAY_HEIGHT;
-#if PLUGIN_BUFFER_SIZE > 0x10000
ret = read_image_file(albumart_file, &input_bmp,
buf_size, format, &format_transposed);
-#else
- ret = scaled_read_bmp_file(albumart_file, &input_bmp,
- buf_size, format, &format_transposed);
-#endif
if (ret <= 0) {
rb->splash(HZ, "Could not read bmp");
continue; /* skip missing/broken files */
@@ -1648,7 +1643,7 @@ void render_slide(struct slide_data *slide, const int alpha)
pixel -= pixelstep;
}
}
- p = (bmp->height-DISPLAY_OFFS) * PFREAL_ONE;
+ p = (bmp->height-DISPLAY_OFFS) * PFREAL_ONE;
plim = MIN(sh * PFREAL_ONE, p + (LCD_HEIGHT/2) * dy);
int plim2 = MIN(MIN(sh + REFLECT_HEIGHT, sh * 2) * PFREAL_ONE,
p + (LCD_HEIGHT/2) * dy);
@@ -2556,7 +2551,7 @@ enum plugin_status plugin_start(const void *parameter)
#ifdef HAVE_ADJUSTABLE_CPU_FREQ
rb->cpu_boost(true);
#endif
-#if PLUGIN_BUFFER_SIZE > 0x10000
+#if PLUGIN_BUFFER_SIZE > 0x10000 && 0
buf = rb->plugin_get_buffer(&buf_size);
#else
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 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id$
+#
+
+PICTUREFLOW_SRCDIR = $(APPSDIR)/plugins/pictureflow
+PICTUREFLOW_OBJDIR = $(BUILDDIR)/apps/plugins/pictureflow
+
+PICTUREFLOW_SRC := $(call preprocess, $(PICTUREFLOW_SRCDIR)/SOURCES)
+PICTUREFLOW_OBJ := $(call c2obj, $(PICTUREFLOW_SRC))
+
+OTHER_SRC += $(PICTUREFLOW_SRC)
+
+ifndef SIMVER
+ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
+ ### lowmem targets
+ ROCKS += $(PICTUREFLOW_OBJDIR)/pictureflow.ovl
+ PICTUREFLOW_OUTLDS = $(PICTUREFLOW_OBJDIR)/picutreflow.link
+ PICTUREFLOW_OVLFLAGS = -T$(PICTUREFLOW_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
+else
+ ### all other targets
+ ROCKS += $(PICTUREFLOW_OBJDIR)/pictureflow.rock
+endif
+else
+ ### simulator
+ ROCKS += $(PICTUREFLOW_OBJDIR)/pictureflow.rock
+endif
+
+ifeq ($(CPU),sh)
+# sh need to retain its' -Os
+PICTUREFLOWFLAGS = $(PLUGINFLAGS)
+else
+PICTUREFLOWFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O2
+endif
+
+$(PICTUREFLOW_OBJDIR)/pictureflow.rock: $(PICTUREFLOW_OBJ)
+
+$(PICTUREFLOW_OBJDIR)/pictureflow.refmap: $(PICTUREFLOW_OBJ)
+
+$(PICTUREFLOW_OUTLDS): $(PLUGIN_LDS) $(PICTUREFLOW_OBJDIR)/pictureflow.refmap
+ $(call PRINTS,PP $(@F))$(call preprocess2file,$<,$@,-DOVERLAY_OFFSET=$(shell \
+ $(TOOLSDIR)/ovl_offset.pl $(PICTUREFLOW_OBJDIR)/pictureflow.refmap))
+
+$(PICTUREFLOW_OBJDIR)/pictureflow.ovl: $(PICTUREFLOW_OBJ) $(PICTUREFLOW_OUTLDS)
+ $(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
+ $(filter %.o, $^) \
+ $(filter %.a, $+) \
+ -lgcc $(PICTUREFLOW_OVLFLAGS)
+ $(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@
+
+# special pattern rule for compiling pictureflow with extra flags
+$(PICTUREFLOW_OBJDIR)/%.o: $(PICTUREFLOW_SRCDIR)/%.c $(PLUGINBITMAPLIB) $(PICTUREFLOW_SRCDIR)/pictureflow.make
+ $(SILENT)mkdir -p $(dir $@)
+ $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PICTUREFLOWFLAGS) -c $< -o $@