mirror of
https://github.com/ksherlock/morse-gs.git
synced 2024-06-17 04:29:46 +00:00
enable/disable the osc. instead of futzing with the volume.
this guarantees it will always start/end near $80 ending is handled via one-shot mode and letting it expire.
This commit is contained in:
parent
85bf488bd1
commit
9c6e9fb850
85
morse.s
85
morse.s
|
@ -79,6 +79,7 @@ cmdline
|
||||||
]c equ 4
|
]c equ 4
|
||||||
|
|
||||||
mx %00
|
mx %00
|
||||||
|
* brk $ea
|
||||||
; x:y is command line ptr.
|
; x:y is command line ptr.
|
||||||
sty 0
|
sty 0
|
||||||
stx 2
|
stx 2
|
||||||
|
@ -96,6 +97,7 @@ cmdline
|
||||||
lda 0
|
lda 0
|
||||||
ora 2
|
ora 2
|
||||||
beq :eof2
|
beq :eof2
|
||||||
|
lda #0 ; clear b accumulator for tax.
|
||||||
|
|
||||||
* skip past first word of command line.
|
* skip past first word of command line.
|
||||||
sep $20
|
sep $20
|
||||||
|
@ -166,15 +168,22 @@ start
|
||||||
|
|
||||||
lda #$a0
|
lda #$a0
|
||||||
sta >SoundAddr
|
sta >SoundAddr
|
||||||
lda #%0000_0_00_0 ; free-run, enabled
|
lda #%0000_0_00_1 ; free-run, disabled
|
||||||
sta >SoundData
|
sta >SoundData
|
||||||
lda #%0001_0_00_0 ; free-run, enabled
|
lda #%0001_0_00_1 ; free-run, disabled
|
||||||
sta >SoundData
|
sta >SoundData
|
||||||
lda #%0000_0_00_0 ; free-run, enabled
|
lda #%0000_0_00_0 ; free-run, enabled
|
||||||
sta >SoundData
|
sta >SoundData
|
||||||
lda #%0001_0_00_0 ; free-run, enabled
|
lda #%0001_0_00_0 ; free-run, enabled
|
||||||
sta >SoundData
|
sta >SoundData
|
||||||
|
|
||||||
|
* volume, again.
|
||||||
|
lda #$40
|
||||||
|
sta >SoundAddr
|
||||||
|
lda #$ff
|
||||||
|
sta >SoundData
|
||||||
|
sta >SoundData
|
||||||
|
|
||||||
|
|
||||||
* trigger the timing oscillator.
|
* trigger the timing oscillator.
|
||||||
lda #$a0+timer_1
|
lda #$a0+timer_1
|
||||||
|
@ -250,11 +259,12 @@ sound_irq
|
||||||
|
|
||||||
sep $30
|
sep $30
|
||||||
bcc :off
|
bcc :off
|
||||||
lda _on
|
* lda _on
|
||||||
bne :trigger1
|
* bne :trigger1
|
||||||
ldx #$ff
|
* ldx #$ff
|
||||||
stx _on
|
* stx _on
|
||||||
jsr setvolume
|
jsr beep_on
|
||||||
|
* jsr setvolume
|
||||||
|
|
||||||
if border_color
|
if border_color
|
||||||
lda >$e0c034 ; white border
|
lda >$e0c034 ; white border
|
||||||
|
@ -271,9 +281,10 @@ sound_irq
|
||||||
|
|
||||||
:off
|
:off
|
||||||
* turn off sound generators.
|
* turn off sound generators.
|
||||||
stz _on
|
* stz _on
|
||||||
ldx #0
|
* ldx #0
|
||||||
jsr setvolume
|
* jsr setvolume
|
||||||
|
jsr beep_off
|
||||||
if border_color
|
if border_color
|
||||||
lda >$e0c034 ; black border
|
lda >$e0c034 ; black border
|
||||||
and #$f0
|
and #$f0
|
||||||
|
@ -337,6 +348,38 @@ sound_irq
|
||||||
clc
|
clc
|
||||||
rtl
|
rtl
|
||||||
|
|
||||||
|
beep_on
|
||||||
|
mx %11
|
||||||
|
lda _on
|
||||||
|
bne :rts
|
||||||
|
lda #$a0
|
||||||
|
sta >SoundAddr
|
||||||
|
lda #%0000_0_00_0 ; free-run, enabled
|
||||||
|
sta >SoundData
|
||||||
|
lda #%0001_0_00_0 ; free-run, enabled
|
||||||
|
sta >SoundData
|
||||||
|
inc _on
|
||||||
|
** volume.
|
||||||
|
* lda #$40
|
||||||
|
* sta >SoundAddr
|
||||||
|
* lda #$ff
|
||||||
|
* sta >SoundData
|
||||||
|
* sta >SoundData
|
||||||
|
:rts rts
|
||||||
|
|
||||||
|
beep_off ; changes to one-shot mode so it will expire at the end of the sample
|
||||||
|
mx %11
|
||||||
|
lda _on
|
||||||
|
beq :rts
|
||||||
|
lda #$a0
|
||||||
|
sta >SoundAddr
|
||||||
|
lda #%0000_0_01_0 ; one-shot, enabled
|
||||||
|
sta >SoundData
|
||||||
|
lda #%0001_0_01_0 ; one-shot, enabled
|
||||||
|
sta >SoundData
|
||||||
|
stz _on
|
||||||
|
:rts rts
|
||||||
|
|
||||||
setvolume
|
setvolume
|
||||||
mx %11
|
mx %11
|
||||||
lda #$40
|
lda #$40
|
||||||
|
@ -499,7 +542,7 @@ init
|
||||||
sta >SoundAddr+1
|
sta >SoundAddr+1
|
||||||
|
|
||||||
ldx #0
|
ldx #0
|
||||||
]loop lda beep,x
|
]loop lda beep_f5,x
|
||||||
sta >SoundData
|
sta >SoundData
|
||||||
inx
|
inx
|
||||||
bne ]loop
|
bne ]loop
|
||||||
|
@ -532,7 +575,7 @@ init
|
||||||
* pcm = [128 + round(127 * sin(n*xx)) for n in range(0,256)]
|
* pcm = [128 + round(127 * sin(n*xx)) for n in range(0,256)]
|
||||||
|
|
||||||
|
|
||||||
beep
|
beep_b5
|
||||||
hex 809fbcd5eaf8fefef5e6d1b6997a5b3f
|
hex 809fbcd5eaf8fefef5e6d1b6997a5b3f
|
||||||
hex 26130601030d1e344f6d8cabc7def0fb
|
hex 26130601030d1e344f6d8cabc7def0fb
|
||||||
hex fffbf0dec7ab8c6d4f341e0d03010613
|
hex fffbf0dec7ab8c6d4f341e0d03010613
|
||||||
|
@ -550,6 +593,23 @@ beep
|
||||||
hex 0105102239557493b1cce2f3fdfffaed
|
hex 0105102239557493b1cce2f3fdfffaed
|
||||||
hex dac1a586674a2f1a0b020208162b4461
|
hex dac1a586674a2f1a0b020208162b4461
|
||||||
|
|
||||||
|
beep_f5
|
||||||
|
hex 8096abbfd1e0edf6fdfffef9f0e4d5c4
|
||||||
|
hex b19c86705b473424160c050102060d18
|
||||||
|
hex 26374a5e74899fb3c7d8e6f1fafefffc
|
||||||
|
hex f5ebdecebca8937d67523f2d1e110803
|
||||||
|
hex 010308111e2d3f52677d93a8bccedeeb
|
||||||
|
hex f5fcfffefaf1e6d8c7b39f89745e4a37
|
||||||
|
hex 26180d060201050c162434475b70869c
|
||||||
|
hex b1c4d5e4f0f9fefffdf6ede0d1bfab96
|
||||||
|
hex 806a55412f20130a03010207101c2b3c
|
||||||
|
hex 4f647a90a5b9ccdceaf4fbfffefaf3e8
|
||||||
|
hex dac9b6a28c77614d39281a0f06020104
|
||||||
|
hex 0b15223244586d8399aec1d3e2eff8fd
|
||||||
|
hex fffdf8efe2d3c1ae99836d5844322215
|
||||||
|
hex 0b040102060f1a28394d61778ca2b6c9
|
||||||
|
hex dae8f3fafefffbf4eadcccb9a5907a64
|
||||||
|
hex 4f3c2b1c10070201030a13202f41556a
|
||||||
|
|
||||||
noise
|
noise
|
||||||
hex 6c917262a488987a82a7895966a7589e
|
hex 6c917262a488987a82a7895966a7589e
|
||||||
|
@ -841,5 +901,6 @@ _buffer ds 256
|
||||||
|
|
||||||
sav morse.l
|
sav morse.l
|
||||||
* lst on
|
* lst on
|
||||||
|
typ exe
|
||||||
sym
|
sym
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user