summaryrefslogtreecommitdiff
path: root/apps/plugins/pacbox
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/pacbox')
-rw-r--r--apps/plugins/pacbox/pacbox.h23
-rw-r--r--apps/plugins/pacbox/pacbox_lcd.c39
2 files changed, 62 insertions, 0 deletions
diff --git a/apps/plugins/pacbox/pacbox.h b/apps/plugins/pacbox/pacbox.h
index 77a107bec4..58838c7be3 100644
--- a/apps/plugins/pacbox/pacbox.h
+++ b/apps/plugins/pacbox/pacbox.h
@@ -123,6 +123,17 @@
123#define PACMAN_COIN (BUTTON_SELECT | BUTTON_DOWN) 123#define PACMAN_COIN (BUTTON_SELECT | BUTTON_DOWN)
124#define PACMAN_MENU BUTTON_HOME 124#define PACMAN_MENU BUTTON_HOME
125 125
126#elif CONFIG_KEYPAD == SANSA_CLIP_PAD
127
128#define PACMAN_UP BUTTON_UP
129#define PACMAN_DOWN BUTTON_DOWN
130#define PACMAN_LEFT BUTTON_LEFT
131#define PACMAN_RIGHT BUTTON_RIGHT
132#define PACMAN_1UP BUTTON_SELECT
133#define PACMAN_COIN_PRE BUTTON_SELECT
134#define PACMAN_COIN (BUTTON_SELECT | BUTTON_DOWN)
135#define PACMAN_MENU BUTTON_HOME
136
126#elif CONFIG_KEYPAD == IRIVER_H10_PAD 137#elif CONFIG_KEYPAD == IRIVER_H10_PAD
127 138
128#if defined(IRIVER_H10_5GB) 139#if defined(IRIVER_H10_5GB)
@@ -418,6 +429,18 @@
418#define YOFS ((LCD_HEIGHT-288/2)/2) 429#define YOFS ((LCD_HEIGHT-288/2)/2)
419#endif 430#endif
420 431
432#elif (LCD_WIDTH >= 116) && (LCD_HEIGHT >= 90)
433#define LCD_SCALE 40
434#define LCD_ROTATE 1
435#define XOFS ((LCD_HEIGHT-224*2/5)/2)
436#define YOFS ((LCD_WIDTH-288*2/5)/2)
437
438#elif (LCD_WIDTH >= 75) && (LCD_HEIGHT >= 96)
439#define LCD_SCALE 33
440#define LCD_ROTATE 0
441#define XOFS ((LCD_HEIGHT-224/3)/2)
442#define YOFS ((LCD_WIDTH-288/3)/2)
443
421#else 444#else
422#error "unsupported screen resolution" 445#error "unsupported screen resolution"
423#endif 446#endif
diff --git a/apps/plugins/pacbox/pacbox_lcd.c b/apps/plugins/pacbox/pacbox_lcd.c
index 6bb51a038d..bf4aa9f028 100644
--- a/apps/plugins/pacbox/pacbox_lcd.c
+++ b/apps/plugins/pacbox/pacbox_lcd.c
@@ -124,7 +124,46 @@ void blit_display(fb_data* lcd_framebuffer, unsigned char* vbuf)
124 dst += XOFS*2; 124 dst += XOFS*2;
125 vbuf+=ScreenWidth; 125 vbuf+=ScreenWidth;
126 } 126 }
127#elif LCD_SCALE==40 && LCD_ROTATE==1
128 /* 0.4 scaling - rotated = 116x90 */
129 /* show 2 out of 5 pixels: 1st and 3rd anf 4th merged together */
130 next_dst=&lcd_framebuffer[XOFS*LCD_WIDTH+YOFS+ScreenHeight*2/5-1];
131 for (y=(ScreenHeight*2/5)-1;y >= 0; y--) {
132 dst = (next_dst--);
133 for (x=0;x<ScreenWidth*2/5;x++) {
134 *dst = palette[*(vbuf)] | palette[*(vbuf+ScreenWidth+1)];
135 /* every odd row number merge 2 source lines as one */
136 if (y & 1) *dst |= palette[*(vbuf+ScreenWidth*2)];
137 vbuf+=2;
138 dst+=LCD_WIDTH;
139
140 x++;
141 /* every odd column merge 2 colums together */
142 *dst = palette[*(vbuf)] | palette[*(vbuf+1)] |palette[*(vbuf+ScreenWidth+2)];
143 if (y & 1) *dst |= palette[*(vbuf+ScreenWidth*2+1)];
144 vbuf+=3;
145 dst+=LCD_WIDTH;
146 }
147 vbuf+=ScreenWidth-1;
148 if (y & 1) vbuf+=ScreenWidth;
149 }
150#elif LCD_SCALE==33 && LCD_ROTATE==0
151 /* 1/3 scaling - display every third pixel - 75x96 */
152 (void)next_dst;
153 dst=&lcd_framebuffer[YOFS*LCD_WIDTH+XOFS];
154
155 for (y=0;y<ScreenHeight/3;y++) {
156 for (x=0;x<ScreenWidth/3;x++) {
157 *(dst++) = palette[*(vbuf)]
158 | palette[*(vbuf+ScreenWidth+1)]
159 | palette[*(vbuf+ScreenWidth*2+2)];
160 vbuf+=3;
161 }
162 dst += XOFS*2;
163 vbuf+=ScreenWidth*2+2;
164 }
127#endif 165#endif
166
128#else /* Greyscale LCDs */ 167#else /* Greyscale LCDs */
129#if LCD_SCALE==50 && LCD_ROTATE==1 168#if LCD_SCALE==50 && LCD_ROTATE==1
130#if LCD_PIXELFORMAT == VERTICAL_PACKING 169#if LCD_PIXELFORMAT == VERTICAL_PACKING