home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1990 February
/
1990-02.d64
/
messenger
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
6KB
|
160 lines
10 rem copyright 1990 compute! publications, inc. - all rights reserved
20 poke55,0:poke56,peek(46)+4:clr:print"[147][159]"tab(9)"one moment, please..."
30 poke53280,0:poke53281,0:poke650,128:dima(70)
40 forz=0to9:a(z+48)=z:a(z+61)=z+6:next:forz=1to7:readb:next
50 forz=49152to49879:reada$:q=16*a(asc(a$))+a(asc(right$(a$,1))):g=g+q
60 pokez,q:next:ifg<>95982thenprint"error in data statement.":stop
70 clr:sys49195:deffna(x)=peek(x)+256*peek(x+1)
80 ad=fna(55):u$=chr$(8)+chr$(142):n=ad:poken,0:w=40959
90 ifn>wthenn=w:pokew,0
100 poke53280,0:poke53281,0:print"[147]";u$;:mb=n-ad:fb=w-n
110 a$="":forz=1to29:a$=a$+"[192]":next:b$="[154] ":c$=" [146][158] "
120 printtab(15)"[154]messenger[151]":printtab(12)"copyright 1990"
130 printtab(6)"compute! publications, inc."
140 printtab(11)"all rights reserved"
150 print"[176]"a$"[174]":forz=1to8:print"[221]"tab(35)"[221]":print"[171]"a$"[179]"
160 next
170 print"[145][173]"a$"[189]"
180 printb$"1"c$"view message"
190 printb$"2"c$"enter message"
200 printb$"3"c$"make message program"
210 printb$"4"c$"compact memory"
220 printb$"5"c$"save message text (seq)"
230 printb$"6"c$"load message text (seq)"
240 printb$"7"c$"clear memory"
250 printb$"8"c$"quit"
260 print,,"[155]";right$(str$(fb+1e6),5);"[159] bytes free"
270 print,,"[155]";right$(str$(mb+1e6),5);"[159] bytes used";:poke198,0
280 geta$:ifa$<"1"ora$>"8"then280
290 onval(a$)goto300,360,350,470,480,550,310,330
300 sys49192,ad:forz=1to500:next:goto90
310 gosub740:ifa$="n"then90
320 n=ad:poken,0:goto90
330 gosub740:ifa$="n"then90
340 sys64738
350 gosub890:goto90
360 sys49192,ad:forz=54272to54300:pokez,0:poke54296,15
370 restore:forz=6to0step-1:ready:poke54272+z,y:next:poke198,0
380 b=54276:c=53280:d=c+1:a=usr(0):pokeb,33:pokeb,255:poken,a:n=n+1
390 ifa<133ora>140then460
400 ifa=133thenpokec,(peek(c)and15)+1
410 ifa=134thenpoked,(peek(d)and15)+1
420 ifa=138thenpokec,0:poked,0:print"[147][159]";u$;
430 ifa=135thenprintu$;
440 ifa=136thenprintchr$(14);
450 ifa=140thenn=n-1:poken,0:goto90
460 printchr$(a);:goto380
470 gosub1050:goto90
480 print"[147]"tab(15)"[153]text save"
490 f$="":input"[159]filename ";f$:iff$=""then90
500 gosub860:print"[147]"tab(10)"[153]saving...please wait"
510 open2,8,2,f$+",s,w":gosub800:ifer<>0then540
520 ifpeek(ad)<>138thenprint#2,chr$(138);
530 sys49201,ad
540 close2:close15:sys65511:goto90
550 gosub860:s$="":forz=1to40:s$=s$+" ":nextz
560 print"[147][153]"tab(10)"files on this disk:[153]"
570 open2,8,0,"$0:*=s":c$=chr$(34):gosub800:ifer<>0then730
580 get#2,a$,a$
590 get#2,a$,a$:ifa$=""then680
600 get#2,a$,a$:n$=""
610 get#2,a$:ifa$=""then590
620 ifa$<>c$then610
630 get#2,a$:ifa$<>c$thenn$=n$+a$:goto630
640 ifz=41thenz=0:print""left$(n$+s$,40)"[153][146]";:goto660
650 printn$;spc(20-len(n$));
660 get#2,a$:ifa$<>""then660
670 goto590
680 close2:close15:print:print"";s$
690 f$="":input"[159]file to load ";f$:iff$=""then730
700 print"[147]"tab(10)"[153]loading...please wait"
710 open2,8,2,f$+",s,r":gosub800:ifer<>0then730
720 sys49198,n:n=fna(781)+1:poken,0
730 close2:close15:sys65511:goto90
740 print"[147]"tab(15)"[158]warning!!!"
750 print"[159] this option will erase the current"
760 printtab(11)"message in memory."
770 printtab(10)"[153]are you sure? [y/n]":poke198,0
780 geta$:ifa$<>"y"anda$<>"n"then780
790 return
800 open15,8,15:input#15,er,er$,et,es:ifer=0thenreturn
810 print"[147]"tab(11)"[153]operation aborted."
820 print"disk error:[158]";er;er$;et;"[157]";es
830 printtab(14)"[153]press a key":poke198,0
840 geta$:ifa$=""then840
850 return
860 print"[147][153]"tab(5)"insert a disk and press a key":poke198,0
870 geta$:ifa$=""then870
880 return
890 a=ad:print"[147][159]"
900 forz=1to8:ky(z)=0:next:q=1
910 print"input password to code the message. [153][return][159] only to not code"
920 k$="":input"password (8 characters max.)";k$
930 p=1:ifk$=""thenk$=chr$(0):p=0
940 forz=1to3:k$=k$+k$:next:f$="":input"filename";f$:iff$=""thenreturn
950 gosub860:print"[147][153] compacting and saving the message."
960 printtab(14)"[159]please wait."
970 gosub1060:open2,8,2,f$+",p,w":gosub800:ifer<>0then1040
980 print#2,chr$(1)chr$(8);:x=2049
990 x=fna(x):iffna(x+2)<>2000then990
1000 forz=xtofna(45)-1:print#2,chr$(peek(z));:next
1010 print#2,chr$(p);:forz=1to8:poke49183+z,0:next
1020 forz=49152to49615:print#2,chr$(peek(z));:next
1030 forz=1to8:poke49183+z,asc(mid$(k$,z,1)):next:sys49207,ad:poke49184,0
1040 close2:close15:sys65511:return
1050 print"[147][153]"tab(8)"compacting... please wait"
1060 ifn=adthenreturn
1070 sys49204,ad:n=fna(781):return
1080 data255,31,255,1,0,50,0
1090 data ad,28,c0,a9,4c,a0,00,84,fb,91,14,a9,c0,85,fc,a2,04,b1,14,91
1100 data fb,88,d0,f9,e6,fc,e6,15,ca,d0,f2,60,00,00,00,00,00,00,00,00
1110 data 4c,3a,c0,4c,d0,c1,4c,0a,c2,4c,2e,c2,4c,49,c2,4c,a5,c2,20,95
1120 data c1,a5,14,8d,51,c1,a5,15,8d,52,c1,20,a8,c0,20,bd,c0,20,72,c1
1130 data a9,00,8d,ce,c1,ad,20,c0,f0,03,20,9f,c1,a9,00,85,a2,20,4b,c1
1140 data c9,00,d0,07,20,a8,c0,20,88,c1,60,8d,c9,c1,20,04,c1,20,88,c1
1150 data ad,c9,c1,20,d2,ff,20,72,c1,ad,c9,c1,29,7f,c9,21,30,03,20,d5
1160 data c0,ad,8d,02,29,02,f0,04,a9,05,85,a2,a9,03,c5,a2,10,fc,ad,8d
1170 data 02,29,01,d0,f9,4c,5d,c0,a0,19,a9,00,99,ff,d3,88,d0,fa,a9,0f
1180 data 8d,18,d4,a2,05,20,42,c1,60,a9,00,8d,20,d0,8d,21,d0,a9,9f,20
1190 data d2,ff,a9,93,20,d2,ff,a9,8e,20,d2,ff,60,8d,c9,c1,a0,06,b9,c2
1200 data c1,99,00,d4,88,10,f7,a9,21,8d,04,d4,a2,00,a0,05,ad,8d,02,29
1210 data 02,f0,02,a0,01,ca,d0,fd,88,d0,fa,a9,ff,8d,04,d4,ad,c9,c1,60
1220 data c9,85,d0,04,ee,20,d0,60,c9,89,d0,0c,20,88,c1,a2,3c,20,42,c1
1230 data 20,72,c1,60,c9,86,d0,04,ee,21,d0,60,c9,8a,d0,04,20,bd,c0,60
1240 data c9,87,d0,06,a9,8e,20,d2,ff,60,c9,88,d0,05,a9,0e,20,d2,ff,60
1250 data a2,01,a9,00,85,a2,e4,a2,d0,fc,60,ad,ce,c1,d0,1b,ad,ff,ff,ee
1260 data 51,c1,d0,03,ee,52,c1,c9,01,d0,12,20,50,c1,8d,ce,c1,20,50,c1
1270 data 8d,cf,c1,ce,ce,c1,ad,cf,c1,60,a4,d3,b1,d1,8d,cc,c1,b1,f3,8d
1280 data cd,c1,a9,a0,91,d1,ad,86,02,91,f3,60,a4,d3,ad,cc,c1,91,d1,ad
1290 data cd,c1,91,f3,60,20,fd,ae,20,8a,ad,20,f7,b7,60,a0,00,a2,00,a1
1300 data 14,59,20,c0,81,14,a1,14,f0,0e,e6,14,d0,02,e6,15,c8,98,29,07
1310 data a8,4c,a3,c1,a9,00,8d,20,c0,60,00,32,00,01,ff,1f,ff,00,00,00
1320 data 00,00,00,00,a9,db,8d,11,03,a9,c1,8d,12,03,60,a4,d3,b1,f3,48
1330 data b1,d1,48,ad,86,02,91,f3,a4,d3,68,48,49,80,91,d1,20,e4,ff,aa
1340 data a4,d3,68,48,91,d1,8a,f0,eb,a4,d3,68,68,91,f3,8a,a8,a9,00,4c
1350 data 91,b3,20,95,c1,a2,02,20,c6,ff,20,cf,ff,a0,00,91,14,20,b7,ff
1360 data 29,40,d0,09,e6,14,d0,ee,e6,15,4c,12,c2,a6,14,a4,15,60,20,95
1370 data c1,a2,02,20,c9,ff,a0,00,b1,14,f0,0c,20,d2,ff,e6,14,d0,f3,e6
1380 data 15,4c,36,c2,60,20,95,c1,a5,14,85,fb,a5,15,85,fc,a0,00,b1,fb
1390 data d0,07,91,14,a6,14,a4,15,60,c8,c0,ff,f0,04,d1,fb,f0,f7,c0,01
1400 data f0,20,c0,02,f0,1c,48,a9,01,20,9a,c2,98,20,9a,c2,18,65,fb,85
1410 data fb,a9,00,65,fc,85,fc,68,20,9a,c2,4c,54,c2,20,9a,c2,e6,fb,d0
1420 data 02,e6,fc,4c,54,c2,a2,00,81,14,e6,14,d0,02,e6,15,60,20,95,c1
1430 data a2,02,20,c9,ff,a2,00,a0,00,a1,14,59,20,c0,8e,ca,c1,8c,cb,c1
1440 data 20,d2,ff,ae,ca,c1,ac,cb,c1,a1,14,f0,0e,e6,14,d0,02,e6,15,c8
1450 data 98,29,07,a8,4c,b1,c2,60
2000 poke53280,0:poke53281,0:print"[147]"chr$(142)chr$(8):x=2049
2010 deffna(x)=peek(x)+256*peek(x+1)
2020 x=fna(x):ifx<>0theny=x+2:goto2020
2030 ifpeek(y+1)=173thensys(y+1)
2040 ifpeek(y)=0then2080
2050 print"this message is protected."
2060 input"please enter password ";k$
2070 forz=1to8:n$=n$+k$:poke49183+z,asc(mid$(n$,z,1)):next:pokey,0
2080 print"[147][159] messenger file-player"
2090 print"[154]hold [153] cmdr [146][154] to speed up"
2100 print"hold [153] shft [146][154] to freeze display"
2110 printtab(9)"[158]press any key to start":poke198,0
2120 geta$:ifa$=""then2120
2130 sys49152,(y+465):run