Created
February 5, 2019 19:50
-
-
Save cheery/b7a209a18bc6ca9c5037a64845d198b9 to your computer and use it in GitHub Desktop.
C128 assembly program
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
. 1800 LDX #$00 # This clears the SID memory | |
LDA #$00 | |
STA $D400,X | |
INX | |
CPX #$29 | |
BNE $1804 | |
. 180C LDX #$0F # Set master volume | |
STX $D418 | |
LDX #$4F # Set attack/decay | |
STX $D405 | |
LDX #$08 # Set duty cycle high byte | |
STX $D403 | |
LDX #$00 # Set frequency high byte. | |
STX $D401 | |
LDX #$41 # Pulse, gate on | |
STX $D404 | |
. 1825 LDA $D012 # Vertical refresh wait | |
CMP #$FF | |
BNE $1825 | |
CLC # Add to frequency | |
LDA #$03 | |
ADC $D400 | |
LDA #$00 | |
ADC $D401 | |
STA $D401 | |
CMP #$F0 # If frequency not tapped, blah. | |
BPL $1825 | |
LDA #$0B # Shorten decay for the last. | |
STA $D405 | |
. 1846 LDX #$00 | |
. 1848 LDA $D012 # Vertical refresh wait again. | |
CMP #$FF | |
BNE $1848 | |
INX | |
CPX #$20 | |
BNE $1848 | |
BRK | |
J F1800 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment