[Coco] Speech / Sound Cartridge detection

Robert Gault robert.gault at att.net
Wed Feb 1 06:46:40 EST 2017


Henry Rietveld wrote:
> I currently writing a small program for the color computer that will optionally offer speech if you are using the radio shack speech/sound cartridge . Is there a PEEK that can be used to auto detect the cartridge  rather than asking the user if he has the cartridge inserted?
>
> Sent from my ⑩ Passport SE; not running Android.
>

As Barry indicated, the I/O bytes with the PAK can give different values than 
those bytes without the PAK. However, merely reading those bytes is not really 
good enough.

If you have the manual for the Speech/Sound PAK or have looked at the driver in 
the NitrOS-9 project, you will know that $FF7D is the reset byte and $FF7E is 
the data/status byte. So if you reset the PAK, you should briefly get a not 
ready at $FF7E.

10 POKE &HFF7D,1:POKE&HFF7D,0
20 PRINT PEEK(&HFF7E);
30 GOTO 20

SpeakBit equ   %01000000  SSPak speech status bit (active low)
SSPData  equ   $01        SSPak data register offset
SSPReset equ   $00        SSPak reset register offset
SSPStat  equ   $01        SSPak status register offset

BusyWait ldx   V.PORT,u   V.PORT=$FF7D
          ldb   SSPStat,x  get SSPak status
          andb  #BusyBit   SSPak busy?
          beq   BusyWait   yes, go check again
          ldb   SSPStat,x  *allow for slow busy bit
          andb  #BusyBit   *
          beq   BusyWait   *
          ldb   SSPStat,x  *allow for very slow busy bit
          andb  #BusyBit   *
          beq   BusyWait   *
          rts

Either of the above should deliver a changed value at $FF7E after a reset 
request at $FF7D. The value you actually see probably will depend on your system.

Robert



More information about the Coco mailing list