diff options
Diffstat (limited to 'firmware/export/lcd.h')
-rw-r--r-- | firmware/export/lcd.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h index 7fe76a5366..4949f51cdb 100644 --- a/firmware/export/lcd.h +++ b/firmware/export/lcd.h | |||
@@ -151,6 +151,15 @@ typedef void lcd_fastpixelfunc_type(fb_data *address); | |||
151 | 151 | ||
152 | #ifdef HAVE_LCD_BITMAP | 152 | #ifdef HAVE_LCD_BITMAP |
153 | 153 | ||
154 | #if defined(HAVE_LCD_COLOR) && LCD_REMOTE_DEPTH > 1 | ||
155 | /* Just return color for screens use */ | ||
156 | static inline unsigned lcd_color_to_native(unsigned color) | ||
157 | { return color; } | ||
158 | #define SCREEN_COLOR_TO_NATIVE(screen, color) (screen)->color_to_native(color) | ||
159 | #else | ||
160 | #define SCREEN_COLOR_TO_NATIVE(screen, color) (color) | ||
161 | #endif | ||
162 | |||
154 | #ifdef HAVE_LCD_COLOR | 163 | #ifdef HAVE_LCD_COLOR |
155 | #if LCD_DEPTH == 16 | 164 | #if LCD_DEPTH == 16 |
156 | #define LCD_MAX_RED 31 | 165 | #define LCD_MAX_RED 31 |
@@ -169,12 +178,12 @@ typedef void lcd_fastpixelfunc_type(fb_data *address); | |||
169 | |((_RGBPACK((r), (g), (b)) & 0x00ff) << 8)) | 178 | |((_RGBPACK((r), (g), (b)) & 0x00ff) << 8)) |
170 | #define RGB_UNPACK_RED(x) _RGB_UNPACK_RED(swap16(x)) | 179 | #define RGB_UNPACK_RED(x) _RGB_UNPACK_RED(swap16(x)) |
171 | #define RGB_UNPACK_GREEN(x) _RGB_UNPACK_GREEN(swap16(x)) | 180 | #define RGB_UNPACK_GREEN(x) _RGB_UNPACK_GREEN(swap16(x)) |
172 | #define RGB_UNPACK_BLUE(x) _RGB_UNPACK_BLUE(swap16(x)) | 181 | #define RGB_UNPACK_BLUE(x) _RGB_UNPACK_BLUE(swap16(x)) |
173 | #else | 182 | #else |
174 | #define LCD_RGBPACK(r, g, b) _RGBPACK((r), (g), (b)) | 183 | #define LCD_RGBPACK(r, g, b) _RGBPACK((r), (g), (b)) |
175 | #define RGB_UNPACK_RED(x) _RGB_UNPACK_RED(x) | 184 | #define RGB_UNPACK_RED(x) _RGB_UNPACK_RED(x) |
176 | #define RGB_UNPACK_GREEN(x) _RGB_UNPACK_GREEN(x) | 185 | #define RGB_UNPACK_GREEN(x) _RGB_UNPACK_GREEN(x) |
177 | #define RGB_UNPACK_BLUE(x) _RGB_UNPACK_BLUE(x) | 186 | #define RGB_UNPACK_BLUE(x) _RGB_UNPACK_BLUE(x) |
178 | #endif | 187 | #endif |
179 | #elif LCD_DEPTH == 18 | 188 | #elif LCD_DEPTH == 18 |
180 | #define LCD_MAX_RED 63 | 189 | #define LCD_MAX_RED 63 |
@@ -185,7 +194,7 @@ typedef void lcd_fastpixelfunc_type(fb_data *address); | |||
185 | | (((b) * (63*257) + (127*257)) >> 16)) | 194 | | (((b) * (63*257) + (127*257)) >> 16)) |
186 | #else | 195 | #else |
187 | /* other colour depths */ | 196 | /* other colour depths */ |
188 | #endif | 197 | #endif |
189 | 198 | ||
190 | #define LCD_BLACK LCD_RGBPACK(0, 0, 0) | 199 | #define LCD_BLACK LCD_RGBPACK(0, 0, 0) |
191 | #define LCD_DARKGRAY LCD_RGBPACK(85, 85, 85) | 200 | #define LCD_DARKGRAY LCD_RGBPACK(85, 85, 85) |
@@ -220,7 +229,7 @@ extern fb_data lcd_framebuffer[LCD_HEIGHT/4][LCD_WIDTH]; | |||
220 | extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH]; | 229 | extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH]; |
221 | #elif LCD_DEPTH == 18 | 230 | #elif LCD_DEPTH == 18 |
222 | extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH]; | 231 | extern fb_data lcd_framebuffer[LCD_HEIGHT][LCD_WIDTH]; |
223 | #endif | 232 | #endif |
224 | 233 | ||
225 | #ifndef LCD_FBWIDTH | 234 | #ifndef LCD_FBWIDTH |
226 | #define LCD_FBWIDTH LCD_WIDTH | 235 | #define LCD_FBWIDTH LCD_WIDTH |
@@ -273,12 +282,12 @@ extern void lcd_setfont(int font); | |||
273 | extern int lcd_getstringsize(const unsigned char *str, int *w, int *h); | 282 | extern int lcd_getstringsize(const unsigned char *str, int *w, int *h); |
274 | 283 | ||
275 | extern void lcd_puts_offset(int x, int y, const unsigned char *str, int offset); | 284 | extern void lcd_puts_offset(int x, int y, const unsigned char *str, int offset); |
276 | extern void lcd_puts_style_offset(int x, int y, const unsigned char *str, | 285 | extern void lcd_puts_style_offset(int x, int y, const unsigned char *str, |
277 | int style, int offset); | 286 | int style, int offset); |
278 | extern void lcd_puts_scroll_offset(int x, int y, const unsigned char *string, | 287 | extern void lcd_puts_scroll_offset(int x, int y, const unsigned char *string, |
279 | int offset); | 288 | int offset); |
280 | extern void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, | 289 | extern void lcd_puts_scroll_style_offset(int x, int y, const unsigned char *string, |
281 | int style, int offset); | 290 | int style, int offset); |
282 | 291 | ||
283 | /* low level drawing function pointer arrays */ | 292 | /* low level drawing function pointer arrays */ |
284 | extern lcd_pixelfunc_type* const lcd_pixelfuncs[8]; | 293 | extern lcd_pixelfunc_type* const lcd_pixelfuncs[8]; |
@@ -333,7 +342,7 @@ extern void lcd_bitmap_transparent(const fb_data *src, int x, int y, | |||
333 | #endif /* HAVE_LCD_BITMAP */ | 342 | #endif /* HAVE_LCD_BITMAP */ |
334 | 343 | ||
335 | /* internal usage, but in multiple drivers */ | 344 | /* internal usage, but in multiple drivers */ |
336 | #ifdef HAVE_LCD_BITMAP | 345 | #ifdef HAVE_LCD_BITMAP |
337 | #define SCROLL_SPACING 3 | 346 | #define SCROLL_SPACING 3 |
338 | 347 | ||
339 | struct scrollinfo { | 348 | struct scrollinfo { |