Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Labels
- PRA = $dc00 ; CIA#1 (Port Register A)
- PRB = $dc01 ; CIA#1 (Port Register B)
- ; main loop to detect keypresses
- keycheck
- lda #$7f ; test $DC00 bit row 7 ($7F)
- sta PRA
- lda PRB
- cmp #$fe ; key '1' pressed?
- beq playtune1 ; then play tune 1 routine
- cmp #$f7 ; key '2' pressed?
- beq playtune2 ; then play tune 2 routine
- ; now swap to different row!
- lda #$fd ; test $DC00 bit row 1 ($fd)
- sta PRA
- lda PRB
- cmp #$fe ; key '3' pressed?
- beq playtune3 ; then play tune 3 routine
- jmp keycheck
- ;routines to play each tune after keypress detection
- playtune1
- lda #$00 ; set tune 1
- jsr music+$00 ; reinitialise player
- jmp keycheck ; back to keycheck loop
- playtune2
- lda #$01 ; set tune 2
- jsr music+$00 ; reinitialise player
- jmp keycheck ; back to keycheck loop
- playtune3
- lda #$02 ; set tune 3
- jsr music+$00 ; reinitialise player
- jmp keycheck ; back to keycheck loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement