[Coco] More stupid questions about sound

K. Pruitt pruittk at roadrunner.com
Fri Dec 25 07:48:58 EST 2015


First, Merry Christmas everybody. Hope it's a great day for you and yours.

Okay, quick and dirty code to make a high-pitched tone:

lda   #$1
ldb   #$98
ldx   #$1464
ldy   #$FA0
os9  I$SetStt
clrb
os9   F$Exit

Works fine. However, If I run that several times in a row it will not
produce a tone of the same duration. It's pretty much 1 short tone to 4 long
tones. The pattern repeats quite reliably. I've noticed this same thing
when using the Alarm call.

Is this an issue resulting from the way I am doing it, or is there an issue
with how I$SetStt/SS.Tone calls are being handled by the SndDrv or even
somewhere deeper?

I'm looking at the source for SndDrv but much of it is over my head. I can
see how the bell is handled differently and I can see how the PIA is being
manipulated. But something that sticks out to me is the comment: "* Note:
G.TnCnt is counted down by vtio at 60hz." Is this countdown in any way
capable of shutting down the duration of an SS.Tone call coming from
I$SetStt?  I haven't dug in to vtio yet. That's next.








More information about the Coco mailing list