summaryrefslogtreecommitdiff
path: root/apps/plugins/zxbox/zxvid_4bpp.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/zxbox/zxvid_4bpp.c')
-rw-r--r--apps/plugins/zxbox/zxvid_4bpp.c31
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 @@
1#include "zxvid_com.h" 1#include "zxvid_com.h"
2 2
3#if !defined USE_GRAY && LCD_PIXELFORMAT == HORIZONTAL_PACKING && LCD_DEPTH < 4 3#if !defined USE_GRAY && LCD_DEPTH < 4
4/* screen routines for greyscale targets not using greyscale lib */ 4/* screen routines for greyscale targets not using greyscale lib */
5
6#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
5#define FB_WIDTH ((LCD_WIDTH+3)/4) 7#define FB_WIDTH ((LCD_WIDTH+3)/4)
6unsigned char pixmask[4] ICONST_ATTR = { 8unsigned char pixmask[4] ICONST_ATTR = {
7 0xC0, 0x30, 0x0C, 0x03 9 0xC0, 0x30, 0x0C, 0x03
8 }; 10 };
11#elif LCD_PIXELFORMAT == VERTICAL_PACKING
12unsigned char pixmask[4] ICONST_ATTR = {
13 0x03, 0x0C, 0x30, 0xC0
14};
15#endif
9 16
10void init_spect_scr(void) 17void init_spect_scr(void)
11{ 18{
@@ -41,7 +48,7 @@ void init_spect_scr(void)
41void update_screen(void) 48void update_screen(void)
42{ 49{
43 char str[80]; 50 char str[80];
44 51
45 fb_data *frameb; 52 fb_data *frameb;
46 int y=0; 53 int y=0;
47 int x=0; 54 int x=0;
@@ -49,7 +56,7 @@ void update_screen(void)
49 int srcx, srcy=0; /* x / y coordinates in source image */ 56 int srcx, srcy=0; /* x / y coordinates in source image */
50 image = sp_image + ( (Y_OFF)*(WIDTH) ) + X_OFF; 57 image = sp_image + ( (Y_OFF)*(WIDTH) ) + X_OFF;
51 unsigned mask; 58 unsigned mask;
52 59#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
53 for(y = 0; y < LCD_HEIGHT; y++) 60 for(y = 0; y < LCD_HEIGHT; y++)
54 { 61 {
55 frameb = rb->lcd_framebuffer + (y) * FB_WIDTH; 62 frameb = rb->lcd_framebuffer + (y) * FB_WIDTH;
@@ -64,6 +71,24 @@ void update_screen(void)
64 image += (srcy>>16)*WIDTH; /* and possibly to the next row. */ 71 image += (srcy>>16)*WIDTH; /* and possibly to the next row. */
65 srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */ 72 srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */
66 } 73 }
74#elif LCD_PIXELFORMAT == VERTICAL_PACKING
75 int shift;
76 for(y = 0; y < LCD_HEIGHT; y++)
77 {
78 frameb = rb->lcd_framebuffer + (y/4) * LCD_WIDTH;
79 srcx = 0; /* reset our x counter before each row... */
80 shift = ((y & 3 ) * 2 );
81 mask = pixmask[y & 3];
82 for(x = 0; x < LCD_WIDTH; x++)
83 {
84 frameb[x] = (frameb[x] & ~mask) | ((image[(srcx>>16)]&0x3) << shift );
85 srcx += X_STEP; /* move through source image */
86 }
87 srcy += Y_STEP; /* move through the source image... */
88 image += (srcy>>16)*WIDTH; /* and possibly to the next row. */
89 srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */
90 }
91#endif
67 92
68 if ( settings.showfps ) { 93 if ( settings.showfps ) {
69 int percent=0; 94 int percent=0;