Product specifications

Joystick Manipulation (BASIC)
5.2
This section describes the basic code which will perform a keyboard strobe on cursor
left/right/up/down), and home.
100 LET SENSEBYTE=223 : OUT 5,SENSEBYTE
: LET READBYTE =INP(5)
110 IF READBYTE=127 THEN (firekey has been pressed)
120 LET SENSEBYTE=247 : OUT 5,SENSEBYTE
: LET READBYTE=INP(5)
130 IF READBYTE=127 THEN (cursor left has been pressed)
140 LET SENSEBYTE=129 : OUT 5,SENESBYTE
:LET READBYTE=INP(5)
150 IF READBYTE=127 THEN (cursor right has been pressed)
160 LET SENSEBYTE=251 : OUT 5,SENSEBYTE
: LET READBYTE=INP(5)
170 IF READBYTE=127 THEN (cursor up has been pressed)
180 LET SENSEBYTE=191 : OUT 5,SENSEBYTE
: LET READBYTE=INP(5)
190 IF READBYTE=127 THEN (cursor down has been pressed)
Joystick Manipulation (Assembler)
5.3
This section describes the machine code which performs the same task as the BASIC
described above.
The routine is called GETCHR and is relocatable. It requires no parameters on entry,
and will return the results of the keyboard strobe in a variable called KEYCHR
according to the table listed below.
No key pressed KEYCHR = 0
Cursor left Bit 0 set
Cursor right Bit 1 set
Cursor up Bit 2 set
Cursor down Bit 3 set
Home key Bit 4 set
This table assumes that bit 0 is the LSB, and bit 7 is the MSB.
;
GETCHR-USES VARIABLE ‘KEYCHR’
; NO PARAMETERS ON ENTRY REQUIRED
; AF AND HL REGISTERS AFFECTED ON EXIT
;
; ‘KEYCHR’ SET ACCORDING TO TABLE ABOVE
;
KEYCHR: DB 0 ;See description above
;