summaryrefslogtreecommitdiff
path: root/apps/plugins/zxbox
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2008-03-22 14:20:04 +0000
committerJens Arnold <amiconn@rockbox.org>2008-03-22 14:20:04 +0000
commit106ac75ad8229d4c5f66a846609520d22d9d8f0c (patch)
treedefc6786b833bbef4f589070814eee59a8567ba8 /apps/plugins/zxbox
parent95d8590659602080acc7d25f49e7b24b429aa5af (diff)
Adapted most multi-source plugins to the iAudio M3 keypad and screen. Doom and mpegplayer are disabled because of the not yet implemented greyscale library, and zxbox used 2-bit greyscale for now. * Slight optimisation for the (currently unused except on M3) 2-bit greyscale code in zxbox. * Simplified button definitions in chessbox.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16744 a1c6a512-1295-4272-9138-f99709370657
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 @@
#define ZX_SELECT BUTTON_RC_MODE
#define ZX_MENU (BUTTON_POWER | BUTTON_REL)
+#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
+#define ZX_UP BUTTON_RC_VOL_UP
+#define ZX_DOWN BUTTON_RC_VOL_DOWN
+#define ZX_LEFT BUTTON_RC_REW
+#define ZX_RIGHT BUTTON_RC_FF
+#define ZX_SELECT BUTTON_RC_PLAY
+#define ZX_MENU BUTTON_RC_REC
+
#else
#error Keymap not defined!
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 @@
#define KBD_UP BUTTON_UP
#define KBD_DOWN BUTTON_DOWN
+#elif CONFIG_KEYPAD == IAUDIO_M3_PAD
+
+#define KBD_SELECT BUTTON_RC_PLAY
+#define KBD_ABORT BUTTON_RC_REC
+#define KBD_LEFT BUTTON_RC_REW
+#define KBD_RIGHT BUTTON_RC_FF
+#define KBD_UP BUTTON_RC_VOL_UP
+#define KBD_DOWN BUTTON_RC_VOL_DOWN
+
#endif
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];
#define SETTINGS_VERSION 2
/* undef not to use greyscale lib */
-#if !defined HAVE_LCD_COLOR
+#if !defined HAVE_LCD_COLOR && !defined(IAUDIO_M3)
+ /* FIXME: change after implementing greyscale lib for M3 */
#define USE_GREY
#define USE_BUFFERED_GREY
#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 @@
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
#define FB_WIDTH ((LCD_WIDTH+3)/4)
-unsigned char pixmask[4] ICONST_ATTR = {
- 0xC0, 0x30, 0x0C, 0x03
- };
+fb_data pixmask[4] ICONST_ATTR = {
+ 0xC0, 0x30, 0x0C, 0x03
+};
#elif LCD_PIXELFORMAT == VERTICAL_PACKING
-unsigned char pixmask[4] ICONST_ATTR = {
+fb_data pixmask[4] ICONST_ATTR = {
0x03, 0x0C, 0x30, 0xC0
};
+#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED
+fb_data pixmask[8] ICONST_ATTR = {
+ 0x0101, 0x0202, 0x0404, 0x0808, 0x1010, 0x2020, 0x4040, 0x8080
+};
+fb_data pixval[4] ICONST_ATTR = {
+ 0x0000, 0x0001, 0x0100, 0x0101
+};
#endif
void init_spect_scr(void)
@@ -63,8 +70,8 @@ void update_screen(void)
srcx = 0; /* reset our x counter before each row... */
for(x = 0; x < LCD_WIDTH; x++)
{
- mask = pixmask[x & 3];
- frameb[x >> 2] = (frameb[x >> 2] & ~mask) | ((image[(srcx>>16)]&0x3) << ((3-(x & 3 )) * 2 ));
+ mask = ~pixmask[x & 3];
+ frameb[x >> 2] = (frameb[x >> 2] & mask) | ((image[(srcx>>16)]&0x3) << ((3-(x & 3 )) * 2 ));
srcx += X_STEP; /* move through source image */
}
srcy += Y_STEP; /* move through the source image... */
@@ -78,17 +85,34 @@ void update_screen(void)
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];
+ 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 */
+ }
+#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED
+ int shift;
+ for(y = 0; y < LCD_HEIGHT; y++)
+ {
+ frameb = rb->lcd_framebuffer + (y/8) * LCD_WIDTH;
+ srcx = 0; /* reset our x counter before each row... */
+ shift = (y & 7);
+ mask = ~pixmask[y & 7];
for(x = 0; x < LCD_WIDTH; x++)
{
- frameb[x] = (frameb[x] & ~mask) | ((image[(srcx>>16)]&0x3) << shift );
+ frameb[x] = (frameb[x] & mask) | (pixval[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
+#endif
if ( settings.showfps ) {
int percent=0;