Classic Computer Magazine Archive ANTIC VOL. 6, NO. 9 / JANUARY 1988

SSI

Joystick

Commander

More fun for wargamers

by RICH MOORE

Wargamers can now get more fun and playing ease out of their sessions with the hits from Strategic Simulations Inc. With these short routines from SSI Joystick Commander you'll bypass the awkward number-key cursor movement schemes built into most SSI games. This BASIC program works on 8-bit Atari computers with at least 48K memory and a disk drive.

   I have written positive reviews of quite a few SSI war-games for Antic. But many of these use an awkward method of controlling the screen cursor with number keys. SSI actually has two schemes, one for squares (an eight-direction cursor) and one for hexagons, or hexes (a six-direction cursor). When displayed on a diagram, they seem logical:

   Unfortunately, the typewriter-style row of numbers on the keyboard of an 8-bit Atari is arranged a little differently:

   1234567890

   Notice that the keys which move the cursor to the right are all to the left of those which move it left.


With the joystick
to drive the cursor
I don't need a "compass rose"

Some-not all-SSI games helpfully display a "compass rose" onscreen. For those that don't, I made a little "overlay" that sits above the number keys on my 130XE to label the directions in which they will move the cursor. Neither aid is really satisfactory.

A better solution would be to add a driver that loads the appropriate key code into the Atari's internal hardware register (memory location 764) whenever joystick 1 is moved. And finally I got around to doing just that, with SSI Joystick Commander.

The code for drivers to handle either squares or hexes is fairly simple. The routine doesn't even have to be hooked into the initialization vector, since SSI games tend to reboot if [RESET] is pressed.

The driver links itself into the Deferred Vertical Blank portion of normal operating system processing. Then it waits for a joystick movement. It looks up the corresponding internal key code in a short table and places the code into location 764, just as if a key had been pressed.

My biggest problem was finding a "safe" memory location for the driver. While XL/XE users can use a translator to get safe RAM above the normal 48K point, I wanted to find a place that would work on the older 800 models as well. Experimentation showed that there was no part of "normal" memory untouched by any of my SSI games. However, it turns out that the games that would benefit from a joystick driver all use Atari DOS 2.0S.

ABOUT DOS

A DOS (disk operating system) is a machine language program which loads into your Atari's memory whenever you boot a disk and remains in memory until you turn off your Atari. Its primary purpose is to tell your Atari how to communicate with your disk drive. (Note that the "DOS" command loads the DUP.SYS program which lets you manipulate disk files.)

Since all of these games use the same DOS, I chose to put my driver there. Since there aren't too many free memory locations in DOS, I decided to deactivate the RENAME function and use its space for the driver. None of the games use the RENAME function, so this modification would not harm game play.

A smaller problem was that the cursor tended to move a little too quickly under joystick control, particularly in the Gettysburg and Antietam games. At first it was hard to make the cursor move just a single square, especially diagonally, so I added a "debounce" delay

Also, to verify that the player indeed selected a diagonal with the eight-direction driver, the program was modified to ignore cardinal directions (North, South, East, West) when the joystick button is pressed. And it ignores diagonal movement when the trigger is not pressed. This should help overcome the great variation in directional sensitivity among different joysticks.

Since games such as Warship and Battlecruiser don't require precise control of the cursor, you can remove this feature when you create the driver. Simply RUN SSIJOY8.BAS and type 'Y' at the "Ignore Trigger?" prompt. The resulting driver will move the cursor in any direction, regardless of trigger status.

The six-direction driver does not require pressing the joystick button for diagonal movement since the horizontal directions are not used at all, thereby providing comfortable "stops."

GETTING STARTED

Listings 1 and 2 create customized .DRV files for eight-direction and six-direction cursor drivers, respectively. Type in Listing 1, SSIJOY8.BAS, check it with TYPO II and SAVE a copy before you RUN it. Now follow the same procedure for Listing 2, SSIJOY6.BAS.

Listings 3 and 4 contain the MAC/65 source code for the two drivers, for students of assembly language. You don't need to type these in to use the program.

Both SSUOY6.BAS and SSIJOY8.BAS will create joystick drivers with any specified delay rate. Just type in the rate you want at the "Delay Value" prompt, or press [RETURN] to use a default delay rate of 3.

Increasing the delay values in the drivers will make the cursor slower but more precise. Decreasing the delay values has the opposite effect.

Warship and Battlecruiser work best with the trigger disabled and a delay of 0. You may find values of 4 to 6 better for War in Russia.

You can test your driver now, but make sure you're using DOS 2.0. Use the "Binary Load" feature (choice L from the DOS menu) to load either of the .DRV files. Now plug a joystick into port 1. As you move the stick, numbers corresponding to the SSI direction codes should appear on the screen just as if you had pressed the number keys.

Caution: You can't rename a file with the driver installed. If you load the driver into memory, you must reboot to restore the RENAME function. [RESET] disables the driver, but you still can't rename files-which you'll need to do for installing the driver on a gaming disk.

SAFEST PROCEDURE

If you're the very cautious type, here's a procedure for installing the driver without writing to your original copy-protected SSI disk. It is a little complicated and requires an extra disk for each game.


Using the number
keys to determine
direction can be a pain

1. Using DOS 2.0 with BASIC enabled, check the directory of your game disk. If you don't get a "normal" directory listing, the game isn't compatible with DOS 2.0 and you can't go any further.

   2. Copy the game disk with a sector copier that won't quit when it encounters bad or non-existent sectors. Your backup won't run the game, but that's not what you need at this point.

   3. Delete the AUTORUN.SYS file from the backup.

   4. If the backup disk doesn't have DUP. SYS, file, use choice 0 from the DOS menu Move (or choice C to Copy) DUP.SYS from DOS 2.0 to the backup. Don't use anything but the standard Atari DUP.SYS from DOS 2.0. If there's not enough room on the disk for DUP.SYS, delete any large file except DOS.SYS. All we need is the game disk's DOS.SYS, a standard DUP.SYS file and the driver file RENAMed to AUTORUN.SYS.

   5. Put a write-protect tab on the backup disk and label it as the boot disk for that particular game.

   SSI has modified DOS for some of its games, which is why we can't just boot from a DOS 2.0 disk and make the driver an AUTORUN.SYS file. It's easiest to just get the DOS for each game using the preceding steps.

If you don't have a good sector copier, there's a trickier (and less reliable) method to get the particular DOS used by the game. Boot the game, but with BASIC enabled. DOS actually loads in first, then "stumbles" slightly when it looks for AUTORUN.SYS in the directory. Listen carefully to the loading sounds on your TV/monitor's speaker. When you hear the load stumble, press [RESET] to interrupt DOS and enter BASIC. Replace the game disk with an empty, DOS-formatted disk and write DOS to it by typing:

        OPEN #1,8,0,"D1:DOS.SYS":CLOSE #1

   Then proceed with steps 4-5 above.

Loading the game now takes two steps: one to boot the correct DOS and load the driver, the second to run the game on the original disk:

   A. Boot the backup disk, disabling BASIC. When the DUP menu comes up, replace the boot disk with the game disk.

   B. Select option L to load the game's AUTORUN.SYS file.

DARING METHOD

For the stronger at heart, the driver can be placed directly onto your copy-protected SSI disk for a fully automatic boot, load and run. No software is modified, but it is necessary to change a couple of file names and to add the one-sector driver to the disk.

If you use this method, the author and Antic Publishing are not responsible for any possible damages to your SSI disks. However, I have had no problems using the convenient procedure below for the following copy-protected disks:

Warship             Reforger 88
Battlecruiser       Mech Brigade
U.S.A.A.F           War in Russia
Gettysburg          Objective: Kursk
Battle of Antietam

   1. Using DOS 2.0 with BASIC enabled, check your game disk directory. If you don't get a "normal" directory listing, the game isn't compatible with DOS 2.0 and you can't go any further.

   2. Copy your driver file to your game disk. (If your disk is write-protected, you may have to cut a notch in it.)

   3. On the game disk, use choice E from the DOS menu to rename DUP.SYS as DUPSYS.OBJ. (Skip this step if DUPSYS isn't there.)

   4. Rename the AUTORUN.SYS file to DUP.SYS. This step is essential.

   5. Move (choice O) or Copy (choice C) the driver to the game disk.

   6. Rename the driver on the game disk to AUTORUN.SYS.

   7. Place a write-protect tab over the notch you cut during step 2. You can now reboot and play the game using a joystick to control the cursor.

   This procedure takes advantage of the fact that DOS will actually load and execute two files on the disk when BASIC is disabled. DOS first looks for and loads a file named AUTORUN.SYS. If a cartridge (external or internal) is not there, DOS then searches for a program file named DUP.SYS to run.

With the joystick to drive the cursor, I no longer need an artificial "compass rose" in order to look over the battlefield or to command unit movements. Large-scale cursor moves are both faster and easier, and the entire games are more enjoyable.



Lt. Commander Rich Moore is a wargame simulation expert for the U.S. Navy. He is currently in charge of developing the database for a large-scale U.S./Korean joint arms exercise scheduled for 1988.

Listing 1  SSIJOY6.BAS Download

Listing 2  SSIJOY6.M65 Download / View

Listing 3  SSIJOY8.BAS Download

Listing 4  SSIJOY8.M65 Download / View

On Disk  SSIJ6.DRV Download

On Disk  SSIJ8.DRV Download