summaryrefslogtreecommitdiff
path: root/apps/plugins/zxbox
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/zxbox')
-rw-r--r--apps/plugins/zxbox/keymaps.h8
-rw-r--r--apps/plugins/zxbox/zxbox_keyb.c9
-rw-r--r--apps/plugins/zxbox/zxconfig.h3
-rw-r--r--apps/plugins/zxbox/zxvid_4bpp.c42
4 files changed, 52 insertions, 10 deletions
diff --git a/apps/plugins/zxbox/keymaps.h b/apps/plugins/zxbox/keymaps.h
index 9e9e3ed616..19503e1c78 100644
--- a/apps/plugins/zxbox/keymaps.h
+++ b/apps/plugins/zxbox/keymaps.h
@@ -94,6 +94,14 @@
94#define ZX_SELECT BUTTON_RC_MODE 94#define ZX_SELECT BUTTON_RC_MODE
95#define ZX_MENU (BUTTON_POWER | BUTTON_REL) 95#define ZX_MENU (BUTTON_POWER | BUTTON_REL)
96 96
97#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
98#define ZX_UP BUTTON_RC_VOL_UP
99#define ZX_DOWN BUTTON_RC_VOL_DOWN
100#define ZX_LEFT BUTTON_RC_REW
101#define ZX_RIGHT BUTTON_RC_FF
102#define ZX_SELECT BUTTON_RC_PLAY
103#define ZX_MENU BUTTON_RC_REC
104
97#else 105#else
98#error Keymap not defined! 106#error Keymap not defined!
99 107
diff --git a/apps/plugins/zxbox/zxbox_keyb.c b/apps/plugins/zxbox/zxbox_keyb.c
index 2b1d171c11..e3fb92c43d 100644
--- a/apps/plugins/zxbox/zxbox_keyb.c
+++ b/apps/plugins/zxbox/zxbox_keyb.c
@@ -113,6 +113,15 @@
113#define KBD_UP BUTTON_UP 113#define KBD_UP BUTTON_UP
114#define KBD_DOWN BUTTON_DOWN 114#define KBD_DOWN BUTTON_DOWN
115 115
116#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
117
118#define KBD_SELECT BUTTON_RC_PLAY
119#define KBD_ABORT BUTTON_RC_REC
120#define KBD_LEFT BUTTON_RC_REW
121#define KBD_RIGHT BUTTON_RC_FF
122#define KBD_UP BUTTON_RC_VOL_UP
123#define KBD_DOWN BUTTON_RC_VOL_DOWN
124
116#endif 125#endif
117 126
118 127
diff --git a/apps/plugins/zxbox/zxconfig.h b/apps/plugins/zxbox/zxconfig.h
index f83c091ab9..cdba2626cf 100644
--- a/apps/plugins/zxbox/zxconfig.h
+++ b/apps/plugins/zxbox/zxconfig.h
@@ -18,7 +18,8 @@ extern int intkeys[5];
18#define SETTINGS_VERSION 2 18#define SETTINGS_VERSION 2
19 19
20/* undef not to use greyscale lib */ 20/* undef not to use greyscale lib */
21#if !defined HAVE_LCD_COLOR 21#if !defined HAVE_LCD_COLOR && !defined(IAUDIO_M3)
22 /* FIXME: change after implementing greyscale lib for M3 */
22#define USE_GREY 23#define USE_GREY
23#define USE_BUFFERED_GREY 24#define USE_BUFFERED_GREY
24#endif 25#endif
diff --git a/apps/plugins/zxbox/zxvid_4bpp.c b/apps/plugins/zxbox/zxvid_4bpp.c
index c05e48b8e6..5129d17327 100644
--- a/apps/plugins/zxbox/zxvid_4bpp.c
+++ b/apps/plugins/zxbox/zxvid_4bpp.c
@@ -5,13 +5,20 @@
5 5
6#if LCD_PIXELFORMAT == HORIZONTAL_PACKING 6#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
7#define FB_WIDTH ((LCD_WIDTH+3)/4) 7#define FB_WIDTH ((LCD_WIDTH+3)/4)
8unsigned char pixmask[4] ICONST_ATTR = { 8fb_data pixmask[4] ICONST_ATTR = {
9 0xC0, 0x30, 0x0C, 0x03 9 0xC0, 0x30, 0x0C, 0x03
10 }; 10};
11#elif LCD_PIXELFORMAT == VERTICAL_PACKING 11#elif LCD_PIXELFORMAT == VERTICAL_PACKING
12unsigned char pixmask[4] ICONST_ATTR = { 12fb_data pixmask[4] ICONST_ATTR = {
13 0x03, 0x0C, 0x30, 0xC0 13 0x03, 0x0C, 0x30, 0xC0
14}; 14};
15#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED
16fb_data pixmask[8] ICONST_ATTR = {
17 0x0101, 0x0202, 0x0404, 0x0808, 0x1010, 0x2020, 0x4040, 0x8080
18};
19fb_data pixval[4] ICONST_ATTR = {
20 0x0000, 0x0001, 0x0100, 0x0101
21};
15#endif 22#endif
16 23
17void init_spect_scr(void) 24void init_spect_scr(void)
@@ -63,8 +70,8 @@ void update_screen(void)
63 srcx = 0; /* reset our x counter before each row... */ 70 srcx = 0; /* reset our x counter before each row... */
64 for(x = 0; x < LCD_WIDTH; x++) 71 for(x = 0; x < LCD_WIDTH; x++)
65 { 72 {
66 mask = pixmask[x & 3]; 73 mask = ~pixmask[x & 3];
67 frameb[x >> 2] = (frameb[x >> 2] & ~mask) | ((image[(srcx>>16)]&0x3) << ((3-(x & 3 )) * 2 )); 74 frameb[x >> 2] = (frameb[x >> 2] & mask) | ((image[(srcx>>16)]&0x3) << ((3-(x & 3 )) * 2 ));
68 srcx += X_STEP; /* move through source image */ 75 srcx += X_STEP; /* move through source image */
69 } 76 }
70 srcy += Y_STEP; /* move through the source image... */ 77 srcy += Y_STEP; /* move through the source image... */
@@ -78,17 +85,34 @@ void update_screen(void)
78 frameb = rb->lcd_framebuffer + (y/4) * LCD_WIDTH; 85 frameb = rb->lcd_framebuffer + (y/4) * LCD_WIDTH;
79 srcx = 0; /* reset our x counter before each row... */ 86 srcx = 0; /* reset our x counter before each row... */
80 shift = ((y & 3 ) * 2 ); 87 shift = ((y & 3 ) * 2 );
81 mask = pixmask[y & 3]; 88 mask = ~pixmask[y & 3];
89 for(x = 0; x < LCD_WIDTH; x++)
90 {
91 frameb[x] = (frameb[x] & mask) | ((image[(srcx>>16)]&0x3) << shift );
92 srcx += X_STEP; /* move through source image */
93 }
94 srcy += Y_STEP; /* move through the source image... */
95 image += (srcy>>16)*WIDTH; /* and possibly to the next row. */
96 srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */
97 }
98#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED
99 int shift;
100 for(y = 0; y < LCD_HEIGHT; y++)
101 {
102 frameb = rb->lcd_framebuffer + (y/8) * LCD_WIDTH;
103 srcx = 0; /* reset our x counter before each row... */
104 shift = (y & 7);
105 mask = ~pixmask[y & 7];
82 for(x = 0; x < LCD_WIDTH; x++) 106 for(x = 0; x < LCD_WIDTH; x++)
83 { 107 {
84 frameb[x] = (frameb[x] & ~mask) | ((image[(srcx>>16)]&0x3) << shift ); 108 frameb[x] = (frameb[x] & mask) | (pixval[image[(srcx>>16)]&0x3] << shift );
85 srcx += X_STEP; /* move through source image */ 109 srcx += X_STEP; /* move through source image */
86 } 110 }
87 srcy += Y_STEP; /* move through the source image... */ 111 srcy += Y_STEP; /* move through the source image... */
88 image += (srcy>>16)*WIDTH; /* and possibly to the next row. */ 112 image += (srcy>>16)*WIDTH; /* and possibly to the next row. */
89 srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */ 113 srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */
90 } 114 }
91#endif 115#endif
92 116
93 if ( settings.showfps ) { 117 if ( settings.showfps ) {
94 int percent=0; 118 int percent=0;