summaryrefslogtreecommitdiff
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.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 @@
25#include "hw.h" 25#include "hw.h"
26#include "config.h" 26#include "config.h"
27 27
28#if (CONFIG_KEYPAD == IPOD_4G_PAD)
29
30#define ROCKBOY_PAD_LEFT BUTTON_LEFT
31#define ROCKBOY_PAD_RIGHT BUTTON_RIGHT
32#define ROCKBOY_PAD_UP BUTTON_MENU
33#define ROCKBOY_PAD_DOWN BUTTON_PLAY
34
35#else
36
37#define ROCKBOY_PAD_LEFT BUTTON_LEFT
38#define ROCKBOY_PAD_RIGHT BUTTON_RIGHT
39#define ROCKBOY_PAD_UP BUTTON_UP
40#define ROCKBOY_PAD_DOWN BUTTON_DOWN
41
42#endif
43
28rcvar_t joy_exports[] = 44rcvar_t joy_exports[] =
29{ 45{
30 RCV_END 46 RCV_END
@@ -73,10 +89,10 @@ void ev_poll(void)
73#endif 89#endif
74 if(released) { 90 if(released) {
75 ev.type = EV_RELEASE; 91 ev.type = EV_RELEASE;
76 if(released & BUTTON_LEFT) { ev.code=PAD_LEFT; ev_postevent(&ev); } 92 if(released & ROCKBOY_PAD_LEFT) { ev.code=PAD_LEFT; ev_postevent(&ev); }
77 if(released & BUTTON_RIGHT) {ev.code=PAD_RIGHT; ev_postevent(&ev);} 93 if(released & ROCKBOY_PAD_RIGHT) {ev.code=PAD_RIGHT; ev_postevent(&ev);}
78 if(released & BUTTON_DOWN) { ev.code=PAD_DOWN; ev_postevent(&ev); } 94 if(released & ROCKBOY_PAD_DOWN) { ev.code=PAD_DOWN; ev_postevent(&ev); }
79 if(released & BUTTON_UP) { ev.code=PAD_UP; ev_postevent(&ev); } 95 if(released & ROCKBOY_PAD_UP) { ev.code=PAD_UP; ev_postevent(&ev); }
80 if(released & options.A) { ev.code=PAD_A; ev_postevent(&ev); } 96 if(released & options.A) { ev.code=PAD_A; ev_postevent(&ev); }
81 if(released & options.B) { ev.code=PAD_B; ev_postevent(&ev); } 97 if(released & options.B) { ev.code=PAD_B; ev_postevent(&ev); }
82 if(released & options.START) { 98 if(released & options.START) {
@@ -90,10 +106,10 @@ void ev_poll(void)
90 } 106 }
91 if(pressed) { /* button press */ 107 if(pressed) { /* button press */
92 ev.type = EV_PRESS; 108 ev.type = EV_PRESS;
93 if(pressed & BUTTON_LEFT) { ev.code=PAD_LEFT; ev_postevent(&ev); } 109 if(pressed & ROCKBOY_PAD_LEFT) { ev.code=PAD_LEFT; ev_postevent(&ev); }
94 if(pressed & BUTTON_RIGHT) { ev.code=PAD_RIGHT; ev_postevent(&ev);} 110 if(pressed & ROCKBOY_PAD_RIGHT) { ev.code=PAD_RIGHT; ev_postevent(&ev);}
95 if(pressed & BUTTON_DOWN) { ev.code=PAD_DOWN; ev_postevent(&ev); } 111 if(pressed & ROCKBOY_PAD_DOWN) { ev.code=PAD_DOWN; ev_postevent(&ev); }
96 if(pressed & BUTTON_UP) { ev.code=PAD_UP; ev_postevent(&ev); } 112 if(pressed & ROCKBOY_PAD_UP) { ev.code=PAD_UP; ev_postevent(&ev); }
97 if(pressed & options.A) { ev.code=PAD_A; ev_postevent(&ev); } 113 if(pressed & options.A) { ev.code=PAD_A; ev_postevent(&ev); }
98 if(pressed & options.B) { ev.code=PAD_B; ev_postevent(&ev); } 114 if(pressed & options.B) { ev.code=PAD_B; ev_postevent(&ev); }
99 if(pressed & options.START) { 115 if(pressed & options.START) {
@@ -105,7 +121,9 @@ void ev_poll(void)
105 ev_postevent(&ev); 121 ev_postevent(&ev);
106 } 122 }
107 if(pressed & options.MENU) { 123 if(pressed & options.MENU) {
108#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || (CONFIG_KEYPAD == IRIVER_H300_PAD) 124#if (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
125 (CONFIG_KEYPAD == IRIVER_H300_PAD) || \
126 (CONFIG_KEYPAD == IPOD_4G_PAD)
109 if (do_user_menu() == USER_MENU_QUIT) 127 if (do_user_menu() == USER_MENU_QUIT)
110#endif 128#endif
111 { 129 {
@@ -264,7 +282,7 @@ void vid_update(int scanline)
264 cnt++; 282 cnt++;
265 } 283 }
266 rb->lcd_update_rect(0, scanline & ~3, LCD_WIDTH, 4); 284 rb->lcd_update_rect(0, scanline & ~3, LCD_WIDTH, 4);
267#elif (LCD_HEIGHT >= 144) && defined(HAVE_LCD_COLOR) /* iriver H3x0, colour iPod */ 285#elif defined(HAVE_LCD_COLOR) /* iriver H3x0, colour iPod */
268 // handled in lcd.c now 286 // handled in lcd.c now
269#endif /* LCD_HEIGHT */ 287#endif /* LCD_HEIGHT */
270} 288}