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. .import toto
  3. ; set the header
  4. @loop:
  5.   BRK_TELEMON XRD0
  6.   bcc key_pressed
  7.   jmp loop
  8. @key_pressed:
  9. ; At this step A contains ASCII Key pressed
  10.  
  11. .byte 12
  12. .word addr
  13. .ifdef TOTO
  14. .endif
  15. .define

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