Re: A83: finally ...
[Prev][Next][Index][Thread]
Re: A83: finally ...
On 26-Apr-99, you wrote:
> Hi
> again
> Remember me... I while ago I was trying to make an input routine that read more than one key and in different groups ...... after a lot of copying from other people (credits ...... ) I have finally made it ....
> Here it is 2nd Alpha + Arrows simultaneousely ....
> in a simple well organised form
aAAAAAAAAAAAAAAAAAAAAAAAggh!
Sorry.
Why not:
ld a,dfh
out (1),a
in a,(1) ;alpha is bit 7
or 01111111b
ld l,a
ld a,bfh
out (1),a
in a,(1) ;2nd is bit 5
or 11011111b
and l
ld l,a
ld a,feh
out (1),a
in a,(1) ;arrow keys are in bits 0-3
or 11110000h
and l
ld l,a
cpl
Now you have bits 0-3 in l for the arrow keys, bit 7 for alpha and bit 5 for
2nd. You can check them like this:
bit 0,l
call nz,downpressed
bit 1,l
call nz,leftpressed
bit 2,l
call nz,rightpressed
bit 3,l
call nz,uppressed
bit 5,l
call nz,secondpressed
bit 7,l
call nz,alphapressed
(and that's the _unoptimized_ version...)
Linus
--
wwww
(o)(O)
.--> .-------mm--(__)--mm--------.
| Linus Akesson | http://linusworld.cjb.net |
`---------------^-- ----- --- -- -- - - - `---------ooO--Ooo----------'
Here I am. Now what are your other two wishes?
References: