VOGONS


rdtsc games

Topic actions

First post, by plx0z

User metadata
Rank Newbie
Rank
Newbie

I’ve been using RDTSC for years and still do today. However, most modern games rely on QueryPerformanceCounter (QPC) for timing. I was wondering if there are any games that still use RDTSC directly without going through QPC?

For games that use QPC, I typically replace that function and use RDTSC instead.

Additionally, I experimented with a kernel-level hook on KeQueryPerformanceCounter and direct RDTSC access. However, the KeQueryPerformanceCounter hook isn’t PatchGuard-safe, so it's not ideal

I know of alternative methods to read the timestamp counter directly without using QPC, but that’s not my focus. I’m just looking for examples of games (past or present) that rely directly on RDTSC for timing.

If anyone has insight or has come across games that do this, I’d appreciate the info!"

Reply 1 of 2, by BEEN_Nath_58

User metadata
Rank l33t
Rank
l33t

I think SpeedBusters and State of Emergency used it. Can't be certain about Jane's USNF

previously known as Discrete_BOB_058

Reply 2 of 2, by alberthamik

User metadata
Rank Newbie
Rank
Newbie

Just noticed this post, and I have to make mention of a game I've been messing with for a few years now that might be of interest maybe, though I'm the wrong person to say how exactly it handles timing, but I believe it is an RDTSC game. 1998's Gunmetal from Mad Genius Software. The game's implementation of timing, however it was done, is rather broken.

In modern Windows, running the Windows version of the game, things run too fast. It was also an MS-DOS game (one of the last commercial titles for the operating system), but it runs rather slow in most options for modern play of DOS stuff, and I have heard that in scenarios where someone gets it running "bare metal" (FreeDOS or whatever on a modern CPU), the timing issues exist there as well.

Honestly I've been hoping to find someone with knowledge of timing stuff who might be interested in helping to solve this. I know there's been similar projects that have hooked into a game process to solve such stuff. Anyhow I also hope this can be a helpful example for what you're looking for. The demo is easy to find online, and preferably you should look at "demo 1.3" as the 0.99 demo is kind of borked.