diff options
author | Karl Kurbjun <kkurbjun@gmail.com> | 2009-09-07 14:00:38 +0000 |
---|---|---|
committer | Karl Kurbjun <kkurbjun@gmail.com> | 2009-09-07 14:00:38 +0000 |
commit | 0633a9aaac43fa6da7dd6f4ecdfdedf99a0a613e (patch) | |
tree | a84e332d4ef191d2df11fffa14ada9bfb1028f9b | |
parent | 18286d3cc53fbea3c8a5954c69a992c4b3179911 (diff) |
Plasma: Add hardware support for 256 color palette mode.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22649 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/plasma.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/apps/plugins/plasma.c b/apps/plugins/plasma.c index 294747ffe4..450b09fb8c 100644 --- a/apps/plugins/plasma.c +++ b/apps/plugins/plasma.c @@ -236,6 +236,9 @@ void shades_generate(int time) r++; g++; b++; } +#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) + rb->lcd_pal256_update_pal(colours); +#endif } #else /* Make a smooth shade from black into white and back into black again. */ @@ -275,7 +278,11 @@ int main(void) int button, x, y; unsigned char p1,p2,p3,p4,t1,t2,t3,t4, z; #ifdef HAVE_LCD_COLOR +#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) + unsigned char *ptr; +#else fb_data *ptr; +#endif int time=0; #else unsigned char *ptr; @@ -303,7 +310,12 @@ int main(void) { #ifdef HAVE_LCD_COLOR shades_generate(time++); /* dynamically */ +#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) + ptr = (unsigned char*)rb->lcd_framebuffer; +#else ptr = rb->lcd_framebuffer; +#endif + #else ptr = greybuffer; #endif @@ -317,7 +329,11 @@ int main(void) { z = wave_array[t1] + wave_array[t2] + wave_array[t3] + wave_array[t4]; +#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) + *ptr++ = z; +#else *ptr++ = colours[z]; +#endif t3+=1; t4+=2; } @@ -330,7 +346,12 @@ int main(void) p3+=sp3; p4-=sp4; #ifdef HAVE_LCD_COLOR +#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) + rb->lcd_blit_pal256( (unsigned char*)rb->lcd_framebuffer, + 0,0,0,0,LCD_WIDTH,LCD_HEIGHT); +#else rb->lcd_update(); +#endif #else grey_ub_gray_bitmap(greybuffer, 0, 0, LCD_WIDTH, LCD_HEIGHT); #endif @@ -392,8 +413,16 @@ enum plugin_status plugin_start(const void* parameter) /* Turn off backlight timeout */ backlight_force_on(); /* backlight control in lib/helper.c */ +#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) + rb->lcd_set_mode(LCD_MODE_PAL256); +#endif + ret = main(); +#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256) + rb->lcd_set_mode(LCD_MODE_RGB565); +#endif + return ret; } |