From ba3110ca07808d5e6e1ec08c70479ccf59de4bc3 Mon Sep 17 00:00:00 2001 From: ripsaw8080 Date: Wed, 13 May 2015 01:35:39 +0000 Subject: [PATCH] Aspect correction fixes for CGA composite, Hercules graphics, 350-line text modes, 400-line VESA modes, and VGA ModeX (God of Thunder, Lost Vikings, Wrath of Earth, etc.) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3913 --- src/hardware/vga_draw.cpp | 8 +++++--- src/ints/int10_modes.cpp | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/hardware/vga_draw.cpp b/src/hardware/vga_draw.cpp index 254e826e..bd1cadc8 100644 --- a/src/hardware/vga_draw.cpp +++ b/src/hardware/vga_draw.cpp @@ -1310,7 +1310,9 @@ void VGA_SetupDrawing(Bitu /*val*/) { break; case 3: //480 line mode, filled with 525 total default: - pheight = (480.0 / 480.0) * ( 525.0 / vtotal ); + //Allow 527 total ModeX to have exact 1:1 aspect + target_total = (vga.mode==M_VGA && vtotal==527) ? 527.0 : 525.0; + pheight = (480.0 / 480.0) * ( target_total / vtotal ); break; } @@ -1403,6 +1405,7 @@ void VGA_SetupDrawing(Bitu /*val*/) { vga.draw.linear_mask = (vga.vmemwrap<<1) - 1; break; case M_CGA16: + aspect_ratio=1.2; doubleheight=true; vga.draw.blocks=width*2; width<<=4; @@ -1421,7 +1424,6 @@ void VGA_SetupDrawing(Bitu /*val*/) { VGA_DrawLine=VGA_Draw_1BPP_Line; break; case M_TEXT: - aspect_ratio=1.2; vga.draw.blocks=width; doublewidth=(vga.seq.clocking_mode & 0x8) > 0; if ((IS_VGA_ARCH) && (svgaCard==SVGA_None)) { @@ -1444,9 +1446,9 @@ void VGA_SetupDrawing(Bitu /*val*/) { } break; case M_HERC_GFX: - aspect_ratio=1.5; vga.draw.blocks=width*2; width*=16; + aspect_ratio=((double)width/(double)height)*(3.0/4.0); VGA_DrawLine=VGA_Draw_1BPP_Line; break; case M_TANDY2: diff --git a/src/ints/int10_modes.cpp b/src/ints/int10_modes.cpp index 1e8c6d62..f68a7fc9 100644 --- a/src/ints/int10_modes.cpp +++ b/src/ints/int10_modes.cpp @@ -1006,7 +1006,9 @@ bool INT10_SetVideoMode(Bit16u mode) { if (svgaCard == SVGA_S3Trio) { /* Setup the correct clock */ if (CurMode->mode>=0x100) { - misc_output|=0xef; //Select clock 3 + if (CurMode->vdispend>480) + misc_output|=0xc0; //480-line sync + misc_output|=0x0c; //Select clock 3 Bitu clock=CurMode->vtotal*8*CurMode->htotal*70; VGA_SetClock(3,clock/1000); }