[Coco] PCM + joystick

Roger Taylor operator at coco3.com
Fri Jan 11 03:04:45 EST 2008


My latest trick... and I hope it works...  sneaking in a joystick 
poll when the time is best while the 4-voice music and sound effects 
are playing.

How?... Mostly only sample the joystick if the last PCM sample was 
128 (the BIAS level (center/0 volts).  This will reduce the distance 
between output samples and comparitor samples by half.  If a 128 PCM 
byte doesn't occur (which translate to never or not enough), always 
fall through to the 256-byte counter/timer and sample only when the 
counter wraps around to 0 again.  This means 256 HSYNCs of time per 
forced joystick sample no matter what the last PCM voltage was 
(*except* 0 volts).  Keep in mind that 4-voice MUSICA output produces 
a robust waveform that's almost guaranteed to have MANY 128's in 
there and fast enough (maybe even too fast at times, but I'm working 
on that as well).

With the running music, the chances of there being a 128 PCM sample 
on a fast enough interval has proved tonight to work pretty well!  I 
can't hear any popping because this is being designed from the 
Rainbow IDE, and MESS and VCC are both used for testing.  I have no 
way of getting a floppy over to my CoCo 3 from my laptop, so I'm 
relying on some testers to give feedback for distortion clicks if 
there are any.





More information about the Coco mailing list