Support s3 pixel format register, 8bpp only for now
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1723
This commit is contained in:
parent
c462ea28c3
commit
db45414323
4 changed files with 27 additions and 2 deletions
|
@ -144,6 +144,7 @@ typedef struct {
|
|||
Bit8u ex_hor_overflow;
|
||||
Bit8u ex_ver_overflow;
|
||||
Bit16u la_window;
|
||||
Bit8u misc_control_2;
|
||||
struct {
|
||||
Bit8u r;
|
||||
Bit8u n;
|
||||
|
|
|
@ -49,8 +49,13 @@ void VGA_SetMode(VGAModes mode) {
|
|||
}
|
||||
|
||||
void VGA_DetermineMode(void) {
|
||||
/* Test for VGA output active or direct color modes */
|
||||
if (vga.s3.misc_control_2 & 0xf0) {
|
||||
switch (vga.s3.misc_control_2 >> 4) {
|
||||
case 1:VGA_SetMode(M_LIN8);break;
|
||||
}
|
||||
/* Test for graphics or alphanumeric mode */
|
||||
if (vga.attr.mode_control & 1) {
|
||||
} else if (vga.attr.mode_control & 1) {
|
||||
if (!(vga.crtc.mode_control & 0x1)) {
|
||||
if (vga.gfx.mode & 0x20) VGA_SetMode(M_CGA4);
|
||||
else VGA_SetMode(M_CGA2);
|
||||
|
|
|
@ -478,6 +478,21 @@ void write_p3d5_vga(Bit32u port,Bit8u val) {
|
|||
(3d4h index 18h). Bit 8 is in 3d4h index 7 bit 4 and bit 9 in 3d4h
|
||||
index 9 bit 6.
|
||||
*/
|
||||
case 0x67: /* Extended Miscellaneous Control 2 */
|
||||
/*
|
||||
0 VCLK PHS. VCLK Phase With Respect to DCLK. If clear VLKC is inverted
|
||||
DCLK, if set VCLK = DCLK.
|
||||
4-7 Pixel format.
|
||||
0 Mode 0: 8bit (1 pixel/VCLK)
|
||||
1 Mode 8: 8bit (2 pixels/VCLK)
|
||||
3 Mode 9: 15bit (1 pixel/VCLK)
|
||||
5 Mode 10: 16bit (1 pixel/VCLK)
|
||||
7 Mode 11: 24/32bit (2 VCLKs/pixel)
|
||||
13 (732/764) 32bit (1 pixel/VCLK)
|
||||
*/
|
||||
vga.s3.misc_control_2=val;
|
||||
VGA_DetermineMode();
|
||||
break;
|
||||
case 0x69: /* Extended System Control 3 */
|
||||
if (((vga.config.display_start & 0x1f0000)>>16) ^ (val & 0x1f)) {
|
||||
vga.config.display_start&=0xffff;
|
||||
|
@ -590,6 +605,8 @@ Bit8u read_p3d5_vga(Bit32u port) {
|
|||
return vga.s3.ex_hor_overflow;
|
||||
case 0x5e: /* Extended Vertical Overflow */
|
||||
return vga.s3.ex_ver_overflow;
|
||||
case 0x67: /* Extended Miscellaneous Control 2 */
|
||||
return vga.s3.misc_control_2;
|
||||
case 0x69: /* Extended System Control 3 */
|
||||
return (Bit8u)((vga.config.display_start & 0x1f0000)>>16);
|
||||
case 0x6a: /* Extended System Control 4 */
|
||||
|
|
|
@ -184,6 +184,7 @@ static void VGA_VerticalTimer(Bitu val) {
|
|||
vga.draw.address=(vga.draw.address*2);
|
||||
break;
|
||||
case M_CGA4:case M_CGA2:case M_CGA16:
|
||||
case M_TANDY2:case M_TANDY4:case M_TANDY16:
|
||||
vga.draw.address=(vga.draw.address*2)&0x1fff;
|
||||
break;
|
||||
}
|
||||
|
@ -324,9 +325,10 @@ void VGA_SetupDrawing(Bitu val) {
|
|||
break;
|
||||
case M_LIN8:
|
||||
scaleh*=vga.draw.font_height;
|
||||
if (vga.crtc.maximum_scan_line&0x80) scaleh*=2;
|
||||
vga.draw.lines_scaled=scaleh;
|
||||
vga.draw.address_line_total=1;
|
||||
width<<=3;
|
||||
height/=scaleh;width<<=3;
|
||||
VGA_DrawLine=VGA_Draw_VGA_Line;
|
||||
break;
|
||||
case M_EGA16:
|
||||
|
|
Loading…
Add table
Reference in a new issue