diff --git a/src/ints/int10.cpp b/src/ints/int10.cpp index 86af6f84..ccbb5097 100644 --- a/src/ints/int10.cpp +++ b/src/ints/int10.cpp @@ -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) { diff --git a/src/ints/int10_modes.cpp b/src/ints/int10_modes.cpp index efc46eec..4c8d4609 100644 --- a/src/ints/int10_modes.cpp +++ b/src/ints/int10_modes.cpp @@ -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]);