diff options
author | Dave Chapman <dave@dchapman.com> | 2007-05-26 08:48:44 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2007-05-26 08:48:44 +0000 |
commit | 1186c18c3aed23b8c0d2964084b33bf40ab4ae86 (patch) | |
tree | 635b3adfd2654440f7fb86afdaa20067558bf345 /apps/plugins | |
parent | 31df21c4f97b71c86dea1171b8623aa0cd14944f (diff) | |
download | rockbox-1186c18c3aed23b8c0d2964084b33bf40ab4ae86.tar.gz rockbox-1186c18c3aed23b8c0d2964084b33bf40ab4ae86.zip |
Adapt Pacbox for the Sansa's LCD - it was using the ipod Nano display routine before.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13494 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r-- | apps/plugins/pacbox/pacbox.h | 11 | ||||
-rw-r--r-- | apps/plugins/pacbox/pacbox_lcd.c | 23 |
2 files changed, 28 insertions, 6 deletions
diff --git a/apps/plugins/pacbox/pacbox.h b/apps/plugins/pacbox/pacbox.h index 4b8ec41ce5..0d879fcddc 100644 --- a/apps/plugins/pacbox/pacbox.h +++ b/apps/plugins/pacbox/pacbox.h | |||
@@ -89,10 +89,10 @@ | |||
89 | 89 | ||
90 | #elif CONFIG_KEYPAD == SANSA_E200_PAD | 90 | #elif CONFIG_KEYPAD == SANSA_E200_PAD |
91 | 91 | ||
92 | #define PACMAN_UP BUTTON_RIGHT | 92 | #define PACMAN_UP BUTTON_UP |
93 | #define PACMAN_DOWN BUTTON_LEFT | 93 | #define PACMAN_DOWN BUTTON_DOWN |
94 | #define PACMAN_LEFT BUTTON_UP | 94 | #define PACMAN_LEFT BUTTON_LEFT |
95 | #define PACMAN_RIGHT BUTTON_DOWN | 95 | #define PACMAN_RIGHT BUTTON_RIGHT |
96 | #define PACMAN_1UP BUTTON_SELECT | 96 | #define PACMAN_1UP BUTTON_SELECT |
97 | #define PACMAN_2UP BUTTON_REC | 97 | #define PACMAN_2UP BUTTON_REC |
98 | #define PACMAN_COIN_PRE BUTTON_SELECT | 98 | #define PACMAN_COIN_PRE BUTTON_SELECT |
@@ -129,6 +129,9 @@ | |||
129 | #elif (LCD_WIDTH >= 220) | 129 | #elif (LCD_WIDTH >= 220) |
130 | #define XOFS ((LCD_WIDTH-(288*3/4))/2) | 130 | #define XOFS ((LCD_WIDTH-(288*3/4))/2) |
131 | #define YOFS ((LCD_HEIGHT-(224*3/4))/2) | 131 | #define YOFS ((LCD_HEIGHT-(224*3/4))/2) |
132 | #elif (LCD_WIDTH >= 168) && (LCD_HEIGHT >= 216) | ||
133 | #define XOFS ((LCD_WIDTH-(224*3/4))/2) | ||
134 | #define YOFS ((LCD_HEIGHT-(288*3/4))/2) | ||
132 | #elif (LCD_WIDTH >= 144) | 135 | #elif (LCD_WIDTH >= 144) |
133 | #define XOFS ((LCD_WIDTH-288/2)/2) | 136 | #define XOFS ((LCD_WIDTH-288/2)/2) |
134 | #define YOFS ((LCD_HEIGHT-224/2)/2) | 137 | #define YOFS ((LCD_HEIGHT-224/2)/2) |
diff --git a/apps/plugins/pacbox/pacbox_lcd.c b/apps/plugins/pacbox/pacbox_lcd.c index e63ef4dd31..b312cf087b 100644 --- a/apps/plugins/pacbox/pacbox_lcd.c +++ b/apps/plugins/pacbox/pacbox_lcd.c | |||
@@ -56,7 +56,7 @@ void blit_display(fb_data* lcd_framebuffer, unsigned char* vbuf) | |||
56 | } | 56 | } |
57 | } | 57 | } |
58 | #elif (LCD_WIDTH >= 216) && (LCD_HEIGHT >= 168) | 58 | #elif (LCD_WIDTH >= 216) && (LCD_HEIGHT >= 168) |
59 | /* 0.75 scaling - display 3 out of 4 pixels = 216x168 | 59 | /* 0.75 scaling - display 3 out of 4 pixels - rotated = 216x168 |
60 | Skipping pixel #2 out of 4 seems to give the most legible display | 60 | Skipping pixel #2 out of 4 seems to give the most legible display |
61 | */ | 61 | */ |
62 | next_dst=&lcd_framebuffer[YOFS*LCD_WIDTH+XOFS+((ScreenHeight*3)/4)-1]; | 62 | next_dst=&lcd_framebuffer[YOFS*LCD_WIDTH+XOFS+((ScreenHeight*3)/4)-1]; |
@@ -74,8 +74,27 @@ void blit_display(fb_data* lcd_framebuffer, unsigned char* vbuf) | |||
74 | vbuf+=ScreenWidth; | 74 | vbuf+=ScreenWidth; |
75 | } | 75 | } |
76 | } | 76 | } |
77 | #elif (LCD_WIDTH >= 168) && (LCD_HEIGHT >= 216) | ||
78 | /* 0.75 scaling - display 3 out of 4 pixels - = 168x216 | ||
79 | Skipping pixel #2 out of 4 seems to give the most legible display | ||
80 | */ | ||
81 | (void)next_dst; | ||
82 | dst=&lcd_framebuffer[YOFS*LCD_WIDTH+XOFS]; | ||
83 | for (y=0;y<ScreenHeight;y++) { | ||
84 | if ((y & 3) != 1) { | ||
85 | for (x=0;x<ScreenWidth;x++) { | ||
86 | if ((x & 3) == 1) { vbuf++; } | ||
87 | else { | ||
88 | *(dst++) = palette[*(vbuf++)]; | ||
89 | } | ||
90 | } | ||
91 | dst += XOFS*2; | ||
92 | } else { | ||
93 | vbuf+=ScreenWidth; | ||
94 | } | ||
95 | } | ||
77 | #elif (LCD_WIDTH >= 144) && (LCD_HEIGHT >= 112) | 96 | #elif (LCD_WIDTH >= 144) && (LCD_HEIGHT >= 112) |
78 | /* 0.5 scaling - display every other pixel = 144x112 */ | 97 | /* 0.5 scaling - display every other pixel - rotated = 144x112 */ |
79 | next_dst=&lcd_framebuffer[YOFS*LCD_WIDTH+XOFS+ScreenHeight/2-1]; | 98 | next_dst=&lcd_framebuffer[YOFS*LCD_WIDTH+XOFS+ScreenHeight/2-1]; |
80 | for (y=(ScreenHeight/2)-1;y >= 0; y--) { | 99 | for (y=(ScreenHeight/2)-1;y >= 0; y--) { |
81 | dst = (next_dst--); | 100 | dst = (next_dst--); |