home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1993 October / 1993-10.d64 / megamorphs (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  134 lines

  1. 10 rem megamorphs v2.0 by tom zdanowicz
  2. 80 rem copyright 1993 - compute publications intl ltd - all rights reserved
  3. 85 ifa=0thena=1:load"morph.ml",8,1
  4. 94 open15,8,15
  5. 95 print"[147]":poke53280,0:poke53281,0:print"  please insert work disk with images"
  6. 96 print"     and press a key to continue"
  7. 97 geta$:ifa$=""then97
  8. 100 print"[147]":poke53280,0:poke53281,0
  9. 110 print:print:printspc(14)"megamorphs"
  10. 120 print spc(14)"[183][183][183][183][183][183][183][183][183][183]":print:print
  11. 130 print "[159]1. load keyframes & morph (builds s/s)":print
  12. 140 print "2. morph existing s/s points files":print
  13. 155 print "3. look":print
  14. 157 print "5. exit"
  15. 160 get c$:c=val(c$):ifc<1orc>5then 160
  16. 170 on c goto 200,190,6021,180
  17. 180 sys64738
  18. 190 gosub 9000:goto8020
  19. 200 rem *set bitmap and load keyframes*
  20. 204 print"image file type (p[146]rg/s[146]eq)":getft$
  21. 205 ifft$<>"s"andft$<>"p"thenprint"[145][145]":goto204
  22. 206 gosub9000
  23. 230 rem *******load keyframe1*******
  24. 241 mb=n1*320:nm$="0:1pag,"+ft$+",r"
  25. 250 gosub6040:open5,8,5,"0:startpoints,s,w":ymax=n1*8:gosub300:l1=ct
  26. 252 mb=n2*320:nm$="0:2pag,"+ft$+",r"
  27. 253 gosub6040:open5,8,5,"0:stoppoints,s,w":ymax=n2*8:gosub 300:l2=ct
  28. 260 gosub 7031:goto8026
  29. 297 rem *** map image to disk *****
  30. 300 poke53280,2:ct=0:fory=0 toymax:forx=0to319
  31. 301 hb=int(x/256):lb=x-(256*hb)
  32. 310 poke 840,lb:poke841,hb:poke842,y:poke 766,0:sys49271
  33. 320 if peek(767)=0 then 340
  34. 330 print#5,x:print#5,y:ct=ct+2
  35. 340 next:next:close5:return
  36. 6010 rem ***view image file*****
  37. 6021 gosub6025:goto6105
  38. 6025 print"image file type (p[146]rg/s[146]eq)":getft$
  39. 6026 ifft$<>"s"andft$<>"p"thenprint"[145][145]":goto6025
  40. 6030 print"[147]":input"filename to view";n$:nm$="0:"+n$+","+ft$+",r"
  41. 6031 ifft$="p"then6055
  42. 6035 input"number of rows to view/save";nr:mb=nr*320
  43. 6040 sys49161:poke680,12:sys49220
  44. 6050 bc=peek(53280):poke53280,6:open5,8,5,nm$:goto6057
  45. 6055 sys49161:poke680,12:sys49220:poke147,0:sys57812n$,8,1:sys62631:goto6105
  46. 6057 ad=8192:nb=0
  47. 6060 get#5,x$
  48. 6070 ifx$=""thenx$=chr$(0)
  49. 6075 x=asc(x$):pokead,x:ad=ad+1:nb=nb+1:ifnb=mbthen6100
  50. 6076 if st=64then6100
  51. 6080 goto6060
  52. 6100 close5:poke53280,bc:return
  53. 6105 geta$:ifa$=""then6105
  54. 6107 rem ***recover text mode******     6108 rem **************************
  55. 6110 poke53265,peek(53265)and223:poke53272,(peek(53272)and240)or4:goto100
  56. 7010 rem ** remap and equalize ****
  57. 7020 rem * startpoints/stoppoints *
  58. 7031 poke53280,7
  59. 7040 ifl1<l2then 7070
  60. 7050 ifl2<l1then 7200
  61. 7060 ifl1=l2then return
  62. 7070 open5,8,5,"0:startcopy,s,w":open6,8,6,"0:startpoints,s,r"
  63. 7080 input#6,x:input#6,y:su=st:print#5,x:print#5,y:ifsu=64then7100
  64. 7090 goto7080
  65. 7100 close5:close6
  66. 7110 open5,8,5,"0:startpoints,a":open6,8,6,"0:startcopy,s,r"
  67. 7120 input#6,x:input#6,y:su=st:print#5,x:print#5,y:l1=l1+2:ifl1=l2then7150
  68. 7121 ifsu=64then7140
  69. 7130 goto 7120
  70. 7140 close6:open6,8,6,"0:startcopy,s,r":goto7120
  71. 7150 close5:close6:print#15,"s0:startcopy":return
  72. 7200 open5,8,5,"0:stopcopy,s,w":open6,8,6,"0:stoppoints,s,r"
  73. 7210 input#6,x:input#6,y:su=st:print#5,x:print#5,y:ifsu=64then7230
  74. 7220 goto7210
  75. 7230 close5:close6
  76. 7240 open5,8,5,"0:stoppoints,a":open6,8,6,"0:stopcopy,s,r"
  77. 7250 input#6,x:input#6,y:su=st:print#5,x:print#5,y:l2=l2+2:ifl2=l1then7290
  78. 7260 ifsu=64then7280
  79. 7270 goto 7250
  80. 7280 close6:open6,8,6,"0:stopcopy,s,r":goto7250
  81. 7290 close5:close6:print#15,"s0:stopcopy":return
  82. 8000 rem ************************
  83. 8010 rem *** morph two images ***
  84. 8020 rem **** main menu option 2 here**
  85. 8021 print:print:open5,8,5,"0:startpoints,s,r":l1=0
  86. 8022 input#5,v:l1=l1+1:ifst<>64then8022
  87. 8023 print"[156]number of pixels in s/s files=";int(l1/2)
  88. 8024 print:print"       press a key to continue[146][159]":close5
  89. 8025 geta$:ifa$=""then8025
  90. 8026 rem ***main menu option 1 here**
  91. 8027 poke53280,5
  92. 8030 ss=1/ns
  93. 8040 fori=0tons:sys49161:poke680,12:sys49220:ia=i*ss
  94. 8045 open5,8,5,"0:startpoints,s,r":open6,8,6,"0:stoppoints,s,r"
  95. 8050 forj=0tol1step2
  96. 8055 input#5,x:input#5,y:input#6,x2:input#6,y2
  97. 8060 x1=x+ia*(x2-x):y1=y+ia*(y2-y)
  98. 8070 hb=int(x1/256):lb=x1-(256*hb)
  99. 8080 poke840,lb:poke841,hb:poke842,y1:poke766,1:sys49271
  100. 8090 next:close5:close6
  101. 8091 rem ***build slide filename**
  102. 8092 ifi=si then gosub 8700
  103. 8093 gosub 8500
  104. 8105 bc=peek(53280):poke53280,14:sys49612:poke53280,bc:next
  105. 8111 rem ****recover text mode****
  106. 8200 poke53265,peek(53265)and223:poke53272,(peek(53272)and240)or4:print"[147]"
  107. 8201 print:print:print"           [159]morph finished"
  108. 8202 print:print:print:print:print:print:print"           press any key[146]"
  109. 8240 geta$:ifa$<>""then100
  110. 8242 poke54296,21:poke54277,9:poke54278,0:poke54273,48:poke54276,32:poke54276,33
  111. 8244 poke53280,253-(peek(53280)+1):ford=1to300:next:goto8240
  112. 8500 sn=i+1+os:s$=str$(sn)
  113. 8510 ifsn>9then8540
  114. 8520 s$=mid$(s$,2,1):s$="0"+s$
  115. 8530 goto 8550
  116. 8540 s$=mid$(s$,2,2)
  117. 8550 sn$="slide"+s$
  118. 8560 mm=757:forp=1to7:k$=mid$(sn$,p,1):pokemm,asc(k$):mm=mm+1:next
  119. 8570 ifn1>n2thenmb=n1*320
  120. 8580 ifn2>n1thenmb=n2*320
  121. 8590 ifn1=n2thenmb=n1*320
  122. 8600 la=8192+mb:lh=int(la/256):ll=la-(256*lh):poke755,ll:poke756,lh:return
  123. 8700 i1=i:o1=os:os=0
  124. 8710 fori=sitoei:gosub8500
  125. 8720 bc=peek(53280):poke53280,14:sys49612:poke53280,bc:next
  126. 8730 i=i1:os=o1:return
  127. 9000 input"#rows in imag1(1-25)";n1:ifn1<1orn1>25thenprint"[145][145]":goto9000
  128. 9005 input"#rows in imag2(1-25)";n2:ifn2<1orn2>25thenprint"[145][145]":goto9000
  129. 9010 input"number of frames(2-99)";ns:ifns<2orns>99thenprint"[145][145]":goto9010
  130. 9012 ns=ns-1
  131. 9015 os=0:input"frame offset";os$:ifval(os$)>99oros<0thenprint"[145][145]":goto9015
  132. 9016 os=val(os$):return
  133. 10060 goto100
  134.