home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 67
/
067.d81
/
edstar
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
7KB
|
278 lines
5 poke650,255:print"";:goto30
10 xx=0:ifxy<760thenreturn
15 print"[207]ut of lines!!!":fort=1to500:next:print"[145] "
20 xx=-1
25 return
30 poke53280,6:poke53281,0:print"[147]"
35 ifpeek(49408)<>1thenprint"[158]loading":load"edstar 5.o",8,1
40 gosub50:poke55,0:poke56,39:clr:s=10000:poke53272,23:tb=1503:goto60
45 rem *rst scr wd*
50 poke1020,1:poke1021,19:poke1022,0:poke1023,39:return
55 rem *sys #s*
60 iprc=49448:lsav=49430
65 mttp=49433:mbot=49436
70 sdwn=49415:scup=49412
75 sfil=49418:lfil=49421
80 lmov=49442:mwip=49439
85 dchr=49424:ichr=49427
90 wwrp=49445:clsm=49409
95 mdel=49451:mins=49454
100 wchk=49457:prnt=49460
105 splt=49463:cata=49466
110 g1lu=49469:g2lu=49472
115 g3lu=49475:g4li=49478
120 g5lu=49481:rdel=49484
125 sys mwip
130 gosub765
135 deffns(x)=x*40+9960
140 poke646,12:sys clsm:gosub300:gosub405:ln=1:goto145
145 ps=1465:poke53272,23:t$="x":gosub715:goto155
150 rem*
155 getc$:ifc$<>"" then175
160 pokeps,peek(ps)or128
165 getc$
166 if((ln-1)/19)<>(int((ln-1)/19))thenpoke53280,6
167 if((ln-1)/19)=(int((ln-1)/19))thenpoke53280,1
169 ifc$<>""then175
170 gosub303:goto155
175 poke150,asc(c$):sysiprc:if peek(150)=0then270
180 onpeek(151)goto190,205,210,215,220,225,230,235,240,245,250,255,260,265
185 goto165
190 xy=ln:gosub10:ifxxthen200:rem cr
195 gosub303:ps=1465:syslsav,ln:ln=ln+1:sys scup:sys mbot,ln+8
200 goto280
205 gosub395:goto165:ins char
210 gosub330:goto165:crs lt
215 gosub345:goto165:crs rt
220 gosub355:goto165:crs up
225 gosub380:goto165:crs dn
230 gosub475:goto165:^d line del
235 gosub530:goto165:^i line ins
240 gosub303:gosub635:gosub410:gosub725:gosub985:goto165:save
245 gosub805:gosub720:goto165:^p printer
250 gosub310:goto165:del char
255 gosub1315:goto165:^x exit
260 gosub910:goto165:^h help
265 gosub1025:goto165:^f functions
270 lp=peek(49151+asc(c$))
275 pokeps,lp:ps=ps+1:ifps=tbthen ps=1465:gosub430:syslsav,ln:sys mbot,ln+8
280 ifln>nlthennl=ln
285 goto155
290 :
295 rem*rstr clr ln*
300 fort=55736to55775:poket,7:nextt:return
303 pokeps,peek(ps)and127:return
305 rem*dl ch*
310 if ps<1466 then return
315 poke150,ps-1465:gosub303:sys dchr
320 ps=ps-1:return
325 rem*cr lf*
330 if ps>1465thengosub303:pokeps,peek(ps)or128:gosub303:ps=ps-1
335 return
340 rem*cr rt*
345 if ps<1502thengosub303:pokeps,peek(ps)or128:gosub303:ps=ps+1
350 return
355 rem*cr up*
360 ifln=1thenprint" [211]tart of text[152]":gosub585:return
365 gosub303:syslsav,ln:ln=ln-1:syssdwn
370 if ln>10then sysmttp,ln-10
375 return
380 rem*crsr dn*
385 ifln>=nlthengosub575:return
390 gosub303:syslsav,ln:ln=ln+1:sys scup:sys mbot,ln+8:return
395 rem*ins cpokear*
400 pokeps,peek(ps)and127:poke150,ps-1463:sys ichr:return
405 rem*clr menu*
410 print"[155] [176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
415 gosub303
420 fort=1to3:print" [221] [221]":nextt
425 print" [173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189][145][145][145][145]";:return
430 rem*wrap*
435 xy=ln:gosub10:ifxxthenreturn
440 xf=0:ifpeek(tb-1)=32thenxf=-1
445 sm=fns(ln+1):poke251,int(sm/256):poke250,sm-peek(251)*256
450 fm=fns(nl):poke253,int(fm/256):poke252,fm-peek(253)*256
455 syswchk:ifpeek(150)<>0thenpoke1020,12:syssdwn:sysmins:nl=nl+1:poke1020,1
460 sys wwrp:ps=peek(150)+1464:syslsav,ln:sys scup:ln=ln+1
465 ifxf=-1thenps=1465
470 return
475 rem*line del*
480 if nl=0 then return
485 print"[196]eleting a line..."
490 sm=fns(ln):poke251,int(sm/256):poke250,sm-peek(251)*256
495 sm=fns(nl+1):poke253,int(sm/256):poke252,sm-peek(253)*256:sys mdel
500 poke1020,11:sys scup:gosub50:ps=1465:nl=nl-1
505 syslsav,ln:sys mbot,ln+8
510 print" ":poke150,0:poke151,0
515 poke152,0:poke153,o
520 if nl<ln then gosub355
525 return
530 rem*line ins*
535 xy=nl:gosub10:ifxxthenreturn
540 print"[201]nserting a line..."
545 sm=fns(ln):poke251,int(sm/256):poke250,sm-peek(251)*256
550 fm=fns(nl):poke253,int(fm/256):poke252,fm-peek(253)*256:sys mins
555 :nl=nl+1
560 gosub303:poke1020,11:syssdwn:gosub50:ps=1465
565 print" ":poke150,0:poke151,0:poke152,0
570 poke153,0:return
575 rembzz
580 print"[197]nd of text"
585 fort=1to40:nextt:goto605
590 poke54296,15:poke54277,45:poke54278,165
595 poke54276,33:poke54273,6:poke54272,5
600 fort=1to200:next:poke54276,32:poke54273,0:poke54272,0:poke198,0:return
605 print" ":return
610 :
615 rem*exit*
620 gosub410:print"[193]re you sure you want to exit?(y/n)"
625 getd$:ifd$="" then625
630 ifd$<>"y"then ow=0:return
635 syslsav,ln:fx=17:open15,8,15,"i0":close15
640 gosub410:print"save as what? "fi$:printtab(16)"[145]";:inputfs$
645 iffs$=""orfs$=chr$(221)thenprint"[147]":syscata:print"":goto640
650 fx=fx-1:fs$=left$(fs$,fx):ifright$(fs$,1)=" "then645:iffs$=fi$then655
655 fi$=fs$:gosub410:print"saving '"fi$"'":open15,8,15
660 print#15,"r0:"fi$"=0:"fi$
665 ow=-1:input#15,a$:if a$<>"63"then690
670 print"[145]file exists! replace?(y/n)";:gosub590
675 get r$:ifr$="" then675
680 if r$<>"y"then close15:return
685 print" [156][207].[203].[152]":print#15,"s0:"+fi$:close15
690 f$=fi$+",p,w"
695 poke827,len(f$):forc=1tolen(f$):poke827+c,asc(mid$(f$,c)):next
700 fi$=f$
705 poke251,(nl)/256:poke250,256*((nl)/256-peek(251)):sys sfil
710 sv=-1:return
715 rem*menu*
720 gosub303:syslsav,ln:gosub410
725 print"<ctrl>[159][201][152][146]nsert line <ctrl>[159][211][152][146]ave text"
730 print"<ctrl>[159][196][152][146]elete line <ctrl>[159][208][152][146]rinter"
735 print"<ctrl>[159][200][152][146]elp <ctrl>e[159][216][152][146]it"
740 if t$="x"then return
745 get me$:ifme$="" then745
750 if me$="d"orme$="i"orme$="p"orme$="h"orme$="s"orme$="x"then return
755 goto745
760 rem*load*
765 print"[147][204]oad:":gosub1260
770 sysmwip
775 poke250,17:poke251,39:poke252,nl/256:poke253,256*((nl/256)-peek(252))
780 sys lfil:t$="x":gosub1295:ifnl<>0then795
785 :
790 open15,8,15:input#15,s$:close15:return
795 gosub300:return
800 rem*print*
805 syslsav,ln:gosub410
810 print" ===== [208][210][201][206][212][197][210][152] ====="
815 print"[210]eady printer and hit space bar."
820 print"[216] to cancel. "
825 getp$:ifp$="" then825
830 ifp$<>" "then print"[145][207].[203]., don't print.":fort=1to699::nextt:return
835 open4,4,7:cmd4
840 lc=0:lp=1
845 ifnl-lp<120then865
850 fori=lptolp+59:rs=60:gosub885:next
855 ifpeek(203)=23then875
860 print:print:print:print:print:print:lp=lp+120:goto845
865 rs%=(nl-lp+2)/2:rs=rs%:fori=lptolp+rs-1:gosub885
870 next
875 print"";:getk$:print#4:close4:return
880 :
885 m1=fns(i):m2=fns(i+rs)
890 poke151,m1/256:poke150,256*(m1/256-peek(151)):sysprnt
895 poke151,m2/256:poke150,256*(m2/256-peek(151)):sysprnt
900 return
905 :
910 rem*help*
915 gosub303:syslsav,ln:print"[147]"
920 print"[158][197][196][211][212][193][210]"
925 print" [212]o access functions press ^f."
930 print" [212]he next key does the job."
935 print" f1 = top of text, f7 = bottom"
940 print" f3 = up 10 lines, f5 = down.
945 [153]" ^s splits lines, ^g glues."
950 [153]" ^w wipes leading spaces."
955 [153]" ^a appends a file."
960 [153]" ^z zaps between \ flags."
962 [153]" ^d double spaces lines."
965 [153]" "
970 [153]" (NULL)ow press the (NULL) key to exit help. "
975 [161] t$:[139] t$ [178] "" [167]975
980 [139] t$[179][177]"x" [167]975
985 [153]"load":[151]646,12:[158] clsm
990 [141]410:[141]725:[141]300
995 [129]p[178]ln[171]10[164]ln[170]7
1000 [139] p[179]1[167]1010
1005 [158] mbot,p:[158] scup
1010 [130]p:[158] mbot,p
1015 [141]300:[142]
1020 functs
1025 [141]303:[153]"ascunct:";:[158]lsav,ln
1030 [161]f$:[139]f$[178]""[167]1030
1035 [153]" ";
1040 [139]f$[178]""[167][141]1100:[142]:glue
1045 [139]f$[178]""[167][141]1160:[142]:split
1050 [139]f$[178]"let"[167][141]1180:[142]:[128] of te