A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

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

+11 -69
-55
apps/plugins/zxbox/spscr.c
··· 28 28 #include <stdlib.h> 29 29 #include <stdio.h> 30 30 31 - int color_type = 0; 32 - 33 - #define N0 0x04 34 - #define N1 0x34 35 - 36 - #define B0 0x08 37 - #define B1 0x3F 38 - 39 - 40 - struct rgb *spscr_crgb; 41 - 42 - static 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 - 50 - static 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 - 58 - struct 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 31 #define TABOFFS 2 68 32 69 33 volatile int screen_visible = 1; ··· 240 204 } 241 205 } 242 206 } 243 - 244 - void 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 - }
-4
apps/plugins/zxbox/spscr_p.h
··· 30 30 #define SCRSIZE 6912 31 31 #define COLORBEG 6144 32 32 33 - extern struct rgb *spscr_crgb; 34 - extern struct rgb custom_colors[]; 35 - 36 33 extern void spscr_init_mask_color(void); 37 34 extern void spscr_init_line_pointers(int lines); 38 - extern void spscr_init_colors(void); 39 35 40 36 #endif /* SPSCR_P_H */
+4 -3
apps/plugins/zxbox/zxvid_16bpp.c
··· 13 13 */ 14 14 15 15 #define N0 0x00 16 - #define N1 0xAA 16 + #define N1 0xC0 17 17 18 - #define B0 0x55 18 + #define B0 0x00 19 19 #define B1 0xFF 20 + 20 21 struct rgb norm_colors[COLORNUM]={ 21 22 {0,0,0},{N0,N0,N1},{N1,N0,N0},{N1,N0,N1}, 22 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 26 {B0,B1,B0},{B0,B1,B1},{B1,B1,B0},{B1,B1,B1} 26 27 }; 27 28
+7 -7
apps/plugins/zxbox/zxvid_4bpp.c
··· 33 33 sp_colors[7] = 3;/* WHITE ? */ 34 34 35 35 /* same but 'light/bright' colors */ 36 - sp_colors[8] = 1; 36 + sp_colors[8] = 0; 37 37 sp_colors[9] = 1; 38 38 sp_colors[10] = 1; 39 39 sp_colors[11] = 1; ··· 79 79 srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */ 80 80 } 81 81 #elif LCD_PIXELFORMAT == VERTICAL_PACKING 82 - int shift; 82 + int shift; 83 83 for(y = 0; y < LCD_HEIGHT; y++) 84 84 { 85 85 frameb = rb->lcd_framebuffer + (y/4) * LCD_WIDTH; 86 86 srcx = 0; /* reset our x counter before each row... */ 87 - shift = ((y & 3 ) * 2 ); 88 - mask = ~pixmask[y & 3]; 87 + shift = ((y & 3 ) * 2 ); 88 + mask = ~pixmask[y & 3]; 89 89 for(x = 0; x < LCD_WIDTH; x++) 90 90 { 91 91 frameb[x] = (frameb[x] & mask) | ((image[(srcx>>16)]&0x3) << shift ); ··· 96 96 srcy &= 0xffff; /* set up the y-coordinate between 0 and 1 */ 97 97 } 98 98 #elif LCD_PIXELFORMAT == VERTICAL_INTERLEAVED 99 - int shift; 99 + int shift; 100 100 for(y = 0; y < LCD_HEIGHT; y++) 101 101 { 102 102 frameb = rb->lcd_framebuffer + (y/8) * LCD_WIDTH; 103 103 srcx = 0; /* reset our x counter before each row... */ 104 - shift = (y & 7); 105 - mask = ~pixmask[y & 7]; 104 + shift = (y & 7); 105 + mask = ~pixmask[y & 7]; 106 106 for(x = 0; x < LCD_WIDTH; x++) 107 107 { 108 108 frameb[x] = (frameb[x] & mask) | (pixval[image[(srcx>>16)]&0x3] << shift );