diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2008-01-04 23:42:38 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2008-01-04 23:42:38 +0000 |
| commit | feb5b15e9bf9292e3d4d82ea1e01ab3557fb1240 (patch) | |
| tree | d854c9a6fbbb3263537071fb02df349fdfa62361 /apps/plugins/doom | |
| parent | d3586837fa9221a7ef104550b4c0aadc1a6ea77c (diff) | |
| download | rockbox-feb5b15e9bf9292e3d4d82ea1e01ab3557fb1240.zip rockbox-feb5b15e9bf9292e3d4d82ea1e01ab3557fb1240.tar.gz rockbox-feb5b15e9bf9292e3d4d82ea1e01ab3557fb1240.tar.bz2 rockbox-feb5b15e9bf9292e3d4d82ea1e01ab3557fb1240.tar.xz | |
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
Diffstat (limited to 'apps/plugins/doom')
| -rw-r--r-- | apps/plugins/doom/i_system.c | 2 | ||||
| -rw-r--r-- | apps/plugins/doom/i_video.c | 31 |
2 files changed, 13 insertions, 20 deletions
diff --git a/apps/plugins/doom/i_system.c b/apps/plugins/doom/i_system.c index 40ebe98..4a22743 100644 --- a/apps/plugins/doom/i_system.c +++ b/apps/plugins/doom/i_system.c @@ -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. */ diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c index 9d9e4bb..fe2f91b 100644 --- a/apps/plugins/doom/i_video.c +++ b/apps/plugins/doom/i_video.c @@ -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 |