forked from len0rd/rockbox
Plasma: Add hardware support for 256 color palette mode.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22649 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
18286d3cc5
commit
0633a9aaac
1 changed files with 29 additions and 0 deletions
|
@ -236,6 +236,9 @@ void shades_generate(int time)
|
||||||
|
|
||||||
r++; g++; b++;
|
r++; g++; b++;
|
||||||
}
|
}
|
||||||
|
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
|
||||||
|
rb->lcd_pal256_update_pal(colours);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
/* Make a smooth shade from black into white and back into black again. */
|
/* Make a smooth shade from black into white and back into black again. */
|
||||||
|
@ -275,7 +278,11 @@ int main(void)
|
||||||
int button, x, y;
|
int button, x, y;
|
||||||
unsigned char p1,p2,p3,p4,t1,t2,t3,t4, z;
|
unsigned char p1,p2,p3,p4,t1,t2,t3,t4, z;
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
|
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
|
||||||
|
unsigned char *ptr;
|
||||||
|
#else
|
||||||
fb_data *ptr;
|
fb_data *ptr;
|
||||||
|
#endif
|
||||||
int time=0;
|
int time=0;
|
||||||
#else
|
#else
|
||||||
unsigned char *ptr;
|
unsigned char *ptr;
|
||||||
|
@ -303,7 +310,12 @@ int main(void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
shades_generate(time++); /* dynamically */
|
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;
|
ptr = rb->lcd_framebuffer;
|
||||||
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
ptr = greybuffer;
|
ptr = greybuffer;
|
||||||
#endif
|
#endif
|
||||||
|
@ -317,7 +329,11 @@ int main(void)
|
||||||
{
|
{
|
||||||
z = wave_array[t1] + wave_array[t2] + wave_array[t3]
|
z = wave_array[t1] + wave_array[t2] + wave_array[t3]
|
||||||
+ wave_array[t4];
|
+ wave_array[t4];
|
||||||
|
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
|
||||||
|
*ptr++ = z;
|
||||||
|
#else
|
||||||
*ptr++ = colours[z];
|
*ptr++ = colours[z];
|
||||||
|
#endif
|
||||||
t3+=1;
|
t3+=1;
|
||||||
t4+=2;
|
t4+=2;
|
||||||
}
|
}
|
||||||
|
@ -330,7 +346,12 @@ int main(void)
|
||||||
p3+=sp3;
|
p3+=sp3;
|
||||||
p4-=sp4;
|
p4-=sp4;
|
||||||
#ifdef HAVE_LCD_COLOR
|
#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();
|
rb->lcd_update();
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
grey_ub_gray_bitmap(greybuffer, 0, 0, LCD_WIDTH, LCD_HEIGHT);
|
grey_ub_gray_bitmap(greybuffer, 0, 0, LCD_WIDTH, LCD_HEIGHT);
|
||||||
#endif
|
#endif
|
||||||
|
@ -392,8 +413,16 @@ enum plugin_status plugin_start(const void* parameter)
|
||||||
/* Turn off backlight timeout */
|
/* Turn off backlight timeout */
|
||||||
backlight_force_on(); /* backlight control in lib/helper.c */
|
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();
|
ret = main();
|
||||||
|
|
||||||
|
#if defined(HAVE_LCD_MODES) && (HAVE_LCD_MODES & LCD_MODE_PAL256)
|
||||||
|
rb->lcd_set_mode(LCD_MODE_RGB565);
|
||||||
|
#endif
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue