summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2005-11-14 20:43:49 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2005-11-14 20:43:49 +0000
commit0cb4a4610ddf1a392e04c8818e89fa188a2e9fad (patch)
treefa2bd30e53d1cde946e83edf750a0d7158f564a1
parentdbc8c2c14cc86b6a23b437e3f3145214e173bfa2 (diff)
downloadrockbox-0cb4a4610ddf1a392e04c8818e89fa188a2e9fad.tar.gz
rockbox-0cb4a4610ddf1a392e04c8818e89fa188a2e9fad.zip
New type for the LCD frame buffer data
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7876 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugin.h8
-rw-r--r--firmware/export/lcd.h20
2 files changed, 17 insertions, 11 deletions
diff --git a/apps/plugin.h b/apps/plugin.h
index 5e2b3b67d0..8630ce7f17 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -184,17 +184,17 @@ struct plugin_api {
184 void (*lcd_set_background)(int brightness); 184 void (*lcd_set_background)(int brightness);
185 int (*lcd_get_background)(void); 185 int (*lcd_get_background)(void);
186#endif 186#endif
187 void (*lcd_bitmap_part)(const unsigned char *src, int src_x, int src_y, 187 void (*lcd_bitmap_part)(const fb_data *src, int src_x, int src_y,
188 int stride, int x, int y, int width, int height); 188 int stride, int x, int y, int width, int height);
189 void (*lcd_bitmap)(const unsigned char *src, int x, int y, int width, 189 void (*lcd_bitmap)(const fb_data *src, int x, int y, int width,
190 int height); 190 int height);
191#endif 191#endif
192 void (*lcd_putsxy)(int x, int y, const unsigned char *string); 192 void (*lcd_putsxy)(int x, int y, const unsigned char *string);
193 void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style); 193 void (*lcd_puts_style)(int x, int y, const unsigned char *str, int style);
194 void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string, 194 void (*lcd_puts_scroll_style)(int x, int y, const unsigned char* string,
195 int style); 195 int style);
196 unsigned char* lcd_framebuffer; 196 fb_data* lcd_framebuffer;
197 void (*lcd_blit) (const unsigned char* data, int x, int by, int width, 197 void (*lcd_blit) (const fb_data* data, int x, int by, int width,
198 int bheight, int stride); 198 int bheight, int stride);
199 void (*lcd_update)(void); 199 void (*lcd_update)(void);
200 void (*lcd_update_rect)(int x, int y, int width, int height); 200 void (*lcd_update_rect)(int x, int y, int width, int height);
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index f095bbffa0..2d04cec054 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -34,10 +34,16 @@
34#include "file.h" /* for MAX_PATH; FIXME: Why does this not work for sims? */ 34#include "file.h" /* for MAX_PATH; FIXME: Why does this not work for sims? */
35#endif 35#endif
36 36
37#if LCD_DEPTH <=8
38typedef unsigned char fb_data;
39#elif LCD_DEPTH <= 16
40typedef unsigned short fb_data;
41#endif
42
37/* common functions */ 43/* common functions */
38extern void lcd_write_command(int byte); 44extern void lcd_write_command(int byte);
39extern void lcd_write_command_ex(int cmd, int data1, int data2); 45extern void lcd_write_command_ex(int cmd, int data1, int data2);
40extern void lcd_write_data(const unsigned char* p_bytes, int count); 46extern void lcd_write_data(const fb_data* p_bytes, int count);
41extern void lcd_init(void); 47extern void lcd_init(void);
42#ifdef SIMULATOR 48#ifdef SIMULATOR
43/* Define a dummy device specific init for the sims */ 49/* Define a dummy device specific init for the sims */
@@ -63,7 +69,7 @@ extern void lcd_icon(int icon, bool enable);
63 69
64#if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP) 70#if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP)
65/* performance function */ 71/* performance function */
66extern void lcd_blit(const unsigned char* data, int x, int by, int width, 72extern void lcd_blit(const fb_data* data, int x, int by, int width,
67 int bheight, int stride); 73 int bheight, int stride);
68 74
69extern void lcd_update(void); 75extern void lcd_update(void);
@@ -161,11 +167,11 @@ struct rgb {
161 167
162/* Memory copy of display bitmap */ 168/* Memory copy of display bitmap */
163#if LCD_DEPTH == 1 169#if LCD_DEPTH == 1
164extern unsigned char lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH]; 170extern fb_data lcd_framebuffer[LCD_HEIGHT/8][LCD_WIDTH];
165#elif LCD_DEPTH == 2 171#elif LCD_DEPTH == 2
166extern unsigned char lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH]; 172extern fb_data lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH];
167#elif LCD_DEPTH == 16 173#elif LCD_DEPTH == 16
168extern unsigned char lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH*2]; 174extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH];
169#endif 175#endif
170 176
171extern void lcd_set_invert_display(bool yesno); 177extern void lcd_set_invert_display(bool yesno);
@@ -190,9 +196,9 @@ extern void lcd_hline(int x1, int x2, int y);
190extern void lcd_vline(int x, int y1, int y2); 196extern void lcd_vline(int x, int y1, int y2);
191extern void lcd_drawrect(int x, int y, int width, int height); 197extern void lcd_drawrect(int x, int y, int width, int height);
192extern void lcd_fillrect(int x, int y, int width, int height); 198extern void lcd_fillrect(int x, int y, int width, int height);
193extern void lcd_bitmap_part(const unsigned char *src, int src_x, int src_y, 199extern void lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
194 int stride, int x, int y, int width, int height); 200 int stride, int x, int y, int width, int height);
195extern void lcd_bitmap(const unsigned char *src, int x, int y, int width, 201extern void lcd_bitmap(const fb_data *src, int x, int y, int width,
196 int height); 202 int height);
197extern void lcd_putsxy(int x, int y, const unsigned char *string); 203extern void lcd_putsxy(int x, int y, const unsigned char *string);
198 204