forked from len0rd/rockbox
Renamed MAX_LEVEL to LCD_MAX_LEVEL to match the naming scheme. Preparations for colour LCD support.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7194 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
144fc69a9f
commit
82ea7c3bac
8 changed files with 43 additions and 15 deletions
|
@ -412,7 +412,7 @@ int plugin_load(const char* plugin, void* parameter)
|
||||||
button_clear_queue();
|
button_clear_queue();
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
lcd_set_drawinfo(DRMODE_SOLID, 0, MAX_LEVEL);
|
lcd_set_drawinfo(DRMODE_SOLID, 0, LCD_MAX_LEVEL);
|
||||||
#else
|
#else
|
||||||
lcd_set_drawmode(DRMODE_SOLID);
|
lcd_set_drawmode(DRMODE_SOLID);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -284,7 +284,7 @@ static void addclock(void)
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
static const int face_colors[] =
|
static const int face_colors[] =
|
||||||
{
|
{
|
||||||
0, 2*MAX_LEVEL/3, MAX_LEVEL/3
|
0, 2*LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -451,7 +451,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
|
||||||
|
|
||||||
len = 1;
|
len = 1;
|
||||||
rb->lcd_getstringsize(off, &w, &h);
|
rb->lcd_getstringsize(off, &w, &h);
|
||||||
|
|
||||||
/* Get horizontel centering for text */
|
/* Get horizontel centering for text */
|
||||||
len *= w;
|
len *= w;
|
||||||
if (len%2 != 0)
|
if (len%2 != 0)
|
||||||
|
|
|
@ -154,7 +154,7 @@ static const struct face faces[6] =
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
static const int face_colors[6] =
|
static const int face_colors[6] =
|
||||||
{
|
{
|
||||||
2*MAX_LEVEL/3, 2*MAX_LEVEL/3, MAX_LEVEL/3, MAX_LEVEL/3, 0, 0
|
2*LCD_MAX_LEVEL/3, 2*LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3, 0, 0
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -855,7 +855,7 @@ void splash(int ticks, /* how long the splash is displayed */
|
||||||
int xx = (LCD_WIDTH-maxw)/2 - 2;
|
int xx = (LCD_WIDTH-maxw)/2 - 2;
|
||||||
/* The new graphics routines handle clipping, so no need to check */
|
/* The new graphics routines handle clipping, so no need to check */
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
lcd_set_background(MAX_LEVEL-1);
|
lcd_set_background(LCD_MAX_LEVEL-1);
|
||||||
#endif
|
#endif
|
||||||
lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
|
lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
|
||||||
lcd_fillrect(xx, y-2, maxw+4, LCD_HEIGHT-y*2+4);
|
lcd_fillrect(xx, y-2, maxw+4, LCD_HEIGHT-y*2+4);
|
||||||
|
@ -903,7 +903,7 @@ void splash(int ticks, /* how long the splash is displayed */
|
||||||
next = strtok_r(NULL, " ", &store);
|
next = strtok_r(NULL, " ", &store);
|
||||||
}
|
}
|
||||||
#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH > 1)
|
#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH > 1)
|
||||||
lcd_set_background(MAX_LEVEL);
|
lcd_set_background(LCD_MAX_LEVEL);
|
||||||
#endif
|
#endif
|
||||||
lcd_update();
|
lcd_update();
|
||||||
|
|
||||||
|
|
|
@ -49,9 +49,9 @@ drivers/lcd-player-charset.c
|
||||||
drivers/lcd-player.c
|
drivers/lcd-player.c
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
#if CONFIG_LCD == LCD_S1D15E06
|
#if LCD_DEPTH == 2
|
||||||
drivers/lcd-h100.c
|
drivers/lcd-h100.c
|
||||||
#else
|
#elif LCD_DEPTH == 1
|
||||||
drivers/lcd-recorder.c
|
drivers/lcd-recorder.c
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,16 +1,19 @@
|
||||||
|
/* For Rolo and boot loader */
|
||||||
|
#define MODEL_NUMBER 2
|
||||||
|
|
||||||
/* define this if you have recording possibility */
|
/* define this if you have recording possibility */
|
||||||
/*#define HAVE_RECORDING 1*/
|
/*#define HAVE_RECORDING 1*/
|
||||||
|
|
||||||
/* define this if you have a bitmap LCD display */
|
/* define this if you have a bitmap LCD display */
|
||||||
#define HAVE_LCD_BITMAP 1
|
#define HAVE_LCD_BITMAP 1
|
||||||
|
|
||||||
/* For Rolo and boot loader */
|
/* define this if you have a colour LCD */
|
||||||
#define MODEL_NUMBER 2
|
#define HAVE_LCD_COLOR 1
|
||||||
|
|
||||||
/* LCD dimensions */
|
/* LCD dimensions */
|
||||||
#define LCD_WIDTH 220
|
#define LCD_WIDTH 220
|
||||||
#define LCD_HEIGHT 176
|
#define LCD_HEIGHT 176
|
||||||
#define LCD_DEPTH 18
|
#define LCD_DEPTH 18 /* 262.144 colours */
|
||||||
|
|
||||||
/* remote LCD */
|
/* remote LCD */
|
||||||
#define LCD_REMOTE_WIDTH 128
|
#define LCD_REMOTE_WIDTH 128
|
||||||
|
|
|
@ -8,10 +8,13 @@
|
||||||
/* define this if you have a bitmap LCD display */
|
/* define this if you have a bitmap LCD display */
|
||||||
#define HAVE_LCD_BITMAP 1
|
#define HAVE_LCD_BITMAP 1
|
||||||
|
|
||||||
|
/* define this if you have a colour LCD */
|
||||||
|
#define HAVE_LCD_COLOR 1
|
||||||
|
|
||||||
/* LCD dimensions */
|
/* LCD dimensions */
|
||||||
#define LCD_WIDTH 160
|
#define LCD_WIDTH 160
|
||||||
#define LCD_HEIGHT 128
|
#define LCD_HEIGHT 128
|
||||||
#define LCD_DEPTH 18 /* 260.000 colors */
|
#define LCD_DEPTH 18 /* 262.144 colors */
|
||||||
|
|
||||||
/* remote LCD */
|
/* remote LCD */
|
||||||
#define LCD_REMOTE_WIDTH 128
|
#define LCD_REMOTE_WIDTH 128
|
||||||
|
|
|
@ -124,13 +124,26 @@ extern void lcd_jump_scroll_delay(int ms);
|
||||||
typedef void lcd_pixelfunc_type(int x, int y);
|
typedef void lcd_pixelfunc_type(int x, int y);
|
||||||
typedef void lcd_blockfunc_type(unsigned char *address, unsigned mask, unsigned bits);
|
typedef void lcd_blockfunc_type(unsigned char *address, unsigned mask, unsigned bits);
|
||||||
|
|
||||||
#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR)
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
|
||||||
|
#ifdef HAVE_LCD_COLOR
|
||||||
|
#define LCD_MAX_RED ((1 << (LCD_DEPTH/3)) - 1)
|
||||||
|
#define LCD_MAX_GREEN ((1 << (LCD_DEPTH/3)) - 1)
|
||||||
|
#define LCD_MAX_BLUE ((1 << (LCD_DEPTH/3)) - 1)
|
||||||
|
struct rgb {
|
||||||
|
unsigned char red;
|
||||||
|
unsigned char green;
|
||||||
|
unsigned char blue;
|
||||||
|
};
|
||||||
|
#else /* monochrome */
|
||||||
|
#define LCD_MAX_LEVEL ((1 << LCD_DEPTH) - 1)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Memory copy of display bitmap */
|
/* Memory copy of display bitmap */
|
||||||
#if LCD_DEPTH == 1
|
#if LCD_DEPTH == 1
|
||||||
extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
|
extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
|
||||||
#elif LCD_DEPTH == 2
|
#elif LCD_DEPTH == 2
|
||||||
#define MAX_LEVEL 3
|
|
||||||
extern unsigned char lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH];
|
extern unsigned char lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -167,11 +180,20 @@ extern void lcd_bidir_scroll(int threshold);
|
||||||
extern void lcd_scroll_step(int pixels);
|
extern void lcd_scroll_step(int pixels);
|
||||||
|
|
||||||
#if LCD_DEPTH > 1
|
#if LCD_DEPTH > 1
|
||||||
|
#ifdef HAVE_LCD_COLOR
|
||||||
|
extern void lcd_set_foreground(struct rgb color);
|
||||||
|
extern struct rgb lcd_get_foreground(void);
|
||||||
|
extern void lcd_set_background(struct rgb color);
|
||||||
|
extern struct rgb lcd_get_background(void);
|
||||||
|
extern void lcd_set_drawinfo(int mode, struct rgb fg_color,
|
||||||
|
struct rgb bg_color);
|
||||||
|
#else /* monochrome */
|
||||||
extern void lcd_set_foreground(int brightness);
|
extern void lcd_set_foreground(int brightness);
|
||||||
extern int lcd_get_foreground(void);
|
extern int lcd_get_foreground(void);
|
||||||
extern void lcd_set_background(int brightness);
|
extern void lcd_set_background(int brightness);
|
||||||
extern int lcd_get_background(void);
|
extern int lcd_get_background(void);
|
||||||
extern void lcd_set_drawinfo(int mode, int fg_brightness, int bg_brightness);
|
extern void lcd_set_drawinfo(int mode, int fg_brightness, int bg_brightness);
|
||||||
|
#endif
|
||||||
extern void lcd_mono_bitmap_part(const unsigned char *src, int src_x, int src_y,
|
extern void lcd_mono_bitmap_part(const unsigned char *src, int src_x, int src_y,
|
||||||
int stride, int x, int y, int width, int height);
|
int stride, int x, int y, int width, int height);
|
||||||
extern void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width,
|
extern void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width,
|
||||||
|
@ -181,7 +203,7 @@ extern void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width,
|
||||||
#define lcd_mono_bitmap_part lcd_bitmap_part
|
#define lcd_mono_bitmap_part lcd_bitmap_part
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* CHARCELLS / BITMAP */
|
#endif /* HAVE_LCD_BITMAP */
|
||||||
|
|
||||||
/* internal usage, but in multiple drivers */
|
/* internal usage, but in multiple drivers */
|
||||||
#ifdef HAVE_LCD_BITMAP
|
#ifdef HAVE_LCD_BITMAP
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue