Product specifications

CALL VDINPT ;Read sprite X coord from VRAM and
LD H,C ;place into register H
POP BC ;Retrieve old BC Register pair
RET ;Return to calling routine
Joystick and keyboard control – Introduction
5.1
On the MTX series computers, the joystick (left hand side), is mapped onto the cursor
keys and home key as shown below.
Cursor left Joystick left
Cursor right Joystick right
Cursor up Joystick up
Cursor down Joystick down
Home key Fire key
What this effectively means is that if you wish to manipulate the joystick ports and
read joystick data, you can dispense with having to look at the joystick ports and
simply scan the keyboard for the corresponding cursor results.
This is a very simple process to perform but it does have what may be a disadvantage
in some applications in that it cannot detect multiple key presses at the same time.
However, this can be done by performing a strobe across selected lines of the
keyboard, and then reading the results directly from the read lines as described in
sections 5.2 and 5.3 by by-passing the operating systems. ‘GET A CHARACTER’
routine.
The sense lines and read lines for the keyboard on the MTX are tied into the same
port. This is port 5.
An output to this port is interpreted as a sense byte
An input from this port is interpreted as a read byte
An important point to realise is that the sense lines and read lines are active on bit
low. That is key presses across the keyboard matrix are indicated by 0,s rather than
1,s.
The difficult part of writing a routine to perform keyboard scanning is selecting the right
values to output along the sense lines of the keyboard, and knowing which lines to
look at when examining the value returned from the read lines.
In both code options described in section 5.2 and 5.3 the correct scan values have
already been worked out for the cursor keys. If however, you wish to create your won
keyboard scan routines to look at other keys, the correct values can be obtained by
reading appendix D (keyboard layout), and appendix E (keyboard scan values).