From 5d7c4f0540d9ef118622d797421c4bc8c2a557fa Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Fri, 14 Feb 2020 19:02:29 +0000 Subject: [PATCH] Fix bug 469. Give 640x480 and upwards square pixels and several fixes for high colour modes. (jmarsh) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4324 --- src/hardware/vga_draw.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/hardware/vga_draw.cpp b/src/hardware/vga_draw.cpp index 168d9dc0..3d36da91 100644 --- a/src/hardware/vga_draw.cpp +++ b/src/hardware/vga_draw.cpp @@ -1371,8 +1371,13 @@ void VGA_SetupDrawing(Bitu /*val*/) { // fall-through case M_LIN32: width<<=3; - if (vga.crtc.mode_control & 0x8) + if (vga.crtc.mode_control & 0x8) { doublewidth = true; + if (vga.mode == M_LIN32) { + // vesa modes 10f/190/191/192 + aspect_ratio *= 2.0; + } + } /* Use HW mouse cursor drawer if enabled */ VGA_ActivateHardwareCursor(); break; @@ -1382,6 +1387,10 @@ void VGA_SetupDrawing(Bitu /*val*/) { width<<=2; if ((vga.crtc.mode_control & 0x8) || (svgaCard == SVGA_S3Trio && (vga.s3.pll.cmd & 0x10))) doublewidth = true; + else { + // vesa modes 165/175 + aspect_ratio /= 2.0; + } /* Use HW mouse cursor drawer if enabled */ VGA_ActivateHardwareCursor(); break; @@ -1539,11 +1548,11 @@ void VGA_SetupDrawing(Bitu /*val*/) { vga.changes.frame = 0; vga.changes.writeMask = 1; #endif - /* - Cheap hack to just make all > 640x480 modes have 4:3 aspect ratio + /* + Cheap hack to just make all > 640x480 modes have square pixels */ if ( width >= 640 && height >= 480 ) { - aspect_ratio = ((float)width / (float)height) * ( 3.0 / 4.0); + aspect_ratio = 1.0;//((float)width / (float)height) * ( 3.0 / 4.0); } // LOG_MSG("ht %d vt %d ratio %f", htotal, vtotal, aspect_ratio );