home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 10 / 010.d81 / tinkertools (.txt) < prev    next >
Encoding:
Commodore BASIC  |  1985-01-01  |  4.0 KB  |  156 lines

  1. 500 poke52,112:poke56,112:clr:poke650,128:cr$=chr$(13):zz$=str$(999)
  2. 502 dima$(92):x=160:y=100:pn=28673:pokepn,112:poke(pn+1),3
  3. 504 print"            tinkertools  cad"
  4. 506 print"          by james chandler jr"
  5. 508 print"             copyright 1984"
  6. 510 gosub766:D 2,1:D 1,2,7:f=0:b=1
  7. 512 gosub568:DI:D 0:goto652
  8. 514 iff>15thenf=0
  9. 518 ifb>15thenb=0
  10. 520 poke53280,b:onegosub696,694
  11. 522 pm=2:s=1
  12. 524 getz$:ifz$=""thengosub578:gosub578:i=1:goto524
  13. 526 ifz$=chr$(17)theny=y+i:i=i+1:goto576
  14. 528 ifz$=chr$(145)theny=y-i:i=i+1:goto576
  15. 530 ifz$=chr$(29)thenx=x+i:i=i+1:goto576
  16. 532 ifz$=chr$(157)thenx=x-i:i=i+1:goto576
  17. 534 d=asc(z$)-132:ifd<0then538
  18. 536 ondgoto552,556,564,560,554,558,566,562
  19. 538 d=asc(z$)-33:ifd>(-1)andd<62thena=d:goto524
  20. 540 d=asc(z$)-131:ifd>61andd<91thena=d:goto524
  21. 542 ifz$=chr$(95)then gosub614:goto576
  22. 544 ifz$=chr$(191)thenb=b+1:goto514
  23. 546 ifz$=chr$(187)thenf=f+1:goto514
  24. 548 ifz$=chr$(172)thengoto616
  25. 550 ifz$=chr$(167)thengosub692:goto652
  26. 552 a=a+1:goto576
  27. 554 a=a-1:goto576
  28. 556 rt=rt+1:goto576
  29. 558 rt=rt-1:goto576
  30. 560 pm=1:gosub578:pm=2:goto576
  31. 562 pm=0:gosub578:pm=2:goto576
  32. 564 s=s+1:goto576
  33. 566 s=s-1:goto576
  34. 568 getz$:ifz$=""then568
  35. 570 return
  36. 572 pokepn,(int(w/256)):poke(pn+1),(w-(peek(pn)*256)):return
  37. 574 ford=0to300:nextd:return
  38. 576 gosub578:gosub578:goto524
  39. 578 ifa>90thena=90
  40. 580 ifa<0thena=0
  41. 582 ify>200theny=200
  42. 584 ify<1theny=1
  43. 586 ifx>318thenx=318
  44. 588 ifx<1thenx=1
  45. 590 ifrt>7thenrt=0
  46. 592 ifrt<0thenrt=7
  47. 594 ifs<1thens=1
  48. 596 gosub762:gosub764
  49. 598 ifpm=2then612
  50. 600 w=(256*peek(pn))+peek(pn+1)
  51. 602 pokew,rt:poke(w+1),s:poke(w+2),a
  52. 604 poke(w+3),(int(x/256)):poke(w+4),(x-(peek(w+3)*256))
  53. 606 poke(w+5),y:poke(w+6),pm
  54. 608 w=w+7:gosub572
  55. 610 ifw>(pn+4088)then650
  56. 612 return
  57. 614 DW:return
  58. 616 onegosub696,694
  59. 618 px=(peek(pn)*256)+peek(pn+1)-1
  60. 620 forw=(pn+2)topxstep7
  61. 622 rt=peek(w):s=peek(w+1)
  62. 624 ifrt<0orrt>7then640
  63. 626 gosub762
  64. 628 a=peek(w+2):ifa<0ora>90then640
  65. 630 x=(256*peek(w+3))+peek(w+4):ifx<0orx>318then640
  66. 632 y=peek(w+5):ify<0ory>200then640
  67. 634 pm=peek(w+6):ifpm<0orpm>2then640
  68. 636 gosub764
  69. 638 nextw:pm=2:goto524
  70. 640 gosub692:print"bad drawing data encountered"
  71. 642 w=int((w-pn+2)/7)
  72. 644 print"last good data at drawing pointer "w
  73. 646 print"press (commodore) m to continue"
  74. 648 w=px:goto638
  75. 650 gosub692:print"drawing memory is full":gosub766:gosub568
  76. 652 print"            tinkertools menu"
  77. 654 print"0.   load drawing"
  78. 656 print"1.   go to blank hires screen"
  79. 658 print"2.   go to previous hires screen"
  80. 660 print"3.   save drawing"
  81. 662 print"4.   view directory"
  82. 664 print"5.   reset drawing pointer"
  83. 666 print"6.   find drawing pointer"
  84. 668 print"7.   load figures"
  85. 670 print"8.   create figures"
  86. 672 print"9.   save figures"
  87. 674 gosub568:z=asc(z$):ifz<48orz>57then674
  88. 675 z=val(z$)+1:onzgoto678,680,682,684,688,698,706,788,710,778
  89. 676 goto674
  90. 678 gosub768:poke780,0:sys65493:gosub766:gosub568:goto652
  91. 680 e=1:goto514
  92. 682 e=2:goto514
  93. 684 gosub768:poke251,1:poke252,112:poke780,251
  94. 686 poke781,peek(pn+1):poke782,peek(pn):sys65496:gosub766:gosub568:goto652
  95. 688 Dj "$
  96.  
  97. 690 gosub766:gosub568:goto652
  98. 692 DP 0:return
  99. 694 DP 2:return
  100. 696 D f,b:return
  101. 698 print"set drawing pointer to what value? (999 to abort)"
  102. 700 inputw:ifw=999then706
  103. 702 ifw<0orw>584thenprint"out of range value":goto706
  104. 704 w=(w*7)+pn+2:gosub572
  105. 706 w=(256*peek(pn))+peek(pn+1):w=(w-pn+2)/7:w=int(w)
  106. 708 print"current drawing pointer is "w:gosub766:gosub568:goto652
  107. 710 a=91:az=0:a$(a)="":pm=1
  108. 712 gosub696:gosub762
  109. 714 gosub568
  110. 716 ifz$="e"then744
  111. 718 ifz$="x"then748
  112. 720 ifz$="s"then746
  113. 722 ifz$=chr$(19)then712
  114. 724 ifz$=chr$(147)then710
  115. 726 ifz$=chr$(29)thenv=0:goto736
  116. 728 ifz$=chr$(157)thenv=3:goto736
  117. 730 ifz$=chr$(145)thenv=1:goto736
  118. 732 ifz$=chr$(17)thenv=2:goto736
  119. 734 goto714
  120. 736 gosub568:ifz$=chr$(136)orz$=chr$(140)thenv=v+5:goto740
  121. 738 ifz$<>chr$(135)andz$<>chr$(139)then736
  122. 740 a$(a)=a$(a)+right$(str$(v),1):iflen(a$(a))>254then748
  123. 742 gosub764:goto714
  124. 744 az$=a$(a):goto710
  125. 746 az=az+1:a$(a)=a$(a)+mid$(az$,az,1):goto742
  126. 748 gosub692:print""
  127. 750 print"hit key which represents figure":print"(f8 to abort)":gosub568
  128. 752 ifz$=chr$(140)then652
  129. 754 d=asc(z$)-33:ifd>(-1)andd<62thena=d:goto760
  130. 756 d=asc(z$)-131:ifd>61andd<91thena=d:goto760
  131. 758 print"invalid key":goto750
  132. 760 a$(a)=a$(91):goto652
  133. 762 D rt,s:return
  134. 764 D
  135.  a$(a),x,y,pm:return
  136. 766 print:print"      *** any key to continue ***":return
  137. 768 print"drawing name (x to abort)":inputf$:ifright$(f$,1)="x"then652
  138. 770 l=len(f$):ifl>15thenprint"name too long":goto768
  139. 772 forx=1tol:poke819+x,asc(mid$(f$,x,1)):nextx
  140. 774 poke780,4:poke781,8:poke782,1:sys65466
  141. 776 poke780,l:poke782,3:poke781,52:sys65469:return
  142. 778 gosub800:open8,8,8,"0:"+f$+",s,w"
  143. 780 fora=0to90:l=len(a$(a)):ifl=0then786
  144. 782 lx$=str$(int((l/51)+.99)):ax$=str$(a):print#8,lx$cr$ax$cr$;
  145. 784 fori=1tolstep51:z$=mid$(a$(a),i,51):print#8,z$cr$;:nexti
  146. 786 nexta:print#8,zz$:close8:gosub766:gosub568:goto652
  147. 788 gosub800:open8,8,8,"0:"+f$+",s,r"
  148. 790 input#8,lx$:input#8,ax$
  149. 792 l=val(lx$):ifl>5then798
  150. 794 a=val(ax$):a$(a)=""
  151. 796 fori=1tol:input#8,z$:a$(a)=a$(a)+z$:next:goto790
  152. 798 close8:gosub766:gosub568:goto652
  153. 800 print"name of figure set (x to abort)"
  154. 802 inputf$:ifright$(f$,1)="x"then652
  155. 804 iflen(f$)>15thenprint"name too long":goto800
  156. 806 return
  157.