In order to benchmark the 286 and 386 era I've decided to take Wolfenstein 3D and use the source code. I got lucky because there is quite some information available about setting up the compiler and even (exactly what I am looking for) building in an FPS counter!
I want to thank the people that provided information on various websites:
All the files in this article are compressed using 7Zip. You can download 7Zip here. Modern versions of WinRAR are able to unzip these files as well.
You can download my modified version here: Wolf3DEXE.7z. Place this executable in your Wolf3D folder. Make sure you are using the registered version 1.4!
How did I get started?
- Installed DOSBox
- Used files and configuration as explained here: http://www.btinternet.com/~belowe/instructions.html
- Compiled and tested it
- Zipped the whole package for you to download here.
(Note: make sure that the files will be in the root i.e. C:\WOLF3D, C:\WOLFSRC)
Files in correct file structure.
Modifying the source for an FPS-counter
I followed the instructions on http://wolfgl.narod.ru/classic/wolftut01.htm except for the compiler optimalisations. I want Wolf3D to run on old systems without an FPU as well.
Then I modified WL_DRAW.C (beginning of the file, defining variables)
int fps_frames=0, fps_time=0, fps=0;
And the actual code for FPS measurement (in the ThreeDRefresh function)
US_Print(" fps" );
Wolfenstein 3D Episode 1 Map 1 with FPS-counter.
Playing a demo and record the frames
I've tried to get one step further by recording a demo (described here: AReyeP and MCS Wolfenstein 3D). After recording a demo I removed the start-up sequences (image of Wolf3D, PC-13 notice, etc.) making Wolf3D playing the demo directly. This worked fine but the demo is fixed at 18 FPS.
The next step was to remove the fixed tics to run the demo as fast as the hardware can. At this point I got stuck because the demo needs the fixed tics in order to play correctly. Without them the actions (e.g. shooting) is not accurate on the movement and position of the player.
In case you feel up to fixing this problem let me point you into the right direction:
At line 1541 of WL_MAIN.C you can define to play only one demo:
If you scroll up in WL_MAIN.C you can also remove the VM_UpdateScreen and fadeouts to remove the time consuming intro screens.
To play with the tics while playing a demo go to line 463 of WL_PLAY.C and find:
TimeCount = lasttimecount + DEMOTICS;
lasttimecount += DEMOTICS;
tics = DEMOTICS;
If you remove this text and place, for example, CalcTics (); in place you'll notice a change in the behavior of playing demos.