A83: wait 'til no key is pressed


[Prev][Next][Index][Thread]

A83: wait 'til no key is pressed




Hello,

I (a new guy in ASM) am about to write a (the 1st?) chat program in asm.
Sometimes I use wait_clear written by myself. I want to wait until clear is
pressed. But I also want to wait until the key is released:

wait_clear:
 ld a,0ffh
 out (1),a
 ld a,0fdh
 out (1),a
 in a,(1)
 cp 191
 jr nz,wait_clear
wait_no_clear_pressed:
 ld a,0ffh
 out (1),a
 ld a,0fdh
 out (1),a
 in a,(1)
 cp 191
 jr z,wait_no_clear_pressed
 ret

But the 2nd part of this routine does not work (as long as clear is pressed
the routine should repeat). I don't want to use _getkey because this is only
an example and I handle 2nd and ALPHA presses myself. Is there a general
routine that waits until no key is pressed (every key)? I cannot find
anything about it in asmguru and other docs.