Classic Computer Magazine Archive COMPUTE! ISSUE 46 / MARCH 1984 / PAGE 10

Synthesizer Check Routine For TI "Crazy Climber"

Here is a neat trick to use on TI computer programs (Extended BASIC only) that have CALL SAY statements. (See "Crazy Climber" for the TI-99/4A, COMPUTE!, November 1983.) If there is no speech synthesizer attached, the program stops at line 320 with an error message, because the computer can't talk without its talker.

COMPUTE! puts in a REM about removing the CALL SAY if no synthesizer is attached, but there is an easier way. Edit lines 110 and 320 to read:

110 CALL PEEK(-28672,SP)::GOTO 140
320 T = 1::V = 2::CALL DELSPRITE(#1)::
IF SP = 96 THEN CALL SAY ("UHOH")

Here's how it works:

In the TI editor/assembler manual, page 354, there is a way to check to see if the synthesizer is attached or not. Without going into machine language (which I don't understand that well), it boils down to CALL PEEK(-28672,SP). This PEEK should be placed ahead of any CALL SAY statement and need be executed only once.

When the program runs, the PEEK looks to see if the synthesizer is attached. It sets the variable SP to 0 if not attached, and 96 if attached.

Try this two-liner:

100 CALL PEEK(-28672,Q)::CALL CLEAR
110 IF Q THEN CALL SAY("HELLO,HOW ARE YOU")ELSE DISPLAY AT(12, 3): "NO SYNTHESIZER ATTACHED."

No, I didn't goof by using the @ for a variable name—it is valid.

After running the above, you will get the message one way or another. Try it with and without the synthesizer.

Caution: Do not attach or remove the synthesizer with your console power on. Lockup will occur, and you will have to turn the console power off, then on again, to recover.

Jim Pate

Thank you for the suggestion.