Re: A86: multiple keys


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

Re: A86: multiple keys




At 11:34 PM 4/4/99 EDT, you wrote:
>here is the 82 code
>
>Loop:
>   MULTI_KEY(KEY_21)
>   CALL_Z(2ndPressed)
>   MULTI_KEY(KEY_22)  ; See if user is wanting to quit
>   CALL_Z(Exit)
>   MULTI_KEY(KEY_26)  ; Right arrow on 82 (same for 86?)
>   CALL_Z(RightPressed)
>   jr Loop
>
>change MULTI_KEY(KEY_21) to call MULTI_KEY(KEY_21)


Oops!  My mistake, it is supposed to be Multi_Key(KEY_21), etc. (NOT in all
caps!)

Multi_Key(addr) is a macro...not a function.  Calling the function MULTIKEY
directly is a fatal mistake!!!!!!!!  You first have to load the address
into bc.  The macro makes sure that only the flags are destroyed.  Use the
macro Multi_Key and don't call the function.




>and just CALL_Z(2ndPressed) to jp z, 2ndPressed

CALL_Z(2ndPressed) is equal to call z, 2ndPressed...not jp z, 2ndPressed.
A jp won't return.

>the code in MULTI_KEY looks like it will work but i havent recompiled it yet

The 82, 83, 85, and 86 keypad ports all use the same format, thus the
routine should work without changing it a single bit (nice pun, not
intended).  I was just using 82 CALLs and JUMPs.


        Thomas J. Hruska -- shinelight@detroit.crosswinds.net
Shining Light Productions -- "Meeting the needs of fellow programmers"
         http://www.geocities.com/SiliconValley/Heights/8504
                    http://click-on.to/shinelight




References: