Re: A83: sprites


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

Re: A83: sprites




Try something like this:

  ld hl,0
MainLoop:
  push hl       ; Push hl onto the stack because _getkey probably
KeyLoop:        ; changes it
  call _getkey  ; Wait for a key press
  cp kClear
  jr z,Exit     ; Exit is Clear is pressed
  cp kEnter
  jr nz,KeyLoop ; If Enter isn't pressed, wait for another key press
  pop hl        ; Get HL again
  inc hl        ; Increment it
  call _disphl  ; Display it
  jr MainLoop   ; Loop again

Exit:
  pop hl          ; Clear stack
  ret             ; Finish


I don't see why that shouldn't work.

== Original Message ==
>how can i increment the number in hl by one each time the user presses 
>enter.
>i already have the getkey code ready, but every time i press enter, the
>number changes to 19015??
>


James Vernon
james@calc.org
jimbob_v@hotmail.com
http://tcpa.calc.org/members/james/

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com