summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMats Lidell <matsl@rockbox.org>2002-10-11 11:12:00 +0000
committerMats Lidell <matsl@rockbox.org>2002-10-11 11:12:00 +0000
commitd5fd94d6936e4d08368e03b91ee3e2150b8271b2 (patch)
tree7bf3b2a84b71addfabef38acb4fba276bc934d6d
parent36e935f1b76c3d5eb6a2f6ceeafb0fdc3410ebcb (diff)
downloadrockbox-d5fd94d6936e4d08368e03b91ee3e2150b8271b2.tar.gz
rockbox-d5fd94d6936e4d08368e03b91ee3e2150b8271b2.zip
Player simulator stuff for patterns added.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2580 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--uisimulator/common/stubs.c50
1 files changed, 43 insertions, 7 deletions
diff --git a/uisimulator/common/stubs.c b/uisimulator/common/stubs.c
index dee86b078f..11c1b827d4 100644
--- a/uisimulator/common/stubs.c
+++ b/uisimulator/common/stubs.c
@@ -24,6 +24,9 @@
#include "button.h"
#include "menu.h"
+#include "string.h"
+#include "lcd.h"
+
void backlight_on(void)
{
/* we could do something better here! */
@@ -106,18 +109,51 @@ bool simulate_usb(void)
return false;
}
-void lcd_define_pattern (int which,char *pattern,int length)
+static char patterns[8][7];
+
+void lcd_define_pattern(int which, char *pattern, int length)
{
- (void)which;
- (void)pattern;
- (void)length;
+ int i, j;
+ int pat = which / 8;
+ char icon[8];
+ memset(icon, 0, sizeof icon);
+
+ DEBUGF("Defining pattern %d\n", pat);
+ for (j = 0; j <= 5; j++) {
+ for (i = 0; i < length; i++) {
+ if ((pattern[i])&(1<<(j)))
+ icon[j] |= (1<<(i));
+ }
+ }
+ for (i = 0; i <= 5; i++)
+ {
+ patterns[pat][i] = icon[i];
+ }
}
+char* get_lcd_pattern(int which)
+{
+ DEBUGF("Get pattern %d\n", which);
+ return patterns[which];
+}
+
+extern void lcd_puts(int x, int y, unsigned char *str);
+
void lcd_putc(int x, int y, unsigned char ch)
{
- (void)x;
- (void)y;
- (void)ch;
+ static char str[2] = "x";
+ if (ch <= 8)
+ {
+ char* bm = get_lcd_pattern(ch);
+ lcd_bitmap(bm, x * 6, (y * 8) + 8, 6, 8, true);
+ return;
+ }
+ if (ch == 137) {
+ /* Have no good font yet. Simulate the cursor character. */
+ ch = '>';
+ }
+ str[0] = ch;
+ lcd_puts(x, y, str);
}
void lcd_set_contrast( int x )