Skip to content

Instantly share code, notes, and snippets.

@podstawek
Created October 24, 2021 15:20
Show Gist options
  • Save podstawek/42fbc3e773a88b4764e8799048e1ba25 to your computer and use it in GitHub Desktop.
Save podstawek/42fbc3e773a88b4764e8799048e1ba25 to your computer and use it in GitHub Desktop.
* makes beeps
ORG $300
LDA #$FF
STA FREQ
LDA #$80
STA PLSWIDTH
PLAY LDA $C030
LDY PLSWIDTH
PULSE DEY
BNE PULSE
LDA $C030
LDX FREQ
COUNTDN DEX
BNE COUNTDN
JSR READKB
JMP PLAY
FREQ EQU $350
PLSWIDTH EQU $352
INCR INC FREQ
RTS
DECR DEC FREQ
RTS
PULSEINC DEC PLSWIDTH
INC FREQ
RTS
PULSEDEC INC PLSWIDTH
DEC FREQ
RTS
READKB LDA $C000
STA $C010
CMP #$88
BEQ INCR
CMP #$95
BEQ DECR
CMP #$C1
BEQ PULSEINC
CMP #$DA
BEQ PULSEDEC
RTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment