Saturday, August 30, 2008

Playstation2 Controller for an MS-DOS Game on Linux

I had one of those situations where you suddenly realize that the circumstances where just totally unexpected. One by one the pieces come together as one innocently adds or changes something until something nobody expects occurs.Descent was a video game developed by Interplay a long time ago when MS-DOS ruled computer gaming. Back then, joysticks had those connectors to those game ports sound cards had. Then Microsoft developed DirectX and then it was Windows 95 to reign. Since Windows 95 basically was a front-end for MS-DOS while providing a lot of the missing functionality from what one would expect from a full operating system (memory management, etc.) The point is that DOS games for the most part can run while Windows 95 ran because the Windows 95 environment was very compatible.Linux 1.0, a UNIX clone was released. Being a UNIX it was a very different environment than MS-DOS and Windows 95 (98, ME, 2K, XP, or Vista for that matter). Written by hackers, Linux was rapidly developed and then adopted by GNU as their official kernel. However Linux didn't get to enjoy the aggressive marketing and support of Microsoft and all the hardware vendors. The hackers had to write all their own drivers.Windows 95 was supported in that all hardware manufactures write drivers for Windows and Windows users enjoyed the ease of installing drivers for Windows to use their hardware, but the Linux community grew and continued to develop drivers, as well as software.Occasionally a new program would pop up that allowed compatibility: Wine, dosemu, dosbox, and so on. Then there was USB and other types of hardware support. Then some clever hacker wrote d1x-rebirth.So, I install d1x-rebirth. I plug in my PS2 controller into my Radio Shack USB dongle and into the USB slot there. I launch the game and have some fun before I realize:I'm playing an old DOS game on a UNIX with a controller for a non-PC, and the game was never coded to use USB nor graphics acceleration either.It was a blast. Way to go Open Source!