diff options
author | Sebastian Leonhardt <sebastian.leonhardt@web.de> | 2016-04-12 17:20:04 +0200 |
---|---|---|
committer | Sebastian Leonhardt <sebastian.leonhardt@web.de> | 2018-04-03 00:21:40 +0200 |
commit | fb3f7651fd68bf3b8c7e4dbd62dbb2b3505f929a (patch) | |
tree | d09a0cd7828395d70962b5ef18ba7b5a8d71afc2 /apps | |
parent | 96335a7eb2e9cf1e452feac0c8ae0c489197500f (diff) | |
download | rockbox-fb3f7651fd68bf3b8c7e4dbd62dbb2b3505f929a.tar.gz rockbox-fb3f7651fd68bf3b8c7e4dbd62dbb2b3505f929a.zip |
pacbox for small screens, up to 75x96
Change-Id: I6e9adf2f6923f4d0078a54e9857fc8eacef259a6
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/SUBDIRS | 3 | ||||
-rw-r--r-- | apps/plugins/pacbox/pacbox.h | 23 | ||||
-rw-r--r-- | apps/plugins/pacbox/pacbox_lcd.c | 39 |
3 files changed, 64 insertions, 1 deletions
diff --git a/apps/plugins/SUBDIRS b/apps/plugins/SUBDIRS index 07c435123c..055db43b48 100644 --- a/apps/plugins/SUBDIRS +++ b/apps/plugins/SUBDIRS | |||
@@ -65,7 +65,8 @@ zxbox | |||
65 | #endif /* HAVE_LCD_BITMAP */ | 65 | #endif /* HAVE_LCD_BITMAP */ |
66 | 66 | ||
67 | /* For all big enough colour screens, iriver H1x0 and iAudio M5 */ | 67 | /* For all big enough colour screens, iriver H1x0 and iAudio M5 */ |
68 | #if defined(HAVE_LCD_COLOR) && LCD_HEIGHT > 96\ | 68 | #if defined(HAVE_LCD_COLOR) && ( (LCD_HEIGHT >= 90 && LCD_WIDTH >=116) \ |
69 | || (LCD_HEIGHT >= 96 && LCD_WIDTH >=75) ) \ | ||
69 | || defined(IRIVER_H100_SERIES) || defined(IAUDIO_M5) | 70 | || defined(IRIVER_H100_SERIES) || defined(IAUDIO_M5) |
70 | pacbox | 71 | pacbox |
71 | #endif | 72 | #endif |
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 |