Morse Code decoder

From: maximum entropy (entropy@gnu.ai.mit.edu)
Date: 09/19/94-04:57:00 AM Z


From: entropy@gnu.ai.mit.edu (maximum entropy)
Subject: Morse Code decoder
Date: Mon Sep 19 04:57:00 1994

Here's a little program I wrote and thought no one would ever want :-)
It works off the joystick trigger (I made an adapter that let me plug
in a code key).  It's not too clever (you need to tune the timing
manually).  Enjoy!

Comments in email please, I rarely read this group.

10 REM MORSE.BAS BY ENTROPY@GNU.AI.MIT.EDU PUBLIC DOMAIN
100 DOT=7:SPS=0:TONE=47:GMODE=1:REM CONFIGURE DOT TIMING, SHORT PROCEDURAL SIGNALS, FEEP TONE, AND GR. 0,1,2
110 TRAP 120:ARGH$="X":DOT=DOT*2
120 TRAP 32768:DASH=DOT*3:SBC=DASH:SPACE=DOT*7
130 DIM I$(256):I$="":DIM Q$(256):I=0:T=SPACE:DIM S$(1):S$=" ":IF GMODE<>0 THEN S$="_"
140 GMODE=GMODE+16:GRAPHICS GMODE
150 DIM C$(84):C$="ETIANMSURWDKGOHVF+L+PJBXCYZQ++54+3+++2$+#++++16%&+++'+7+++8+90+++++(++++++?++++++++."
160 POKE 710,0:DIM P$(18):P$="@AR!AS-BT/DN#KN$SK"
170 T=T+1:IF T<SBC OR I=0 THEN GOTO 270
180 N=0:FOR P=1 TO I:N=1+N*2+(I$(P,P)="-"):NEXT P
190 Q$="+":IF N<=LEN(C$) THEN Q$=C$(N,N):IF Q$>"+" THEN GOTO 260
200 IF Q$>"(" THEN GOTO 230
210 P=(ASC(Q$)-35)*3+1:Q$=P$(P,P):IF SPS=0 OR Q$="+" THEN Q$="<  >":Q$(2,3)=P$(P+1,P+2)
220 GOTO 260
230 IF N=114 THEN Q$=",":GOTO 260
240 IF N=567 THEN Q$="<SOS>":GOTO 260
250 Q$="<":Q$(I+2)=">":Q$(2,I+1)=I$
260 TRAP 350:? #6;Q$;:I=0:I$="":TRAP 32768
270 IF T=SPACE THEN TRAP 350:? #6;S$;:TRAP 32768
280 IF STRIG(0)=1 THEN GOTO 170
290 I=I+1:POKE 77,0:T=0:SOUND 0,TONE,10,8
300 T=T+1:IF STRIG(0)=0 THEN GOTO 300
310 TRAP 330:I$(I,I)=".":IF T>=DASH THEN I$(I,I)="-"
320 TRAP 32768:T=0:SOUND 0,0,0,0:GOTO 170
330 TRAP 32768:IF PEEK(195)=9 THEN I=I-1:SOUND 0,0,0,0:GOTO 170
340 ? "ERROR-   ";PEEK(195);" AT LINE ";PEEK(186)+256*PEEK(187):END 
350 TRAP 32768:IF PEEK(195)=141 THEN GRAPHICS GMODE:GOTO PEEK(186)+256*PEEK(187)
360 GOTO 340
--
entropy -- it's not just a good idea, it's the second law.
Personal mail:      entropy@gnu.ai.mit.edu
MiNT library mail:  entropy@terminator.rs.itd.umich.edu


-----------------------------------------
Return to message index