summaryrefslogtreecommitdiffstats
path: root/apps/plugins/rockboy/sys_rockbox.c
diff options
context:
space:
mode:
authorDave Chapman <dave@dchapman.com>2006-01-20 20:59:07 +0000
committerDave Chapman <dave@dchapman.com>2006-01-20 20:59:07 +0000
commite8f8d9e7e93bd211a754b0722977f5ac72a4ba30 (patch)
treeb11cf1c83a487e98d7413f10265c745a5aa463f4 /apps/plugins/rockboy/sys_rockbox.c
parentb96ec65ac016f3f308049a7287b1beefd0d1b67e (diff)
downloadrockbox-e8f8d9e7e93bd211a754b0722977f5ac72a4ba30.tar.gz
rockbox-e8f8d9e7e93bd211a754b0722977f5ac72a4ba30.tar.bz2
rockbox-e8f8d9e7e93bd211a754b0722977f5ac72a4ba30.zip
Initial support for iPod color and video. The Nano has a 176x132 LCD, which is the first colour LCD smaller than the gameboy's 160x144 display - so it needs work to skip scanlines. Button handling still needs more work - only up/down/left/right/start are currently mapped. Code is removed from IRAM due to 'relocation truncated to fit: R_ARM_PC24' errors.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8400 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/rockboy/sys_rockbox.c')
-rw-r--r--apps/plugins/rockboy/sys_rockbox.c38
1 files changed, 28 insertions, 10 deletions
diff --git a/apps/plugins/rockboy/sys_rockbox.c b/apps/plugins/rockboy/sys_rockbox.c
index 578a864ca0..077727352d 100644
--- a/apps/plugins/rockboy/sys_rockbox.c
+++ b/apps/plugins/rockboy/sys_rockbox.c
@@ -25,6 +25,22 @@
#include "hw.h"
#include "config.h"
+#if (CONFIG_KEYPAD == IPOD_4G_PAD)
+
+#define ROCKBOY_PAD_LEFT BUTTON_LEFT
+#define ROCKBOY_PAD_RIGHT BUTTON_RIGHT
+#define ROCKBOY_PAD_UP BUTTON_MENU
+#define ROCKBOY_PAD_DOWN BUTTON_PLAY
+
+#else
+
+#define ROCKBOY_PAD_LEFT BUTTON_LEFT
+#define ROCKBOY_PAD_RIGHT BUTTON_RIGHT
+#define ROCKBOY_PAD_UP BUTTON_UP
+#define ROCKBOY_PAD_DOWN BUTTON_DOWN
+
+#endif
+
rcvar_t joy_exports[] =
{
RCV_END
@@ -73,10 +89,10 @@ void ev_poll(void)
#endif
if(released) {
ev.type = EV_RELEASE;
- if(released & BUTTON_LEFT) { ev.code=PAD_LEFT; ev_postevent(&ev); }
- if(released & BUTTON_RIGHT) {ev.code=PAD_RIGHT; ev_postevent(&ev);}
- if(released & BUTTON_DOWN) { ev.code=PAD_DOWN; ev_postevent(&ev); }
- if(released & BUTTON_UP) { ev.code=PAD_UP; ev_postevent(&ev); }
+ if(released & ROCKBOY_PAD_LEFT) { ev.code=PAD_LEFT; ev_postevent(&ev); }
+ if(released & ROCKBOY_PAD_RIGHT) {ev.code=PAD_RIGHT; ev_postevent(&ev);}
+ if(released & ROCKBOY_PAD_DOWN) { ev.code=PAD_DOWN; ev_postevent(&ev); }
+ if(released & ROCKBOY_PAD_UP) { ev.code=PAD_UP; ev_postevent(&ev); }
if(released & options.A) { ev.code=PAD_A; ev_postevent(&ev); }
if(released & options.B) { ev.code=PAD_B; ev_postevent(&ev); }
if(released & options.START) {
@@ -90,10 +106,10 @@ void ev_poll(void)
}
if(pressed) { /* button press */
ev.type = EV_PRESS;
- if(pressed & BUTTON_LEFT) { ev.code=PAD_LEFT; ev_postevent(&ev); }
- if(pressed & BUTTON_RIGHT) { ev.code=PAD_RIGHT; ev_postevent(&ev);}
- if(pressed & BUTTON_DOWN) { ev.code=PAD_DOWN; ev_postevent(&ev); }
- if(pressed & BUTTON_UP) { ev.code=PAD_UP; ev_postevent(&ev); }
+ if(pressed & ROCKBOY_PAD_LEFT) { ev.code=PAD_LEFT; ev_postevent(&ev); }
+ if(pressed & ROCKBOY_PAD_RIGHT) { ev.code=PAD_RIGHT; ev_postevent(&ev);}
+ if(pressed & ROCKBOY_PAD_DOWN) { ev.code=PAD_DOWN; ev_postevent(&ev); }
+ if(pressed & ROCKBOY_PAD_UP) { ev.code=PAD_UP; ev_postevent(&ev); }
if(pressed & options.A) { ev.code=PAD_A; ev_postevent(&ev); }
if(pressed & options.B) { ev.code=PAD_B; ev_postevent(&ev); }
if(pressed & options.START) {
@@ -105,7 +121,9 @@ void ev_poll(void)
ev_postevent(&ev);
}
if(pressed & options.MENU) {
-#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD)
+#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
+ (CONFIG_KEYPAD == IRIVER_H300_PAD) || \
+ (CONFIG_KEYPAD == IPOD_4G_PAD)
if (do_user_menu() == USER_MENU_QUIT)
#endif
{
@@ -264,7 +282,7 @@ void vid_update(int scanline)
cnt++;
}
rb->lcd_update_rect(0, scanline & ~3, LCD_WIDTH, 4);
-#elif (LCD_HEIGHT >= 144) && defined(HAVE_LCD_COLOR) /* iriver H3x0, colour iPod */
+#elif defined(HAVE_LCD_COLOR) /* iriver H3x0, colour iPod */
// handled in lcd.c now
#endif /* LCD_HEIGHT */
}