RE: A86: Key Presses


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

RE: A86: Key Presses




Thanks for responding.  What should I define _getcsc as?  I couldn't find it
on the list in Assembly Studio (btw, is that the best thing to be using?)

Also, would you add a jr z,Exit after the cp K_EXIT?

When I try to compile I also get undefined errors for all the K_ statements.
Should I use kAdd, kSub, and kExit or am I doing something wrong?

-----Original Message-----
From: owner-assembly-86@lists.ticalc.org
[mailto:owner-assembly-86@lists.ticalc.org]On Behalf Of
ComAsYuAre@aol.com
Sent: Saturday, December 04, 1999 1:53 PM
To: assembly-86@lists.ticalc.org
Subject: Re: A86: Key Presses



If you don't want to read more than one key "at the same time", using
_getcsc
(same as _getky or _get_key) is much easier than the ports.

Waitkey:
  call _getcsc          ;get keypress in a
  cp K_PLUS
  jr z,ContrastUp
  cp K_MINUS
  jr z,ContrastDown
  cp K_EXIT
  jr nz,Waitkey


In a message dated 12/4/99 16:48:55 Eastern Standard Time, bryan_kam@usa.net
writes:

>     I'm a newbie at this and I'm having trouble reading multiple
keypresses.
>  I am reading the presses by writing to port 1 and reading from port 1 and
I
>  can read one key just fine, but I've heard that one can read more than
one
>  key press with the ports, but I am unsure how to do this.  Is reading the
>  port the best way to do this or is _getky or _getkey better?  I'm trying
to
>  let them press +, -, or exit.  Here's my code:
>
>  Getkeypress:
>      ld a,%01111101
>      out (1),a
>      nop
>      nop
>      in a,(1)
>      bit 1,a
>      jr nz, Getkeypress
>
>      After that code it goes on to something that will change the contrast
>  up, but I want to know how to make little routines for inc-ing the
contrast,
>  dec-ing the contrast, and ret-ing to the OS.
>      Am I making sense?



----
Jonah Cohen
<ComAsYuAre@aol.com>
http://linux.hypnotic.org/~jonah/



Follow-Ups: References: