A83: About Input again .. yet again
[Prev][Next][Index][Thread]
A83: About Input again .. yet again
"Hi everybody, I'm Dr. Nick"
I posted this message a couple of days ago and nobody answered. How can
I use the following routine to get simultaneus input from
DOWN_FRONT_Alpha or something like that....
Hi ...
I found the PaneJump (PlainJump) input routine that you seggeested and
it does work in the game. I don`t understand it though.
-----------------------------------------------------------
TestKeys:
push bc
ld a,$FE
out (1),a
in a,(1)
ld b,a
ld a,$BF
out (1),a
in a,(1)
or $0F
and b
pop bc
cp $FF
jp z,Redraw
TestLeftKey:
ld d,a
ld a,(SPEED)
ld e,a
bit 1,d
jr nz,TestRightKey
ld a,b
cp 2 ; X < 2 ?
jr c,TestRightKey ; yeah ==> cannot move left
dec b
ld a,e
cp 3
jr nz,TestRightKey ; if speed = 3, move 2 steps left
dec b
TestRightKey:
bit 2,d
jr nz,TestUpKey
ld a,b
cp 80 ; x >= 96-16 ?
jr nc,TestUpKey
inc b
ld a,e
cp 3
jr nz,TestUpKey
inc b
TestUpKey:
bit 3,d
jr nz,TestDownKey
ld a,e
cp 3
jr nc,TestDownKey
inc e
TestDownKey:
bit 0,d
jr nz,Test2ndKey
ld a,e
or a
jr z,Test2ndKey
dec e
Test2ndKey:
ld a,e
ld (SPEED),a
bit 5,d
jr nz,TestExitKey
ld a,(JUMPFLAG)
or a
jr nz,TestExitKey
inc a
ld (JUMPFLAG),a
TestExitKey: ; [MODE]
bit 6,d
jp z,PAUSE
TestPauseKey:
bit 7,d
jp z,LSaveGame
Redraw:
ld a,$FD
out (1),a
in a,(1)
and $40
jp z, GameOver
(C)1996/98 by Andreas Ess
-----------------------------------------------------------
How can I edit this code so that every keypress will lead to a label.
For example, I test for the left key and call a label "left", I test for
the left and Alpha key and it calls "Alpha_left" .
Is it possible ...
I'm thankful for any responses or comments...
homonerdicus
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com