summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2006-02-19 12:31:04 +0000
committerJens Arnold <amiconn@rockbox.org>2006-02-19 12:31:04 +0000
commitda5cef63301a2b13bbbcd36bf409a921fbb5402d (patch)
tree80b7c31c34039ffcc3b85023628376936ac19f60
parent9e244e04a0bd2602efde1230480016865130162e (diff)
downloadrockbox-da5cef63301a2b13bbbcd36bf409a921fbb5402d.tar.gz
rockbox-da5cef63301a2b13bbbcd36bf409a921fbb5402d.zip
Proper screendump for greyscale iPods.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8735 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/misc.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/apps/misc.c b/apps/misc.c
index e8bc8f9345..c815589c06 100644
--- a/apps/misc.c
+++ b/apps/misc.c
@@ -295,7 +295,11 @@ void screen_dump(void)
295#if LCD_DEPTH == 1 295#if LCD_DEPTH == 1
296 static unsigned char line_block[8][BMP_LINESIZE]; 296 static unsigned char line_block[8][BMP_LINESIZE];
297#elif LCD_DEPTH == 2 297#elif LCD_DEPTH == 2
298#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
299 static unsigned char line_block[BMP_LINESIZE];
300#else
298 static unsigned char line_block[4][BMP_LINESIZE]; 301 static unsigned char line_block[4][BMP_LINESIZE];
302#endif
299#elif LCD_DEPTH == 16 303#elif LCD_DEPTH == 16
300 static unsigned short line_block[BMP_LINESIZE/2]; 304 static unsigned short line_block[BMP_LINESIZE/2];
301#endif 305#endif
@@ -352,6 +356,30 @@ void screen_dump(void)
352 write(fh, line_block, sizeof(line_block)); 356 write(fh, line_block, sizeof(line_block));
353 } 357 }
354#elif LCD_DEPTH == 2 358#elif LCD_DEPTH == 2
359#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
360 for (by = LCD_HEIGHT - 1; by >= 0; by--)
361 {
362 unsigned char *src = &lcd_framebuffer[by][0];
363 unsigned char *dst = line_block;
364
365 memset(line_block, 0, sizeof(line_block));
366 for (bx = LCD_WIDTH/4; bx > 0; bx--)
367 {
368 unsigned src_byte = *src++;
369 unsigned tmp;
370
371 tmp = src_byte & 3;
372 src_byte >>= 2;
373 *dst++ = (tmp << 4) | (src_byte & 3);
374 src_byte >>= 2;
375 tmp = src_byte & 3;
376 src_byte >>= 2;
377 *dst++ = (tmp << 4) | (src_byte & 3);
378 }
379
380 write(fh, line_block, sizeof(line_block));
381 }
382#else /* VERTICAL_PACKING */
355 for (by = LCD_HEIGHT/4 - 1; by >= 0; by--) 383 for (by = LCD_HEIGHT/4 - 1; by >= 0; by--)
356 { 384 {
357 unsigned char *src = &lcd_framebuffer[by][0]; 385 unsigned char *src = &lcd_framebuffer[by][0];
@@ -376,6 +404,7 @@ void screen_dump(void)
376 404
377 write(fh, line_block, sizeof(line_block)); 405 write(fh, line_block, sizeof(line_block));
378 } 406 }
407#endif
379#elif LCD_DEPTH == 16 408#elif LCD_DEPTH == 16
380 for (by = LCD_HEIGHT - 1; by >= 0; by--) 409 for (by = LCD_HEIGHT - 1; by >= 0; by--)
381 { 410 {