chapterC/CHCPRG1.LST:

10 REM PROGRAM "FROG" TO DEMONSTRATE SYNCHRONIZATION
20 REM OF AUDIO WITH DIGITAL FOR THE CASSETTE SYSTEM
30 REM 
40 DIM IN$(20)
50 POKE 54018,52:REM TURN ON MOTOR
60 GRAPHICS 1
70 PRINT #6;"THE PRINCESS AND THE FROG":PRINT #6;,,,,:REM SET UP THE SCREEN FOR EVENT 2.
80 GOSUB 1000:REM CHECK SYNC MARK, MAKE SURE THE INTRODUCTION IS SAID.
100 POSITION X,Y:PRINT #6;"YOUR NAME?":REM FOR EVENT 4
105 GOSUB 1000:REM EVENT 5
110 POKE 54018,60:REM STOP MOTOR FOR USER INPUT
120 INPUT IN$:REM WAIT FOR THE USER'S NAME
130 POKE 54018,52
135 PRINT #6,CHR$(125):REM CLEAR THE SCREEN
140 POSITION X,Y:PRINT #6;IN$:PRINT #6;,,,,:REM DISPLAY SCREEN FOR EVENT 10
150 GOSUB 1000:REM MAKE SURE SPEECH FOR EVENT 10 IS FINISHED
160 PRINT #6;,,,,:REM READY FOR EVENT 12
1000 IF INT(PEEK(53775)/32+0.5)=INT(PEEK(53775)/32) THEN RETURN :REM CHECK THE 5TH BIT OF EACH INCOMING BYTE.
1005 REM IF IT IS "0" THEN THE SYNC SPACE IS FOUND.
1010 GOTO 1000

Back to previous page