Friday, 27 August 2021

Retro Game Wednesdays (Part 6)

2.4 DOS Networking, Internet and Multiplayer.

DOS networking is great! You can play games together over LAN or the Internet, transfer files to and from other PCs using FTP, or even browse the web. But it’s not as simple as networking today where you just plug in a network cable and you’re off the races. MS-DOS has no always on auto-configuring network support, it must all be configured and executed using the following:

  • A driver for your network card also known as a Packet Driver or ODI (Open Data-Link Interface).
  • A network stack which defines the protocol such as TCP/IP, IPX/NetBIOS or Novell NetWare.
  • A TSR (Terminate and Stay Resident program) for requesting a address from your DHCP if you’re connecting to an IP4 network.

2.4.1 Drivers for your Network Card

When I first set out to get networking going in DOS I struggled to get my head around packet drivers, how they worked and what exactly they did. Now I know the ins and outs it seems obvious but for anyone approaching it without any prior knowledge it can be a real headache.

The first thing first you need to know is what network card you are using. If for any reason you don’t know or cannot workout what NIC (Network Interface Controller) you are using there’s a handy tool called NICSCAN which will help you identify the correct card and driver.

NICSCAN and a great collection of packet drivers can be found on Georg Potthast’s website.

I’m using a REALTEK RTL8139(A) PCI fast ethernet card which can use either the RTSPKT.COM packet driver or the RTSODI.COM ODI Driver. The main difference between these two drivers is the intended application, with the packet driver being a generic driver for TCP/IP and the ODI driver being for use with Novell NetWare protocols like NW 3.x, 4.x, NetBIOS and IPX.

I’ve created a set of disk images for the setup disk for the REALTEK RTL8139(A) PCI available here.

If you are limited by only having an ODI driver or packet driver, translation layers or converters are available, but with most common network cards you shouldn’t need to worry. More information on these converters can be found here.

2.4.2 Network Stacks & Protocols

Now you know what network interface you have and the corresponding packet driver to load we need to set it up along side a protocol or network stack. The two most common (and the only ones you really need) are TCP/IP and IPX/SPX.

  • The TCP/IP protocol is what modern networks still use and allows you to connect your computer to the internet. I will outline using the mTCP suite to achieve this later in this post.
  • IPX/SPX is a protocol that was popularly used on LANs (Local Area Networks) when MS-DOS and Windows 3.x were the popular choice for home and office PCs. A lot of multiplayer games such as Doom. Duke3D and Blood for example use this protocol for network play.
  • Novell NetWare is a protocol used primarily as a foundation for Novell business network solutions.
  • NetBIOS is another protocol used primarily as a communication layer for IBM PC networks.

You can configure and use both the TCP/IP & IPX/SPX protocols for your network device but usually only one stack can be initialised at a time. Except in some instances where both a separate ODI and Packet driver can be run without conflicting resources. A reboot of the system will most likely be required if you wish to change from using one protocol to another.

2.4.3 IPX/SPX, Novell NetWare & NetBIOS

IPX/SPX, NetWare and NetBIOS all have their own TSRs that just need to be run in sequence along with the ODI or packet driver depending on your network card.

For this example I will be using the Realtek ODI driver RTSODI.COM, along with LSL.COM (Novell Link Support Layer for DOS ODI) and IPXODI.COM (IPX/SPX Protocol).

LSL.COM and IPXODI.COM are usually provided with your network card driver, for the RTL8139 they are in a folder named NWCLIENT on the install disk along with an example NETSTART.BAT. RTSODI.COM is located in the NETWARE\DOSODI folder on the same disk along with NET.CFG and RTSODI.INS. Or you can download them here.

I recommend putting all these files into a single folder on the local drive of the system you wish to configure eg. C:\DRIVERS\IPX\*.*

For launching the IPX ODI drivers see the example below and create a batch file ie. NETSTART.BAT to launch them in sequence.

@echo off
lsl
rtsodi
ipxodi

Additionally NETBIOS.EXE (NetBIOS) and NETX.EXE (NetWare v3.x) can be launched afterwards or included at the end of your batch file. A successful initialisation should look like the screenshot provided.

You should now have initialised the IPX network stack on your network so any other machines also connected should be able to communicate with each other.

That’s all you need to do to prepare for network multiplayer gaming in DOS!

See 2.4.5 later in this article where I’ll cover how to host/join local IPX game lobbies, playing IPX based multiplayer over the internet using a program called Kali, along with connecting virtual DOSBOX clients to real machines on the same network.

2.4.4 TCP/IP using mTCP

For TCP/IP to work we need a packet driver and a software suite called mTCP the latter is available for free from Michael Burtman’s website. The TCP/IP packet driver can be found in the PKTDRV folder on the RTL8139 install disk or can be download on its own from here . The same as before I’m using the REALTEK RTL8139(A) for this example.

Running the packet driver is pretty simple, only one launch parameter is required for RTSPKT and that is the software interrupt so other programs can access it. The default as described in the readme is 0x60. Move the packet driver to somewhere onto your hard disk ie. C:\DRIVERS\TCPIP\*.*

You can add the following to a batch file or your autoexec.bat if you want it to auto load on start-up.

C:\DRIVERS\PKTDRV\RTSPKT.COM 0x60

When executed you should see a message like the following that means the packet driver is loaded and running successfully.

System: [345]86 processor, PCI bus, Two 8259s
Packet driver software interrupt is 0x60
Interrupt number is 0x9
I/O port is 0x6100
My Ethernet address is 52:54:4C:29:29:AD

The last line will display the mac address of your network card if you wanted to note that down for whitelisting, or address reservation on your network later.

mTCP requires configuration before we can use it. Firstly extract the contents of the standard binaries zip file to your system (eg. C:\DRIVERS\MTCP\*.*). Next MTCP.CFG needs to be filled out with your packet drivers interrupt we used earlier (0x60), a host name needs to be chosen and ftpsrv_password_file location needs to be set. Save the file and add the following line to a batch file or your autoexec.bat.

SET MTCPCFG=C:\DRIVERS\MTCP\MTCP.CFG

After editing your autoexec.bat and rebooting or alternatively launching your own custom batch file with the SET value, you can re-run your packet driver and then launch DHCP.EXE. If all is correct you should see the line “Good news everyone!” with your assigned local network IP address details (see images below).

You are now connected to your local network via TCP/IP and should have internet access if it’s available on that network. This allows you to use a web browser such as Arachne or play any TCP/IP compatible games online such as Quake World.

Transferring files is also easy if you have a ftp server on another machine to connect to using mTCP’s FTPSrv utility, I highly recommend Phil’s Computer lab video on the subject which you can find here.

2.4.5 Connecting DOSBOX to Real Hardware

I made this video as a guide that covers all the steps necessary for getting a portable DOSBOX distribution up and running, which can connect real computers and DOSBOX instances over your TCP/IP and/or IPX network.

The first half of this video covers everything from points 2.4.1 to 2.4.4 in this post but for the virtual NE2000 network adapter this build of DOSBOX uses.

The latter half of the video covers creating/joining game lobbies in DOS and also how to setup and use Kali 1.4a for DOS. You can skip to the time 6:38 for those details which also apply to real MS-DOS.

Kali 1.4a is a Client and TSR for DOS which allows IPX traffic to be captured and passed through the internet over TCP/IP, allowing games designed for local network play only to be played online.

Unlike modern games which allow players to join a match in progress any time, IPX games tend to use a lobby system. This is when the game finds and syncs all the players running the game on the network and then creates the game instance once they are all ready.

In the next post I’ll be finally moving onto Windows 9x!

Retro Game Wednesdays (Part 5)

2.3 System Performance in DOS

(Click the image above to view it larger with a description.)

For a PC made up of hardware from the end of the 90’s it performs as you would expect in DOS, it kills it. You can see a breakdown of the systems stock and overclocked performances in the SpeedSys summaries and DOSBench results in the images on the left.

All earlier era games that run in either CGA (320×200) or QVGA (320×240) resolutions run great, at either the frame-cap of the game or the refresh rate of the monitor. Some early games rely on the frame rate for in game timings and thus run too fast, for these I’m using the SETMUL tool to limit the CPU speed by reducing the multiplier or in some cases disabling the L1 or L2 Caches.

The late era DOS games that run in higher VESA resolutions like VGA or SVGA can vary in speed. Most VGA (640×480) games are perfectly playable when using stock settings, but while running under an overclock with write-combining enabled can be very smooth. As for games with support for SVGA (800×600) resolution they tend to be a bit slow under DOS even with overclocking or write-combining. This slowness seems to be a limitation of 3D rendering in software mode, with games which don’t make use of an optimised graphics library like Dirext3D, OpenGL or Glide.

I’ve tested a few games with DOS source-ports specifically designed to utilise MesaFX. An OpenGL based graphics library that takes advantage of 3Dfx’s Glide functions and allows for better hardware accelerated effects. There are also community patches for many games which improve their performance in similar ways.

The first is a port of Quake called QDOSFX. This source port is based of version 1.09 of Quake with a combination of enhancements from multiple other ports. This is possibly my favourite way to enjoy the original Quake episodes. Unlike glQuake this port does a excellent job retaining the dark and gritty software rendered look of quake, which is where I feel a lot of the charm of the game lies. It also has the benefit of running at higher resolutions, with greater performance and enhanced 3Dfx effects/lighting. Plus the kind of extra features we’ve all come to expect in more modern first person shooters; such as an FOV slider, on screen frame counter and better mouse look options etc.

Vanilla Quake at stock clocks and settings rendered at 640×480 finishes the Timedemo benchmark of 969 Frames in 74.4 Seconds with an average frame rate of 13 FPS. While the source port completes the same benchmark of 969 Frames in 13.2 Seconds with an average frame rate of 56.3 FPS. This is an improvement of approximately 425.5%.

See below the side-by-side comparisons of the Quake vs. QDOS and glQuake vs. QDOSFX. The newer ports are the images on the right of the slider.

Quake vs QDOS (Software) 640×480

glQuake (MiniGL) vs QDOSFX (MesaFX) @640×480

Super Mario 64 (MesaFX) Gameplay

Another game utilising the MesaFX library that I have tested is Super Mario 64. This port is based upon the reverse engineered SM64 codebase and is compiled for DOS. There is no benchmark but the game experience is smooth and enjoyable (even played with a keyboard). In some locations like the submarine it actually performs better than on the N64 version.

It’s interesting to see this game run natively on a 3Dfx system because back in the day UltraHLE’s N64 emulation took advantage of the N64’s 3Dfx graphics chip instructions and translated those calls to glide with very little overhead. While UltraHLE ran in Windows this port runs natively in DOS. Using write-combining even more performance can be gained.

System Shock (SSPTool) Gameplay

The last game I tested was a patched version of System Shock which not only looks better than it’s original DOS release but has more resolution options and modern control improvements. The mods I used were all part of the SSPTool mod pack and installer. This tool will let you select the modifications you desire and use a System Shock CD or GOG install to create a standalone modded install.

All of these ports ran incredibly smoothly at 640×480 and are even still enjoyable at 800×600 with Write Combining enabled. Checkout the comparison images and gameplay videos to see for yourself.

In the next part I’ll be covering networking, internet and multiplayer in MS-DOS. Also a little look at getting real hardware to connect to DOSBox on a LAN or over the internet.