diff options
author | Jens Arnold <amiconn@rockbox.org> | 2006-02-19 12:31:04 +0000 |
---|---|---|
committer | Jens Arnold <amiconn@rockbox.org> | 2006-02-19 12:31:04 +0000 |
commit | da5cef63301a2b13bbbcd36bf409a921fbb5402d (patch) | |
tree | 80b7c31c34039ffcc3b85023628376936ac19f60 | |
parent | 9e244e04a0bd2602efde1230480016865130162e (diff) | |
download | rockbox-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.c | 29 |
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) #if LCD_DEPTH == 1 static unsigned char line_block[8][BMP_LINESIZE]; #elif LCD_DEPTH == 2 +#if LCD_PIXELFORMAT == HORIZONTAL_PACKING + static unsigned char line_block[BMP_LINESIZE]; +#else static unsigned char line_block[4][BMP_LINESIZE]; +#endif #elif LCD_DEPTH == 16 static unsigned short line_block[BMP_LINESIZE/2]; #endif @@ -352,6 +356,30 @@ void screen_dump(void) write(fh, line_block, sizeof(line_block)); } #elif LCD_DEPTH == 2 +#if LCD_PIXELFORMAT == HORIZONTAL_PACKING + for (by = LCD_HEIGHT - 1; by >= 0; by--) + { + unsigned char *src = &lcd_framebuffer[by][0]; + unsigned char *dst = line_block; + + memset(line_block, 0, sizeof(line_block)); + for (bx = LCD_WIDTH/4; bx > 0; bx--) + { + unsigned src_byte = *src++; + unsigned tmp; + + tmp = src_byte & 3; + src_byte >>= 2; + *dst++ = (tmp << 4) | (src_byte & 3); + src_byte >>= 2; + tmp = src_byte & 3; + src_byte >>= 2; + *dst++ = (tmp << 4) | (src_byte & 3); + } + + write(fh, line_block, sizeof(line_block)); + } +#else /* VERTICAL_PACKING */ for (by = LCD_HEIGHT/4 - 1; by >= 0; by--) { unsigned char *src = &lcd_framebuffer[by][0]; @@ -376,6 +404,7 @@ void screen_dump(void) write(fh, line_block, sizeof(line_block)); } +#endif #elif LCD_DEPTH == 16 for (by = LCD_HEIGHT - 1; by >= 0; by--) { |