A83: About Input again ..
[Prev][Next][Index][Thread]
A83: About Input again ..
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 2nd key and it calls "2nd_left" .
Is it possible ...
How does the bit command work exactly. I know how to use it for the
text_inverse thing, but here ? ..
I'm thankful for any responses or comments...
homonerdicus
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com