mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -05:00
rk27xx: Slightly refactor lcd_set_gram_area()
Change-Id: I1040164220dd87b19b58be560eb5b628857bc284
This commit is contained in:
parent
3f4824b94f
commit
ca8154741f
5 changed files with 46 additions and 39 deletions
|
|
@ -151,21 +151,22 @@ void lcd_enable (bool on)
|
|||
LCDC_CTRL &= ~RGB24B;
|
||||
}
|
||||
|
||||
void lcd_set_gram_area(int x, int y, int width, int height)
|
||||
void lcd_set_gram_area(int x_start, int y_start,
|
||||
int x_end, int y_end)
|
||||
{
|
||||
lcdctrl_bypass(1);
|
||||
LCDC_CTRL |= RGB24B;
|
||||
|
||||
lcd_cmd(0x002A);
|
||||
lcd_data((x&0xff00)>>8);
|
||||
lcd_data(x&0x00ff);
|
||||
lcd_data(((width-1)&0xff00)>>8);
|
||||
lcd_data((width-1)&0x00ff);
|
||||
lcd_data((x_start&0xff00)>>8);
|
||||
lcd_data(x_start&0x00ff);
|
||||
lcd_data((x_end&0xff00)>>8);
|
||||
lcd_data(x_end&0x00ff);
|
||||
lcd_cmd(0x002B);
|
||||
lcd_data((y&0xff00)>>8);
|
||||
lcd_data(y&0x00ff);
|
||||
lcd_data(((height-1)&0xff00)>>8);
|
||||
lcd_data((height-1)&0x00ff);
|
||||
lcd_data((y_start&0xff00)>>8);
|
||||
lcd_data(y_start&0x00ff);
|
||||
lcd_data((y_end&0xff00)>>8);
|
||||
lcd_data(y_end&0x00ff);
|
||||
|
||||
lcd_cmd(0x2c);
|
||||
LCDC_CTRL &= ~RGB24B;
|
||||
|
|
@ -176,7 +177,7 @@ void lcd_update_rect(int x, int y, int width, int height)
|
|||
int px = x, py = y;
|
||||
int pxmax = x + width, pymax = y + height;
|
||||
|
||||
lcd_set_gram_area(x, y, pxmax, pymax);
|
||||
lcd_set_gram_area(x, y, pxmax-1, pymax-1);
|
||||
|
||||
for (py = y; py < pymax; py++)
|
||||
for (px = x; px < pxmax; px++)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue