chipty5/sid.asm

53 lines
1.3 KiB
NASM

;
; SID registers
;
.virtual
_sid .struct
_sid_voice .struct
freq .word ?
duty .word ?
ctrl .byte ?
ad .byte ?
sr .byte ?
.endstruct
voice1 .dstruct _sid_voice
voice2 .dstruct _sid_voice
voice3 .dstruct _sid_voice
ffreq .word ?
fres .byte ?
volume .byte ?
potx .byte ?
poty .byte ?
osc3 .byte ?
env3 .byte ?
.endstruct
.endvirtual
PAL_CLOCK = 985248
NTSC_CLOCK = 1022727
sid_freq .sfunction freq, clock=PAL_CLOCK, int(freq*16777216/clock)
sid_duty .sfunction duty, int(duty*(1<<12))
SID_CTRL_NOISE = %1000_0000
SID_CTRL_PULSE = %0100_0000
SID_CTRL_SAWTOOTH = %0010_0000
SID_CTRL_TRIANGLE = %0001_0000
SID_CTRL_TEST = %0000_1000
SID_CTRL_RING = %0000_0100
SID_CTRL_SYNC = %0000_0010
SID_CTRL_GATE = %0000_0001
SID_RES_EXT = %0000_1000
SID_RES_V3 = %0000_0100
SID_RES_V2 = %0000_0010
SID_RES_V1 = %0000_0001
SID_FILTER_MUTE3 = %1000_0000
SID_FILTER_HIGHPASS = %0100_0000
SID_FILTER_BANDPASS = %0010_0000
SID_FILTER_LOWPASS = %0001_0000
; vim: syntax=64tass