[A83] Re: Checking how long a key is pressed


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

[A83] Re: Checking how long a key is pressed



Aww man.. It's still doing the same thing as before, where it doesn't matter 
how much it is pressed, it still increases the number to the max. Here is the 
code that is not working as I wish it to:

var_set:                                      ; label that sets the 
increasing variable to be 10
  ld   a,10
  ld   (increasingvar),a
get_increase_amount:                 ; loop that checks for keypress
  ld   a,(increasingvar)
  cp   35                                     ; if increasingvar = 35, jump 
to analyze label
  jp   z,analyze_increased_amount
  inc  a                                       ; increase increasingvar
  ld   (increasingvar),a
  ld   a,kReset
  out  (1),A
  ld   a,Group7
  out  (1),A
  in   a,(1)
  cp   k2nd
  jr   z,get_height                         ; if 2nd is pressed, loop back 
and increase again
analyze_increased_amount:         ; we would end up here if 2nd wasn't pressed
(*stuff that analyzes*) 

What's wrong here? When I press 2nd, the number is automatically increased to 
35, no matter how much I press!

Thanks,
Colin Hart
darkfire139@aol.com
----------------------------------
> 
> 
>     ld    hl,0
> loop:
>     inc   hl
>     ld    a,$FF
>     out   (1),a
>     ld    a,[group]
>     out   (1),a
>     in    a,(1)
>     cp    [keyvalue]
>     jr    z,loop
>   [..analyze HL here..]
> 







Follow-Ups: