VOGONS


First post, by oldgamer85

User metadata
Rank Newbie
Rank
Newbie

Running dos Mortal Kombat Trilogy on stand-alone dosbox 0.74-3, while using no form of fps control (vsync or anything else), and monitoring its fps with RTSS, I noticed MKT runs at something that approaches 63fps, so it seems the game regulates itself to this fps.

mktrilogy_63fps.jpg
Filename
mktrilogy_63fps.jpg
File size
27.8 KiB
Views
1653 views
File license
Fair use/fair dealing exception

But I'm wondering if that might be somehow wrong, as I have someone in another forum telling me that it is 70Hz instead. I tend to trust dosbox standalone more, but I'm trying to be sure of things before telling people they're wrong, plus I don't want to sound confrontational, just want to figure things out.

My ultimate objective is to run MKT on a crt tv set and give the tv a refresh rate that matches MKT as close as possible.

So, which one is the correct, 63 or 70 Hz?

I know several/many DOS games did run at 70Hz, but it seems 63 is the correct value for MKT (even though its a strange value) plus MKT is a 240p game (which weren't the ones running @70fps AFAIK).

Also, I've found a thread here on vogons where I first learned this fact and other good things about MKT so I could get it to run, here it is:

Mortal Kombat Trilogy hints and observations
Mortal Kombat Trilogy hints and observations

Reply 1 of 4, by Silanda

User metadata
Rank Member
Rank
Member

That's my thread but I honestly don't know the answer as I haven't tried it on an actual DOS machine, only DOSBox and the Windows version. I measured it at ~62.46 fps in the Windows version, which is a really weird number, but after disabling UniVBE it's also smooth in DOSBox VSynced at a resolution with that refresh rate.

The number is so weird that I can't help wonder if it's bug, but it would be interesting to hear about any results from people running DOS unemulated.

I'd also be interested in how the Windows version of MK3 runs because AFAIK MKT is based off that code. The DOS version of MK3 is a completely different port and runs at 70Hz AFAIK.

EDIT: Oh yeah, I almost forgot. With UniVBE I believe it's possible to configure it to run at a user specified refresh rate. I'm not sure what it defaults to though. My suspicion was 60Hz based upon the way I seemed to be getting ~30fps with UniVBE active in DOSBox, and my assumption was that the framerate was being cut in half for some reason. That would match the console versions rate, but it would also be judder/tearing city if the game behaves on a '90s machine the same way as it does on modern systems.

Reply 2 of 4, by oldgamer85

User metadata
Rank Newbie
Rank
Newbie
Silanda wrote on 2020-02-05, 14:26:

That's my thread but I honestly don't know the answer as I haven't tried it on an actual DOS machine, only DOSBox and the Windows version. I measured it at ~62.46 fps in the Windows version,...

How did you measure the fps of the Windows version?

I tried using RTSS to show its fps, but it doesn't seem to hook at all, no matter the options I try.

EDIT: Oh yeah, I almost forgot. With UniVBE I believe it's possible to configure it to run at a user specified refresh rate. I'm not sure what it defaults to though. My suspicion was 60Hz based upon the way I seemed to be getting ~30fps with UniVBE active in DOSBox, and my assumption was that the framerate was being cut in half for some reason. That would match the console versions rate, but it would also be judder/tearing city if the game behaves on a '90s machine the same way as it does on modern systems.

I noticed that if you use uniVBE the pace of the game seems to be controlled by the video fps, and if you halve the fps (via RTSS for example) the pace of the game slows down by halve as well. However, if you use the hex edit trick to disable univbe only then the fps goes to 63, and changes to the fps no longer change the pace of the game.

Reply 3 of 4, by The Serpent Rider

User metadata
Rank l33t++
Rank
l33t++

Arcade cabinets were running MK3 at 53Hz, so that weird 63Hz refresh rate probably stem from there.

I must be some kind of standard: the anonymous gangbanger of the 21st century.

Reply 4 of 4, by cubanraul

User metadata
Rank Newbie
Rank
Newbie

Mortal Kombat Trilogy's internal timer has a precision of 1 millisecond. The developers chose to set 1 frame to be 16ms.

The stock target timing:

1000ms / 16ms = 62.5fps

This is as close to 16.66ms (60fps) as the original code can get without slowing the game down. Changing one instruction would let us use 17ms. Then the game would run at a slightly more accurate 58.82fps. If we rapidly alternate the duration of one frame between 16ms and 17ms, we end up with 60.66fps. Closer, but still not ideal.

What works best:

mov al, [0032F0E6]
aam 03
cmp al, 0
je 09
add [003AFB0C], 0x10
jmp 07
add [003AFB0C], 0x11

Frame count (0-63 by default) stored in 0032F0E6
Timer in milliseconds (0-1000) stored in 003AFB0C

What this does is decrease the duration of 1 frame by 1ms every third frame. We end up with each frame taking an average of 16.66ms and an FPS of 59.99. Since the stock frame rate ended up highly variable, adjusting it in a controlled way beats the original jittery mess. The gameplay speed should now be identical to the console releases.

The new patch, with the above code, can be downloaded here: http://cubanraul.altervista.org/mkt