summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-07-19 09:24:29 +0000
committerJens Arnold <amiconn@rockbox.org>2005-07-19 09:24:29 +0000
commit82ea7c3bacd0b5308e7f0b1d8f35a4e3e13e54f7 (patch)
treec26486e3dc90d2e49e9407c32c09aa6c5e2b34ec
parent144fc69a9f774aa3c0542ee075055bce87f28b14 (diff)
downloadrockbox-82ea7c3bacd0b5308e7f0b1d8f35a4e3e13e54f7.tar.gz
rockbox-82ea7c3bacd0b5308e7f0b1d8f35a4e3e13e54f7.zip
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
-rw-r--r--apps/plugin.c2
-rw-r--r--apps/plugins/bounce.c4
-rw-r--r--apps/plugins/cube.c2
-rw-r--r--apps/screens.c4
-rw-r--r--firmware/SOURCES4
-rw-r--r--firmware/export/config-h300.h9
-rw-r--r--firmware/export/config-iaudiox5.h5
-rw-r--r--firmware/export/lcd.h28
8 files changed, 43 insertions, 15 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index bf69dfbc86..e298b55b23 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -412,7 +412,7 @@ int plugin_load(const char* plugin, void* parameter)
412 button_clear_queue(); 412 button_clear_queue();
413#ifdef HAVE_LCD_BITMAP 413#ifdef HAVE_LCD_BITMAP
414#if LCD_DEPTH > 1 414#if LCD_DEPTH > 1
415 lcd_set_drawinfo(DRMODE_SOLID, 0, MAX_LEVEL); 415 lcd_set_drawinfo(DRMODE_SOLID, 0, LCD_MAX_LEVEL);
416#else 416#else
417 lcd_set_drawmode(DRMODE_SOLID); 417 lcd_set_drawmode(DRMODE_SOLID);
418#endif 418#endif
diff --git a/apps/plugins/bounce.c b/apps/plugins/bounce.c
index 8ac4202ab1..c3bea8e14f 100644
--- a/apps/plugins/bounce.c
+++ b/apps/plugins/bounce.c
@@ -284,7 +284,7 @@ static void addclock(void)
284#if LCD_DEPTH > 1 284#if LCD_DEPTH > 1
285static const int face_colors[] = 285static const int face_colors[] =
286{ 286{
287 0, 2*MAX_LEVEL/3, MAX_LEVEL/3 287 0, 2*LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3
288}; 288};
289#endif 289#endif
290 290
@@ -451,7 +451,7 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
451 451
452 len = 1; 452 len = 1;
453 rb->lcd_getstringsize(off, &w, &h); 453 rb->lcd_getstringsize(off, &w, &h);
454 454
455 /* Get horizontel centering for text */ 455 /* Get horizontel centering for text */
456 len *= w; 456 len *= w;
457 if (len%2 != 0) 457 if (len%2 != 0)
diff --git a/apps/plugins/cube.c b/apps/plugins/cube.c
index 10694b3bd2..afb2b88628 100644
--- a/apps/plugins/cube.c
+++ b/apps/plugins/cube.c
@@ -154,7 +154,7 @@ static const struct face faces[6] =
154#if LCD_DEPTH > 1 154#if LCD_DEPTH > 1
155static const int face_colors[6] = 155static const int face_colors[6] =
156{ 156{
157 2*MAX_LEVEL/3, 2*MAX_LEVEL/3, MAX_LEVEL/3, MAX_LEVEL/3, 0, 0 157 2*LCD_MAX_LEVEL/3, 2*LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3, LCD_MAX_LEVEL/3, 0, 0
158}; 158};
159#endif 159#endif
160 160
diff --git a/apps/screens.c b/apps/screens.c
index f761919d35..a51d83fed3 100644
--- a/apps/screens.c
+++ b/apps/screens.c
@@ -855,7 +855,7 @@ void splash(int ticks, /* how long the splash is displayed */
855 int xx = (LCD_WIDTH-maxw)/2 - 2; 855 int xx = (LCD_WIDTH-maxw)/2 - 2;
856 /* The new graphics routines handle clipping, so no need to check */ 856 /* The new graphics routines handle clipping, so no need to check */
857#if LCD_DEPTH > 1 857#if LCD_DEPTH > 1
858 lcd_set_background(MAX_LEVEL-1); 858 lcd_set_background(LCD_MAX_LEVEL-1);
859#endif 859#endif
860 lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID); 860 lcd_set_drawmode(DRMODE_SOLID|DRMODE_INVERSEVID);
861 lcd_fillrect(xx, y-2, maxw+4, LCD_HEIGHT-y*2+4); 861 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 */
903 next = strtok_r(NULL, " ", &store); 903 next = strtok_r(NULL, " ", &store);
904 } 904 }
905#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH > 1) 905#if defined(HAVE_LCD_BITMAP) && (LCD_DEPTH > 1)
906 lcd_set_background(MAX_LEVEL); 906 lcd_set_background(LCD_MAX_LEVEL);
907#endif 907#endif
908 lcd_update(); 908 lcd_update();
909 909
diff --git a/firmware/SOURCES b/firmware/SOURCES
index 2fca3ffab5..afb36f490d 100644
--- a/firmware/SOURCES
+++ b/firmware/SOURCES
@@ -49,9 +49,9 @@ drivers/lcd-player-charset.c
49drivers/lcd-player.c 49drivers/lcd-player.c
50#endif 50#endif
51#ifdef HAVE_LCD_BITMAP 51#ifdef HAVE_LCD_BITMAP
52#if CONFIG_LCD == LCD_S1D15E06 52#if LCD_DEPTH == 2
53drivers/lcd-h100.c 53drivers/lcd-h100.c
54#else 54#elif LCD_DEPTH == 1
55drivers/lcd-recorder.c 55drivers/lcd-recorder.c
56#endif 56#endif
57#endif 57#endif
diff --git a/firmware/export/config-h300.h b/firmware/export/config-h300.h
index 1c284b9ef8..be6511cb2f 100644
--- a/firmware/export/config-h300.h
+++ b/firmware/export/config-h300.h
@@ -1,16 +1,19 @@
1/* For Rolo and boot loader */
2#define MODEL_NUMBER 2
3
1/* define this if you have recording possibility */ 4/* define this if you have recording possibility */
2/*#define HAVE_RECORDING 1*/ 5/*#define HAVE_RECORDING 1*/
3 6
4/* define this if you have a bitmap LCD display */ 7/* define this if you have a bitmap LCD display */
5#define HAVE_LCD_BITMAP 1 8#define HAVE_LCD_BITMAP 1
6 9
7/* For Rolo and boot loader */ 10/* define this if you have a colour LCD */
8#define MODEL_NUMBER 2 11#define HAVE_LCD_COLOR 1
9 12
10/* LCD dimensions */ 13/* LCD dimensions */
11#define LCD_WIDTH 220 14#define LCD_WIDTH 220
12#define LCD_HEIGHT 176 15#define LCD_HEIGHT 176
13#define LCD_DEPTH 18 16#define LCD_DEPTH 18 /* 262.144 colours */
14 17
15/* remote LCD */ 18/* remote LCD */
16#define LCD_REMOTE_WIDTH 128 19#define LCD_REMOTE_WIDTH 128
diff --git a/firmware/export/config-iaudiox5.h b/firmware/export/config-iaudiox5.h
index 6894fe2ca5..1a95a5202c 100644
--- a/firmware/export/config-iaudiox5.h
+++ b/firmware/export/config-iaudiox5.h
@@ -8,10 +8,13 @@
8/* define this if you have a bitmap LCD display */ 8/* define this if you have a bitmap LCD display */
9#define HAVE_LCD_BITMAP 1 9#define HAVE_LCD_BITMAP 1
10 10
11/* define this if you have a colour LCD */
12#define HAVE_LCD_COLOR 1
13
11/* LCD dimensions */ 14/* LCD dimensions */
12#define LCD_WIDTH 160 15#define LCD_WIDTH 160
13#define LCD_HEIGHT 128 16#define LCD_HEIGHT 128
14#define LCD_DEPTH 18 /* 260.000 colors */ 17#define LCD_DEPTH 18 /* 262.144 colors */
15 18
16/* remote LCD */ 19/* remote LCD */
17#define LCD_REMOTE_WIDTH 128 20#define LCD_REMOTE_WIDTH 128
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 6860d8f064..30677e492e 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -124,13 +124,26 @@ extern void lcd_jump_scroll_delay(int ms);
124typedef void lcd_pixelfunc_type(int x, int y); 124typedef void lcd_pixelfunc_type(int x, int y);
125typedef void lcd_blockfunc_type(unsigned char *address, unsigned mask, unsigned bits); 125typedef void lcd_blockfunc_type(unsigned char *address, unsigned mask, unsigned bits);
126 126
127#if defined(HAVE_LCD_BITMAP) || defined(SIMULATOR) 127#ifdef HAVE_LCD_BITMAP
128
129#ifdef HAVE_LCD_COLOR
130#define LCD_MAX_RED ((1 << (LCD_DEPTH/3)) - 1)
131#define LCD_MAX_GREEN ((1 << (LCD_DEPTH/3)) - 1)
132#define LCD_MAX_BLUE ((1 << (LCD_DEPTH/3)) - 1)
133struct rgb {
134 unsigned char red;
135 unsigned char green;
136 unsigned char blue;
137};
138#else /* monochrome */
139#define LCD_MAX_LEVEL ((1 << LCD_DEPTH) - 1)
140
141#endif
128 142
129/* Memory copy of display bitmap */ 143/* Memory copy of display bitmap */
130#if LCD_DEPTH == 1 144#if LCD_DEPTH == 1
131extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; 145extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
132#elif LCD_DEPTH == 2 146#elif LCD_DEPTH == 2
133#define MAX_LEVEL 3
134extern unsigned char lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH]; 147extern unsigned char lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH];
135#endif 148#endif
136 149
@@ -167,11 +180,20 @@ extern void lcd_bidir_scroll(int threshold);
167extern void lcd_scroll_step(int pixels); 180extern void lcd_scroll_step(int pixels);
168 181
169#if LCD_DEPTH > 1 182#if LCD_DEPTH > 1
183#ifdef HAVE_LCD_COLOR
184extern void lcd_set_foreground(struct rgb color);
185extern struct rgb lcd_get_foreground(void);
186extern void lcd_set_background(struct rgb color);
187extern struct rgb lcd_get_background(void);
188extern void lcd_set_drawinfo(int mode, struct rgb fg_color,
189 struct rgb bg_color);
190#else /* monochrome */
170extern void lcd_set_foreground(int brightness); 191extern void lcd_set_foreground(int brightness);
171extern int lcd_get_foreground(void); 192extern int lcd_get_foreground(void);
172extern void lcd_set_background(int brightness); 193extern void lcd_set_background(int brightness);
173extern int lcd_get_background(void); 194extern int lcd_get_background(void);
174extern void lcd_set_drawinfo(int mode, int fg_brightness, int bg_brightness); 195extern void lcd_set_drawinfo(int mode, int fg_brightness, int bg_brightness);
196#endif
175extern void lcd_mono_bitmap_part(const unsigned char *src, int src_x, int src_y, 197extern void lcd_mono_bitmap_part(const unsigned char *src, int src_x, int src_y,
176 int stride, int x, int y, int width, int height); 198 int stride, int x, int y, int width, int height);
177extern void lcd_mono_bitmap(const unsigned char *src, int x, int y, int width, 199extern 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,
181#define lcd_mono_bitmap_part lcd_bitmap_part 203#define lcd_mono_bitmap_part lcd_bitmap_part
182#endif 204#endif
183 205
184#endif /* CHARCELLS / BITMAP */ 206#endif /* HAVE_LCD_BITMAP */
185 207
186/* internal usage, but in multiple drivers */ 208/* internal usage, but in multiple drivers */
187#ifdef HAVE_LCD_BITMAP 209#ifdef HAVE_LCD_BITMAP