summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-04-15 13:06:29 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-04-15 13:06:29 +0000
commit595d0659d40de2892f2c880713cbf1d15ca7e03f (patch)
tree5381af50d9b73264867993df30b95066d38c6914
parente50202c5c4b984874bb4f326e93b3303e1eef128 (diff)
downloadrockbox-595d0659d40de2892f2c880713cbf1d15ca7e03f.tar.gz
rockbox-595d0659d40de2892f2c880713cbf1d15ca7e03f.zip
Make the transparent bitmaps work on Gigabeat S.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17118 a1c6a512-1295-4272-9138-f99709370657
-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 =
/* The Gigabeat target build requires access to the current fg_pattern
in lcd-meg-fx.c */
-#if !defined(TOSHIBA_GIGABEAT_F) || defined(SIMULATOR)
+#if (!defined(TOSHIBA_GIGABEAT_F)&& !defined(TOSHIBA_GIGABEAT_S)) || defined(SIMULATOR)
static struct viewport* current_vp IDATA_ATTR = &default_vp;
#else
struct 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;
volatile bool lcd_poweroff = false;
static unsigned lcd_yuv_options = 0;
/*
-** These are imported from lcd-16bit.c
+** This is imported from lcd-16bit.c
*/
-extern unsigned fg_pattern;
-extern unsigned bg_pattern;
-
extern struct viewport* current_vp;
+/* Copies a rectangle from one framebuffer to another. Can be used in
+ single transfer mode with width = num pixels, and height = 1 which
+ allows a full-width rectangle to be copied more efficiently. */
+extern void lcd_copy_buffer_rect(fb_data *dst, const fb_data *src,
+ int width, int height);
+
#if 0
bool lcd_enabled()
{
@@ -106,26 +109,25 @@ void lcd_bitmap_transparent_part(const fb_data *src, int src_x, int src_y,
int stride, int x, int y, int width,
int height)
{
-#if 0
int w, px;
fb_data *dst;
- if (x + width > LCD_WIDTH)
- width = LCD_WIDTH - x; /* Clip right */
+ if (x + width > current_vp->width)
+ width = current_vp->width - x; /* Clip right */
if (x < 0)
width += x, x = 0; /* Clip left */
if (width <= 0)
return; /* nothing left to do */
- if (y + height > LCD_HEIGHT)
- height = LCD_HEIGHT - y; /* Clip bottom */
+ if (y + height > current_vp->height)
+ height = current_vp->height - y; /* Clip bottom */
if (y < 0)
height += y, y = 0; /* Clip top */
if (height <= 0)
return; /* nothing left to do */
src += stride * src_y + src_x; /* move starting point */
- dst = &lcd_framebuffer[y][x];
+ dst = &lcd_framebuffer[current_vp->y+y][current_vp->x+x];
asm volatile (
".rowstart: \r\n"
@@ -152,7 +154,6 @@ void lcd_bitmap_transparent_part(const fb_data *src, int src_x, int src_y,
[fgcolor]"r"(REPLACEWITHFG_COLOR),
[fgpat]"r"(current_vp->fg_pattern)
);
-#endif
}
void lcd_yuv_set_options(unsigned options)