Classic Computer Magazine Archive ANTIC VOL. 5, NO. 4 / AUGUST 1986

TECH TIPS


If you want to try a different approach to protecting your vauable programs, you might consider a hardware key. Hardware key protection is now starting to appear with commercial software such as Batteries  Included's Paper-Clip word processor.

HOW IT WORKS
Every joystick port on an 8-bit Atari has two PADDLE inputs. Each input can return a number between zero and 228 to your program. This value is based on the amount of electrical resistance in the PADDLE controller.

Usually, this resistance is provided by a paddle controller. But if we solder a pair of fixed resistors across the appropriate pins of the joystick plug, we can easily write code in our program to look for these known values and take whatever action we want if they are not there.

DB-9 Connector
You will need a few inexpensive components: a DB-9 female plug ($2.49, Radio Shack #276-1538), a hood for the plug ($1.99, Radio Shack #276-1539) and two resistors (19 cents, Radio Shack) with any different values between 470 ohms and 10K ohms. These resistors will supply your hardware encoding.

Solder one end of both resistors to the plug's pin 7. Solder the free end of one resistor to pin 9 (PADDLE 0) and the free end of the other resistor to pin 5 (PADDLE 1). Enclose the resistors with the hood.

Insert your key into joystick port 1 and boot your computer with BASIC. Type in this short program:
1 A = PEEK(624):B = PEEK(625)
2 ? "A = ";A:? "B = ";B

You will see values for A and B displayed on the screen. These are the values you will want your program to look for. For example, you could write a line like this:

100 IF PEEK(624)<>A AND PEEK(625)<>B THEN PRINT "INSERT KEY":GOTO 100

If you intend to use the key with a BASIC program, a machine language loader that checks for the key would probably be the best approach. If you write one, share it with other Atari users by sending it to the Antic I/O Board for possible publication.

(Antic came across this Hardware Key project in the newsletter of Milatari, the Milwaukee Atari Users Group, where it was put together by Gerald Hagopian.- ANTIC ED)