0 Members and 1 Guest are viewing this topic.
ld c, 1WaitKey: ld a, $FF out (c), a ld a, $FD out (c), a nop nop in a, (c) bit 7, a jp nz, WaitKey ld a, $FF out (c), a ret
;you don't need to do the $FF thing ld a, $FD out (01), a ;once this is set, you don't have to reset it unless you change it ei ;this is for the haltswaitKey: halt ;this will lower battery usage (lol) and is roughly a 1/100 sec delay in a, (01) add a, a ;moves bit 7 into carry position jr c, waitKey halt ;this is known as debouncing, when keys are pressed, they often barely halt ; connect, disconnect, and then solidly reconnect halt ; without debouncing, you might accidentally press the button twice in a, (01) ; this is only needed in menus (and even then, it's optional) add a, a ; the .03 sec delay was rather arbitrary jr c, waitKey ret