67 |
|
#include "user_strings.h" |
68 |
|
#include "video.h" |
69 |
|
|
70 |
< |
#define DEBUG 0 |
70 |
> |
#define DEBUG 1 |
71 |
|
#include "debug.h" |
72 |
|
|
73 |
|
|
218 |
|
break; |
219 |
|
#ifdef ENABLE_VOSF |
220 |
|
case VDEPTH_2BIT: |
221 |
< |
case VDEPTH_4BIT: // VOSF blitters can convert 2/4-bit -> 16/32-bit |
222 |
< |
min_depth = 15; |
223 |
< |
max_depth = 32; |
224 |
< |
break; |
225 |
< |
case VDEPTH_8BIT: // VOSF blitters can convert 8-bit -> 16/32-bit |
221 |
> |
case VDEPTH_4BIT: // VOSF blitters can convert 2/4/8-bit -> 8/16/32-bit |
222 |
> |
case VDEPTH_8BIT: |
223 |
|
min_depth = 8; |
224 |
|
max_depth = 32; |
225 |
|
break; |
522 |
|
void driver_base::update_palette(void) |
523 |
|
{ |
524 |
|
if (cmap[0] && cmap[1]) { |
525 |
< |
int num = 256; |
526 |
< |
if (IsDirectMode(VideoMonitor.mode)) |
530 |
< |
num = vis->map_entries; // Palette is gamma table |
531 |
< |
else if (color_class == DirectColor) |
525 |
> |
int num = vis->map_entries; |
526 |
> |
if (!IsDirectMode(VideoMonitor.mode) && color_class == DirectColor) |
527 |
|
return; // Indexed mode on true color screen, don't set CLUT |
528 |
|
XStoreColors(x_display, cmap[0], palette, num); |
529 |
|
XStoreColors(x_display, cmap[1], palette, num); |
1650 |
|
|
1651 |
|
// Convert colors to XColor array |
1652 |
|
int num_out = 256; |
1653 |
+ |
bool stretch = false; |
1654 |
|
if (IsDirectMode(VideoMonitor.mode)) { |
1655 |
|
// If X is in 565 mode we have to stretch the gamma table from 32 to 64 entries |
1656 |
|
num_out = vis->map_entries; |
1657 |
+ |
stretch = true; |
1658 |
|
} |
1659 |
|
XColor *p = palette; |
1660 |
|
for (int i=0; i<num_out; i++) { |
1661 |
< |
int c = (i * num_in) / num_out; |
1661 |
> |
int c = (stretch ? (i * num_in) / num_out : i); |
1662 |
|
p->red = pal[c*3 + 0] * 0x0101; |
1663 |
|
p->green = pal[c*3 + 1] * 0x0101; |
1664 |
|
p->blue = pal[c*3 + 2] * 0x0101; |