[A86] Re: Rom versions & key port


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

[A86] Re: Rom versions & key port



>> When leaving a program reading keypresses with ports the last pressed
>> key is also detected by the shell, can anything be done to avoid
>> this?

David Phillips> The easiest solution is to not exit until the key is released.


Another way is to clear the keyport and then call _get_key for the os vars to
get cleaned up:

 ld a,-1 ;(255) i think that will clear it
 out (1),a
 jp _get_key
;ret


-------------------------------------------------------------------------------------
Ricky Cobb III
arcadesdude@intercom.net
Google Answers Researcher
http://answers.google.com/
When you're searching for information, Google Answers.
---------------------------------------------------
My Personal Sites:
http://geocaching.port5.com/
http://tip.ti-programmers.com/
[IM]
msn arcadesdude@hotmail.com
aim  arcadesdude
y!     arcadesdude
icq   41440378


--------Original Message-------------
Sunday, January 26, 2003, 12:22:30 PM, you wrote:

David Phillips> Leif Åstrand writes:
>> _vputs ($3ae8 with rom version 1.6)
>> _getkey ($3e4e)

David Phillips> Do not depend on them being the same across ROM pages.

>> _cphlde ($0107)

David Phillips> If this routine is speed critical to your program, then include it locally:

David Phillips>  push hl
David Phillips>  or a
David Phillips>  sbc hl,de
David Phillips>  pop hl
David Phillips>  ret

David Phillips> There is a faster version, but it destroys the A register:

David Phillips>  ld a,h
David Phillips>  cp d
David Phillips>  ret nz
David Phillips>  ld a,l
David Phillips>  cp e
David Phillips>  ret

>> When leaving a program reading keypresses with ports the last pressed
>> key is also detected by the shell, can anything be done to avoid
>> this?

David Phillips> The easiest solution is to not exit until the key is released.

David Phillips> --
David Phillips> David Phillips <david@acz.org>
David Phillips> http://david.acz.org/




References: