2020-12-27 01:22:18 +00:00
|
|
|
%import textio
|
2021-02-21 15:22:44 +00:00
|
|
|
%zeropage dontuse
|
2021-02-15 16:47:48 +00:00
|
|
|
%option no_sysinit
|
2020-12-08 00:02:38 +00:00
|
|
|
|
2020-12-08 21:54:20 +00:00
|
|
|
main {
|
2020-12-21 23:59:07 +00:00
|
|
|
|
2021-02-21 00:24:44 +00:00
|
|
|
; $1F9C0 - $1F9FF PSG registers
|
|
|
|
|
2021-01-13 21:32:17 +00:00
|
|
|
sub start() {
|
2021-02-21 22:41:50 +00:00
|
|
|
cx16.set_rasterirq(&irq.irq, 100)
|
|
|
|
;cx16.set_irq(&irq.irq, true)
|
2021-02-21 21:17:28 +00:00
|
|
|
sys.wait(100)
|
2021-02-21 22:41:50 +00:00
|
|
|
cx16.restore_irq()
|
2021-02-21 14:10:40 +00:00
|
|
|
|
|
|
|
; uword freq = 1181
|
|
|
|
; cx16.vpoke(1, $f9c0, lsb(freq))
|
|
|
|
; cx16.vpoke(1, $f9c1, msb(freq))
|
|
|
|
; cx16.vpoke(1, $f9c2, %11111111) ; volume
|
|
|
|
; cx16.vpoke(1, $f9c3, %11000000) ; triangle waveform
|
2021-01-10 14:15:00 +00:00
|
|
|
}
|
2020-08-27 17:47:50 +00:00
|
|
|
}
|
2021-02-20 02:06:00 +00:00
|
|
|
|
2021-02-21 21:17:28 +00:00
|
|
|
|
|
|
|
irq {
|
2021-02-21 22:41:50 +00:00
|
|
|
%option force_output
|
|
|
|
|
2021-02-21 21:17:28 +00:00
|
|
|
uword counter = 0
|
|
|
|
|
|
|
|
sub irq() {
|
2021-02-21 22:41:50 +00:00
|
|
|
cx16.vpoke(1, $fa00+6*2, lsb(counter))
|
|
|
|
cx16.vpoke(1, $fa01+6*2, msb(counter))
|
|
|
|
repeat 20 {
|
|
|
|
uword xx
|
|
|
|
repeat 16 {
|
|
|
|
xx++
|
|
|
|
}
|
|
|
|
cx16.vpoke(1, $fa00+6*2, 0)
|
|
|
|
cx16.vpoke(1, $fa01+6*2, 255)
|
|
|
|
repeat 16 {
|
|
|
|
xx++
|
|
|
|
}
|
|
|
|
cx16.vpoke(1, $fa00+6*2, 0)
|
|
|
|
cx16.vpoke(1, $fa01+6*2, 0)
|
|
|
|
}
|
2021-02-21 21:17:28 +00:00
|
|
|
counter++
|
|
|
|
}
|
|
|
|
}
|