To put the ideas into practice, I started by purchasing the LCD and joystick. These two items, in addition to
my main computer were sufficient to start testing the software. I fed MPXPlay a few sound files. It worked as it
should. The joystick came with drivers for Windows but nothing for DOS. After rummaging around Gravis's website,
I found some older software that supported DOS. For the Matrix Orbital LCD, I found two add-on software packages
that feed info from MPXPlay to the LCD: MPXFE, and
Unfortunately, I was disappointed with both. MPXFE had problems (may be fixed by now) passing command line parameters to MPXPlay. MPXF worked, but I had problems getting the layout that I wanted. Since this part of the project was going nowhere fast, I decided to put it on hold and began writing my own front end software to handle the directory navigation. After a while I finally got an early prototype hammered out.
At this point I got tired of tieing up my main computer for this project and proceeded to move the project
development to my "basement computer" (an old Pentium 133). I added the joystick keystroke-emulation TSR to the
machine's autoexec.bat file, and proceeded to do some testing with the joystick. The software did properly "fake
the keystrokes", thus providing MPXPlay and my software with the necessary input (just as if it had been typed on
Trouble in Paradise:
It didn't take long before I experienced an annoying issue with the keystroke emulation software. It would cause the machine to lock up on startup about 1 in every 10 times the computer was booted. First I thought the old computer might be a little flaky. After further investigation, testing it on my main machine, I was able to reproduce the problem on a number of occasions. Well, my cd changer in my car starts up properly 10 out of every 10 times I turn it on. 9 out of 10 is something that I consider unacceptable.
I began searching for an alternative. In the end I found SNESkey. It's a generic keystroke-emulation tsr that works with a number of oddball joysticks. Initially I had some success, but I found that it locked up my machine if I held down any particular button for too long (buffer overflow??).
I was counting on the LCD add-on software, and the keystroke emulation software. Now I could count on neither. This left me with three options:
- Abandon DOS
- Abandon the LCD and joystick
- Write my own TSR
I immediately dismissed option 1. I like DOS's speed, stability, light hardware requirements, and the fact that it doesn't care whether it's shut down properly.
Option 2 wasn't all that great, either. I was in no mood to abandon the hardware, that I spent my hard earned money on, without a fight. Time to investigate option 3.
First things first, I needed a way to get the joystick working. To accomplish this I needed to do the following:
- Figure out how to add keystrokes to the keystroke buffer
- Find out how the Gamepad Pro uses the joystick port
- Try to find a way to put this in a TSR.
I found a possible solution to #1 in SWAG, the sourceware archive group.
In addition they also have examples on how to read the joystick port. Their source code is written in Turbo
Pascal...not a problem since I'm familiar with the language and enjoy using it.
Reading the Joystick:
#2 was a big problem. I wrote a simple program to echo data from the joystick port to the screen. The output
looked like a bunch of gibberish. After a couple weeks of frustration, and while on the verge of ordering a
different joystick, I found a description on a Linux
joystick driver development page. Here is a direct
link to the description. Although I
wasn't able to make much sense out of their source code, the information was sufficient for me to write my own code.
Writing My First TSR:
I found a nice "tsr clock" example in SWAG. Once I figured out what made it tick, I removed their clock-related code and replaced it with my own. After a while I was faking keystrokes with my GamePad pro. It worked at the DOS prompt. It worked in Microsoft Edit. No go for MPXPlay. For some reason their method of reading the keyboard was different. I tried several different SWAG examples, but had no success with MPXPlay. In the end I found a solution that works, at Günther Klaming's low level hardware programming page.
Fortunately, displaying data on the LCD is much more straight-forward. The commands are documented, and example source code is available here. The one remaining issue involves grabbing data, displayed by MPXPlay, from screen memory. An example of this was available on SWAG.
With these issues resolved I had all of the tools necessary to write my own joystick/LCD tsr. Over time I developed working prototypes of the tsr and the front-end directory navigation software.
Last Update: 11-15-2006
Copyright © 2001-2018, Brent Harris
All rights reserved.