summaryrefslogtreecommitdiff
path: root/apps/plugins/zxbox/zxvid_16bpp.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/zxbox/zxvid_16bpp.c')
-rw-r--r--apps/plugins/zxbox/zxvid_16bpp.c57
1 files changed, 27 insertions, 30 deletions
diff --git a/apps/plugins/zxbox/zxvid_16bpp.c b/apps/plugins/zxbox/zxvid_16bpp.c
index 336e1c2447..4a05c69f97 100644
--- a/apps/plugins/zxbox/zxvid_16bpp.c
+++ b/apps/plugins/zxbox/zxvid_16bpp.c
@@ -1,48 +1,46 @@
1#include "zxvid_com.h" 1#include "zxvid_com.h"
2 2
3#if LCD_DEPTH > 4
4/* screen routines for color targets */ 3/* screen routines for color targets */
5 4
6/*
7use for slightly different colors
8#define N0 0x04
9#define N1 0x34
10
11#define B0 0x08
12#define B1 0x3F
13*/
14
15#define N0 0x00 5#define N0 0x00
16#define N1 0xC0 6#define N1 0xC0
17
18#define B0 0x00 7#define B0 0x00
19#define B1 0xFF 8#define B1 0xFF
20 9
21struct rgb norm_colors[COLORNUM]={ 10#define IN0 (0xFF-N0)
22 {0,0,0},{N0,N0,N1},{N1,N0,N0},{N1,N0,N1}, 11#define IN1 (0xFF-N1)
23 {N0,N1,N0},{N0,N1,N1},{N1,N1,N0},{N1,N1,N1}, 12#define IB0 (0xFF-B0)
24 13#define IB1 (0xFF-B1)
25 {0,0,0},{B0,B0,B1},{B1,B0,B0},{B1,B0,B1}, 14
26 {B0,B1,B0},{B0,B1,B1},{B1,B1,B0},{B1,B1,B1} 15static const fb_data _16bpp_colors[32] = {
16 /* normal */
17 LCD_RGBPACK(N0, N0, N0), LCD_RGBPACK(N0, N0, N1),
18 LCD_RGBPACK(N1, N0, N0), LCD_RGBPACK(N1, N0, N1),
19 LCD_RGBPACK(N0, N1, N0), LCD_RGBPACK(N0, N1, N1),
20 LCD_RGBPACK(N1, N1, N0), LCD_RGBPACK(N1, N1, N1),
21 LCD_RGBPACK(B0, B0, B0), LCD_RGBPACK(B0, B0, B1),
22 LCD_RGBPACK(B1, B0, B0), LCD_RGBPACK(B1, B0, B1),
23 LCD_RGBPACK(B0, B1, B0), LCD_RGBPACK(B0, B1, B1),
24 LCD_RGBPACK(B1, B1, B0), LCD_RGBPACK(B1, B1, B1),
25 /* inverted */
26 LCD_RGBPACK(IN0, IN0, IN0), LCD_RGBPACK(IN0, IN0, IN1),
27 LCD_RGBPACK(IN1, IN0, IN0), LCD_RGBPACK(IN1, IN0, IN1),
28 LCD_RGBPACK(IN0, IN1, IN0), LCD_RGBPACK(IN0, IN1, IN1),
29 LCD_RGBPACK(IN1, IN1, IN0), LCD_RGBPACK(IN1, IN1, IN1),
30 LCD_RGBPACK(IB0, IB0, IB0), LCD_RGBPACK(IB0, IB0, IB1),
31 LCD_RGBPACK(IB1, IB0, IB0), LCD_RGBPACK(IB1, IB0, IB1),
32 LCD_RGBPACK(IB0, IB1, IB0), LCD_RGBPACK(IB0, IB1, IB1),
33 LCD_RGBPACK(IB1, IB1, IB0), LCD_RGBPACK(IB1, IB1, IB1),
27}; 34};
28 35
29
30/* since emulator uses array of bytes for screen representation
31 * short 16b colors won't fit there */
32short _16bpp_colors[16] IBSS_ATTR;
33
34void init_spect_scr(void) 36void init_spect_scr(void)
35{ 37{
36 int i; 38 int i;
39 int offset = settings.invert_colors ? 16 : 0;
37 40
38 for(i = 0; i < 16; i++) 41 for(i = 0; i < 16; i++)
39 sp_colors[i] = i; 42 sp_colors[i] = i + offset;
40 for(i = 0; i < 16; i++) 43
41 _16bpp_colors[i] = LCD_RGBPACK(norm_colors[i].r,norm_colors[i].g,norm_colors[i].b);
42 if ( settings.invert_colors ){
43 for ( i = 0 ; i < 16 ; i++ )
44 _16bpp_colors[i] = 0xFFFFFF - _16bpp_colors[i];
45 }
46 sp_image = (char *) &image_array; 44 sp_image = (char *) &image_array;
47 spscr_init_mask_color(); 45 spscr_init_mask_color();
48 spscr_init_line_pointers(HEIGHT); 46 spscr_init_line_pointers(HEIGHT);
@@ -97,4 +95,3 @@ void update_screen(void)
97} 95}
98 96
99 97
100#endif /* HAVE_LCD_COLOR */