summaryrefslogtreecommitdiff
path: root/firmware/target/sh/archos/lcd-archos-bitmap.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-01-04 23:42:38 +0000
committerJens Arnold <amiconn@rockbox.org>2008-01-04 23:42:38 +0000
commitfeb5b15e9bf9292e3d4d82ea1e01ab3557fb1240 (patch)
treed854c9a6fbbb3263537071fb02df349fdfa62361 /firmware/target/sh/archos/lcd-archos-bitmap.c
parentd3586837fa9221a7ef104550b4c0aadc1a6ea77c (diff)
downloadrockbox-feb5b15e9bf9292e3d4d82ea1e01ab3557fb1240.tar.gz
rockbox-feb5b15e9bf9292e3d4d82ea1e01ab3557fb1240.zip
All-new greyscale library, replacing the old one. Features: (1) Drawing/updating is faster than the old grayscale lib at full depth. (2) Always 129 shades instead of 2..33 shades. (3) No graininess caused by frequent updates (mpegplayer, doom, ...). (4) Needs less memory than the old grayscale lib at full depth. * The tradeoff is slightly higher CPU load in the ISR (frames are calculated 'live') and an extra function in the core. * Ported all plugins which used the graylib to use the new one. * Some slight optimisations for archos and H1x0 LCD update.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15998 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/sh/archos/lcd-archos-bitmap.c')
-rw-r--r--firmware/target/sh/archos/lcd-archos-bitmap.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/firmware/target/sh/archos/lcd-archos-bitmap.c b/firmware/target/sh/archos/lcd-archos-bitmap.c
index 28600a9769..17c4d76092 100644
--- a/firmware/target/sh/archos/lcd-archos-bitmap.c
+++ b/firmware/target/sh/archos/lcd-archos-bitmap.c
@@ -155,10 +155,26 @@ void lcd_blit(const unsigned char* data, int x, int by, int width,
155 } 155 }
156} 156}
157 157
158/* Performance function that works with an external buffer
159 note that by and bheight are in 8-pixel units! */
160void lcd_grey_phase_blit(const struct grey_data *data, int x, int by,
161 int width, int bheight, int stride)
162{
163 stride <<= 3; /* 8 pixels per block */
164 while (bheight--)
165 {
166 lcd_write_command (LCD_CNTL_PAGE | (by++ & 0xf));
167 lcd_write_command (LCD_CNTL_HIGHCOL | (((x+xoffset)>>4) & 0xf));
168 lcd_write_command (LCD_CNTL_LOWCOL | ((x+xoffset) & 0xf));
169
170 lcd_grey_data(data, width);
171 data += stride;
172 }
173}
174
158 175
159/* Update the display. 176/* Update the display.
160 This must be called after all other LCD functions that change the display. */ 177 This must be called after all other LCD functions that change the display. */
161void lcd_update(void) ICODE_ATTR;
162void lcd_update(void) 178void lcd_update(void)
163{ 179{
164 int y; 180 int y;
@@ -175,7 +191,6 @@ void lcd_update(void)
175} 191}
176 192
177/* Update a fraction of the display. */ 193/* Update a fraction of the display. */
178void lcd_update_rect(int, int, int, int) ICODE_ATTR;
179void lcd_update_rect(int x, int y, int width, int height) 194void lcd_update_rect(int x, int y, int width, int height)
180{ 195{
181 int ymax; 196 int ymax;