[A89] Re: _rowread()


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

[A89] Re: _rowread()




INT_HANDLER int1 = GetIntVec(AUTO_INT_1);

SetIntVec(AUTO_INT_1,DUMMY_HANDLER);

... do code here (like GrayOn(), etc...)

// DO NOT EXIT THE PROGRAM WITHOUT DOING THAT OR THE CALC WILL BECOME
UNUSABLE!!!!
SetIntVec(AUTO_INT_1,int1);

John David Ratliff
jdratlif@cs.indiana.edu

-----Original Message-----
From: assembly-89-bounce@lists.ticalc.org
[mailto:assembly-89-bounce@lists.ticalc.org]On Behalf Of Nick Peaden
Sent: Thursday, June 28, 2001 4:59 PM
To: assembly-89@lists.ticalc.org
Subject: [A89] Re: _rowread()



Scott Noveck wrote:

> > is the _rowread() function the only way to get keyboard input if auto
int
> 1
> > is disabled?
>
> Yes
>
> > can someone please give me
> > an explanation of how to properly use _rowread()?
>
> Look at the TIGCC docs for kbd.h.  Scroll down toward the bottom and
you'll
> see a pair of tables (you want the big ones that say Column on top, not
the
> small ones with arrow keycodes).
>
> Now, say you're looking for a certain key (I'll use the 89's Enter as an
> example) -- you want to input the "mask out" that key's bit in the "row".
> That means that you want a word (two bytes) in which every bit BUT the bit
> for that row is set.  Just use this formula to get that, where x is the
> number of the row bit corresponding to that key (2 for 89's Enter):
>
> ~((short)(1<<x)
>
> after calling _rowread() with this input, you'll get back a byte.  This
byte
> has 8 bits, each of which corresponds to the number of a key's "column"
> within that "row".  89's Enter is in row zero, so you want to check if bit
> zero of the output is set.  To do this, mask out all the other bits.
You'll
> want a binary AND of the output with (1<<x), where x here is the column.
>
> In summary, use this formula:
>
> _rowread(~((short)(1<<r)))&(1<<c)
>
> where r and c are the row and column of the key you're looking for in that
> table.  It'll return true if they key is down, false if it is up.
>
>     -Scott

How do you disable Auto Int 1 and fill in with a dummy handler so I can
still
use gray scale?






Follow-Ups: References: