Slow DOS game/music performance

Getting old DOS games working on modern hardware. (DOSBox topics belong in DOSBox areas below, not here).

Slow DOS game/music performance

Postby Snover » 2002-6-30 @ 23:59

Original written by Vlad:


Slow DOS game performance and/or music
Some games will run slower under Windows 9x/NT/2k than
they do in DOS. This is caused by the way Windows
emulates the timer interrupt.

Cause 1 - Idle sensitivity.

SYMPTOMS:
This will cause your game to run at normal spped for a
while, then slow down. The game would go back to
normal speed whenever a key is pressed or the mouse is
moved, but will eventually slow down again after a
while.

CAUSE:
This is caused by the fact that Windows will try to
detect inactivity in DOS boxes based on keyboard and
mouse input, and whenever it thinks the DOS box is
inactive it will slow down the emulated timer in order
to give more CPU time to the rest of the system (see
[url=http://support.microsoft.com/support/kb/articles/Q102/0
/60.asp]Microsoft Knowledge base article Q102060[/url]).

RESOLUTION:
If you ran your game using your own .pif file, edit
the .pif file's properties and bring down idle
sensitivity to a minimum. If you ran the game from
the default DOS box, you can either modify
_DEFAULT.PIF in %SystemRoot%\SYSTEM32, or create a
custom .pif for the game with idle sensitivity at a
minimum.

Cause 2 - PIT reprogramming.

SYMPTOMS:
This will cause your game to consistently run slower
under Windows than it normally would under DOS.

CAUSE:
Most games rely on the timer interrupt to play music
or to display animation. Normally, the interrupt
occurs, very roughly, about twenty times every
second. This timer's frequency is, however,
reprogrammable, and many games take advantage of this
facility to increase their timing resolution. The
timer frequency can be increased a couple of thousand
times (!), and such high frequencies do not make much
sense in a multi-tasked environment like Windows,
where every DOS box is allocated a given timeslice and
is suspended the rest of the time. Windows will
therefore not always generate the timer interrupts at
the desired frequency and, in consequence, some games
will run noticeably slower.

RESOLUTION:
Step 1:
If you ran your game using your own .pif file, edit
the .pif file's properties, go to "Advanced" and make
sure "Compatible timer emulation" is TURNED OFF. If
you ran the game from the default DOS box, you can
either modify _DEFAULT.PIF in %SystemRoot%\SYSTEM32,
or create a custom .pif for the game with "Compatible
timer emulation" disabled (in _DEFAULT.PIF it is, by
default, disabled).

Step 2:
If your problem was not fixed after having performed
Step 1, use a third-party program to force Windows
into generating interrupts at an increased frequency.
Such a program is attached; it will remain resident
and will periodically reprogramm the Programmable
Interrupt Timer (PIT) to a given frequency, overriding
the default frequency or that that might have been
specified by the game. You will probably need to
tweak it for every game, as different games might
expect different interrupt frequencies.
Snover
l33t++
 
Posts: 5213
Joined: 2002-6-30 @ 04:47

Return to DOS

Who is online

Users browsing this forum: No registered users and 5 guests