summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/lcd-16bit-vert.c6
-rw-r--r--firmware/export/lcd.h16
2 files changed, 17 insertions, 5 deletions
diff --git a/firmware/drivers/lcd-16bit-vert.c b/firmware/drivers/lcd-16bit-vert.c
index 396e6f88d8..887505766c 100644
--- a/firmware/drivers/lcd-16bit-vert.c
+++ b/firmware/drivers/lcd-16bit-vert.c
@@ -69,7 +69,7 @@ static struct viewport default_vp =
69 69
70/* The Gigabeat target build requires access to the current fg_pattern 70/* The Gigabeat target build requires access to the current fg_pattern
71 in lcd-meg-fx.c */ 71 in lcd-meg-fx.c */
72#if (!defined(TOSHIBA_GIGABEAT_F)&& !defined(TOSHIBA_GIGABEAT_S)) || defined(SIMULATOR) 72#if defined(SIMULATOR)
73static struct viewport* current_vp IDATA_ATTR = &default_vp; 73static struct viewport* current_vp IDATA_ATTR = &default_vp;
74#else 74#else
75struct viewport* current_vp IDATA_ATTR = &default_vp; 75struct viewport* current_vp IDATA_ATTR = &default_vp;
@@ -853,7 +853,7 @@ void ICODE_ATTR lcd_bitmap_part(const fb_data *src, int src_x, int src_y,
853/* Draw a full native bitmap */ 853/* Draw a full native bitmap */
854void lcd_bitmap(const fb_data *src, int x, int y, int width, int height) 854void lcd_bitmap(const fb_data *src, int x, int y, int width, int height)
855{ 855{
856 lcd_bitmap_part(src, 0, 0, STRIDE(width, height), x, y, width, height); 856 lcd_bitmap_part(src, 0, 0, STRIDE(SCREEN_MAIN, width, height), x, y, width, height);
857} 857}
858 858
859#if !defined(TOSHIBA_GIGABEAT_F) && !defined(TOSHIBA_GIGABEAT_S) \ 859#if !defined(TOSHIBA_GIGABEAT_F) && !defined(TOSHIBA_GIGABEAT_S) \
@@ -914,7 +914,7 @@ void lcd_bitmap_transparent(const fb_data *src, int x, int y,
914 int width, int height) 914 int width, int height)
915{ 915{
916 lcd_bitmap_transparent_part(src, 0, 0, 916 lcd_bitmap_transparent_part(src, 0, 0,
917 STRIDE(width, height), x, y, width, height); 917 STRIDE(SCREEN_MAIN, width, height), x, y, width, height);
918} 918}
919 919
920#include "lcd-bitmap-common.c" 920#include "lcd-bitmap-common.c"
diff --git a/firmware/export/lcd.h b/firmware/export/lcd.h
index 3d391d6685..3f3d8f875f 100644
--- a/firmware/export/lcd.h
+++ b/firmware/export/lcd.h
@@ -306,13 +306,25 @@ static inline unsigned lcd_color_to_native(unsigned color)
306 306
307#endif /* HAVE_LCD_COLOR */ 307#endif /* HAVE_LCD_COLOR */
308 308
309enum screen_type {
310 SCREEN_MAIN
311#ifdef HAVE_REMOTE_LCD
312 ,SCREEN_REMOTE
313#endif
314};
315
309/* Frame buffer stride */ 316/* Frame buffer stride */
317#define STRIDE_REMOTE(w, h) (w)
318
310#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE 319#if defined(LCD_STRIDEFORMAT) && LCD_STRIDEFORMAT == VERTICAL_STRIDE
311#define STRIDE(w, h) (h) 320#define STRIDE_MAIN(w, h) (h)
312#else 321#else
313#define STRIDE(w, h) (w) 322#define STRIDE_MAIN(w, h) (w)
314#endif 323#endif
315 324
325#define STRIDE(screen, w, h) (screen==SCREEN_MAIN?STRIDE_MAIN((w), \
326 (h)):STRIDE_REMOTE((w),(h)))
327
316/* Frame buffer dimensions */ 328/* Frame buffer dimensions */
317#if LCD_DEPTH == 1 329#if LCD_DEPTH == 1
318#if LCD_PIXELFORMAT == HORIZONTAL_PACKING 330#if LCD_PIXELFORMAT == HORIZONTAL_PACKING