Kempston - Kempston joystick and its application.

Faultless #08
Topic: Kempston and its application.

 Nowadays, many
domestic software products.IG-
ry, system programs, magazines and this is how
as they say, right!  But there's always
'But'.  Many respected people write their
programs using KEMPSTON
interface, and only some of them
implements its support correctly.
There is a feeling that these people are writing
program without being able to
check (I won’t name specifically
any names or names of groups).
For example XL-DESIGN, COOPER FEET and
other, no less famous groups,
correctly support KEMPSTON.  After all
how nice it is to press 'down' on Kempston,
get exactly what you wanted, not
other.   Therefore, if anyone wants
use this support
devices in their programs, without having
I can give you the opportunity to check it
some tips:
   1) First of all, you need to check for
availability
   device as such, otherwise it
maybe
   lead to unpleasant consequences
(imitation
   constantly pressed Kempston key)
Example:
   . . . .
   LD B,0 Check the port for
   stability, because work
   unstable kempston
   undesirable. LOOP IN A,(31)
   AND A
   JR NZ,KEMP_OFF
   DJNZ LOOP KEMP_OFF
   LD (KEMPSTON),A
   . . . . KEMPSTON DEFB 0 If the number is not
equal to zero,
   then Kempston is missing.
   2)I provide the correct bit encoding
Kempston.
   Direction Bit
   ------------------------
   Right ???00001
   Left ???00010
   Up ???00100
   Down ???01000
   Fire ???10000
   ------------------------
   3) Apply a general check for all
controlled keys:
   allocate space (1 byte). Let 1 bit
there will be
   responsible for moving to the right, 2nd
left, etc.
   When you press a key (not only
Kempston) bring
   bits according to numbering. B
in the end it is possible
   press up on the keyboard and left on
Kempstone
   and hero (arrow), etc.  there will be
move around
   diagonals. Food for thought:
   There is only ONE (1) standard
Kempston.
   This is port 31 (#1F)! And get your bearings
please
   only for him! And kill the #DF port in
himself
   embryo (meaning replacing it with
#1F),
   so that people don't get nervous
tick at
   trying to play humanly
game!
   Let's make quality ones
software products!
    PANDA/BIS/ETC/RUSH/ASM/97

Share your thoughts about the article