Skip to content

Instantly share code, notes, and snippets.

@podstawek
Created October 24, 2021 15:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save podstawek/11b19ee42d894691f38c718a539b6b33 to your computer and use it in GitHub Desktop.
Save podstawek/11b19ee42d894691f38c718a539b6b33 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