1
0
Fork 0

There are only 248 default colors in the 256-color mode palette, and the remaining 8 colors are not altered by mode changes. Fixes font and mouse pointer colors in Voyages of Discovery.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3852
This commit is contained in:
ripsaw8080 2013-12-11 13:59:24 +00:00
parent 3074cbbc59
commit a8d8f7818a
2 changed files with 18 additions and 9 deletions

View file

@ -712,11 +712,18 @@ static void INT10_Seg40Init(void) {
static void INT10_InitVGA(void) {
/* switch to color mode and enable CPU access 480 lines */
IO_Write(0x3c2,0xc3);
/* More than 64k */
IO_Write(0x3c4,0x04);
IO_Write(0x3c5,0x02);
if (IS_EGAVGA_ARCH) {
/* switch to color mode and enable CPU access 480 lines */
IO_Write(0x3c2,0xc3);
/* More than 64k */
IO_Write(0x3c4,0x04);
IO_Write(0x3c5,0x02);
if (IS_VGA_ARCH) {
/* Initialize DAC */
IO_Write(0x3c8,0);
for (Bitu i=0;i<3*256;i++) IO_Write(0x3c9,0);
}
}
}
static void SetupTandyBios(void) {

View file

@ -326,7 +326,7 @@ static Bit8u cga_palette_2[64][3]=
{0x15,0x15,0x15}, {0x15,0x15,0x3f}, {0x15,0x3f,0x15}, {0x15,0x3f,0x3f}, {0x3f,0x15,0x15}, {0x3f,0x15,0x3f}, {0x3f,0x3f,0x15}, {0x3f,0x3f,0x3f},
};
static Bit8u vga_palette[256][3]=
static Bit8u vga_palette[248][3]=
{
{0x00,0x00,0x00},{0x00,0x00,0x2a},{0x00,0x2a,0x00},{0x00,0x2a,0x2a},{0x2a,0x00,0x00},{0x2a,0x00,0x2a},{0x2a,0x15,0x00},{0x2a,0x2a,0x2a},
{0x15,0x15,0x15},{0x15,0x15,0x3f},{0x15,0x3f,0x15},{0x15,0x3f,0x3f},{0x3f,0x15,0x15},{0x3f,0x15,0x3f},{0x3f,0x3f,0x15},{0x3f,0x3f,0x3f},
@ -361,8 +361,7 @@ static Bit8u vga_palette[256][3]=
{0x08,0x10,0x08},{0x08,0x10,0x0a},{0x08,0x10,0x0c},{0x08,0x10,0x0e},{0x08,0x10,0x10},{0x08,0x0e,0x10},{0x08,0x0c,0x10},{0x08,0x0a,0x10},
{0x0b,0x0b,0x10},{0x0c,0x0b,0x10},{0x0d,0x0b,0x10},{0x0f,0x0b,0x10},{0x10,0x0b,0x10},{0x10,0x0b,0x0f},{0x10,0x0b,0x0d},{0x10,0x0b,0x0c},
{0x10,0x0b,0x0b},{0x10,0x0c,0x0b},{0x10,0x0d,0x0b},{0x10,0x0f,0x0b},{0x10,0x10,0x0b},{0x0f,0x10,0x0b},{0x0d,0x10,0x0b},{0x0c,0x10,0x0b},
{0x0b,0x10,0x0b},{0x0b,0x10,0x0c},{0x0b,0x10,0x0d},{0x0b,0x10,0x0f},{0x0b,0x10,0x10},{0x0b,0x0f,0x10},{0x0b,0x0d,0x10},{0x0b,0x0c,0x10},
{0x00,0x00,0x00},{0x00,0x00,0x00},{0x00,0x00,0x00},{0x00,0x00,0x00},{0x00,0x00,0x00},{0x00,0x00,0x00},{0x00,0x00,0x00},{0x00,0x00,0x00}
{0x0b,0x10,0x0b},{0x0b,0x10,0x0c},{0x0b,0x10,0x0d},{0x0b,0x10,0x0f},{0x0b,0x10,0x10},{0x0b,0x0f,0x10},{0x0b,0x0d,0x10},{0x0b,0x0c,0x10}
};
VideoModeBlock * CurMode;
@ -1229,7 +1228,10 @@ dac_text16:
case M_LIN15:
case M_LIN16:
case M_LIN32:
for (i=0;i<256;i++) {
// IBM and clones use 248 default colors in the palette for 256-color mode.
// The last 8 colors of the palette are only initialized to 0 at BIOS init.
// Palette index is left at 0xf8 as on most clones, IBM leaves it at 0x10.
for (i=0;i<248;i++) {
IO_Write(0x3c9,vga_palette[i][0]);
IO_Write(0x3c9,vga_palette[i][1]);
IO_Write(0x3c9,vga_palette[i][2]);