Writing

Feed Software, technology, sysadmin war stories, and more.

Tuesday, June 21, 2011

Bridging a technology gap just to play some games

Some hacks are small and stupid, and yet still useful. Years ago, in the days when we needed actual modems and phone lines to play games, one of my friends had a bit of a situation. He had a computer which was up to the task of playing games, but it had an old slow modem which wasn't. He also had a laptop which had a nice, relatively quick modem built-in, but it was not suitable for gaming. What to do?

It turned out that this laptop had a separate serial port, and his "real" machine did too. My friend couldn't afford a full-blown modem, but he was able to scrape together a few bucks for the null-modem adapter to go between them. I supplied the rest: a tiny, ridiculous program called TWOPORT. It just ran on the laptop and cross-connected the serial ("com") ports. That's it.

I didn't even bother with the control lines: DTR, DSR, CTS, RTS, DCD, all of that stuff. It didn't matter. For gaming purposes, you never did the buffer-filling stuff where flow control would be needed, and he'd just hang up manually (since DCD was nailed up, as I recall).

Here, have a laugh with me at how dumb the inner part of this code was:

  setuart (1, speed1, Pnone, 8, 1);
  activatecom (1, 2048, true);
 
  setuart (2, speed2, Pnone, 8, 1);
  activatecom (2, 2048, true);
 
  repeat
 
    if receive (1, b) = true then
      begin
      hsendbyte (2, b);
      write ('.');
      end;
 
    if receive (2, b) = true then
      begin
      hsendbyte (1, b);
      write ('.');
      end;
 
  until keypressed;