First post, by augnober
Hey.. A while ago, I started posting somewhere on the forums about the possibility of syncing dosbox's vsync to the host display in cases where the host and virtual display Hz is sufficiently similar to get supersmooth scrolling in certain apps, demos, whatever.
I got a preliminary version of the simplest sort going on my machine. You won't be impressed, because it's simple work and somewhat of a hassle for the user -- but it's cross-platform and gets some nice smooth results, so I'll explain it. It's certainly not in releasable form, but it's enough to be a toy.
SDL doesn't have access functions for this kind of information. I didn't change SDL. So how do I get this information on all platforms? I momentarily thought of using a webcam or interference in the soundcard -- anything to automatically grab the timings -- but that's not very feasible.. So I decided to use the users' eyes with a manual calibration process. I made a small COM file which runs in DOSBox, showing the worst tearing/shearing possible. The user needs to adjust the refresh timing using the keys to figure out what their refresh rate is (by stabilizing the shear -- this value will be common across runs with appropriate fullfixed setting), and then uses another key to shift the shear line off the screen (adjustment to the timing offset, via a one-refresh-only time tweak -- unfortunately, this would need to be adjusted every time except on Windows).
Anyway.. looks great in some programs, though I'm forcing them to sync to 75Hz (My LCD will only give me 60Hz or 75Hz... Though my driver keeps teasing me by saying it's at other speeds, the vsync's stuck at those speeds nonetheless). I wish I could run at 70Hz, since that's what apparently lots of demos are at, and some of them seem to perhaps have their own timing routines to aid in the vsync handling (in a small number of apps, rather than run fast, things run kind of weird). With a CRT, it would be possible to keep switching the host refresh rate while running, and have knowledge of the timings available stored. I know it's possible to automate this on Windows without giving the user hassle, but having to adjust the shear offset at every mode switch on other platforms would be too annoying, I think.