Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#6 Slow DOS game performance and/or music

open
None
1
2001-05-09
2001-05-08
Vlad ROMASCANU
No

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
Microsoft Knowledge base article Q102060 -
http://support.microsoft.com/support/kb/articles/Q102/0
/60.asp ).

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.

Discussion

  • Vlad ROMASCANU
    Vlad ROMASCANU
    2001-05-08

    PITSET v0.1

     
    Attachments
  • Vlad ROMASCANU
    Vlad ROMASCANU
    2001-05-09

    • priority: 1 --> 5
    • assigned_to: nobody --> vladr
     
  • Vlad ROMASCANU
    Vlad ROMASCANU
    2001-05-09

    • priority: 5 --> 1
     
  • Vlad ROMASCANU
    Vlad ROMASCANU
    2002-03-24

    Logged In: YES
    user_id=148964

    A newer version of PITSET is now available. The old TSR
    version (v0.1) was having serious problems with Win2k's DOS
    emulation.

     
  • Vlad ROMASCANU
    Vlad ROMASCANU
    2002-03-24

    PITSET v0.2

     
    Attachments
  • rate ces amplified times causes