Frame per Second

Limit

LIMITFPS

Introduces a configurable delay between screen refresh operations, so that the FPS is limited accordingly.

Skip

SKIPFPS

Doesn't introduce delay in the screen operations, but skips several screen updates so that the actual FPS value is limited without the program noticing it.

delay (msec)

When the "Hz" flag is unchecked, it sets the delay time expressed in milliseconds, for both the "Limit" (LIMITFPS) and "Skip" (SKIPFPS) options. It should be noted that the FPS is related to the delay by the formula, FPS = 1000/Delay or, the other way around, Delay = 1000/FPS. So if, for example, you desire an FPS not greater than 50, the corresponding value to get this effect is, Delay = 20msec. Note that a greater delay means a slower frame rate.

When the "Hz" flag is checked, it sets a target FPS value, expressed in Hertz (or frames per second) by means of a sequence of delay times. This holds for the "Limit" mode only. It should be noted that in order to get an accurate FPS value, the delay of each frame delay may have to vary: for instance, a FPS of 60Hz would require a frame delay of 1000/60 = 16.666... mSec that is impossible to get on a Windows system. For this reason, the delay sequence will alternate frame delays of 16 and 17 mSec up to the desired mean value.

Hz

LIMITFREQUENCY

This is a toggle flag for the modes of the delay field (see above).

Limit Flip only

LIMITFLIPONLY

When set, both the FPS limitation and the FPS count take only the Flip operations in consideration, ignoring any other operation like Blt to primary surface.

Limit D3D BeginScene

LIMITBEGINSCENE

Flag to limit FPS in Direct3D games.

NOTE: If it is used together with the "Limit" flag, you will get a doubled delay.

Limit DIB operations

LIMITDIBOPERATIONS

Flag to apply delay to GDI32 DIB operations only. Helps improving the animations in Rubik's Games.

Limiting the FPS may also help old games that suffer from the strange side effects of running too fast. For example: "Mechwarrior 3" has a jumping APC bug that can be fixed by limiting the FPS to 30 or below. Another game that benefits from limiting the FPS is the 1999 release of "Outcast" (Twon-ha riding bug). Another example is in "Blade Runner" (shooting range bug).



Time Stretching

Time Stretching – initial

TIMESTRETCH

If this option is checked, DxWnd tries to emulate an accelerated (xn) or decelerated (:n) time flow. The value set in the listbox is the initial value, that can be altered by means of the time control slider in the time panel (see Time Slider). When checked, DxWnd stretches time in the timing API (such as with GetSystemTime()), the query performance APIs, and the Sleep APIs, which are the most common ways to control a program's timing.

Show time stretch

SHOWTIMESTRETCH

When checked, the time stretch ratio is drawn as an overlay in a corner of the screen, sometimes moving to other corners when it is updated.

Fine time adjust

FINETIMING

When checked, the time stretch ratio shows ticks in finer increments, switching from a 50% change with each tick to a 10% change with each tick. This limits the range to 0.5x-2.0x but allows for finer timing control.

Enable Time Freeze

ENABLETIMEFREEZE

See Function Keys.

Stretch timers

STRETCHTIMERS

When checked, the window timers are stretched, namely the "user32.dll" timers set by SetTimer and the multimedia timers in "winmm.dll" set by timeSetEvent().

Intercept RDTSC opcode

INTERCEPTRDTSC

Program timing is usually determined by system calls that can be easily and safely hooked to stretch the flow of time. There is one possible exception, when the program embeds the RDTSC assembly instruction opcodes in its assembly that directly access the hardware clock. This timing value can still be intercepted and manipulated, but by using a more delicate technique that searches for the assembly code and replaces it with specific calls. This is why I preferred to make this option available with a dedicated flag to be activated when necessary. This flag should be set whenever adjusting the time stretching option does not alter the time flow.

Stretch Performance Frequency

STRETCHPERFREQUENCY

Despite the fact that Microsoft documents clearly state that the QueryPerformanceFrequency returns a constant value which could be cached on a given machine, some games (e.g., "Gun Wings") do not rely on the system clock and repeatedly use QueryPerformanceFrequency. This flag alters the returned value, scaling it by the time stretching factor.

Normalize Performance Counter

NORMALIZEPERFCOUNT

Normalizes the system performance counter, simulating a clock speed of 1MHz. Some old games assume that this is the correct clock speed, and produce speed problems without this flag. This flag gives these old games the clock speed they depend on to run properly. Don't use this flag unless you are experiencing speed issues.

Suspend time stretch in movies

SUSPENDTIMESTRETCH

Suspends the time stretch flag to play movies at normal speed and avoid audio stuttering (implemented for Bink and Smacker videos only so far).

Use nanosleep

USENANOSLEEP

The time intervals are calculated using nanosleep system call instead of the Sleep system call. Nanosleep could provide better accuracy, though this is arguable and may depend on the situation.

Custom

CUSTOMTIMESHIFT

To set a finely chosen value for the time shift ratio, this flag forces a scaling factor as defined in the "Global settings / Defaults" panel (see Global settings ).



System speed

CPU slow down

CPUSLOWDOWN

Reduces a program's CPU usage by suspending and resuming all of its threads according to the specified ratio. Since the minimum timing resolution that the system can use for this operation is 1ms (1/1000th of a second), high ratios may make the game appear choppy. This flag doesn't suspend high-priority threads.

CPU max usage

CPUMAXUSAGE

Same as CPUSLOWDOWN, but operates more selectively. This flag only suspends process threads that are consuming more CPU than the selected ratio. This option can't be set at the same time as CPUSLOWDOWN.

Ratio

Allows you to set a ratio for the slowdown used by the above flags. For example, a value of 2 will produce a ratio of 1:2, suspending the program for 1ms and then running it for 2ms, reducing that program's CPU usage by 33%.

Use precise timing

PRECISETIMING

Uses precise timing through the QueryPerformanceCounter system call. Produces a smoother slow down.

Set priority below normal

SETPRIORITYLOW

Sets priority level to "Below normal".



VSync Tweaks

Kill D3D vSync

KILLVSYNC

Fast-paced games may rely on the video vertical synchronization to control the game speed, making it easy to delay the frame rate, but making it hard to speed it up. This flag forces no vertical synchronization in Direct3D operations so that the FPS value is allowed to grow indefinitely.

BEWARE: This tweak is supported on Direct3D9 and higher, Direct3D8 does not support this method.


Time

Fake date

FAKEDATE

This flag simulates the condition where the system date corresponds to the value configured in the Global settings and specified on the right, by default, January 1, 1986. To change that date, you can go to the "Defaults" tab in Global settings.

The flag can be useful in several situations:

  • To run programs that have an expiration deadline after a given date.

  • To enable time-based hacks (see below, the "Full Moon Level" in Dungeon Keeper).

  • To test the behavior of the program in certain future or past situation (for instance, after the 2038 time_t bug).

Dungeon Keeper enables an additional level on full moon days named the "Full Moon Level". If you don't want to wait for a full moon day, you can set the fake date to a full moon calendar day (e.g., 08/11/2022). The new level will then become visible in the level selection screen.

Clear UpTime

UPTIMECLEAR

This flag simulates the condition where the system was booted immediately before the program start so that the measured uptime starts with values close to 0.

Increase UpTime

UPTIMESTRESS

This flag simulates the condition where the system was booted a long time ago (45 days by default, but configurable in the "Defaults" tab of the Global settings). This way, you can anticipate the effects of a long uptime period on the program's performance.


CPU Optimization

Slow down mouse polling

SLOW

Some old programs have this bad habit of continuously looping through the mouse status polling with no delay, hogging 100% of CPU resources. This flag introduces a minimal and unnoticeable delay between mouse polls, saving CPU resources.

Slow down window polling

SLOWWINPOLLING

Reduces CPU load in some programs.