1
0
Fork 0
forked from len0rd/rockbox

Player simulator stuff for patterns added.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2580 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Mats Lidell 2002-10-11 11:12:00 +00:00
parent 36e935f1b7
commit d5fd94d693

View file

@ -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 )