dosbox-staging / dosbox-staging

DOSBox Staging is a modern continuation of DOSBox with advanced features and current development practices.
https://www.dosbox-staging.org/
Other
1.3k stars 154 forks source link

688 Attack Sub nullmodem connection not supported #486

Closed emanuelepulcidoria closed 4 years ago

emanuelepulcidoria commented 4 years ago

As per classic Dosbox the nullmodem multiplayer game for 688 Attack sub is not supported in Dosbox-x either.

To Reproduce Steps to reproduce the behavior:

  1. Open a server Dosbox-staging window and a client Dosbox-staging window and connect them through nullmodem emulation under 127.0.0.1; 1a.: Check from the console that the 2 server and client are connected;
  2. Launch 688 Attack Sub on both server and client;
  3. Choose the first mission TORPEX'89: server clicks on blue button, client clicks on red button;
  4. Select Modem on COM1 on both server and client;
  5. Leave all the telephone numbers blank to let understand the program that you are attempting a nullmodem connection instead of a modem connection (read attached manual pag. 33: https://archive.org/details/688attacksub_201909/page/n7/mode/2up);
  6. Click AUTO-ANSWER on the host first and ORIGINATE on the client after OR Click ORIGINATE on the client first and MANUAL ANSWER on the host after
  7. Both client and server attempt to connect the game without success;

Expected behaviour As per modem connection server and client games connect first, load the game and open the mission simultaneously;

Environment (please complete the following information):

Windows 10 DOSBox-staging 0.75.0

Additional context This issue has been reported in the original DOSBox in 2007 and it has never been solved: https://www.vogons.org/viewtopic.php?f=31&t=15454&p=107674#p107674

There are different versions of 688 Attack Sub on the web (and I am purely talking of the DOS versions) and for none of them is possible to open the connection through nullmodem cable emulation.

Some research on this topic has been already done at the following issue in Dosbox-X: https://github.com/joncampbell123/dosbox-x/issues/1668

dreamer commented 4 years ago

Reproduced the problem; used the following settings:

# server
[serial]
serial1 = nullmodem port:5000 txdelay:500 rxdelay:500
# client
[serial]
serial1 = nullmodem server:localhost port:5000 txdelay:500 rxdelay:500

(I tested few different txdelay/rxdelay configurations without a success)

Two dosbox-staging instances connect (confirmed via log SERIAL: Port 1 connected to 127.0.0.1.), but I can't force the games to actually see each other; either one side leaves RX overrun errors (sometimes with different values):

SERIAL: Port 1 errors:
  - framing 0
  - parity 0
  - RX overruns 120
  - IF0 overruns: 0
  - TX overruns: 0
  - break 0

Here are checksums of the game files (for the record):

$ sha1sum *
13b5151df5a83b83e4a3a60d9cb68a3d254acf57  688.BAT
0d78e4d95014b746edaf1fde50a5034e42e0e39b  688.PAK
084a62de74ff3d40e0e8cea66969debb25b01ce7  688.PAL
555423d00deefaebad6d1ec8d2a2fd371b236289  ALFA.PAK
084a62de74ff3d40e0e8cea66969debb25b01ce7  ALFA.PAL
8a41646c76c39d74eb535d8507eea4d43ab52e58  CALLS.EXE
f70324ab41a9f8ab468a0f52c6f4cc885b800fdb  DISK1.MLB
dfc7fdc808b915ae3644db5c2a35be1c0e3a32b5  DISK2.MLB
7df7eabc788fa6b0baa8f24c4e58284be378e4b6  GAME.EXE
07d6443ea70a4396c8f0ad9cb8b2f7f29cd70d7c  MAIN.EGA
604693564128a0a5048e49e0724179db809da94e  PROFILE.688
ad79c1ef3ea28e203b08d91fbbba4b34e951d6fc  TITLE.EXE
5fbdf814160600a2bb2ef9da050620b1ad06ffd6  TITLE.PAK
1368a470178219db54e1bdb488d2be70c66f491a  TITLE.PAL
23843c38bd6119784ce9def5902ac209501186bc  VBTDY

I see quite a long discussion in DOSBox-X bugtracker, but the original @rderooy question got unanswered:

(…) do you know if 688 Attack Sub works with nullmodem on retro hardware?

Do we have any confirmation that indeed this is not a game bug?

rderooy commented 4 years ago

For reference, this is the version I was originally trying to use. GAME.EXE and TITLE.EXE are different, and I have one more file, MODEM.688 (which just contains a modem init string, and I don't think it matters in this context).

I don't know what this VBTDY file is that you have in your directory. Something for Tandy?

eb2b68c41b8b6ba4cdb8ad4b36512b3320f63877  688.BAT
0d78e4d95014b746edaf1fde50a5034e42e0e39b  688.PAK
084a62de74ff3d40e0e8cea66969debb25b01ce7  688.PAL
555423d00deefaebad6d1ec8d2a2fd371b236289  ALFA.PAK
084a62de74ff3d40e0e8cea66969debb25b01ce7  ALFA.PAL
8a41646c76c39d74eb535d8507eea4d43ab52e58  CALLS.EXE
f70324ab41a9f8ab468a0f52c6f4cc885b800fdb  DISK1.MLB
dfc7fdc808b915ae3644db5c2a35be1c0e3a32b5  DISK2.MLB
4dacb86c4d0bf76c9b94e380c66911244a334e2e  GAME.EXE
07d6443ea70a4396c8f0ad9cb8b2f7f29cd70d7c  MAIN.EGA
d8101be2085c97e770cf215aa45b9b3f0e404e24  MODEM.688
0e6ab9be4015e2c22893adb6d75128285cfd34d8  PROFILE.688
3b583a0a4eec2771586cb0ccad72f40b9f08c276  TITLE.EXE
5fbdf814160600a2bb2ef9da050620b1ad06ffd6  TITLE.PAK
1368a470178219db54e1bdb488d2be70c66f491a  TITLE.PAL
kcgen commented 4 years ago

I couldn't find hard visual evidence of it working, such as in YouTube videos. There's one written report from sybok1, in context of asking why it's not working in DOSBox:

"Does this mean, I will not be able to play multiplayer with it? I know on my older computer back in the day I used to play with my father using a null modem cable. The virtual null modem cable just doesn't seem to be working."

https://www.vogons.org/viewtopic.php?t=15454

Sybok1's post history only contains a handful of unresolved 688 multiplayer posts before going dormant.

If getting 688 working across nullmodem indeed involves building a custom-wired cable, then this would have massively reduced the subset of positive historic cases.

emanuelepulcidoria commented 4 years ago

What I would like to understand from you experienced coders is: if you had time to create a custom-wired cable inside Dosbox-staging for 688 would you be able to do it OR this is impossible to do without knowing exactly how 688 uses the pins in the nullmodem cable?

kcgen commented 4 years ago

Yes, that's the ultimate question :-)

First, I do think the modem dialing approach needs more investigation, you've proven that two PCs work fine when running on a local network over TCP.

This means it should work over the internet too, with the challenge being getting all the ports forwarded and passed through to the dosbox machines. If this can't be figured out by both parties then the same issue will impede a nullmodem connection operating over TCP in the exact way.

Regarding the nullmodem coding question: right now, dosbox doesn't implement serial operations using an underlying concept of pins or wires to which functionally is attached. If it did, this remapping might be easy to "change the pins associated with a given command", which is what the wiring differences ultimately do in the 688 cable.

Instead, dosbox simply implements the commands directly and dispensers with the underlying hardware representation (which is faster, and easier to implement, and easier to maintain).

So in this case, what we need is the ability to map these existing serial line command differently than what dosbox thinks it's using the commands for. Essenly perform the 'pin rewiring' directly on the associated commands.

Another option would be to code a hardware representation of the pins to which functions are mapped. Then make this pin to function mapping configurable (both users would need to apply mappings to match their end of the cable).

Even if we could do this perfectly and have it work on a local LAN, the trouble would still be getting that data across the internet, just like the show stopper with the modem scenario.

Suggestion: let's take a game with proven modem functionality and a track record of users playing it successfully across the internet.

Let's use that game for you and your 688 partner to get working across the internet, and use tutorials and such to help. Assuming that eventually works, then reuse your working settings and retry 688's modem mode over the internet.

rderooy commented 4 years ago

To me, once it works on a local network, or at least on the same machine, it is done from a dosbox perspective. The whole firewall and port-forwarding issues that you get with running it over the internet are outside the dosbox scope.

Unless you wanted to implement UPnP, but then who in his right mind would enable that security hole on their router.

kcgen commented 4 years ago

I agree @rderooy - and in this case, LAN play has been proven with 688.

emanuelepulcidoria commented 4 years ago

And I can confirm that it has been proven because I was finally able to play a match with Alle82 yesterday over the internet from beginning to end with the modem connection between a Windows 64bit and a MacOS systems. Considering that the modem connection works for 688 I think that the issue in subject will never been solved because it is redundant now. Apart in the case it will be found in some other DOS software....

kcgen commented 4 years ago

That's fantastic news @emanuelepulcidoria ! It's been a long haul for you to see this through, but your persistence has paid off! It's also spun off benefits for mac users of dosbox-staging, as we now statically link sdl2_net, which is what Alle82 is using.

kcgen commented 4 years ago

On that note, we're probably good to close this issue now. For future reference @emanuelepulcidoria, I will quote your thorough post on vogons:

Finally the last piece of the puzzle is solved! There are different DOS versions of 688 Attack Sub online. All the one that I have seen work fine in single player mode but only the one I initially downloaded works as well in multiplayer mode. The one that works in modem connection has to have the details in the following files like this: $ md5sum *.EXE 4552638ddf08042531ec3a23971e9459 CALLS.EXE 51bb0bbb9b85d33fefab88a69919a449 GAME.EXE 0b2f619ce7067f249416d2b060398e52 TITLE.EXE

This file could be found at Old-games.com under the 688 Attack Sub DOS page and it is the 599KB release and I attached it here as well.

Both Server and client must have this version in order for the modem connection to work. I tried the modem connection under 127.0.0.1 both with dosbox-staging and DOSbox-X and it worked. I tried the connection under the local network with DOSbox-X between a Windows 10 64bit and a Windows XP 32bit and it worked. I tried as well the connection with dosbox-staging between a Windows 10 64bit and a MacOS Catalina and on the web using my external router IP address and it worked as well. So there is finally a solution to this issue. Regarding the nullmodem connection it looks like 688 Attack Sub uses the nullmodem cable in a different way compared to the one set up in DOSbox and as a consequence the nullmodem connection does not work in any of the emulators. A different code for the 688 nullmodem connection should be written in order for it to actually work.

688-modem-pack-for-exo.zip