A86: Re: _getkey
[Prev][Next][Index][Thread]
A86: Re: _getkey
Read the keys section at 86 Central (http://ti86.acz.org/) for further
clarification.
[cut]
a.. _getky - Poll's for a keypress and returns the row/column code in OP2
(floating point value). The key code diagram is in the TI-86 manual. For
more information, check out TI's Reading Keypresses on the TI-86. The
disadvantages are that the calculator runs at full speed and that sucks the
battery life out of the 86. This was also called GET_KEY on the TI-85, and
many programs use that name. The name GET_KEY and the key codes (K_UP,
K_ENTER, K_2ND, etc.) are defined in asm86.h. This is the routine to use to
detect 2nd and Alpha without having to read the ports directly.
b.. _getkey - Enters into low power mode and waits for a key press or for
APD (Auto Power Down). It returns the actual keypresses in the a register.
For more information, check out TI's Reading Keypresses on the TI-86. The
disadvantages are that the calculator has the down-left bug. This the same
input routine that used by the ROM most of the time. It handles 2nd, alpha
and the contrast changing internally. I have had some problems using this
routine, and I prefer to use _getky. But this is the only routine to
handle APD and the other functions.
c.. Using port #1 - By far the most efficient, if you want a key press all
you have to do is write one byte and read one byte. The whole program does
not stop waiting for the keypress either. Read below to find out how to do
this. Reading the ports directly is the only way to detect multiple
keypresses, which is essential to programming many games.
[end cut]
Btw, the reason I or other people mention sites is NOT just to plug the
site, but to offer a more complete reference. It's alot easier to write a
comprehensive HTML tutorial and refer people to it than it is to try to
explain it fifty times...
--
David Phillips <david@acz.org>
http://www.acz.org/
----- Original Message -----
From: <BlAsTo1414@aol.com>
To: <assembly-86@lists.ticalc.org>
Sent: Saturday, January 23, 1999 3:30 PM
Subject: A86: _getkey
>
>can anyone send me the key commands for the _getkey routine(or the _geycode
>rountine) I am writing the menu commands for chips86 but asm studio keeps
>coming up with errors with my keys. I am using the following code:
>menugetkey:
> call _getcode
> cp K_EXIT
> jr z,Exit
> cp K_ALPHA
> jr z,game
> cp K_MORE
> jr z,levels
> cp K_DEL
> jr z,newgame
> cp K_XVAR
> jr z,highscores
> jr menugetkey
>
>if these are wrong can someone send me the right ones?
>
>Thanks,
>BlAsTo1414
>
>