diff options
author | Jens Arnold <amiconn@rockbox.org> | 2008-01-09 23:48:26 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2008-01-09 23:48:26 +0000 |
commit | 6a56c14e17f6ba113ec0d4d40e75bffd61b293cc (patch) | |
tree | 64bcdd8d5d4afa2ca6dd1aa0976cdafa9a346b26 /firmware/target/coldfire/iaudio/m5/lcd-m5.c | |
parent | 75380fd27d175bab1818ef35a9100e74fc6a461b (diff) | |
download | rockbox-6a56c14e17f6ba113ec0d4d40e75bffd61b293cc.tar.gz rockbox-6a56c14e17f6ba113ec0d4d40e75bffd61b293cc.zip |
Greyscale library: Changed the internal data format once more (separated pixel values and phases), allowing for further optimisation of drawing, scrolling etc. * Optimised grey phase blitting in the core reduces CPU load on all architectures, most significantly on coldfire. Previous version was too slow to keep up at 45MHz, leading to unwanted graininess (update frequency was halved). Also fixed screendump on 2bpp targets with vertical pixel packing.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16043 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/target/coldfire/iaudio/m5/lcd-m5.c')
-rw-r--r-- | firmware/target/coldfire/iaudio/m5/lcd-m5.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/firmware/target/coldfire/iaudio/m5/lcd-m5.c b/firmware/target/coldfire/iaudio/m5/lcd-m5.c index 4f963795c7..be9d5a39b8 100644 --- a/firmware/target/coldfire/iaudio/m5/lcd-m5.c +++ b/firmware/target/coldfire/iaudio/m5/lcd-m5.c | |||
@@ -171,10 +171,13 @@ void lcd_blit(const unsigned char* data, int x, int by, int width, | |||
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | /* Helper function for lcd_grey_phase_blit(). */ | ||
175 | void lcd_grey_data(unsigned char *values, unsigned char *phases, int count); | ||
176 | |||
174 | /* Performance function that works with an external buffer | 177 | /* Performance function that works with an external buffer |
175 | note that by and bheight are in 4-pixel units! */ | 178 | note that by and bheight are in 4-pixel units! */ |
176 | void lcd_grey_phase_blit(const struct grey_data *data, int x, int by, | 179 | void lcd_grey_phase_blit(unsigned char *values, unsigned char *phases, |
177 | int width, int bheight, int stride) | 180 | int x, int by, int width, int bheight, int stride) |
178 | { | 181 | { |
179 | stride <<= 2; /* 4 pixels per block */ | 182 | stride <<= 2; /* 4 pixels per block */ |
180 | while (bheight--) | 183 | while (bheight--) |
@@ -182,8 +185,9 @@ void lcd_grey_phase_blit(const struct grey_data *data, int x, int by, | |||
182 | lcd_write_command_ex(LCD_CNTL_PAGE, by++, -1); | 185 | lcd_write_command_ex(LCD_CNTL_PAGE, by++, -1); |
183 | lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1); | 186 | lcd_write_command_ex(LCD_CNTL_COLUMN, x, -1); |
184 | lcd_write_command(LCD_CNTL_DATA_WRITE); | 187 | lcd_write_command(LCD_CNTL_DATA_WRITE); |
185 | lcd_grey_data(data, width); | 188 | lcd_grey_data(values, phases, width); |
186 | data += stride; | 189 | values += stride; |
190 | phases += stride; | ||
187 | } | 191 | } |
188 | } | 192 | } |
189 | 193 | ||