[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sound-makes only one click?
Steve Mentzer writes ...
>
> >8500:LDA $C036
> >8502:JMP $8500
>
> You are on the right track. But you are missing a couple of things.
>
> #1 - Sound is produced on the a2 speaker by peeking and poking at the speaker
> port repeatedly. Different rates of "reading/writing" will vary the tone.
>
> #2 - I think you need to do a STA $CO36 as well. If I remember correctly,
> reading pushed the speaker cone out, while storing a value retracted the
> speaker cone. I could be wrong (and I propably am).
Accessing the address-- like via an STA $C036 (e.g. 8D 36 C0) or an
LDA $C036 (e.g. AD 36 C0)-- will toggle the status of the cone. So,
repeated AD 36 C0 accesses would be okay.
> #3 - Doing a tight loop like the one above will only yield tones that a dog
> might be able to hear. remember that your computer operates at 1Mhz.
> Discounting overhead issues, the above code would cycle 250,000 times a second
> (assuming LDA and JMP [direct] consume 2 cycles each, which may be wrong). That
> is 250khz, which to my knowledge is MUCH beyond the range of human hearing.
>
....
Yes; assuming a very good tweeter, this would be why a tight loop
with no delay between accesses would seem to produce no sound (unless
you're a moth, perhaps). In the case of the speaker inside the Apple II,
the cone is going to be virtually motionless at such a high frequency.
Rubywand