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:
- http://www.btinternet.com/~belowe/
- http://wolfgl.narod.ru/classic/wolftut01.htm
- http://www.areyep.com/Codingtips/demos.html

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?


Preparation


- 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)Image
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)
long lasttimecount;
long frameon;
int fps_frames=0, fps_time=0, fps=0;

And the actual code for FPS measurement (in the ThreeDRefresh function)
frameon++;

fps_frames++;
fps_time+=tics;
if(fps_time>35)
{
fps_time-=35;
fps=fps_frames<<1;
fps_frames=0;
}

SETFONTCOLOR(7,127);
PrintX=8; PrintY=190;
VWB_Bar(2,189,50,10,127);
US_PrintSigned(fps);
US_Print(" fps" );

PM_NextFrame();
}
Image
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:
#ifndef SPEARDEMO
#ifndef SPEARDEMO
PlayDemo (0);
#endif

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:
if (demoplayback)
{
while (TimeCount<lasttimecount+DEMOTICS)
;
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.

08 November 2016 19:35

Please publish the fps for 286 and 386. Indicate the MHz as well!!

18 November 2016 21:22

I'll look into it when I have my 286, 386 (and 486) systems up and running :).

Post new reply as Anonymous user
Want your own account? Create one, it's free!
Insert reply
Your validation code is: 1337