Re: A92: Re: Testing Keypresses


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

Re: A92: Re: Testing Keypresses




>>The ONLY way BEQ would be changing the program counter is if the Z (zero)
>>bit of the CCR is set.  TST sets the Z bit only if the operand is zero.
>
>Yeah, but BNE (branch if Z=0) just exits immediately, even if I move a 0
>into KEY_PRESSED FLAG (which I assume is accomplished through something
>along the lines of move.w #0,KEY_PRESSED_FLAG)


If you use a BEQ (branch when Z) and have set KEY_PRESSED_FLAG to 0, you
should have it loop back to the label.

>How big -is- the flag, anyway?  (b/w/l?)

Which?  KEY_PRESSED_FLAG?

>>I would check your KEY_PRESSED_FLAG.  It must not be getting set to a non-
>>zero state.
>
>Do I have to handle that myself?  I assumed that that was handled by a
>keyboard interrupt driver of some sort...should I just check the getkey
>code instead?  That's a word, right?


Oh, I understand.  I have never heard of KEY_PRESSED_FLAG before.  I had
thought it was something you were handling.  If you are only interested
in a keypress and do not need to "process" anything, use flib::idle_loop.
It returns the key code in D0 (look in the TI92 manual for key codes).
But it is obvious that this KEY_PRESSED_FLAG is NOT being set.  Read up
on it again.  Make sure you haven't forgot to call something.

====
Aaron Hill (Redmond, WA)
E-Mail: SeracOhw24@msn.com
IRC-Nick: Serac (EF-Net) (was SeracOhw)




Follow-Ups: