summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/drivers/lcd-16bit.c2
-rw-r--r--firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c23
2 files changed, 13 insertions, 12 deletions
diff --git a/firmware/drivers/lcd-16bit.c b/firmware/drivers/lcd-16bit.c
index dab29efef7..c91d222830 100644
--- a/firmware/drivers/lcd-16bit.c
+++ b/firmware/drivers/lcd-16bit.c
@@ -68,7 +68,7 @@ static struct viewport default_vp =
68 68
69/* The Gigabeat target build requires access to the current fg_pattern 69/* The Gigabeat target build requires access to the current fg_pattern
70 in lcd-meg-fx.c */ 70 in lcd-meg-fx.c */
71#if !defined(TOSHIBA_GIGABEAT_F) || defined(SIMULATOR) 71#if (!defined(TOSHIBA_GIGABEAT_F)&& !defined(TOSHIBA_GIGABEAT_S)) || defined(SIMULATOR)
72static struct viewport* current_vp IDATA_ATTR = &default_vp; 72static struct viewport* current_vp IDATA_ATTR = &default_vp;
73#else 73#else
74struct viewport* current_vp IDATA_ATTR = &default_vp; 74struct viewport* current_vp IDATA_ATTR = &default_vp;
diff --git a/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c b/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c
index 07258fa123..b834320c12 100644
--- a/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c
+++ b/firmware/target/arm/imx31/gigabeat-s/lcd-imx31.c
@@ -11,13 +11,16 @@ static volatile bool lcd_on = true;
11volatile bool lcd_poweroff = false; 11volatile bool lcd_poweroff = false;
12static unsigned lcd_yuv_options = 0; 12static unsigned lcd_yuv_options = 0;
13/* 13/*
14** These are imported from lcd-16bit.c 14** This is imported from lcd-16bit.c
15*/ 15*/
16extern unsigned fg_pattern;
17extern unsigned bg_pattern;
18
19extern struct viewport* current_vp; 16extern struct viewport* current_vp;
20 17
18/* Copies a rectangle from one framebuffer to another. Can be used in
19 single transfer mode with width = num pixels, and height = 1 which
20 allows a full-width rectangle to be copied more efficiently. */
21extern void lcd_copy_buffer_rect(fb_data *dst, const fb_data *src,
22 int width, int height);
23
21#if 0 24#if 0
22bool lcd_enabled() 25bool lcd_enabled()
23{ 26{
@@ -106,26 +109,25 @@ void lcd_bitmap_transparent_part(const fb_data *src, int src_x, int src_y,
106 int stride, int x, int y, int width, 109 int stride, int x, int y, int width,
107 int height) 110 int height)
108{ 111{
109#if 0
110 int w, px; 112 int w, px;
111 fb_data *dst; 113 fb_data *dst;
112 114
113 if (x + width > LCD_WIDTH) 115 if (x + width > current_vp->width)
114 width = LCD_WIDTH - x; /* Clip right */ 116 width = current_vp->width - x; /* Clip right */
115 if (x < 0) 117 if (x < 0)
116 width += x, x = 0; /* Clip left */ 118 width += x, x = 0; /* Clip left */
117 if (width <= 0) 119 if (width <= 0)
118 return; /* nothing left to do */ 120 return; /* nothing left to do */
119 121
120 if (y + height > LCD_HEIGHT) 122 if (y + height > current_vp->height)
121 height = LCD_HEIGHT - y; /* Clip bottom */ 123 height = current_vp->height - y; /* Clip bottom */
122 if (y < 0) 124 if (y < 0)
123 height += y, y = 0; /* Clip top */ 125 height += y, y = 0; /* Clip top */
124 if (height <= 0) 126 if (height <= 0)
125 return; /* nothing left to do */ 127 return; /* nothing left to do */
126 128
127 src += stride * src_y + src_x; /* move starting point */ 129 src += stride * src_y + src_x; /* move starting point */
128 dst = &lcd_framebuffer[y][x]; 130 dst = &lcd_framebuffer[current_vp->y+y][current_vp->x+x];
129 131
130 asm volatile ( 132 asm volatile (
131 ".rowstart: \r\n" 133 ".rowstart: \r\n"
@@ -152,7 +154,6 @@ void lcd_bitmap_transparent_part(const fb_data *src, int src_x, int src_y,
152 [fgcolor]"r"(REPLACEWITHFG_COLOR), 154 [fgcolor]"r"(REPLACEWITHFG_COLOR),
153 [fgpat]"r"(current_vp->fg_pattern) 155 [fgpat]"r"(current_vp->fg_pattern)
154 ); 156 );
155#endif
156} 157}
157 158
158void lcd_yuv_set_options(unsigned options) 159void lcd_yuv_set_options(unsigned options)