home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 17 / CD_ASCQ_17_101194.iso / vrac / vester_e.zip / TGACONV.BAS < prev    next >
BASIC Source File  |  1994-08-08  |  14KB  |  260 lines

  1. 10 CLEAR,32768!:KEY OFF:CLS
  2. 15 GOTO 2000
  3. 20 X$="system"+CHR$(13):KEY 10,X$
  4. 22 KEY 6,"rcv"+CHR$(13):KEY 9,"txmit"+CHR$(13):KEY 4,"SAVE"+CHR$(13)
  5. 30 PRINT"                        TGA FILE CONVERSION":PRINT
  6. 40 PRINT"       This program converts a file coming from some source in a TGA"
  7. 50 PRINT"   format greater than 640x480 pixels  in  size with 24 bit color "
  8. 60 PRINT"   to a file which can be viewed and transmitted on the K3BC SSTV system"
  9. 70 PRINT"   in the Scottie, Martin, AVT, Wraase, Fax480, and Colorfax modes. It"
  10. 90 PRINT"   should accept any 640 pixel wide, 24 bit color TGA file. To see the"
  11. 92 PRINT"   SYSTEM CONFIGURATION hit Ctrl-Break and LIST 2000-3000. Use the same"
  12. 93 PRINT"   choices as were made for the VU.BAS program."
  13. 100 PRINT:PRINT:PRINT:PRINT"      What Mode desired  (3) Scottie 1 (4) Scottie 2 (5)AVT-90 (6)AVT-94"
  14. 110 INPUT"   (7) Martin 1 (77) Martin 2 (8) Wraase 96 (9) FAX480 (96)ColorFAX";I
  15. 120 IF I=3 THEN MO$=".s1":L=288:LL=878:LI=256:Z=249:GOTO 179
  16. 130 IF I=4 THEN MO$=".s2":L=184:LL=568:LI=256:Z=249:GOTO 179
  17. 140 IF I=5 THEN MO$=".90":L=256:LL=768:LI=240:Z=138:GOTO 179
  18. 150 IF I=6 THEN MO$=".94":L=320:LL=960:LI=200:Z=138:GOTO 179
  19. 155 IF I=8 THEN MO$=".96":L=236:LL=745:LI=256:Z=255:GOTO 179
  20. 160 IF I=7 THEN MO$=".m1":L=302:LL=915:LI=256:Z=249:GOTO 179
  21. 165 IF I=77 THEN MO$=".m2":L=152:LL=464:LI=256:Z=249:GOTO 179
  22. 170 IF I=9 THEN MO$=".fax":Z=249:LI=480:LL=546:GOTO 179
  23. 175 IF I=96 THEN MO$=".cfx":L=536:LL=1638:LI=480:Z=249:GOTO 179
  24. 178 GOTO 100
  25. 179 DEF SEG=&H5F00
  26. 180 BLOAD "tgaconv.asm",&H100
  27. 181 POKE &H22C,51:POKE &H241,74:POKE &H2CC,74
  28. 190 FOR Y=230 TO 1024
  29. 200 POKE (&H2320+Y),Z:NEXT Y
  30. 201 IF I=8 THEN POKE &H241,233:POKE &H242,136:POKE &H243,0:GOTO 310
  31. 202 PRINT:PRINT:PRINT:INPUT"   What TGA Path/File name-program adds suffix(Default=d:a.tga)";OF$
  32. 203 IF OF$="" THEN OF$="d:a"
  33. 204 OF$=OF$+".tga"
  34. 205 OF=0    'offset to get proper colors from different TGA sources
  35. 206 PRINT:INPUT"   Number of horizontal pixels in TGA file (default=768)";LF
  36. 207 IF LF=0 THEN LF=768
  37. 209 SK=12*LF:SKB=INT(SK/256):SKA=SK-256*SKB
  38. 210 LB=INT(L/256):LA=L-256*LB:POKE &H235,LA:POKE &H236,LB
  39. 211 PRINT:INPUT"   Vertical offset in lines (default=0)";VO
  40. 212 PRINT:PRINT:PRINT:INPUT"   Pixel offset to center desired part of image (Default=0)";PO:HO=3*LF-PO
  41. 213 TK=3*(2*LF+VO*LF+HO)+OF:TKB=INT(TK/256):TKA=TK-256*TKB
  42. 214 LFB=INT(3*LF/256):LFA= 3*LF-256*LFB:POKE &H257,LFA:POKE &H258,LFB
  43. 215 SU=6*LF:SUB=INT(SU/256):SUA=SU-256*SUB:POKE &H191,SUA:POKE &H192,SUB
  44. 216 TF=3*(LF+VO*LF+HO)+OF:TOB=INT(TF/256):TOA=TF-256*TOB
  45. 217 POKE &H309,TKA:POKE &H30A,TKB:POKE &H2F4,SKA:POKE &H2F5,SKB
  46. 218 LN=3*LF+3:LNB=INT(LN/256):LNA=LN-256*LNB:POKE &H25F,LNA:POKE &H260,LNB
  47. 220 LLB=INT(LL/256):LLA=LL-256*LLB:POKE &H1B9,LLA:POKE &H1BA,LLB
  48. 221 IF I=9 THEN POKE &H309,TOA:POKE &H30A,TOB:POKE &H2F4,SUA:POKE &H2F5,SUB
  49. 222 IF I=96 THEN POKE &H309,TOA:POKE &H30A,TOB:POKE &H2F4,SUA:POKE &H2F5,SUB
  50. 230 LIB=INT(LI/256):LIA=LI-256*LIB:POKE &H18B,LIA:POKE &H18C,LIB
  51. 231 IF I=9 THEN POKE &H1A7,192:POKE &H191,LFA:POKE &H192,LFB
  52. 232 IF I=7 THEN POKE &H22C,50
  53. 233 IF I=77 THEN POKE &H22C,50:POKE &H23D,12
  54. 234 IF I=4 THEN POKE &H23D,9
  55. 235 IF I=96 THEN POKE &H239,154:POKE &H23A,0:POKE &H191,LFA:POKE &H192,LFB:POKE &H244,233:POKE &H245,157:POKE &H246,0:POKE &H23D,3
  56. 250 PRINT:PRINT:PRINT:INPUT"   Output File Path/Name-program adds suffix(Default=d:a)";PIX$
  57. 260 IF PIX$="" THEN PIX$=DR$+":a"
  58. 270 NF$=PIX$+MO$
  59. 271 POKE &H187,2
  60. 280 K=&H100:CALL K(K%,L%,OF$,NF$)
  61. 285 IF I=96 THEN L=546:LL=1638:P=536:GOTO 1895
  62. 290 GOTO 400
  63. 310 FOR Y=742 TO 745
  64. 320 POKE (&H2320+Y),138:NEXT Y
  65. 330 GOTO 202
  66. 400 BLOAD "vu64ba.asm",&H100
  67. 410 A$=NF$
  68. 420 IF I=3 THEN L=288
  69. 430 IF I=3 THEN L=288
  70. 440 IF I=4 THEN L=184
  71. 450 IF I=5 THEN L=256
  72. 460 IF I=6 THEN L=320
  73. 470 IF I=7 THEN GOTO 740
  74. 480 IF I=77 THEN GOTO 740
  75. 490 IF I=8 THEN L=248
  76. 602 POKE &H226,2  'No. poked here=pixels scrolled per left arrow depression
  77. 605 POKE &H427,PT
  78. 607 IF I=9 THEN GOTO 900
  79. 610 P=L-PT:P2=INT(P/256):P1=P-P2*256
  80. 620 POKE &H15D,P1:POKE &H15E,P2:POKE &H45B,P1:POKE &H45C,P2
  81. 630 IF I=4 THEN POKE &H3EA,16:LL=568
  82. 635 IF I=5 THEN POKE &H3EA,0:LL=768
  83. 640 IF I=7 THEN POKE &H3EA,9:LL=915
  84. 641 IF I=77 THEN POKE &H3EA,8:LL=464
  85. 642 IF I=8 THEN POKE &H3EA,1:LL=745
  86. 645 IF I=6 THEN POKE &H3EA,0:LL=960
  87. 650 IF I=3 THEN POKE &H3EA,14:LL=878
  88. 651 IF EX=0 THEN GOTO 659
  89. 652     'next two lines put in expand by 2 for modes desired
  90. 653 IF I=4 THEN P=320:POKE &H43B,235:POKE &H43C,27:POKE &H15A,0:POKE &H15B,2
  91. 654 IF I=77 THEN P=2*P:POKE &H43B,235:POKE &H43C,27:POKE &H15A,0:POKE &H15B,2
  92. 659 OF=(640-2*P)/2:OF2=INT(OF/256):OF1=OF-256*OF2:POKE &H13B,OF1:POKE &H13C,OF2
  93. 660 LL2=INT(LL/256):LL1=LL-256*LL2:POKE &H1FD,LL1:POKE &H1FE,LL2:POKE &H242,LL1:POKE &H243,LL2
  94. 670 IF V=1 THEN GOTO 683
  95. 680 VC=0:PRINT:PRINT:PRINT"  Is Video Card (1)Trident mode 5D (2)Tseng mode 2E (3)ATI mode 62"
  96. 681 INPUT"(4)Paradise mode 5F (5)Chips&Tech mode 79 (6)Genoa mode 5C (7)VESA (Default=7)";VC
  97. 682 IF VC=0 THEN VC=7       'default choice
  98. 683 IF VC=1 THEN GOTO 1590
  99. 684 IF VC=2 THEN GOTO 710
  100. 685 IF VC=3 THEN GOTO 1600
  101. 686 IF VC=4 THEN GOTO 1650
  102. 690 IF VC=5 THEN GOTO 1700
  103. 700 IF VC=6 THEN GOTO 1750
  104. 701 IF VC=7 THEN GOTO 1800
  105. 705 GOTO 680
  106. 710 POKE &H113,46:POKE &H142,205:POKE &H144,136:POKE &H145,216:POKE &H146,238:POKE &H147,195
  107. 720 K=&H100
  108. 721 IF I=99 THEN CALL K(C%,S%,A$):GOTO 730
  109. 722 CALL K(S%,A$)
  110. 725 PRINT:PRINT:INPUT" Choices (F2)Re-RUN (F4)SAVE (F5)BASIC (F6)RCV (F9)TXMIT (F10)DOS (Def=BASIC)";Z$
  111. 726 IF Z$="" THEN Z$="cont"
  112. 727 IF Z$="RUN" THEN LOAD "tgaconv.bas",R
  113. 728 IF Z$="SAVE" THEN GOTO 1255
  114. 730 IF Z$="CONT" THEN PRINT"        Hit F2 to Re-RUN----Hit F10 to DOS":KEY 9,"files"+CHR$(34):KEY 4,"SAVE"+CHR$(34):END
  115. 731 IF Z$="system" THEN SYSTEM
  116. 732 IF Z$="rcv" THEN LOAD"rt.bas",R
  117. 733 IF Z$="txmit" THEN LOAD "vt.bas",R
  118. 734 GOTO 725
  119. 740 POKE &H180,128:POKE &H3DA,128:POKE &H3CB,64:POKE &H3BC,192
  120. 745 IF I=77 THEN L=152:GOTO 602
  121. 750 L=302:GOTO 602
  122. 800 L=282
  123. 801 BLOAD "vurobol.asm",&H100
  124. 802 POKE &H4BD,10:POKE &H350,10      'initial color offset in robot 72
  125. 810 PT=4     'pixels trimmed on Robot 72
  126. 815 POKE &H16A,(141-PT):POKE &H3D4,(141-PT)
  127. 816 POKE &H46A,(76+4*PT)
  128. 817 POKE &H4D5,(75+4*PT)
  129. 825 POKE &H337,TU:POKE &H33F,TU:POKE &H2D7,TU:POKE &H2DF,TU
  130. 835 IF BR=0 THEN POKE &H4EC,208:POKE &H4ED,232:POKE &H4EE,235:POKE &H4EF,4
  131. 840 IF BR=2 THEN POKE &H4EC,235:POKE &H4ED,6
  132. 850 OF=(640-2*L)/2:OF2=INT(OF/256):OF1=OF-256*OF2:POKE &H13B,OF1:POKE &H13C,OF2
  133. 860 POKE &H226,2:POKE &H1FD,102:POKE &H1FE,2:POKE &H242,102:POKE &H243,2:POKE &H15D,102
  134. 861 IF I=2 THEN GOTO 870
  135. 862 POKE &H1FD,85:POKE &H242,85:POKE &H15D,85
  136. 870 GOTO 670
  137. 900 POKE &H15D,24:POKE &H15E,2:POKE &H184,235:POKE &H185,1:POKE &H180,0:POKE &H3A8,235:POKE &H3A9,57
  138. 910 POKE &H3EA,10:POKE &H3A2,224:POKE &H3A3,1:POKE &H13B,52:POKE &H13C,0:POKE &H16A,128:POKE &H16B,2
  139. 920 LL=546:GOTO 660
  140. 950 PRINT:PRINT:PRINT:INPUT"   Do you choose (1)1024x768 or (2)640x480 (Default=1)";S
  141. 960 IF S=0 THEN S=1
  142. 970 BLOAD "vuwx.asm",&H100
  143. 980 IF S=2 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1:POKE &H113,93
  144. 981 PRINT:PRINT:INPUT"   What White level count do you choose (Default=138)";W
  145. 982 IF W=0 THEN W=138
  146. 985 POKE &H170,W:POKE &H174,W:POKE &H176,W
  147. 990 GOTO 680
  148. 1100 BLOAD "vuro36l.asm",&H100
  149. 1102 IF BR=0 THEN POKE &H4EC,208:POKE &H4ED,232:POKE &H4EE,235:POKE &H4EF,4
  150. 1103 IF BR=2 THEN POKE &H4EC,235:POKE &H4ED,6
  151. 1104 POKE &H4BD,8:POKE &H350,8      'initial color offset in robot 36
  152. 1110 LL=616:POKE &H13B,140:POKE &H226,1:POKE &H15D,100:POKE &H1F2,12
  153. 1120 IF I=11 THEN LL=576:POKE &H15D,64:POKE &H3BB,64:POKE &H3EF,0:POKE &H4A8,0:POKE &H441,0:POKE &H2F6,32:POKE &H303,32
  154. 1130 GOTO 660
  155. 1250 PRINT:PRINT:INPUT"   Do you want to save last picture-y or n (Default=n)";P$
  156. 1251 IF P$="" THEN P$="n"
  157. 1252 IF P$="n" THEN GOTO 725
  158. 1253 IF P$="y" THEN GOTO 1255
  159. 1254 GOTO 1250
  160. 1255 OF$=NF$
  161. 1260 PRINT:PRINT:PRINT OF$:PRINT:PRINT:INPUT"   Save it in compressed format--y or n (Default=n)";F$
  162. 1261 IF F$="" THEN F$="n"
  163. 1262 IF F$="n" THEN GOTO 1270
  164. 1263 IF F$="y" THEN GOTO 1270
  165. 1264 GOTO 1260
  166. 1270 DEF SEG=&H4F00
  167. 1280 BLOAD "savepix.asm",&H100
  168. 1300 PI=512:PO=512:K%=0:L%=0
  169. 1310 POKE &H192,LL1:POKE &H193,LL2:POKE &H1B9,LL1:POKE &H1BA,LL2
  170. 1320 BY=3*L-1:BYB=INT(BY/256):BYA=BY-256*BYB:POKE &H20D,BYA:POKE &H20E,BYB
  171. 1330 IF S%<0 THEN S!=65536!+S% ELSE S!=S%
  172. 1340 S2=INT(S!/256):S1=S!-256*S2:POKE &H163,S1:POKE &H164,S2
  173. 1360 PRINT:PRINT:PRINT"   The program will add an appropiate Mode suffix."
  174. 1370 PRINT:INPUT"       What Name  for Picture (Default is DO NOT SAVE)";PIX$
  175. 1380 IF PIX$="" THEN GOTO 725
  176. 1390 IF I=3 THEN MO$=".s1":LE%=410
  177. 1400 IF I=4 THEN MO$=".s2":LE%=300
  178. 1410 IF I=5 THEN MO$=".90":LE%=360
  179. 1420 IF I=66 THEN MO$=".188":LE%=640
  180. 1430 IF I=6 THEN MO$=".94":LE%=450
  181. 1440 IF I=9 THEN MO$=".fax":LE%=480
  182. 1450 IF I=96 THEN MO$=".cfx":LE%=1440
  183. 1460 IF I=7 THEN MO$=".m1":LE%=420
  184. 1470 IF I=77 THEN MO$=".m2":LE%=300
  185. 1480 IF I=8 THEN MO$=".96":LE%=300
  186. 1490 L2=INT(LE%/256):L1=LE%-256*L2:POKE &H18B,L1:POKE &H18C,L2
  187. 1500 PF$=PIX$+MO$
  188. 1505 IF F$="y" THEN PF$=DR$+":"+PF$
  189. 1510 K=&H100:CALL K(K%,L%,OF$,PF$)
  190. 1520 IF F$="n" THEN GOTO 725
  191. 1522 IF F$="y"THEN PRINT:PRINT:INPUT"   What path/directory for compressed file";X$:GOTO 1524
  192. 1523 GOTO 1522
  193. 1524 SHELL "pk "+X$+" "+DR$+":"+" "+PIX$+" "+MO$
  194. 1525 GOTO 725
  195. 1590 IF I=6 THEN POKE &H113,&H5C
  196. 1595 GOTO 720
  197. 1600 POKE &H113,&H62:POKE &H444,192:POKE 321,235:POKE 322,90  'ATI video mode 62
  198. 1610 POKE 324,136:POKE 325,196
  199. 1615 POKE 326,128:POKE 327,228:POKE 328,225:POKE 329,208:POKE 330,227:POKE 331,8
  200. 1620 POKE 332,220:POKE 333,176:POKE 334,178:POKE 335,254:POKE 336,202:POKE 337,239:POKE 338,195
  201. 1630 IF I=99 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1:POKE 321,233:POKE 322,66:POKE 323,4:POKE &H58A,192
  202. 1635 IF I=6 THEN POKE &H113,&H61
  203. 1640 GOTO 720
  204. 1650 POKE &H113,&H5F:POKE 321,186:POKE 322,206          'Paradise video mode 5f
  205. 1660 POKE 323,3:POKE 324,176:POKE 325,9:POKE 326,136:POKE 327,220:POKE 328,208
  206. 1665 POKE 329,228:POKE 330,208:POKE 331,228:POKE 332,208:POKE 333,228:POKE 334,208:POKE 335,228
  207. 1670 POKE 336,239:POKE 337,195
  208. 1680 IF I=99 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1
  209. 1685 IF I=6 THEN POKE &H113,&H5E
  210. 1690 GOTO 720
  211. 1700 POKE &H113,&H79:POKE 321,186:POKE 322,214            'Chips & Tech Mode 79
  212. 1710 POKE 323,3:POKE 324,176:POKE 325,16:POKE 326,136:POKE 327,220:POKE 328,208
  213. 1715 POKE 329,228:POKE 330,208:POKE 331,228:POKE 332,239:POKE 333,195
  214. 1730 IF I=99 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1
  215. 1735 IF I=6 THEN POKE &H113,&H78
  216. 1740 GOTO 720
  217. 1750 POKE &H113,&H5C:POKE 321,186:POKE 322,196                   'Genoa mode 5c
  218. 1760 POKE 323,3:POKE 324,176:POKE 325,6:POKE 326,238:POKE 327,66:POKE 328,236
  219. 1765 POKE 329,36:POKE 330,199:POKE 331,128:POKE 332,227:POKE 333,7:POKE 334,208
  220. 1770 POKE 335,227:POKE 336,208:POKE 337,227:POKE 338,208:POKE 339,227:POKE 340,8
  221. 1780 POKE 341,216:POKE 342,238:POKE 343,195
  222. 1785 IF I=99 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1
  223. 1787 IF I=6 THEN POKE &H113,&H7E
  224. 1790 GOTO 720
  225. 1800 POKE &H111,79:POKE &H113,2:POKE 321,177                   'VESA mode 101
  226. 1810 POKE 322,BS:POKE 323,210:POKE 324,227:POKE 325,136:POKE 326,218
  227. 1820 POKE 327,48:POKE 328,246:POKE 329,184:POKE 330,5:POKE 331,79:POKE 332,49:POKE 333,219:POKE 334,205
  228. 1821 POKE 335,16:POKE 336,195
  229. 1825 IF S=1 THEN POKE &H44A,5:GOTO 1840
  230. 1830 IF I=99 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1
  231. 1835 'IF I=6 THEN POKE &H398,0
  232. 1840 GOTO 720
  233. 1895 A$=NF$
  234. 1900 BLOAD "trusho.asm",&H100
  235. 1905 P2=INT(P/256):P1=P-256*P2:POKE &H3B0,P1:POKE &H3B1,P2:POKE &H46B,P1:POKE &H46C,P2
  236. 1910 OF=3*(640-P)/2:OF2=INT(OF/256):OF1=OF-256*OF2:POKE &H13C,OF1:POKE &H13D,OF2:POKE &H512,OF1:POKE &H513,OF2
  237. 1915 Z=2*L:ZB=INT(Z/256):ZA=Z-256*ZB:POKE &H3CA,ZA:POKE &H3CB,ZB
  238. 1920 W=2*L+32:WB=INT(W/256):WA=W-256*WB:POKE &H3A9,WA:POKE &H3AA,WB:POKE &H3E5,WA:POKE &H3E6,WB
  239. 1925 LB=INT(L/256):LA=L-256*LB:POKE &H3BC,LA:POKE &H3BD,LB:POKE &H3C3,LA:POKE &H3C4,LB
  240. 1930 U=3*L:UB=INT(U/256):UA=U-256*UB:POKE &H55F,UA:POKE &H560,UB:POKE &H531,UA:POKE &H532,UB
  241. 1935 POKE &H427,10:POKE &H226,2  'poke to &h226 is pixels per left arrow depress
  242. 1940 LL2=INT(LL/256):LL1=LL-256*LL2:POKE &H1FD,LL1:POKE &H1FE,LL2:POKE &H242,LL1:POKE &H243,LL2:POKE &H15D,LL1:POKE &H15E,LL2
  243. 1945 Q=BL-3*P:QB=INT(Q/256):QA=Q-256*QB:POKE &H3D6,QA:POKE &H3D7,QB
  244. 1950 POKE &H39A,233:POKE &H39B,107:POKE &H39C,253:POKE &H11A,0:POKE &H11B,0:POKE &H2B8,235:POKE &H2B9,6:POKE &H3AC,1:POKE &H3B4,1
  245. 1951 POKE &H3A2,224:POKE &H3A3,1
  246. 1955 GOTO 1800
  247. 2000    '                   SYSTEM CONFIGURATION
  248. 2010    'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  249. 2020 V=1     'V=0 is manual video card choice---V=1 is automatic choice
  250. 2030 VC=7    'Video card 1=Trident 2=Tseng 3=ATI 4=Paradise 5=Chips 6=Genoa
  251. 2040         '7=VESA (VESA card or VESA driver.Pick BS below to get full pix).
  252. 2045 BS=4    'BANK SHIFT FOR DIFFERENT VESA CONFIGURATIONS-VALUES FROM 0 TO 6
  253. 2046 BL=2048 'Bytes/Line in TRUCOLOR modes-ATI=1920 and Diamond PRO=2048
  254. 2050 DR$="d" 'RAMDISK drive designation--make letter D match your drive
  255. 2060 BR=2    'Robot brightness control-br=2 is high-br=1 is med-br=0 is low
  256. 2070 TU=2    'Robot tuning increment with F and G in ten's of cycles
  257. 2080 PT=6    'Pixels trimmed from edge of picture--see line 810 for Robot
  258. 2090 EX=1    'For S2 and M2. EX=0 is as rcvd. EX=1 is EXpanded to fill screen
  259. 2100 GOTO 20
  260.