1
0
Fork 0
forked from len0rd/rockbox

Added lcd_update_rect(), for updating only a part of the LCD. This was

written "blindly". I've not tested this on hardware (yet).

The simulators will need to get this funtion added as well.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1643 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Daniel Stenberg 2002-08-09 12:20:54 +00:00
parent 9bf86f75fa
commit 6985f34beb
3 changed files with 46 additions and 1 deletions

View file

@ -30,6 +30,14 @@ LCD
shown on screen by calling lcd_update(). shown on screen by calling lcd_update().
lcd_update() update the LCD according to the internal buffer. lcd_update() update the LCD according to the internal buffer.
lcd_update_rect(int x, int y, int height, int width)
Update the given rectangle to the LCD. Give arguments measured in
pixels. Notice that the smallest vertical resolution in updates that the
hardware supports is even 8 pixels. This function will adjust to those.
lcd_setfont(int font) set default font lcd_setfont(int font) set default font
lcd_setmargins(int x, int y) set top/left margins lcd_setmargins(int x, int y) set top/left margins
lcd_putsxy(x,y,string,font) put a string at given position, using a lcd_putsxy(x,y,string,font) put a string at given position, using a

View file

@ -594,6 +594,40 @@ void lcd_update (void)
} }
} }
/*
* Update a fraction of the display.
*/
void lcd_update_rect (int, int, int, int) __attribute__ ((section (".icode")));
void lcd_update_rect (int x_start, int y,
int width, int height)
{
int ymax;
int xmax;
int x;
/* The Y coordinates have to work on even 8 pixel rows */
ymax = (y + height)/8;
y /= 8;
xmax = x_start + width;
if(xmax > LCD_WIDTH)
xmax = LCD_WIDTH;
if(ymax >= LCD_HEIGHT/8)
ymax = LCD_HEIGHT/8-1;
/* Copy specified rectange bitmap to hardware */
for (; y <= ymax; y++)
{
lcd_write (true, LCD_CNTL_PAGE | (y & 0xf));
lcd_write (true, LCD_CNTL_HIGHCOL | ((x_start>>4) & 0xf));
lcd_write (true, LCD_CNTL_LOWCOL | (x_start & 0xf));
for (x = x_start; x < xmax; x++)
lcd_write (false, lcd_framebuffer[x][y]);
}
}
#endif /* SIMULATOR */ #endif /* SIMULATOR */
/* /*

View file

@ -36,6 +36,9 @@ extern void lcd_scroll_speed( int speed );
#if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP) #if defined(SIMULATOR) || defined(HAVE_LCD_BITMAP)
extern void lcd_update(void); extern void lcd_update(void);
/* update a fraction of the screen */
extern void lcd_update_rect(int x, int y, int width, int height);
#else #else
#define lcd_update() #define lcd_update()
#endif #endif