summaryrefslogtreecommitdiff
path: root/apps/plugins/doom/i_video.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/doom/i_video.c')
-rw-r--r--apps/plugins/doom/i_video.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/apps/plugins/doom/i_video.c b/apps/plugins/doom/i_video.c
index 9d9e4bb111..fe2f91b699 100644
--- a/apps/plugins/doom/i_video.c
+++ b/apps/plugins/doom/i_video.c
@@ -117,13 +117,13 @@
117#include "rockmacros.h" 117#include "rockmacros.h"
118 118
119#ifndef HAVE_LCD_COLOR 119#ifndef HAVE_LCD_COLOR
120#include "../lib/gray.h" 120#include "../lib/grey.h"
121static unsigned char graybuffer[8*LCD_WIDTH] IBSS_ATTR; /* off screen buffer */ 121static unsigned char greybuffer[LCD_WIDTH] IBSS_ATTR; /* off screen buffer */
122static unsigned char *gbuf; 122static unsigned char *gbuf;
123#if LCD_PIXELFORMAT == HORIZONTAL_PACKING 123#if LCD_PIXELFORMAT == HORIZONTAL_PACKING
124#define GRAYBUFSIZE (((LCD_WIDTH+7)/8)*LCD_HEIGHT*32+200) 124#define GREYBUFSIZE (((LCD_WIDTH+7)/8)*LCD_HEIGHT*16+200)
125#else 125#else
126#define GRAYBUFSIZE (LCD_WIDTH*((LCD_HEIGHT+7)/8)*32+200) 126#define GREYBUFSIZE (LCD_WIDTH*((LCD_HEIGHT+7)/8)*16+200)
127#endif 127#endif
128#endif 128#endif
129 129
@@ -140,7 +140,7 @@ static fb_data *paldata=NULL;
140void I_ShutdownGraphics(void) 140void I_ShutdownGraphics(void)
141{ 141{
142#ifndef HAVE_LCD_COLOR 142#ifndef HAVE_LCD_COLOR
143 gray_release(); 143 grey_release();
144#endif 144#endif
145 noprintf=0; 145 noprintf=0;
146} 146}
@@ -580,23 +580,17 @@ void I_FinishUpdate (void)
580 } 580 }
581 rb->lcd_update(); 581 rb->lcd_update();
582#else /* !HAVE_LCD_COLOR */ 582#else /* !HAVE_LCD_COLOR */
583 int x, yd = 0; 583 int x;
584 584
585 for (y = 0; y < SCREENHEIGHT; y++) 585 for (y = 0; y < SCREENHEIGHT; y++)
586 { 586 {
587 for (x = 0; x < SCREENWIDTH; x++) 587 for (x = 0; x < SCREENWIDTH; x++)
588 { 588 {
589 paletteIndex = d_screens[0][y*SCREENWIDTH + x]; 589 paletteIndex = d_screens[0][y*SCREENWIDTH + x];
590 graybuffer[yd * SCREENWIDTH + x]=palette[paletteIndex]; 590 greybuffer[x]=palette[paletteIndex];
591 }
592 if (++yd == 8)
593 {
594 gray_ub_gray_bitmap(graybuffer, 0, y & ~7, SCREENWIDTH, 8);
595 yd = 0;
596 } 591 }
592 grey_ub_gray_bitmap(greybuffer, 0, y, SCREENWIDTH, 1);
597 } 593 }
598 if (yd > 0)
599 gray_ub_gray_bitmap(graybuffer, 0, y & ~7, SCREENWIDTH, yd);
600#endif /* !HAVE_LCD_COLOR */ 594#endif /* !HAVE_LCD_COLOR */
601#endif 595#endif
602} 596}
@@ -629,11 +623,10 @@ void I_InitGraphics(void)
629 /* Note: The other screens are allocated as needed */ 623 /* Note: The other screens are allocated as needed */
630 624
631#ifndef HAVE_LCD_COLOR 625#ifndef HAVE_LCD_COLOR
632 gbuf=malloc(GRAYBUFSIZE); 626 gbuf=malloc(GREYBUFSIZE);
633 gray_init(rb, gbuf, GRAYBUFSIZE, false, LCD_WIDTH, LCD_HEIGHT, 32, 627 grey_init(rb, gbuf, GREYBUFSIZE, false, LCD_WIDTH, LCD_HEIGHT, NULL);
634 3<<7 /* 1.5 */, NULL); 628 /* switch on greyscale overlay */
635 /* switch on grayscale overlay */ 629 grey_show(true);
636 gray_show(true);
637#endif 630#endif
638 631
639#ifdef CPU_COLDFIRE 632#ifdef CPU_COLDFIRE