forked from len0rd/rockbox
All-new greyscale library, replacing the old one. Features: (1) Drawing/updating is faster than the old grayscale lib at full depth. (2) Always 129 shades instead of 2..33 shades. (3) No graininess caused by frequent updates (mpegplayer, doom, ...). (4) Needs less memory than the old grayscale lib at full depth. * The tradeoff is slightly higher CPU load in the ISR (frames are calculated 'live') and an extra function in the core. * Ported all plugins which used the graylib to use the new one. * Some slight optimisations for archos and H1x0 LCD update.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15998 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d3586837fa
commit
feb5b15e9b
35 changed files with 2872 additions and 357 deletions
|
@ -72,7 +72,7 @@
|
|||
/* NOTE:
|
||||
|
||||
The user timer is used to generate a 70Hz tick for Doom. But it
|
||||
is unavailable for the grayscale targets (it's used by the grayscale
|
||||
is unavailable for the greyscale targets (it's used by the greyscale
|
||||
lib) and is not implemented in the simulator - so we have to
|
||||
approximate it using current_tick.
|
||||
*/
|
||||
|
|
|
@ -117,13 +117,13 @@
|
|||
#include "rockmacros.h"
|
||||
|
||||
#ifndef HAVE_LCD_COLOR
|
||||
#include "../lib/gray.h"
|
||||
static unsigned char graybuffer[8*LCD_WIDTH] IBSS_ATTR; /* off screen buffer */
|
||||
#include "../lib/grey.h"
|
||||
static unsigned char greybuffer[LCD_WIDTH] IBSS_ATTR; /* off screen buffer */
|
||||
static unsigned char *gbuf;
|
||||
#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
|
||||
#define GRAYBUFSIZE (((LCD_WIDTH+7)/8)*LCD_HEIGHT*32+200)
|
||||
#define GREYBUFSIZE (((LCD_WIDTH+7)/8)*LCD_HEIGHT*16+200)
|
||||
#else
|
||||
#define GRAYBUFSIZE (LCD_WIDTH*((LCD_HEIGHT+7)/8)*32+200)
|
||||
#define GREYBUFSIZE (LCD_WIDTH*((LCD_HEIGHT+7)/8)*16+200)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
@ -140,7 +140,7 @@ static fb_data *paldata=NULL;
|
|||
void I_ShutdownGraphics(void)
|
||||
{
|
||||
#ifndef HAVE_LCD_COLOR
|
||||
gray_release();
|
||||
grey_release();
|
||||
#endif
|
||||
noprintf=0;
|
||||
}
|
||||
|
@ -580,23 +580,17 @@ void I_FinishUpdate (void)
|
|||
}
|
||||
rb->lcd_update();
|
||||
#else /* !HAVE_LCD_COLOR */
|
||||
int x, yd = 0;
|
||||
int x;
|
||||
|
||||
for (y = 0; y < SCREENHEIGHT; y++)
|
||||
{
|
||||
for (x = 0; x < SCREENWIDTH; x++)
|
||||
{
|
||||
paletteIndex = d_screens[0][y*SCREENWIDTH + x];
|
||||
graybuffer[yd * SCREENWIDTH + x]=palette[paletteIndex];
|
||||
}
|
||||
if (++yd == 8)
|
||||
{
|
||||
gray_ub_gray_bitmap(graybuffer, 0, y & ~7, SCREENWIDTH, 8);
|
||||
yd = 0;
|
||||
greybuffer[x]=palette[paletteIndex];
|
||||
}
|
||||
grey_ub_gray_bitmap(greybuffer, 0, y, SCREENWIDTH, 1);
|
||||
}
|
||||
if (yd > 0)
|
||||
gray_ub_gray_bitmap(graybuffer, 0, y & ~7, SCREENWIDTH, yd);
|
||||
#endif /* !HAVE_LCD_COLOR */
|
||||
#endif
|
||||
}
|
||||
|
@ -629,11 +623,10 @@ void I_InitGraphics(void)
|
|||
/* Note: The other screens are allocated as needed */
|
||||
|
||||
#ifndef HAVE_LCD_COLOR
|
||||
gbuf=malloc(GRAYBUFSIZE);
|
||||
gray_init(rb, gbuf, GRAYBUFSIZE, false, LCD_WIDTH, LCD_HEIGHT, 32,
|
||||
3<<7 /* 1.5 */, NULL);
|
||||
/* switch on grayscale overlay */
|
||||
gray_show(true);
|
||||
gbuf=malloc(GREYBUFSIZE);
|
||||
grey_init(rb, gbuf, GREYBUFSIZE, false, LCD_WIDTH, LCD_HEIGHT, NULL);
|
||||
/* switch on greyscale overlay */
|
||||
grey_show(true);
|
||||
#endif
|
||||
|
||||
#ifdef CPU_COLDFIRE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue