VOGONS

Common searches


Virtual Modem

Topic actions

First post, by Alkarion

User metadata
Rank Member
Rank
Member

I tested the virtual Modem with Dosbox 0.61 with several games and so far I had no success. I set up a local network with two computers which are able to ping each other. Command and Conquer won't recognize the modem at all and Tyrian tells me I have no UART, probably hardware-near programming.

The games which actually recognize the virtual modem that I tested are Kingdoms at War and Warcraft 1. Dialling even leads to Dosbox saying: host 192168000049 port 17. But in spite of activating the answer mode on the other computer the games complain that they get no dialtone.

Has anyone tested the virtual modem successfully? If so, with which game?

Reply 1 of 18, by Vovin

User metadata
Rank Newbie
Rank
Newbie

i have a similar problem, apparently dosbox needs the ip to be input in the form 198.22.22.... blabla... (with dots)

One of the things i tried was to type the phone number with spaces since i cannot type dots in the game i wanted to try the modem with. The result was dosbox opening a connection to 0.0.0.198 port 23 (not 17 although it says 17) as i was able to check in netstat.
The game itself would say "Connection established" but, of course, nothing would come from 0.0.0.198

When typing the IP all sticked together in 1982221391 form or in 198-22-221-39, it says "unable to resolve host" and "no carrier" in the end. The game itself then says: "connection failed" and netstat doesn't show any connection attempt.

I don't think the problem is that "no dial tone" as i always get that and dosbox still tries to obtain a adress to open a connection that the game ( at least the one i tried - DarkLegions) recognizes and uses.

Reply 2 of 18, by Alkarion

User metadata
Rank Member
Rank
Member

I thought it was certain that a number would be interpreted as IP with dots in between. Otherwise the whole thing would make no sense since dots normally can't be entered in the phone number dialog. It would be nice if someone knowing the virtual modem code could comment on this.

Reply 3 of 18, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author
        /* Scan host for port */
Bit16u port;
char * hasport=strrchr(host,':');
if (hasport) {
*hasport++=0;
port=(Bit16u)atoi(hasport);
} else port=23;
/* Resolve host we're gonna dial */
LOG_MSG("host %s port %x",host,port);
if (!SDLNet_ResolveHost(&mhd.openip,host,port)) {

the 17 reported by dosbox is 17 hex =>23 decimal
dosbox takes of the last part. and parses the string as typed to sdl_netresolvehost.
(so it's a name (optionally an ip adress). So with dots.
"1.2.3.4" or "home.org" whatever.

Water flows down the stream
How to ask questions the smart way!

Reply 4 of 18, by Alkarion

User metadata
Rank Member
Rank
Member

I'm sorry but I don't completely understand your answer.

dosbox takes of the last part. and parses the string as typed to sdl_netresolvehost.

So with dots.

Does that mean dots have to be supplied by the user entering the number or that they are automatically inserted? I guess you meant "passes" instead of "parses" (nontrivial spelling error 😁 ) so I assume no dots are inserted as the string is simply passed on.

(so it's a name (optionally an ip adress).

Entering a host name is no option for the games I know.

Reply 5 of 18, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

the virtual modem has as primary function to dail into bbs'.
there you can specify names.

Anyway: dosbox parses the input. and takes off the port.
The part that remains. it gives directly to resolvehost.

So you have to type the dots
.
it tries to resolve what ever you type. You have to type like you would in the ping command.

like
ping www.blah.com
ping 123.222.111.90

Water flows down the stream
How to ask questions the smart way!

Reply 6 of 18, by Alkarion

User metadata
Rank Member
Rank
Member

Ok, so I finally understand. It wasn't coded with games in mind and then the way it handles the phone numbers makes sense. But wouldn't it be great to be able to use it with games, i.e. make the virtual modem interpret strings of numbers as IP-numbers with dots in between. And as far as I can see, it would also be quite easy to implement.

Reply 7 of 18, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

yes. you are right. But usually it's even hard to specify even 12 numbers;) like in doom this isn't possible i think.

We thought of an internal telephone book or so. But it would clutter the configfile too much.

But parsing it as a string is possible. Quite easy indeed 😀

Water flows down the stream
How to ask questions the smart way!

Reply 8 of 18, by Fizzban

User metadata
Rank Newbie
Rank
Newbie
Alkarion wrote:

But wouldn't it be great to be able to use it with games, i.e. make the virtual modem interpret strings of numbers as IP-numbers with dots in between. And as far as I can see, it would also be quite easy to implement.

You're right. I just submitted a patch that does that.. 😀

Reply 9 of 18, by Alkarion

User metadata
Rank Member
Rank
Member

Thank you, that was quick. It's really embarassing that I don't know enough C++ to implement such an easy conversion. Used to program in Pascal back in the early 90's.

Reply 10 of 18, by canadacow

User metadata
Rank Member
Rank
Member

I saw your patch. In the original modem patch (still posted there in the list of patches), I implemented this by allowing the user to create a directory of telephone numbers that corresponded to an IP address. So, if you mapped 555-1212 to 192.168.0.1, when you dialed 555-1212 it would use that IP address. This was for programs that were very strict about the numbers that could be typed in. Your way of solving it works just as well. I'll see about getting it committed to the CVS as soon as possible. Thanks for your input!

Last edited by canadacow on 2004-02-05, 17:55. Edited 1 time in total.

Reply 11 of 18, by Harekiet

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Still have to fix the last remaining bugs in that damn modem support, needs some kind of datarate limit since if the data gets sent too fast most modem programs just keep on getting data even with their internal buffers full.

Reply 13 of 18, by Fizzban

User metadata
Rank Newbie
Rank
Newbie
Harekiet wrote:

Still have to fix the last remaining bugs in that damn modem support, needs some kind of datarate limit since if the data gets sent too fast most modem programs just keep on getting data even with their internal buffers full.

Here is a little proposal for such datarate limit. Basically, instead of handling incoming TCP traffic each tick, it is only checked every fifty ticks (or whatever you define).

When it's time to handle data, at most (modem speed in bytes per second) / (number of updates in one second) bytes are passed to the COM port.

Reply 14 of 18, by Alkarion

User metadata
Rank Member
Rank
Member

It seems indeed that the virtual modem is not yet entirely ready for games. Using Fizzban's little patch I can get a connection in Warcraft but it breaks down after some seconds. Datarates used were 9600 and 19200 baud (14400 not available).

Reply 15 of 18, by Guest

User metadata

Ah, it's nice to see some more interest in that modem support. I've been using it since several months to dial into telnet boards, which is quite fun since you can also keep using your old favourite mailbox program (e.g. Telemate, Terminate, Telix, and so forth). It will probably work with games if the limiting is in place. Sometimes that kind of data overflow results in very strange ANSI graphics on the boards. Oh, I mean, not just sometimes, actually it does that all the time. Looking forward to seeing that fixed.

Reply 16 of 18, by canadacow

User metadata
Rank Member
Rank
Member

Ok, I've patched the modem with the dial-by-string-of-numbers code. I didn't integrate the character limiting code, however, since its not the right way to limit the speed of a TCP connection. I need to figure out how to intercept TCP ACK packets using SDL_Net before I can correctly slow down the stream. In thinking though, I realized that my modem wasn't correctly emulating the Telnet protocol. As such, I've added an AT command... ATNET1 (for when you're connecting to a BBS) and ATNET0 (the default, when you're using it as a null modem cable). With ATNET1, DosBox correctly translates the Telnet commands and as such, the protocols Xmodem and Ymodem now work. Zmodem still doesn't work because by its nature its still too fast for DosBox.

Reply 17 of 18, by Thraka

User metadata
Rank Member
Rank
Member

But what if a specific game stripped out - or .

how would you intrepret the number then? The only real good solution seems to be accociating a number with an IP.

It would be nice to have some sort of in dosbox editor like if you hit ALT+F3 it would come up with a dos interface for managing the numbers. Saved at the end of the ini of course 😀