summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Purchase <shotofadds@rockbox.org>2008-05-27 20:11:53 +0000
committerRob Purchase <shotofadds@rockbox.org>2008-05-27 20:11:53 +0000
commitb57b779fbced4a3fc1ecd0799a7666c2f1645f17 (patch)
tree46207bf001abbbe2a6b711b661b5db1e6820e9a4
parentae4b677736032176459f7adbb65c5386cfc089fb (diff)
downloadrockbox-b57b779fbced4a3fc1ecd0799a7666c2f1645f17.tar.gz
rockbox-b57b779fbced4a3fc1ecd0799a7666c2f1645f17.zip
Tweak ZXBox colours: 1) 'Bright' black is the same as normal black on a real Spectrum, so make it so here too. 2) Use more accurate RGB values in the 16bpp driver (taken from the FUSE emulator). 3) Remove some confusing duplicate definitions.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17638 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugins/zxbox/spscr.c55
-rw-r--r--apps/plugins/zxbox/spscr_p.h4
-rw-r--r--apps/plugins/zxbox/zxvid_16bpp.c7
-rw-r--r--apps/plugins/zxbox/zxvid_4bpp.c14
4 files changed, 11 insertions, 69 deletions
diff --git a/apps/plugins/zxbox/spscr.c b/apps/plugins/zxbox/spscr.c
index 2693812bf6..2c24fb37a8 100644
--- a/apps/plugins/zxbox/spscr.c
+++ b/apps/plugins/zxbox/spscr.c
@@ -28,42 +28,6 @@
28#include <stdlib.h> 28#include <stdlib.h>
29#include <stdio.h> 29#include <stdio.h>
30 30
31int color_type = 0;
32
33#define N0 0x04
34#define N1 0x34
35
36#define B0 0x08
37#define B1 0x3F
38
39
40struct rgb *spscr_crgb;
41
42static struct rgb norm_colors[COLORNUM]={
43 {0,0,0},{N0,N0,N1},{N1,N0,N0},{N1,N0,N1},
44 {N0,N1,N0},{N0,N1,N1},{N1,N1,N0},{N1,N1,N1},
45
46 {0x15,0x15,0x15},{B0,B0,B1},{B1,B0,B0},{B1,B0,B1},
47 {B0,B1,B0},{B0,B1,B1},{B1,B1,B0},{B1,B1,B1}
48};
49
50static struct rgb gray_colors[COLORNUM]={
51 {0,0,0},{20,20,20},{26,26,26},{32,32,32},
52 {38,38,38},{44,44,44},{50,50,50},{56,56,56},
53
54 {16,16,16},{23,23,23},{30,30,30},{36,36,36},
55 {43,43,43},{50,50,50},{56,56,56},{63,63,63}
56};
57
58struct rgb custom_colors[COLORNUM]={
59 {0,0,0},{N0,N0,N1},{N1,N0,N0},{N1,N0,N1},
60 {N0,N1,N0},{N0,N1,N1},{N1,N1,N0},{N1,N1,N1},
61
62 {0x15,0x15,0x15},{B0,B0,B1},{B1,B0,B0},{B1,B0,B1},
63 {B0,B1,B0},{B0,B1,B1},{B1,B1,B0},{B1,B1,B1}
64};
65
66
67#define TABOFFS 2 31#define TABOFFS 2
68 32
69volatile int screen_visible = 1; 33volatile int screen_visible = 1;
@@ -240,22 +204,3 @@ void spscr_init_line_pointers(int lines)
240 } 204 }
241 } 205 }
242} 206}
243
244void spscr_init_colors(void)
245{
246 spscr_crgb = norm_colors;
247
248 switch(color_type) {
249 case 0:
250 spscr_crgb = norm_colors;
251 break;
252
253 case 1:
254 spscr_crgb = gray_colors;
255 break;
256
257 case 2:
258 spscr_crgb = custom_colors;
259 break;
260 }
261}
diff --git a/apps/plugins/zxbox/spscr_p.h b/apps/plugins/zxbox/spscr_p.h
index 394ce2abd9..b518b1415d 100644
--- a/apps/plugins/zxbox/spscr_p.h
+++ b/apps/plugins/zxbox/spscr_p.h
@@ -30,11 +30,7 @@ struct rgb {
30#define SCRSIZE 6912 30#define SCRSIZE 6912
31#define COLORBEG 6144 31#define COLORBEG 6144
32 32
33extern struct rgb *spscr_crgb;
34extern struct rgb custom_colors[];
35
36extern void spscr_init_mask_color(void); 33extern void spscr_init_mask_color(void);
37extern void spscr_init_line_pointers(int lines); 34extern void spscr_init_line_pointers(int lines);
38extern void spscr_init_colors(void);
39 35
40#endif /* SPSCR_P_H */ 36#endif /* SPSCR_P_H */
diff --git a/apps/plugins/zxbox/zxvid_16bpp.c b/apps/plugins/zxbox/zxvid_16bpp.c
index 235efcbcb2..336e1c2447 100644
--- a/apps/plugins/zxbox/zxvid_16bpp.c
+++ b/apps/plugins/zxbox/zxvid_16bpp.c
@@ -13,15 +13,16 @@ use for slightly different colors
13*/ 13*/
14 14
15#define N0 0x00 15#define N0 0x00
16#define N1 0xAA 16#define N1 0xC0
17 17
18#define B0 0x55 18#define B0 0x00
19#define B1 0xFF 19#define B1 0xFF
20
20struct rgb norm_colors[COLORNUM]={ 21struct rgb norm_colors[COLORNUM]={
21 {0,0,0},{N0,N0,N1},{N1,N0,N0},{N1,N0,N1}, 22 {0,0,0},{N0,N0,N1},{N1,N0,N0},{N1,N0,N1},
22 {N0,N1,N0},{N0,N1,N1},{N1,N1,N0},{N1,N1,N1}, 23 {N0,N1,N0},{N0,N1,N1},{N1,N1,N0},{N1,N1,N1},
23 24
24 {0x15,0x15,0x15},{B0,B0,B1},{B1,B0,B0},{B1,B0,B1}, 25 {0,0,0},{B0,B0,B1},{B1,B0,B0},{B1,B0,B1},
25 {B0,B1,B0},{B0,B1,B1},{B1,B1,B0},{B1,B1,B1} 26 {B0,B1,B0},{B0,B1,B1},{B1,B1,B0},{B1,B1,B1}
26}; 27};
27 28
diff --git a/apps/plugins/zxbox/zxvid_4bpp.c b/apps/plugins/zxbox/zxvid_4bpp.c
index 5129d17327..1d9902e125 100644
--- a/apps/plugins/zxbox/zxvid_4bpp.c
+++ b/apps/plugins/zxbox/zxvid_4bpp.c
@@ -33,7 +33,7 @@ void init_spect_scr(void)
33 sp_colors[7] = 3;/* WHITE ? */ 33 sp_colors[7] = 3;/* WHITE ? */
34 34
35 /* same but 'light/bright' colors */ 35 /* same but 'light/bright' colors */
36 sp_colors[8] = 1; 36 sp_colors[8] = 0;
37 sp_colors[9] = 1; 37 sp_colors[9] = 1;
38 sp_colors[10] = 1; 38 sp_colors[10] = 1;
39 sp_colors[11] = 1; 39 sp_colors[11] = 1;
@@ -79,13 +79,13 @@ void update_screen(void)
79 srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */ 79 srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */
80 } 80 }
81#elif LCD_PIXELFORMAT == VERTICAL_PACKING 81#elif LCD_PIXELFORMAT == VERTICAL_PACKING
82 int shift; 82 int shift;
83 for(y = 0; y < LCD_HEIGHT; y++) 83 for(y = 0; y < LCD_HEIGHT; y++)
84 { 84 {
85 frameb = rb->lcd_framebuffer + (y/4) * LCD_WIDTH; 85 frameb = rb->lcd_framebuffer + (y/4) * LCD_WIDTH;
86 srcx = 0; /* reset our x counter before each row... */ 86 srcx = 0; /* reset our x counter before each row... */
87 shift = ((y & 3 ) * 2 ); 87 shift = ((y & 3 ) * 2 );
88 mask = ~pixmask[y & 3]; 88 mask = ~pixmask[y & 3];
89 for(x = 0; x < LCD_WIDTH; x++) 89 for(x = 0; x < LCD_WIDTH; x++)
90 { 90 {
91 frameb[x] = (frameb[x] & mask) | ((image[(srcx>>16)]&0x3) << shift ); 91 frameb[x] = (frameb[x] & mask) | ((image[(srcx>>16)]&0x3) << shift );
@@ -96,13 +96,13 @@ void update_screen(void)
96 srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */ 96 srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */
97 } 97 }
98#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED 98#elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED
99 int shift; 99 int shift;
100 for(y = 0; y < LCD_HEIGHT; y++) 100 for(y = 0; y < LCD_HEIGHT; y++)
101 { 101 {
102 frameb = rb->lcd_framebuffer + (y/8) * LCD_WIDTH; 102 frameb = rb->lcd_framebuffer + (y/8) * LCD_WIDTH;
103 srcx = 0; /* reset our x counter before each row... */ 103 srcx = 0; /* reset our x counter before each row... */
104 shift = (y & 7); 104 shift = (y & 7);
105 mask = ~pixmask[y & 7]; 105 mask = ~pixmask[y & 7];
106 for(x = 0; x < LCD_WIDTH; x++) 106 for(x = 0; x < LCD_WIDTH; x++)
107 { 107 {
108 frameb[x] = (frameb[x] & mask) | (pixval[image[(srcx>>16)]&0x3] << shift ); 108 frameb[x] = (frameb[x] & mask) | (pixval[image[(srcx>>16)]&0x3] << shift );