Keyboard management

Please note that joystick will work too if you use theses primitives because telemon traps joystick too.

Waiting to  key

  1. .include "telestrat.inc"
  2. ; set the header
  3. @loop:
  4.   BRK_TELEMON XRD0
  5.   bcc key_pressed
  6.   jmp loop
  7. @key_pressed:
  8. ; At this step A contains ASCII Key pressed

Trying to find key pressed

  1. .include "telestrat.inc"
  2.  
  3. ; set the header
  4. @loop:
  5.   BRK_TELEMON XRD0 ; Reads keyboard
  6.   bcc key_pressed  ; waiting for a key pressed
  7.   jmp @loop        ; no key pressed, loop
  8. @key_pressed:
  9.   ; At this step A contains ASCII Key pressed
  10.   cmp #27         ; is it ESC
  11.   bne @not_esc     ; it's not key pressed