diff options
author | Linus Nielsen Feltzing <linus@haxx.se> | 2005-12-11 00:30:15 +0000 |
---|---|---|
committer | Linus Nielsen Feltzing <linus@haxx.se> | 2005-12-11 00:30:15 +0000 |
commit | 6ddfac0806a15a8771725ec4fdc39247f36949ff (patch) | |
tree | 02647b38dacbd1394596ce69b66424f9fe1fa060 | |
parent | 27cd6ca15243593085341bb4f3c2a4c864d89214 (diff) | |
download | rockbox-6ddfac0806a15a8771725ec4fdc39247f36949ff.tar.gz rockbox-6ddfac0806a15a8771725ec4fdc39247f36949ff.zip |
Patch #1377879 by Anders Kagerin - faster lcd_update_rect() for h300
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8215 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | docs/CREDITS | 2 | ||||
-rw-r--r-- | firmware/drivers/lcd-h300.c | 22 |
2 files changed, 16 insertions, 8 deletions
diff --git a/docs/CREDITS b/docs/CREDITS index 91a20987c6..a5a1426383 100644 --- a/docs/CREDITS +++ b/docs/CREDITS @@ -148,4 +148,4 @@ Tat Tang Toshihiko Itoh David J. Song Jeong Taek In - +Anders Kagerin diff --git a/firmware/drivers/lcd-h300.c b/firmware/drivers/lcd-h300.c index 17fe1f530b..91a86defd4 100644 --- a/firmware/drivers/lcd-h300.c +++ b/firmware/drivers/lcd-h300.c @@ -200,11 +200,19 @@ void lcd_update_rect(int x, int y, int width, int height) if(ymax >= LCD_HEIGHT) ymax = LCD_HEIGHT-1; - /* Copy specified rectangle bitmap to hardware */ - for (; y <= ymax; y++) - { - lcd_write_reg(0x21, (x << 8) + y); - lcd_begin_write_gram(); - lcd_write_data ((unsigned short *)&lcd_framebuffer[y][x], width); - } + /* set update window */ + lcd_write_reg(0x44, (ymax<<8) | y); /* horiz ram addr */ + lcd_write_reg(0x45, ((x+width-1)<<8) | x); /* vert ram addr */ + lcd_write_reg(0x21, (x<<8) | y); + lcd_begin_write_gram(); + + /* Copy specified rectangle bitmap to hardware */ + for (; y <= ymax; y++) + { + lcd_write_data ((unsigned short *)&lcd_framebuffer[y][x], width); + } + + /* reset update window */ + lcd_write_reg(0x44, 0xaf00); /* horiz ram addr: 0 - 175 */ + lcd_write_reg(0x45, 0xdb00); /* vert ram addr: 0 - 219 */ } |