git @ Cat's Eye Technologies DiskSumo / 712ed29
Initial import of DiskSumo version 1.0 revision 2007.0726. catseye 11 years ago
2 changed file(s) with 131 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
Binary diff not shown
0 10 goto 8900
1 100 rem --dump disk to rs232--
2 110 m=fre(0):m=24576:t=1:s=0:b%=1
3 120 open 15,8,15
4 130 open 5,8,5,"#"
5 160 gosub 8000: rem setup display
6 165 print "{home}{grn}ready. start xmodem on other computer";
7 170 get#4,a$: if a$<>chr$(nak%) then 170
8 175 print "{home} ";
9 180 be=val(ti$)
10 200 for t=1 to 35
11 210 gosub 500: rem calc max sec
12 220 gosub 800: rem read track
13 230 gosub 700: rem send track
14 240 next
15 300 print#4, chr$(eot%);
16 310 mi=(val(ti$)-be)/100
17 320 print "{clr}";mi;"minutes elapsed"
18 330 close 15: close 5
19 340 return
20 400 rem --update display--
21 405 poke 55296+(t-1)+40*(s+1), co%
22 410 poke 1024+(t-1)+40*(s+1), sy%
23 420 return
24 500 rem --calc max sec# for trk#t--
25 510 if t<=17 then ms%=20: return
26 520 if t<=24 then ms%=18: return
27 530 if t<=30 then ms%=17: return
28 540 ms%=16: return
29 700 rem --send trk--
30 710 for s=0 to ms%
31 720 co%=4:sy%=87: gosub 400
32 730 mo=m+s*256: gosub 2000: rem send 1st
33 740 co%=10:sy%=87: gosub 400
34 750 mo=mo+128: gosub 2000: rem send 2nd
35 760 co%=5:sy%=81: gosub 400
36 770 next
37 799 return
38 800 rem ---read trk into m---
39 810 gosub 500: rem calc max sec in ms%
40 820 for s=0 to ms%
41 830 mo=m+s*256: gosub 1000
42 840 co%=7:sy%=90: gosub 400
43 850 next
44 899 return
45 1000 rem ---read sec#s, trk#t into mo---
46 1010 print#15,"u1";5;0;t;s
47 1020 for i=mo to mo+255
48 1030 get#5,a$
49 1035 if a$="" then a$=chr$(0)
50 1040 poke i, asc(a$)
51 1050 next
52 1060 return
53 2000 rem ---send 128 bytes at mo to rs232---
54 2005 ck%=0
55 2007 print "{home}{yel}b";b%;"{left} {left}{left}{left}{left}{left}";
56 2010 print#4, chr$(soh%);chr$(b%);chr$(255-b%);
57 2020 for i=mo to mo+127
58 2025 y%=peek(i)
59 2030 print#4, chr$(y%);
60 2035 ck%=(ck%+y%) and 255
61 2040 next
62 2045 print#4, chr$(ck%);
63 2050 get#4, a$: if a$="" goto 2050
64 2055 if a$=chr$(nak%) then print"nak":goto 2005
65 2060 if a$<>chr$(ack%) then print"???";asc(a$) :goto 2005
66 2070 print "ack"
67 2090 b%=b%+1: if b% > 255 then b% = 0
68 2099 return
69 7000 rem ---terminal---
70 7010 print "{clr}{lblu}terminal mode. press ";chr$(95);" to return to menu"
71 7020 get#4, a$: if a$="" goto 7040
72 7030 print a$;: goto 7020
73 7040 get a$:if a$="" goto 7020
74 7050 print#4, a$;
75 7055 if a$=chr$(95) then return
76 7060 goto 7020
77 8000 rem set up display
78 8010 print "{clr}{red}{down}";
79 8020 for i=1 to 17
80 8030 print "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
81 8040 next
82 8050 print "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ"
83 8060 print "ZZZZZZZZZZZZZZZZZZZZZZZZ"
84 8070 for i=1 to 2
85 8080 print "ZZZZZZZZZZZZZZZZZ"
86 8090 next
87 8099 return
88 8900 rem ---initialize---
89 8910 poke 52,96:poke 56,96:clr
90 8920 open 4, 2, 3, chr$(0)+chr$(0)+chr$(61)+chr$(1)
91 8930 m=24576:t=1:s=0:b%=1
92 8940 soh%=1:eot%=4:ack%=6:nak%=21
93 9000 rem ---main menu---
94 9010 print "{clr}{cyn}";
95 9012 poke 53280, 0: poke 53281, 0
96 9020 print "disksumo v1.0, jul 26 2007"
97 9025 print "chris pressey, cat's eye technologies"
98 9027 print "this program is in the public domain"
99 9030 print "{down}{down}{down}";spc(16);"main menu"
100 9035 print spc(16);"{CBM-T}{CBM-T}{CBM-T}{CBM-T} {CBM-T}{CBM-T}{CBM-T}{CBM-T}"
101 9040 print "{down}{rght}{rght}{rght}{rght}{rght} {wht}t{cyn}erminal"
102 9045 print "{rght}{rght}{rght}{rght}{rght} {wht}d{cyn}irectory"
103 9050 print "{rght}{rght}{rght}{rght}{rght} {wht}e{cyn}rror status"
104 9055 print "{rght}{rght}{rght}{rght}{rght} {wht}b{cyn}egin dump"
105 9060 print "{rght}{rght}{rght}{rght}{rght} {red}q{cyn}uit"
106 9200 get a$: if a$="" goto 9200
107 9210 if a$="t" then gosub 7000: goto 9000
108 9220 if a$="d" then gosub 10000: goto 9500
109 9230 if a$="e" then gosub 12000: goto 9500
110 9240 if a$="b" then gosub 100: goto 9500
111 9250 if a$="q" then goto 15000
112 9490 goto 9000
113 9500 print "{wht}press any key to continue";
114 9510 get a$: if a$="" goto 9510
115 9990 goto 9000
116 10000 rem ---directory---
117 10010 open 1, 8, 0, "$0": get#1, a$, a$
118 10020 get#1, a$, a$: if a$="" then 10060
119 10030 get#1, a$, b$: print asc(a$+chr$(0))+asc(b$+chr$(0))*256;
120 10040 get#1, a$: if a$="" then print: goto 10020
121 10050 print a$;: goto 10040
122 10060 close 1: return
123 12000 rem ---error status---
124 12010 open 14,8,15
125 12020 input#14, en, em$, et, es
126 12030 print en, em$, et, es
127 12040 close 14: return
128 15000 rem ---shutdown---
129 15010 close 4
130 15099 end