VOGONS

Common searches


DirectSerial patch

Topic actions

Reply 121 of 353, by Deuce

User metadata
Rank Newbie
Rank
Newbie

As "The Serial Guy" any chance of you mergeing patch 1363544 (Support socket inheritance) into your stuff and getting it pushed into CVS? I've got people agitating for a build using it. I'm a FreeBSD guy, so I don't feel like jumping through all the hoops on my single headless Win2K box to get these guys a current build unless I need to... nor do I feel like campanigng to get it into CVS.

Reply 122 of 353, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

The "Serial Guy" doesn't push things into CVS since it is not his business 😉
I could provide a windows build (already compiled it), but is there a simple way to test it on Windows?

1+1=10

Reply 123 of 353, by Deuce

User metadata
Rank Newbie
Rank
Newbie

Not unless you run a BBS, no... the quickest way would be to grab GameSrv from http://www.randm.ca/files/gamesrv.rar grab a door game, set it up for direct serial... fiddle with the setup as per instructions on http://dosbox.bbsdev.net/ etc not really "simple". If you wouldn't mind supplying a binary, I could pass it on and let them test it though. My gut tells me it would take me a couple hours to build one for Win32 the first time.

Reply 125 of 353, by Deuce

User metadata
Rank Newbie
Rank
Newbie

Wonderfull! Works great on my test box. I updated the instructions at http://dosbox.bbsdev.net/ to point to your site... would you prefer if I mirrored the files on my system and had them downlod from there instead?

Reply 127 of 353, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Some progress here.
- added serial port timing emulation
- fix a problem with local loopback (minor bug)

Directserial test applications appear to be more stable. No overruns even at lower cycles setting. The modem is only partially updated (but Quake modem connection progresses a bit further). More later. You may have to download the dll package from my homepage.

Feedback welcome.

Edit: remove outdated file.

Reply 128 of 353, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Okay, big update.

Changes:

Serial port general:

- Fix a bug in UART interrupt logic that caused several applications to stop serial traffic when data was transmitted and received simultaneously. This makes a lot of stuff work that acted up previously.

- Simplyfy the serial port code a lot by using CommandLine class. As a result parameters like listenport:123 must now be lowercase and there may not be a space before or after the : .

- Add the COMx file access. This makes Qbasic work with serial port and "echo text > com1" will work (limited, see TODO).

- Make the INT14 BIOS interface more like a real implementation.

- add serial port timing emulation: It is now important to set the same baudrate on both sides of a modem connection. When using low baud rates on a terminl you can watch the characters come in.

- better LOG output: There will only be one warning when the game tries to activate the FIFO (good for settlers mouse). Serial errors are reduced to one comprehensive message per second.

Directserial:

- Initialize the Windows port completely - this might make some more USB adaptors work.

- remove the baudrate, parity, .... settings, use freedos mode.com if you really have to set those outside of the application.

Nullmodem:
New serial port mode that is completely controlled by settings. The IP address is entered either in dosbox.conf or "hot configuration" in command line. No messing with telephone numbers. It's primary purpose is to simulate a nullmodem cable between two dosboxes but it also has the Telnet handler and socket inheritance capability. Includes a simple C++ wrapper for SDLnet.

Example of usage:

Connecting 2 Dosboxes for modem/nullmodem game:
On computer 1 type in command line:

serial1 nullmodem

This will act as the server.

On computer 2:

serial1 nullmodem server:<IP or name of computer 1>

Now start your game and choose nullmodem/serial cable/already connected as multiplayer method on COM1. Remember to set the same baudrate on both computers.

Connecting 2 Dosboxes on a port other than 23:
Computer 1:

serial1 nullmodem port:4444

Computer 2:

serial1 nullmodem server:<IP or name of computer 1> port:4444

Connecting 2 Dosboxes with games that tend to be unresponsive
(when overrun errors are reported, usually while the game loads):
Computer 1:

serial1 nullmodem rxdelay:5000

Computer 2:

serial1 nullmodem server:<IP or name of computer 1> rxdelay:5000

This will delay the data for up to 5 seconds.

Connecting to a Telnet BBS:

serial1 nullmodem server:vert.synchro.net usedtr:1 telnet:1

The nullmodem will not connect immediately but wait for you to start a terminal software (detected by DTR being switched on).

Using the Socket Inheritance feature (patch by Deuce):

serial1 nullmodem inhsocket:1 telnet:1

The nullmodem will evaluate Dosbox's command line:

dosbox.exe -socket <number>

and use that socket for sending / receiving data. For running DOS doors with modern BBS.

Here are all the nullmodem parameters:
port: - TCP port number
rxdelay: - how long (milliseconds) to delay received data. Default: 100
txdelay: - how long to gather data before sending a packet. Default:12 (reduces Network overhead)
server: - This nullmodem will be a client connecting to the specified server.

No server argument: be a server.
transparent:1 - Only send the serial data, no RTS/DTR handshake. Use it when connecting to anyting other than a nullmodem.
telnet:1 Interpret Telnet data from the remote site. Automatically sets transparent.
usedtr:1 Wait for DTR to be switched on. Automatically sets transparent.
inhsocket: Use a socket passed to Dosbox by command line. Automatically sets transparent.

Games I've tested successfully so far:

Master of Orion 2 (use rxdelay:5000)
Transport Tycoon Deluxe
Stunt Drivers (even in serial mode choose 1 caller and 1 answer)
F29 Retaliator (reduce cycles to 2000-3000 or it will burn a lot of your CPU)
T-Zone
Peroxyd (use rxdelay:5000)
Wing Commander Armada
C&C
Warcraft 1
Global Conquest
Heroes 2
Tyrian 2.0

(Remember though: If the game provides IPX, use that. IPX is more similar to UDP than TCP is to serial.)

TODO:
read / write STDAUX (Int21) - anything use this at all?
writing to com file does not produce a \r\n at the end
behavior of reading from COM file differs a bit from the real thing
modify os2 directserial to fit again
modify unix directserial

Edit:
- make modem use the sdlnet wrapper
- improve error message in directserial
diff + exe updated.

Attachments

  • Filename
    nullmodem2.diff
    File size
    140.33 KiB
    Downloads
    116 downloads
    File comment
    Source code patch file.
    File license
    Fair use/fair dealing exception
  • Filename
    dosbox_new.zip
    File size
    533.24 KiB
    Downloads
    99 downloads
    File comment
    Win32 build. See my homepage for the DLLs.
    File license
    Fair use/fair dealing exception
Last edited by h-a-l-9000 on 2006-08-23, 19:30. Edited 1 time in total.

Reply 129 of 353, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Nice 😀 Thanks 😉

> modify os2 directserial to fit again
> modify unix directserial

Do you think those files can be merged for good, like having small
system-dependent files with an interface or something like that?

Reply 130 of 353, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

These files don't share much code already. With the patch only the HandleUpperEvent function is the same for all. Of course it would be cool if there was a SDL_Serial...

1+1=10

Reply 132 of 353, by Alkarion

User metadata
Rank Member
Rank
Member

Thanks a lot, Hal! Great update, especially that you made Stunt Driver work. So far it seemed like it would never work. It still doesn't work with modem, but that's not important now.

I noticed that there are a lot of error messages: "Internal error serial port(1)" regardless of the game I use. Do they slow Dosbox down?

I'd like to point out that there is an error in the nullmodem switches you posted: "serial1 nullmodem" should be "serial1=nullmodem".

Reply 135 of 353, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author
Alkarion wrote:

I noticed that there are a lot of error messages: "Internal error serial port(1)" regardless of the game I use. Do they slow Dosbox down?

Ouch, those shouldn't happen at all. Are you using my exe or your own build? I'll have a look at it and maybe provide a build with more debug messages since it doesn't happen to me.

Alkarion wrote:

I'd like to point out that there is an error in the nullmodem switches you posted: "serial1 nullmodem" should be "serial1=nullmodem".

OK, serial1=nullmodem is in dosbox.conf.
I always type "serial1 nullmodem" at the command line so I don't have to edit the .conf all the time.

Qbix wrote:

misc_util.{h,cpp}
Did you create it ?

Yes, it's the SDLnet -> C++ wrapper. Maybe we should put it somewhere else?

Reply 136 of 353, by Alkarion

User metadata
Rank Member
Rank
Member

I was using your build. The .diff you posted, is this the whole new code against the CVS? The name bugfix would then be a bit misleading 😉

EDIT: I noticed you first posted the patch and then the bugfix. So I should apply both patches?

Reply 137 of 353, by h-a-l-9000

User metadata
Rank DOSBox Author
Rank
DOSBox Author

No the real patch is the .txt attached to the long message. The bugfix is a small part of the patch for CVS if the big thing isn't accepted or takes longer.

1+1=10

Reply 139 of 353, by Alkarion

User metadata
Rank Member
Rank
Member

It's still the same "Internal error in serial port(1)". I tried C&C and Warcraft and they work, but the error is still there.

Btw, you said that if a game supports IPX, one should prefer that option over modem. But is the modem connection not more lag-resistant than an IPX connection (with respect to the way the game handles those connections)?