100 IFA=.THENA=1:LOAD"SMUSH.ML",8,1 110 GOSUB60100:CLR 1000 PRINT"[147] [158]SMUSH" 1001 PRINT" BY EDWARD ROHR" 1002 PRINT" [154][S[154]] SMUSH FILE" 1005 PRINT" [154][U[154]] UN-SMUSH FILE" 1006 PRINT" [154][X[154]] EXIT SMUSH" 1009 PRINT" ENTER COMMAND:" 1010 GETA$:IFA$=""THEN1010 1015 IFA$="S"THEN3000 1020 IFA$="U"THEN5000 1030 IFA$="X"THENPRINT"BYE, BYE!":GOTO60000 1040 GOTO1010 2000 PRINT" [150]ABORTED!":FORR=1TO2500:NEXT:GOTO1000 3000 EX$(1)=".SMU":EX$(2)=".DSM":EX$(3)=".TSM":EX$(4)=".QSM":EX$(5)=".FSM" 3005 EX$(6)=".HSM" 3010 PRINT"[154]ENTER FILENAME:";:LE=16:AL=1:NU=1:GOSUB60500:SF$=C$ 3011 GOSUB5100:IFSF$=""THEN2000 3012 PRINT"[154]SMUSH: "SF$:PRINT"CORRECT? (Y/N)" 3013 GETA$:IFA$<>"Y"ANDA$<>"N"THEN3013 3014 IFA$<>"Y"THEN2000 3015 OF$=LEFT$(SF$,12) 3016 N$=CHR$(0):CL%=. 3020 PRINT"[154]ANALYZING FILE":CLOSE2:OPEN2,8,2,SF$:SYS49896:CLOSE2 3025 N=PEEK(251)+PEEK(252)*256+PEEK(253)*65536 3030 SYS49970 3035 SYS50240:NN=36+PEEK(50240-3)+PEEK(50240-2)*256+PEEK(50240-1)*65536 3040 IFINT(N/254)>INT(NN/254)THEN3065 3045 PRINT"[154]NO FURTHER COMPRESSION." 3050 CLOSE15:OPEN15,8,15:FORR=1TO6:IFR=CL%THEN3060 3055 PRINT#15,"S0:"+OF$+EX$(R) 3060 NEXT:CLOSE15:GOTO1000 3065 CL%=CL%+1:IFCL%=7THENCL%=CL%-1:GOTO3045 3070 PRINT"COMPRESSING" 3075 CLOSE2:CLOSE3:OPEN2,8,2,SF$:OPEN3,8,3,OF$+EX$(CL%)+",P,W":NN=.:O$="" 3080 HH%=N/65536:HL%=(N-HH%*65536)/256:LL%=N-HH%*65536-HL%*256 3085 PRINT#3,CHR$(LL%)+CHR$(HL%)+CHR$(HH%);CHR$(CL%); 3090 FORR=.TO31:PRINT#3,CHR$(PEEK(52736+R));:NEXT:B=.:POKE175,8 3095 PRINT"[145] [157][157][157][157][157][157][157][157][157][157][157][157]BLOCK:"B+1:SYS49852:B=B+1 3100 SYS49890:IFPEEK(252)=.THEN3095 3105 BC=PEEK(175):IFBC=8THEN3125 3110 PRINT"FLUSHING BIT BUFFER":BY=PEEK(174) 3115 IFBC=.THENPRINT#3,CHR$(BY);:GOTO3125 3120 BY=(BY*2)AND255:BC=BC-1:GOTO3115 3125 IFCL%>1THENCLOSE15:OPEN15,8,15,"S0:"+OF$+EX$(CL%-1):CLOSE15 3130 PRINT"[154]COMPRESSED TO LEVEL"CL%:CLOSE2:CLOSE3:SF$=OF$+EX$(CL%):GOTO3020 5000 EX$(1)=".SMU":EX$(2)=".DSM":EX$(3)=".TSM":EX$(4)=".QSM":EX$(5)=".FSM" 5005 EX$(6)=".HSM" 5010 PRINT"[154]ENTER FILENAME:";:AL=1:NU=1:LE=16:GOSUB60500:SF$=C$ 5011 N$=CHR$(0):GOSUB5100:IFSF$=""THEN2000 5012 PRINT"[154]UN-SMUSH: "SF$:PRINT"CORRECT? (Y/N)" 5013 GETA$:IFA$<>"Y"ANDA$<>"N"THEN5013 5014 IFA$<>"Y"THEN2000 5015 CLOSE2:OPEN2,8,2,SF$:GET#2,A$,A$,A$,A$:CLOSE2:CL%=ASC(A$+N$) 5020 FORF=CL%TO1STEP-1:SF$=LEFT$(SF$,LEN(SF$)-4)+EX$(F) 5022 PRINT"[154]DECOMPRESSING LEVEL"F"" 5025 OF$=LEFT$(SF$,LEN(SF$)-4):IFF>1THENOF$=OF$+EX$(F-1) 5030 CLOSE2:OPEN2,8,2,SF$:GET#2,A$,B$,C$:OPEN3,8,3,OF$+",P,W" 5035 N=ASC(A$+N$)+ASC(B$+N$)*256+ASC(C$+N$)*65536:GET#2,O$:O$="" 5040 FORR=.TO31:GET#2,A$:POKE52736+R,ASC(A$+CHR$(0)):NEXT 5045 POKE251,.:SYS50112:CLOSE2:CLOSE3 5050 IFF<>CL%THENCLOSE15:OPEN15,8,15,"S0:"+SF$:CLOSE15 5055 NEXT:GOTO1000 5100 CLOSE2:OPEN2,8,.,"$:"+SF$:FORR=1TO8:GET#2,A$:NEXT 5105 GET#2,A$:IFA$<>""THEN5105 5110 GET#2,A$,A$,A$,B$:SF$="" 5115 GET#2,A$:IFA$="B"THENCLOSE2:RETURN 5120 IFA$<>CHR$(34)THEN5115 5125 GET#2,A$:IFA$=CHR$(34)THENCLOSE2:RETURN 5130 SF$=SF$+A$:GOTO5125 60000 OPEN15,8,15,"R0:HELLO CONNECT=HELLO CONNECT":INPUT#15,ER:CLOSE15 60010 IFER<>63THENEND 60020 LOAD"HELLO CONNECT",8 60100 POKE53280, 2:POKE53281, 0:PRINT"[147][142]"; 60101 PRINT"LOADSTARPRESENTS:" 60102 PRINT" u``````iu``u```iu iu`"; 60103 PRINT"`````i[178] [178]j``````i} j }} }j``````i[171]``````[179]j``````k[177] [177]j`"; 60104 PRINT"`````kj``````k[177] [177] "; 60105 PRINT"[146][158]BYEDWARDROHR" 60106 PRINT"COPYRIGHT1988" 60107 PRINT"[160]" 60108 PRINT"PRESSSPACETOCONTINUE" 60109 IFPEEK(203)<>60THEN60109 60110 RETURN 60500 C$="":POKE198,.:PRINT"[164]"; 60510 FORA=1TOLE+1 60520 GETA$:IFA$=""THEN60520 60530 IFA$=CHR$(13)THENPRINT"[157] ":RETURN 60540 IFA$=CHR$(20)ANDA>1THENPRINT"[157][157] [157][157][164]";:A=A-1:C$=LEFT$(C$,A-1):GOTO60520 60550 IF(A=LE+1)THEN60520 60560 IF(NU)AND((A$>="0")AND(A$<="9"))THEN60595 60570 IF(AL)AND((A$>=" "ANDA$<="/")OR(A$>=":"ANDA$<="Z"))THEN60595 60580 IF(AL)THENIF(A$>="[193]"ANDA$<="[218]")THEN60595 60590 GOTO60520 60595 PRINT"[157]"A$;:POKE212,.:PRINT"[164]";:C$=C$+A$:NEXT