A89: Re: Keypad detection


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

A89: Re: Keypad detection




> > and sometimes when a lot of keys in the vicinity of the 9 key is pressed
>
> Here is the explanation to this, from IO-ports.txt :

FYI, that is quote is truthful, but it's not the correct explanation for
this guy's problem.  I don't like having to "shout," but I got an
overwhelmingly thankful response the last time I did this:

IF YOU WANT TO READ FROM THE KEYBOARD PORT DIRECTLY, YOU MUST ALWAYS DISABLE
AUTO-INTERRUPT ONE WHEN DOING SO!  FAILURE TO DO SO WILL CAUSE THE MASK
WRITTEN TO ($600019) TO BE REPLACED BY TIOS, AND THE OUTPUT WILL BE
INCORRECT!

There are two options here - turn off int 1 at the beginning of the program
and keep it off for the duration, or disable it right at the start of the
key reading and enable it once again right after.  The first is obviously
preferable.

Well, you don't really have to kill int 1 - that would cause anything you
want in there, such as grayscale, to screw up.  Instead, wipe int 1 at the
start of the program, install any interrupts you may want (synch, grayscale,
etc), and restore it upon the program's exit.

    -Scott




Follow-Ups: References: