Last active
May 9, 2020 08:39
-
-
Save tomaes/9343651 to your computer and use it in GitHub Desktop.
another joystick test, bitwise, looped, with comments too (c64)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; minimal joystick test #3, 21 bytes loop version; @ = not set, A = set | |
* = $1000 | |
INIT LDY #8 ; init loop for checking all joystick port bits | |
LDA $DC00 ; load joystick port byte | |
LOOP PHA ; make a copy and put it on the stack | |
AND #1 ; least significant bit set? | |
STA $0400,Y ; put either 0 or 1 (poke code) on screen | |
PLA ; get joystick byte back from stack | |
LSR ; shift right to get next bit | |
DEY ; y = y - 1 | |
CPY #0 ; explicit test to have a correctly set zeroflag | |
BNE LOOP ; finished inner loop? | |
JMP INIT ; all bits checked. get a fresh load. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment