VOGONS


First post, by Mortifere

User metadata
Rank Newbie
Rank
Newbie

One of my favorite submarine games of all times is 688 Attack Submarine. I recently downloaded DOSBox with the purpose of reliving some great moments playing this game. I also wanted to try multiplayer missions on the LAN through the null-modem feature provided by DOSBox.

After trying for a few hours to get the the null-modem feature working with the game I gave up. It seemed that clicking on "Originate", "Auto-Answer" or "Manual Answer" still wanted to send AT modem commands no matter what and that didn't seem to have the desired effect even if DOSBox recognized the emulated computers as being connected through the null-modem cable.

Okay fine, no problem I thought. I'll just use the modem feature. Simple enough, huh? That's when I ran into the problem of using 11 number boxes to try to dial out to the other emulated computer. If you haven't tried the game, it has a section where you enter the number you wish to dial. The only problem is the GUI interface of the game only allows you to select numbers and only 11 of them. So, I couldn't dial something like 192168001001 which has 12 digits to try to connect to 192.168.1.1 like the DOSbox wiki suggests. I also couldn't enter a computer name because, like I said, the GUI only allows numbers.

I wasn't going to download a dialer just so I could use it inside the emulation to dial 192168001001 and even then, I wasn't sure the game was not going to reset the modem before "originating" and drop the connection anyway.

Argh! Forget this...! I decided it was time to modify the code. I set up a development environment, downloaded everything that is needed to recompile DOSBox, wrote a simple modification, recompiled and long story short, the game is now working. I am now able to call from within the game through the modem emulation and have it connect to another emulated computer.

My modification is simple, create support for something like a hosts file. A regular hosts file is used to resolve human-readable computer names to IP addresses. But in this case I wanted to resolve "phone numbers" to IP addresses. The simplified pseudo-code goes like this: If the file exists in the DOSBox directory, read it and if there is a match on the phone, return its IP address. If the file doesn't exist, continue as usual. (For simplicity I didn't mention things like elimination of white space, etc. Which are also needed.)

The hosts file, or in this case the "phone_book.txt" file looks like this:

#############################
# Used to resolve phone number to ip address
# First value is phone number
# Second value is ip address:port
#############################

15555551212 192.168.1.2
15555551213 192.168.1.3
15555551214 192.168.1.2:23
15555551215 192.168.1.3:24

Now I can dial from inside any game any number in the phone book and it will resolve to whatever IP address (with or without a port) in the file.

If someone is intrested in the code or just wants the executable let me know. Now, I have to get back to playing multiplayer 688 Attack Submarine.

Good times!