home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Transactor
/
Transactor_27_1988_Transactor_Publishing.d64
/
maketogeos
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2023-02-26
|
2KB
|
79 lines
100 rem save"maketogeos",8
110 rem originally part of larger prg
120 dims%(255)
130 gosub370
140 end
150 :
160 rem disk error
170 input#15,en,em$,et,es:ifen=0thenreturn
180 print" disk error [146]"en,em$,et,es
190 gosub250:return
200 :
210 open 15,8,15,"i0":rem <<open all>>
220 gosub170
230 open 2,8,2,"#"
240 return
250 close2 :rem << close all >>
260 print#15,"i0"
270 forx=0to2000:next
280 close15:return
290 :
300 rem << read sector >> t,s,s%(255)
310 print"reading trk:";t;"sec:";s
320 print#15,"u1";2;0;t;s
330 gosub170:fori=0to255:get#2,b$
340 s%(i)=asc(b$+chr$(0)):next:return
350 :
360 rem convert a c64 file to geos
370 print"input filename":print:inputf$:iff$=""thenend
380 forx=0to15:f$=f$+chr$(160):next:f$=left$(f$,16)
390 gosub210:gosub 600:rem dir
400 t=d1:s=d2:gosub310:rem get info
410 e4=s%(0):e5=s%(1):rem link
420 s%(0)=0:s%(1)=255:rem /change
430 s%(2)=3:s%(3)=21 :rem /1st 4
440 gosub690:rem write block
450 t=e1:s=e2:gosub310:rem get dir
460 gosub 790:rem dir entry info
470 s%(e3)=131:rem user/c=64
480 s%(e3+1)=e4:s%(e3+2)=e5:rem vlir
490 s%(e3+19)=d1:s%(e3+20)=d2:reminfo
500 s%(e3+21)=0:rem seq/geos
510 s%(e3+22)=6:rem application/geos
520 s%(e3+23)=t1
530 s%(e3+24)=t2
540 s%(e3+25)=t3
550 s%(e3+26)=t4
560 s%(e3+27)=t5
570 gosub690:gosub250:return
580 :
590 rem find a dir entry
600 t=18:s=1:gosub310
610 fori=5to229step32
620 g$="":forj=0to15
630 g$=g$+chr$(s%(i+j)) :next
640 ifg$=f$thend1=s%(i-2):d2=s%(i-1):e1=t:e2=s:e3=i-3:return:rem e3=filetype
650 next:ifs%(0)<>0thent=s%(0):s=s%(1):gosub310:goto610
660 print" not found [146]":return
670 :
680 rem write sector to disk
690 print"writing trk:";t;"sec:";s
700 print#15,"b-p";2;0
710 fori=0to255
720 print#2,chr$(s%(i));
730 next
740 print#15,"u2";2;0;t;s
750 gosub170:return
760 :
770 :
780 rem get dir entry info
790 print"dir. entry information"
800 input"year :";t1:ift1>99then800
810 input"month:";t2:ift2>12then810
820 input"day :";t3:ift3>31then820
830 input"hour :";t4:ift4>23then830
840 input"min. :";t5:ift5>59then840
850 print"file:";f$:print"date:"t1;"/";t2;"/";t3;" time:";t4;":";t5:poke198,0
860 print"do you wish to change info (y/n[146]) ?":inputk$:ifk$="y"then790
870 return