Re: A86: port 1 keyloop
[Prev][Next][Index][Thread]
Re: A86: port 1 keyloop
When doing "bit 6,a", it will return 1 if that key (Exit) was pressed.
Therefore, you need to do "jp nz,game_over" instead of "jp
z,game_over". That way, you test to see if the key was pressed. The
code you gave probably went straight to game_over every time, regardless
of the key pressed.
Rick IRC: RomDump
compwiz1@usa.net
http://www.angelfire.com/ga/ti86
> > JBrett wrote:
> >
> > WHAT IS WRONG WITH THIS KEYLOOP?!?
> > main_keyloop:
> > ld a,%01111110
> > ; out (1),a
> > ; nop
> > ; nop
> > ; nop
> > ; nop
> > ; in a,(1)
> > ; bit 3,a
> > ; jp z,move_up
> > ; bit 2,a
> > ; jp z,move_right
> > ; bit 1,a
> > ; jp z,move_left
> > ; bit 0,a
> > ; jp z,move_down
> > ld a,%00111111
> > out (1),a
> > nop
> > nop
> > nop
> > nop
> > in a,(1)
> > bit 6,a
> > jp z,game_over
> > ; bit 5,a
> > ; jp z,block_test
> > jp main_keyloop
> > --------------
> > Jbrett
> > tbarwick@esn.net
> > http://ww2.esn.net/~tbarwick
References: