summaryrefslogtreecommitdiffstats
path: root/firmware/scroll_engine.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2013-01-31 07:24:19 +0100
committerThomas Martitz <kugel@rockbox.org>2013-12-14 23:11:31 +0100
commit50eb528bc1f9d2f7b7260eff8b85a5ed5b96e679 (patch)
tree47b53d62c0880a3ea6b9e761efdf0628855d13e0 /firmware/scroll_engine.c
parent26801b3bd8f11fe680146086aa0a2fd12e7de289 (diff)
downloadrockbox-50eb528bc1f9d2f7b7260eff8b85a5ed5b96e679.tar.gz
rockbox-50eb528bc1f9d2f7b7260eff8b85a5ed5b96e679.zip
scroll_engine: Major rework to support pixel-based scrolling and scroll callbacks.
Much of the scrolling work is moved from lcd-bitmap-common to lcd-scroll.c, a small scroll callback routine remains. This callback can potentially be overridden by more extensive scrollers. The callback also gets fed with pixel-based scrolling information, which finally removes the strict line-based nature of the scroll engine. Along with this is the change from scroll_stop_viewport_line() to scroll_stop_viewport_rect() which works on a pixel-based rectangle instead of lines. The ultimate goal is to move most of the scroll work to apps, which can much better decide which line decorations to apply etc. This work is laying the ground work. Change-Id: I3b2885cf7d8696ddd9253d5a9a73318d3d42831a
Diffstat (limited to 'firmware/scroll_engine.c')
-rw-r--r--firmware/scroll_engine.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/firmware/scroll_engine.c b/firmware/scroll_engine.c
index d134f7b2ce..d1bc2976a1 100644
--- a/firmware/scroll_engine.c
+++ b/firmware/scroll_engine.c
@@ -23,6 +23,7 @@
*
****************************************************************************/
+#include <stdio.h>
#include "config.h"
#include "gcc_extensions.h"
#include "cpu.h"
@@ -36,16 +37,20 @@
#endif
#include "scroll_engine.h"
+
+/* private helper function for the scroll engine. Do not use in apps/.
+ * defined in lcd-bitmap-common.c */
+extern struct viewport *lcd_get_viewport(bool *is_defaut);
+#ifdef HAVE_REMOTE_LCD
+extern struct viewport *lcd_remote_get_viewport(bool *is_defaut);
+#endif
+
static const char scroll_tick_table[18] = {
/* Hz values [f(x)=100.8/(x+.048)]:
1, 1.25, 1.55, 2, 2.5, 3.12, 4, 5, 6.25, 8.33, 10, 12.5, 16.7, 20, 25, 33, 49.2, 96.2 */
100, 80, 64, 50, 40, 32, 25, 20, 16, 12, 10, 8, 6, 5, 4, 3, 2, 1
};
-/* imported private functions from lcd-bitmap-common.c */
-extern struct viewport *lcd_get_viewport(void);
-extern struct viewport *lcd_remote_get_viewport(void);
-
static void scroll_thread(void);
static char scroll_stack[DEFAULT_STACK_SIZE*3];
static const char scroll_name[] = "scroll";
@@ -156,7 +161,7 @@ static void scroll_thread(void)
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
if (lcd_active())
#endif
- lcd_scroll_fn();
+ lcd_scroll_worker();
lcd_scroll_info.last_scroll = current_tick;
}
@@ -165,7 +170,7 @@ static void scroll_thread(void)
if (scroll & SCROLL_LCD_REMOTE)
{
- lcd_remote_scroll_fn();
+ lcd_remote_scroll_worker();
lcd_remote_scroll_info.last_scroll = current_tick;
}
}
@@ -179,7 +184,7 @@ static void scroll_thread(void)
#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
if (lcd_active())
#endif
- lcd_scroll_fn();
+ lcd_scroll_worker();
}
}
#endif /* HAVE_REMOTE_LCD */