https://sta.c64.org/cbm64krnfunc.html
https://www.youtube.com/watch?v=wAo4dePJaCE Maus in Basic
https://www.chibiakumas.com/6502/platform3.php#LessonP30
assembly
SID_VOL = $d418
V1_FREQ_LO = $d400
V1_FREQ_HI = $d401
V1_CONTROL = $d404
V1_ADSR1 = $d405
V1_ADSR2 = $d406
* = $c000 ; Start address in memory
start:
lda #15 ; Set max volume
sta SID_VOL
lda #$c5 ; Frequency low byte
sta V1_FREQ_LO
lda #$28 ; Frequency high byte
sta V1_FREQ_HI
lda #$09 ; Attack/Decay (fast attack)
sta V1_ADSR1
lda #$00 ; Sustain/Release
sta V1_ADSR2
lda #$21 ; Sawtooth wave + Gate ON (Bit 0 = Gate)
sta V1_CONTROL
rts ; Return to BASIC or monitor