summaryrefslogtreecommitdiff
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 @@
24#include "button.h" 24#include "button.h"
25#include "menu.h" 25#include "menu.h"
26 26
27#include "string.h"
28#include "lcd.h"
29
27void backlight_on(void) 30void backlight_on(void)
28{ 31{
29 /* we could do something better here! */ 32 /* we could do something better here! */
@@ -106,18 +109,51 @@ bool simulate_usb(void)
106 return false; 109 return false;
107} 110}
108 111
109void lcd_define_pattern (int which,char *pattern,int length) 112static char patterns[8][7];
113
114void lcd_define_pattern(int which, char *pattern, int length)
110{ 115{
111 (void)which; 116 int i, j;
112 (void)pattern; 117 int pat = which / 8;
113 (void)length; 118 char icon[8];
119 memset(icon, 0, sizeof icon);
120
121 DEBUGF("Defining pattern %d\n", pat);
122 for (j = 0; j <= 5; j++) {
123 for (i = 0; i < length; i++) {
124 if ((pattern[i])&(1<<(j)))
125 icon[j] |= (1<<(i));
126 }
127 }
128 for (i = 0; i <= 5; i++)
129 {
130 patterns[pat][i] = icon[i];
131 }
114} 132}
115 133
134char* get_lcd_pattern(int which)
135{
136 DEBUGF("Get pattern %d\n", which);
137 return patterns[which];
138}
139
140extern void lcd_puts(int x, int y, unsigned char *str);
141
116void lcd_putc(int x, int y, unsigned char ch) 142void lcd_putc(int x, int y, unsigned char ch)
117{ 143{
118 (void)x; 144 static char str[2] = "x";
119 (void)y; 145 if (ch <= 8)
120 (void)ch; 146 {
147 char* bm = get_lcd_pattern(ch);
148 lcd_bitmap(bm, x * 6, (y * 8) + 8, 6, 8, true);
149 return;
150 }
151 if (ch == 137) {
152 /* Have no good font yet. Simulate the cursor character. */
153 ch = '>';
154 }
155 str[0] = ch;
156 lcd_puts(x, y, str);
121} 157}
122 158
123void lcd_set_contrast( int x ) 159void lcd_set_contrast( int x )