dk'tronics Games Player User manual

Reading port 31 without a joystick interface connected may not
r e t u r n a c o ns t a nt v a l u e .
Example Program
1 0 0 E T X = 1 5 : E T X 1 = 1 5 : E T Y = 1 1 : E T Y 1 = 1 1 : R E M S e t s t a r t i n g
p o s i t i o n .
1 1 0 P R I N T A T Y , X ; " 0 " : R E M P l a c e a n ' 0 ' o n t h e s c r e e n .
1 2 0 E T J O Y = I N 3 1 : R E M R e a d t h e s t a t e o f t h e j o y s t i c k .
1 3 0 I F J O Y = 0 T H E N G O T O 1 2 0 : R E M e a v e a l o n e i f j o y s t i c k n o t p r e s s e d .
1 4 0 I F J O Y = 4 A N D Y < 2 1 T H E N E T Y 1 = Y 1 + 1 : R E M C h e c k f o r D O W N .
1 5 0 I F J O Y = 8 A N D Y > 0 T H E N E T Y 1 = Y 1 - 1 : R E M C h e c k f o r U P .
1 6 0 I F J O Y = 1 A N D X < 3 1 T H E N E T X 1 = X 1 + 1 : R E M C h e c k f o r R I G H T .
1 7 0 I F J O Y = 2 A N D X > 0 T H E N E T X 1 = X 1 - 1 : R E M C h e c k f o r E F T .
1 8 0 P R I N T A T Y , X ; " “ : R E M O V E R P R I N T W I T H A S P A C E .
1 9 0 P R I N T A T Y 1 , X 1 ; " 0 ” : R E M P U T ' 0 ' B A C K I N N E W P O S I T I O N .
2 0 0 E T X = X 1 : E T Y = Y 1 : R E M R e s e t o l d v a l u e s .
2 1 0 G O T O 1 2 0 : R E M o o p r o u n d a n d d o i t a g a i n .
Note only four directions are used but the other four could be used
by adding mor e IF JOY... statements. Fire could also be incor-
porated by checking whether the value JOY is greater than 16 and
if it is then the fire button is pressed.
DK T R ON I C S L im ite d
Shire Hill Industrial Estate
Saffron Walden,
Essex. Cb11 3AQ
INSTRUCTIONS FOR
Games
Player
W A R N I N G
ENSURE THAT YOUR SPECTRUM POWER
SUPPLY IS DISCONNECTED WHEN YOU
A T T A C H O R R E M O V E Y O U R
G A M E S
P L A YE R
INTERFAC E. FAIL URE T O D O
THIS MAY RESULT IN DAMAGE TO THE
I N T E R F A C E O R Y O U R S P E C T R U M .

INSTRUCTIONS FOR USING YOUR
DK'TRONICS GAMES PLAYER
If you are going to be using a joystick with a program then insert it
into the port on top of the interface before connecting to the back
of your Spect rum . Pl ug t he GAMES P AY ER ont o t he back of
you r S pect rum or a thro ugh con nec tor l ik e th at from o ther
DK'Tronics interfaces or interface 1. Now switch on the Spectrum
by inserting the power supply lead.
The GAMES P AYE R can be used with or wit hout a joystick to
'freeze' or slow your gam es. I f you have a joyst ick t hen the
interface will simulate the Kempston type joystick (IN 31) and
allow you to use a vast array of software already available. Once
you ha v e set u p you r com p u te r an d int erf ace , l oa d up y our
Software and enjoy the benefits of a superb joystick interface and
you set the speed of play!
HOW TO CONTROL THE SPEED OF YOUR PROGRAMS.
Set the switch into the left position and rotate the knob completely
anti-clockwise. The computer will now run any software at normal
speed without any slowing down of the computer. Now press the
switch to the right position. This now enables you to control
the speed. A s you turn t he knob i n a c lockwis e direc tion the
computer will get slower and slower. When the knob is completely
rotated clockwise then the computer will almost stop! In this way
you can control the speed of your game as you like it.
If you want to play most of a game at normal speed but need to
slow the computer down at a crucial moment, then, with the switch
set to the right, rotate the knob to set the speed you require. Then
move the switch to the left and play the game at the normal speed.
When you need to slow down the game, quickly move the switch to
the right and the computer will slow down to the speed you had
previously set and you can play the difficult section slowly.
USING THE JOYSTICK IN YOUR OWN PROGRAMS.
The joystick part of the interface can be used as a simple joystick
interface in your own programs using the IN 31 command. Set up
the joystick an d GAMES P A YER as above, then type in the
following short program:
10
20
30
PRINT IN 31
INPUT INKEY$=”Y”
GOTO 10
First you will see a line of noughts and as you move the joystick in
the 8 possible directions the number will change. If you press the
fire button then yet another number comes up on the screen.
Below is a list numbers which are returned for the tour directions
and fire:
0=
oystick
i n c e n t r a l
p o s i t i o n .
1 =
oystick r i g h t .
2 =
oystick l e f t .
4 =
oystick down.
8 =
oystick up.
16 =
Fire button pressed.
the number returned is the sum of the two separate directions. If
the button is pressed also then the number returned has 16 added.
For example a value of 26 would mean 16 for fire button pressed, 8
for up and 2 for left.
In machine code the individual directions can be sampled separately
LD BC ,31
;
(decimal)
I N A,(C )
;read value into accumulator
BIT 0,A
;sample first bit.
R NZ,RIGHT
;if it is set (not 0) then right is pressed.
In this mo e
BIT 0 = RIGHT
BIT 1 = LEF T
BIT 2 = DOWN
BIT 3 = UP
BIT 4 = FIR E