diff options
author | Anton Romanov <theli@rockbox.org> | 2006-09-25 09:44:10 +0000 |
---|---|---|
committer | Anton Romanov <theli@rockbox.org> | 2006-09-25 09:44:10 +0000 |
commit | ec2a5cce1a4e3609535a9ae902a80933fbb0f341 (patch) | |
tree | bd2874b573d5b29ba695e1f13c7ee5d908a473e6 /apps/plugins/zxbox/zxvid_4bpp.c | |
parent | 52f4c4c82bb038f3704007016a5df1639c6af443 (diff) |
yet more code cleanup, quick snapshot feature,sound should no longer crash,light optimizations
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11041 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/zxbox/zxvid_4bpp.c')
-rw-r--r-- | apps/plugins/zxbox/zxvid_4bpp.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/apps/plugins/zxbox/zxvid_4bpp.c b/apps/plugins/zxbox/zxvid_4bpp.c index e9943d9571..4846340c4d 100644 --- a/apps/plugins/zxbox/zxvid_4bpp.c +++ b/apps/plugins/zxbox/zxvid_4bpp.c @@ -1,11 +1,18 @@ #include "zxvid_com.h" -#if !defined USE_GRAY && LCD_PIXELFORMAT == HORIZONTAL_PACKING && LCD_DEPTH < 4 +#if !defined USE_GRAY && LCD_DEPTH < 4 /* screen routines for greyscale targets not using greyscale lib */ + +#if LCD_PIXELFORMAT == HORIZONTAL_PACKING #define FB_WIDTH ((LCD_WIDTH+3)/4) unsigned char pixmask[4] ICONST_ATTR = { 0xC0, 0x30, 0x0C, 0x03 }; +#elif LCD_PIXELFORMAT == VERTICAL_PACKING +unsigned char pixmask[4] ICONST_ATTR = { + 0x03, 0x0C, 0x30, 0xC0 +}; +#endif void init_spect_scr(void) { @@ -41,7 +48,7 @@ void init_spect_scr(void) void update_screen(void) { char str[80]; - + fb_data *frameb; int y=0; int x=0; @@ -49,7 +56,7 @@ void update_screen(void) int srcx, srcy=0; /* x / y coordinates in source image */ image = sp_image + ( (Y_OFF)*(WIDTH) ) + X_OFF; unsigned mask; - +#if LCD_PIXELFORMAT == HORIZONTAL_PACKING for(y = 0; y < LCD_HEIGHT; y++) { frameb = rb->lcd_framebuffer + (y) * FB_WIDTH; @@ -64,6 +71,24 @@ void update_screen(void) image += (srcy>>16)*WIDTH; /* and possibly to the next row. */ srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */ } +#elif LCD_PIXELFORMAT == VERTICAL_PACKING + int shift; + for(y = 0; y < LCD_HEIGHT; y++) + { + frameb = rb->lcd_framebuffer + (y/4) * LCD_WIDTH; + srcx = 0; /* reset our x counter before each row... */ + shift = ((y & 3 ) * 2 ); + mask = pixmask[y & 3]; + for(x = 0; x < LCD_WIDTH; x++) + { + frameb[x] = (frameb[x] & ~mask) | ((image[(srcx>>16)]&0x3) << shift ); + srcx += X_STEP; /* move through source image */ + } + srcy += Y_STEP; /* move through the source image... */ + image += (srcy>>16)*WIDTH; /* and possibly to the next row. */ + srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */ + } +#endif if ( settings.showfps ) { int percent=0; |