home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_24_1988_Transactor_Publishing.d64 / maketogeos (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  2KB  |  79 lines

  1. 100 rem  save"maketogeos",8
  2. 110 rem originally part of larger prg
  3. 120 dims%(255)
  4. 130 gosub370
  5. 140 end
  6. 150 :
  7. 160 rem disk error
  8. 170 input#15,en,em$,et,es:ifen=0thenreturn
  9. 180 print" disk error [146]"en,em$,et,es
  10. 190 gosub250:return
  11. 200 :
  12. 210 open 15,8,15,"i0":rem <<open all>>
  13. 220 gosub170
  14. 230 open 2,8,2,"#"
  15. 240 return
  16. 250 close2 :rem    << close all >>
  17. 260 print#15,"i0"
  18. 270 forx=0to2000:next
  19. 280 close15:return
  20. 290 :
  21. 300 rem << read sector >> t,s,s%(255)
  22. 310 print"reading trk:";t;"sec:";s
  23. 320 print#15,"u1";2;0;t;s
  24. 330 gosub170:fori=0to255:get#2,b$
  25. 340 s%(i)=asc(b$+chr$(0)):next:return
  26. 350 :
  27. 360 rem convert a c64 file to geos
  28. 370 print"input filename":print:inputf$:iff$=""thenend
  29. 380 forx=0to15:f$=f$+chr$(160):next:f$=left$(f$,16)
  30. 390 gosub210:gosub 600:rem dir
  31. 400 t=d1:s=d2:gosub310:rem get info
  32. 410 e4=s%(0):e5=s%(1):rem link
  33. 420 s%(0)=0:s%(1)=255:rem /change
  34. 430 s%(2)=3:s%(3)=21 :rem /1st 4
  35. 440 gosub690:rem write block
  36. 450 t=e1:s=e2:gosub310:rem get dir
  37. 460 gosub 790:rem dir entry info
  38. 470 s%(e3)=131:rem user/c=64
  39. 480 s%(e3+1)=e4:s%(e3+2)=e5:rem vlir
  40. 490 s%(e3+19)=d1:s%(e3+20)=d2:reminfo
  41. 500 s%(e3+21)=0:rem seq/geos
  42. 510 s%(e3+22)=6:rem application/geos
  43. 520 s%(e3+23)=t1
  44. 530 s%(e3+24)=t2
  45. 540 s%(e3+25)=t3
  46. 550 s%(e3+26)=t4
  47. 560 s%(e3+27)=t5
  48. 570 gosub690:gosub250:return
  49. 580 :
  50. 590 rem find a dir entry
  51. 600 t=18:s=1:gosub310
  52. 610 fori=5to229step32
  53. 620 g$="":forj=0to15
  54. 630 g$=g$+chr$(s%(i+j)) :next
  55. 640 ifg$=f$thend1=s%(i-2):d2=s%(i-1):e1=t:e2=s:e3=i-3:return:rem e3=filetype
  56. 650 next:ifs%(0)<>0thent=s%(0):s=s%(1):gosub310:goto610
  57. 660 print"  not found  [146]":return
  58. 670 :
  59. 680 rem write sector to disk
  60. 690 print"writing trk:";t;"sec:";s
  61. 700 print#15,"b-p";2;0
  62. 710 fori=0to255
  63. 720 print#2,chr$(s%(i));
  64. 730 next
  65. 740 print#15,"u2";2;0;t;s
  66. 750 gosub170:return
  67. 760 :
  68. 770 :
  69. 780 rem get dir entry info
  70. 790 print"dir. entry information"
  71. 800 input"year :";t1:ift1>99then800
  72. 810 input"month:";t2:ift2>12then810
  73. 820 input"day  :";t3:ift3>31then820
  74. 830 input"hour :";t4:ift4>23then830
  75. 840 input"min. :";t5:ift5>59then840
  76. 850 print"file:";f$:print"date:"t1;"/";t2;"/";t3;"  time:";t4;":";t5:poke198,0
  77. 860 print"do you wish to change info (y/n[146]) ?":inputk$:ifk$="y"then790
  78. 870 return
  79.