Personal Computer News


First Byte Electron Switched Joystick Interface

 
Published in Personal Computer News #068

A joystick interface plugs onto Kenn Garroch's Electron.

Stick Or Switch

A joystick interface plugs onto Kenn Garroch's Electron

Product: First Byte Switched Joystick Interface
Price: £24.95 including free games conversion tape
Manufacturer: First Byte Computing, 10 Castlefields, Main Centre, Derby DE1 2PE. Tel: 0332 365 280
Outlets: WHSmith and other Electron stockists

Many people see the Electron as effectively a cut-down BBC, so it lacks all of the nice interfaces that its big sister has built in as standard. The First Byte switched joystick interface, one of the first interfaces for the Electron, is compatible with Atari-type joysticks though only one at a time. At £24.95, it comes with a free games conversion tape containing two programs. The first offers conversions for 20 games and the second is a menu-driven program containing details on how to convert other programs.

Installation

It comes in a small square cardboard box with the usual cover illustration showing how it is possible to rule the computer games universe with a joystick. The interface itself is a flat square cream coloured box that plugs into the expansion port at the back of the Electron. Fitting is easy; just remove the expansion port cover and plug in the box, remembering to switch off the power before doing so.

Once the power is turned back on and a joystick has been plugged in, all that remains to be done is to see whether it works. This is fairly easy and First Byte has included a simple routine to demonstrate how the joystick movements can be detected. This routine is a little overcomplicated and all that really needs to be done is to use the following:

10 PRINT ?&FCC0
20 GOTO 10

This produces different values when the joystick is moved and the fire button pressed and son. Detecting the joystick movement from inside a Basic program should be pretty simple. A neater way of doing this is to use our listing which allows the joystick movements to be read using INKEY(-N) where N is one of the numbers shown on page 159 of the Electron User Guide. The joystick movement now takes the place of the selected keys and since the routine is completely relocatable and fairly short is can be put in any convenient position in memory.

The interface is being supported by software houses such as Micro Power, Alligata and A&F. With any other software houses, their programs will need to be converted.

Verdict

The only obvious problem with the First Byte joystick interface is that when it is connected to the expansion port, nothing else can be connected.

The most probable upshot will be a booming market for expansion boards. These will allow more than one device to be plugged into the Electron.

Also, there is only one joystick port. This is not really a fault since most computer games are for single players, but it would have been nice to have had two joysticks, as on the Commodore 64.

Apart from these two niggles, either a joystick interface works or it doesn't. This one works and is easy to install and use.

The Program

The routine, shown in the listing here, works by redirecting the keyboard reading routine to one that reads the joystick. To use the program, run it and press the appropriate keys for up, down, left, right and fire: these should be the same as those used when playing the game. The code will then be saved to tape in a file called "STIKA".

To incorporate the routine into a program, just load it into a convenient position in memory, &C00 for instance. Then redirect the OSBYTE vector at &20A and &20B to point to the routine. So:

*LOAD STIKA C00
?&20A=&C00 MOD 256
?&20B=&C00 DIV 256

Then user INKEY(-N) to detect the movement of the joystick.

With professional software, the routine can be loaded into memory, at a position that will not interfere with the program and then initialised by putting the start memory address in &20A and &20B.

10 JL=123:JR=119:JU=126:JD=125:JF=111
30 PROCKEYS
50 DIM JSTIK 200:JSTICK=&5000
60 NORM=(?20B*256)+?&20A
70 FOR T%=0 TO 3 STEP 3
80 P%=JSTICK
90 [OPT T%
100 CMP #129:BEQ KEY:JSR NORM:RTS
110 .KEY CPX #L:BEQ LEFT
120 CPX #R:BEQ RIGHT
130 CPX #U:BEQ UP
140 CPX #D:BEQ DOWN
150 CPX #FR:BEQ FIRE
160 JSR NORM:RTS
170 .LEFT LDA&FCC0:AND #255-JL
180 BEQ T:BNE F
190 .RIGHT:LDA&FCC0:AND #255-JR
200 BEQ T:BNE F
210 .UP LDA&FCC0:AND #255-JU
220 BEQ T:BNE F
230 .DOWN LDA&FCC0:AND #255-JD
240 BEQ T:BNE F
250 .FIRE LDA&FCC0:AND #255-JF
260 BEQ T:BNE F
270 .T LDX#255:LDY#255:LDA #&81
280 SEC:RTS
290 .F LDX#0:LDY#0:LDA #&81
300 CLC:RTS
310 ]
320 NEXT
330 *SAVE STIKA 5000+5D
340 END
350 DEFPROCKEYS
360 PRINT"Press key for:"
370 PRINT"Left :"
380 L=FNINKY
390 PRINT"Right:"
400 R=FNINKY
410 PRINT"Up :"
420 U=FNINKY
430 PRINT"Down :"
440 D=FNINKY
450 PRINT"Fire :"
460 FR=FNINKY
470 ENDPROC
480 DEFFNINKY1
500 FOR T=1 TO 128
510 IF INKEY(-T)<>0 THEN =T
520 NEXT
530 GOTO 500
540 DEFFNINKY
550 T=256-FNINKY1
560 PRINT"PRESS THE SPACE BAR"
570 IF INKEY$(0)<>" " THEN 570
580 =T

Kenn Garroch