Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;reset controller port 1 (address $4016) by storing #$1000
- ;remember that loads and stores are done one byte at a time
- lda #$10
- sta $4016
- lda #$00
- sta $4016
- ;read button states, in order
- ;A, B, Start, Select, Up, Down, Left, Right
- ;jump to corresponding subroutine if button is pressed
- lda $4016
- and #1
- beq @ASkp
- jsr Pad1_A
- @ASkp:
- lda $4016
- and #1
- bne BSkp
- lda $4016
- and #1
- bne StartSkp
- lda $4016
- and #1
- bne SelectSkp
- lda $4016
- and #1
- bne UpSkp
- lda $4016
- and #1
- bne DownSkp
- lda $4016
- and #1
- bne LeftSkp
- lda $4016
- and #1
- bne RightSkp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement