Fix the width of VGA text modes being incorrectly set sometimes
142c329 caused a regression where the width calculation of the VGA text
modes did not take 8 vs 9-dot VGA fonts into account correctly.
E.g., the 720x400 mode 03h VGA text mode with 9-dot fonts was
incorrectly set to 640x400 with `glshader = none` or `sharp`.
`crt-auto` modes appeared to work fine, at least at startup. But this
was by fluke and weird problems could happen after certain mode change
sequences.
Port video memory I/O delay tweak from DOSBox-X
This is an adaptation of the `vmemdelay` feature from DOSBox-X.
The auto settings have been removed as they were not particularly useful
for games; a static setting of 3000 ns does the job much better for
problematic titles.
Co-authored-by: Jonathan Campbell <email address hidden>
Below is the first relevant commit from the DOSBox-X project
(https://github.com/joncampbell123/dosbox-x).
---
commit 417998f7286a3ffc0b9d8908ae3a6203a97e4c43
Author: Jonathan Campbell <email address hidden>
Date: Thu Feb 5 14:06:06 2015 -0800
Make I/O delay configurable, instead of just CPU_CyclesMax/1024 as
hardcoded in iohandler.cpp. Add code to VGA emulation to emulate memory
I/O delay. Default value emulates an average delay that represents ISA
bus delays combined with 386/486/Pentium pipelining that seems to
represent the slowness of the ISA bus overall. The same code picks a
much shorter delay if PCI bus emulation is enabled, as if the VGA is
connected to PCI.
The reason for this addition is that some demos and games are sensitive
to VGA memory access speeds, especially parts that involve
raster/warping effects. These demos work best if the VGA memory is
slowed down to ISA bus speeds and the effects will not work properly
otherwise.
Majic 12 "Show": ISA VGA memio delay fixes the raster errors during the
"RealPlasma" and the truecolor rotating effect parts of the demo.
The Good, The Bad, The Ugly: VGA memio delay seems to stabilize the
plasma effect just after the credits, plasma effect no longer rolls like
an unstable television picture. Unfortunately, it also causes the demo
to immediately skip the next part and jump directly to the 3D wireframe
object part.
Future Crew "Panic": VGA memory IO delay slows the shadebob effect down
enough that the 3D dot object part can finish on time and on cue to
become the FC logo instead of completing, then sitting for 3-5 seconds
doing nothing.
You can disable the iodelays if you want, to gain speed in your DOS game
if the DOS game is not sensitive to I/O or VGA memory speeds.