summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Kurbjun <kkurbjun@gmail.com>2009-04-16 02:43:39 +0000
committerKarl Kurbjun <kkurbjun@gmail.com>2009-04-16 02:43:39 +0000
commit3c85268f1857d5515b9ddd4ce64fa66cfa6bf955 (patch)
tree54a7f9f05e4ec23d46461acdd7a7aeb09d66b1e9
parenta1614508221a2ce453e1ac306293ba981eb41330 (diff)
downloadrockbox-3c85268f1857d5515b9ddd4ce64fa66cfa6bf955.zip
rockbox-3c85268f1857d5515b9ddd4ce64fa66cfa6bf955.tar.gz
rockbox-3c85268f1857d5515b9ddd4ce64fa66cfa6bf955.tar.bz2
rockbox-3c85268f1857d5515b9ddd4ce64fa66cfa6bf955.tar.xz
M:Robe 500 LCD text scrolling: Fix update corruption
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20711 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
index 54e1dc0..6caf751 100644
--- a/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
+++ b/firmware/target/arm/tms320dm320/mrobe-500/lcd-mr500.c
@@ -250,19 +250,19 @@ void lcd_update_rect(int x, int y, int width, int height)
if (!lcd_on)
return;
+ if ( (width | height) <= 0)
+ return; /* nothing left to do */
+
if (x + width > LCD_WIDTH)
width = LCD_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 < 0)
height += y, y = 0; /* Clip top */
- if (height <= 0)
- return; /* nothing left to do */
+
src = &lcd_framebuffer[y][x];
@@ -284,20 +284,21 @@ void lcd_update_rect(int x, int y, int width, int height)
dst=FRAME + (LCD_NATIVE_WIDTH*(LCD_NATIVE_HEIGHT-1))
- LCD_NATIVE_WIDTH*x + y ;
- do
+ while(height--)
{
register int c_width=width;
register fb_data *c_dst=dst;
- do
+
+ while(c_width--)
{
*c_dst=*src++;
c_dst-=LCD_NATIVE_WIDTH;
}
- while(--c_width);
- src+=LCD_WIDTH-width-x;
+
+ src+=LCD_WIDTH-width;
dst++;
}
- while(--height);
+
#endif
}
@@ -357,35 +358,34 @@ void lcd_blit_pal256(unsigned char *src, int src_x, int src_y, int x, int y,
char *dst=(char *)FRAME+x+y*(LCD_NATIVE_WIDTH+LCD_FUDGE);
src=src+src_x+src_y*LCD_NATIVE_WIDTH;
- do
+ while(height--);
{
memcpy ( dst, src, width);
- /* The LCD uses the top 1/4 of the screen when in palette mode */
dst=dst+width+(LCD_NATIVE_WIDTH-x-width)+LCD_FUDGE;
src+=width;
}
- while(--height);
+
#else
char *dst=(char *)FRAME
+ (LCD_NATIVE_WIDTH+LCD_FUDGE)*(LCD_NATIVE_HEIGHT-1)
- (LCD_NATIVE_WIDTH+LCD_FUDGE)*x + y;
src=src+src_x+src_y*LCD_WIDTH;
- do
+ while(height--)
{
register char *c_dst=dst;
register int c_width=width;
- do
+
+ while (c_width--)
{
*c_dst=*src++;
- /* The LCD uses the top 1/4 of the screen when in palette mode */
c_dst=c_dst-(LCD_NATIVE_WIDTH+LCD_FUDGE);
- } while (--c_width);
+ }
+
dst++;
- src=src+(LCD_WIDTH-width-x);
+ src+=LCD_WIDTH-width;
}
- while(--height);
#endif
}
@@ -438,11 +438,9 @@ void lcd_blit_yuv(unsigned char * const src[3],
*/
y &= ~1;
- if(y<0 || y>LCD_NATIVE_HEIGHT || x<0 || x>LCD_NATIVE_WIDTH
- || height<0 || width <0)
- {
+ if( ((y | x | height | width ) < 0)
+ || y>LCD_NATIVE_HEIGHT || x>LCD_NATIVE_WIDTH )
return;
- }
if(y+height>LCD_NATIVE_WIDTH)
{