[Coco] joystick plus real-time sound?

Roger Taylor operator at coco3.com
Wed Jan 9 20:09:59 EST 2008


At 06:23 PM 1/9/2008, you wrote:
>Roger Taylor wrote:
>
>>Folks,
>>If I'm not mistaken, there is no way on a CoCo to poll the joystick 
>>while doing real-time audio without introducing interference.  The 
>>same DAC is used to output the 6-bit sound and set the voltage for 
>>the joystick axis comparitors.
>>When you set up the PIA to sample the joystick axis, I think a pop 
>>or click sound is introduced if the mode was in 6-bit sound 
>>mode.  Doing this frequently back and forth scares me with the thought.  :)
>>Ofcourse, on an emulator it probably doesn't do this.
>>I could be wrong, but I think this is why I made my Spider-Hype 
>>games use only the keyboard.  I guess having real time music and 
>>sound effects has a cost.
>
>I think you can time share with careful coding. I remember doing 
>that in some software. I'll see if I can find the program source code.


Remember that FIRQ is used for the audio pump.  It can occur at any 
time.  Any joystick sampling would probably have to be done 
"sometimes" during the FIRQ service code.  A cycling timer can be 
used but this will definately cause the game and framerate to appear 
to lag on intervals each time a polling is done, even with super fast 
code.  The existing FIRQ code is short and tight.  Adding 1 more 
instruction is noticeable in the audio and game speed.  Then the FIRQ 
timer has to be lowered a tad.  I had to fine-tune this over and over 
as the game progressed.

Actually, there's a lot of IRQ and FIRQ servicing going on during the 
game.  IRQ sets up the MUSICA notes for FIRQ.

I'd rather release the game as-is and supply any joystick version if 
I can pull it off.




More information about the Coco mailing list