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

  1. 10   'RT.BAS is a program to Receive & Transmit Color SSTV/FAX480/Wefax signals
  2. 20 CLEAR,32768!:KEY OFF:CLS:A=0:B=0:H=0:M=0:D=0:Z=0
  3. 22 COLOR 7,9,4
  4. 30 GOTO 3000
  5. 40 KEY 8,"98"+CHR$(13):KEY 7,"97"+CHR$(13):KEY 9,"222"+CHR$(13):KEY 10,"666"+CHR$(13):KEY 5,"888"+CHR$(13)
  6. 41 KEY 1,"111"+CHR$(13):KEY 6,"333"+CHR$(13)
  7. 51 IF MP=1 AND TC=1 THEN DEF SEG=&H4F00:BLOAD "trushoc.asm",&H100:PRINT:PRINT:PRINT:PRINT:PRINT
  8. 52 IF MP=1 AND TC=1 THEN POKE &H1A3,144:POKE &H1A4,144:POKE &H1BA,235:POKE &H1BB,228:PRINT:PRINT:PRINT:PRINT:PRINT:GOTO 4040
  9. 55 IF MP=1 THEN DEF SEG=&H4F00:BLOAD "vu64ba.asm",&H100:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT
  10. 56 IF MP=1 THEN POKE &H1A3,144:POKE &H1A4,144:POKE &H1BA,235:POKE &H1BB,228:PRINT:PRINT:PRINT:GOTO 1340
  11. 57 PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT
  12. 58 PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT:PRINT
  13. 60 PRINT"                      Copyrights 1993,1994 Ben Vester                        "
  14. 61 PRINT"                  K3BC TRUCOLOR SSTV/WEFAX FOR IBM CLONES                    "
  15. 68 IF MP=3 THEN PRINT:PRINT:PRINT:PRINT:PRINT:GOTO 230
  16. 69 PRINT:PRINT"   This program stores raw pixel count data, then instantly forms a picture "
  17. 70 PRINT"for viewing. With a TRUCOLOR card, it will also display pix real-time as it is"
  18. 80 PRINT"received. It requires a RAMDISK to be created (normally designated D:) with"
  19. 90 PRINT"enough capacity to handle the file size. Raw data is stored as file D:A.P."
  20. 100 PRINT"After copying halts, pix can be scrolled using arrows for small moves and keys"
  21. 110 PRINT"R, L, and D for larger. When satisfied with pix, you can SAVE it, Re-Transmit"
  22. 120 PRINT"it or hit ENTER to copy another pix. The program SAVE's the pix with a suffix"
  23. 130 PRINT"which indicates what mode it was copied under: ie; .S1, .90, .M1, etc. Hit"
  24. 140 PRINT"SPACEBAR to bypass the SYNC process if you are late in selecting mode. If pix"
  25. 150 PRINT"was not synced, it can be scrolled to correct position and color registration."
  26. 160 PRINT"Wefax configured for USB receiving. Program requires as minimum a SVGA card"
  27. 170 PRINT"with 640x480x256. Full capability requires 640x480x16.7 mil. H halts copying."
  28. 180 PRINT"T jumps to a tuning screen snapshot. C and X adjusts color registration for"
  29. 190 PRINT"modes 3 thru 8. Robot color registration is adjusted by horizontal scrolling"
  30. 200 PRINT"and F and G adjust the color hue by retuning (after the fact). You can set"
  31. 210 PRINT"the SYSTEM CONFIGURATION to match your computer using directions in TVINFO.TXT"
  32. 220 PRINT"To view SYSTEM CONFIGURATION now hit F5 and then LIST 3000-3500."
  33. 230 IF VC=0 THEN Z=1
  34. 240 IF VC=1 THEN Z=0
  35. 250 C%=256:D%=256:B=256:GOTO 470
  36. 260 IF CO=2 THEN POKE &H3C0,2:POKE &H1D8,2:POKE &H1E5,2
  37. 261 IF TI=0 THEN POKE 467,1
  38. 262 POKE &H3E3,SW    'SYNC window
  39. 263 POKE &H19C,0:POKE &H19D,8       'Wx SYNC freq count
  40. 270 PRINT:PRINT:INPUT"      Do you want to copy now or later?(N or L--Default=N)";X$
  41. 280 IF X$="n" GOTO 360
  42. 290 IF X$="" GOTO 360
  43. 300 IF X$="l" GOTO 320
  44. 310 GOTO 270
  45. 320 PRINT:PRINT"      Now to choose your starting time----":PRINT
  46. 330 PRINT:INPUT"  What HOUR would you like to start?";H
  47. 340 A=1
  48. 350 INPUT"           and MINUTES after the hour?";M
  49. 360 T=0
  50. 370 PRINT:INPUT"..MINUTES of copy time  (Default=14 Min.)";T
  51. 380 IF T=0 THEN T=14
  52. 390 B%=H
  53. 400 A%=M*256:D%=T*120
  54. 410 PRINT:INPUT"     Do you want AUTO-SYNCHRONIZING (Y or N--Default=N)";S$
  55. 420 IF S$="" THEN S$="n"
  56. 430 IF S$="n" THEN B=0:GOTO 460
  57. 440 IF S$="Y" THEN B=256
  58. 450 IF S$="y" THEN B=256
  59. 460 C%=A+B:GOTO 790
  60. 470 DEF SEG=&H5F00
  61. 471 BLOAD "viscodeb.asm",&H100:POKE &H35B,106:POKE &H35C,116:POKE &H35D,50:POKE &H391,96:POKE &H35F,170:POKE &H360,116:POKE &H361,50:POKE &H395,9
  62. 472 DEF SEG=&H6F00
  63. 473 BLOAD "stowxc.asm",&H100:POKE &H175,GT99
  64. 474 DEF SEG=&H4F00
  65. 475 BLOAD "stotvgf.asm",&H100:POKE &H175,GT:POKE &H430,BS
  66. 476 IF CO=2 THEN POKE &H3C0,2:POKE &H2AD,2:POKE &H1E5,2
  67. 477 IF TI=0 THEN POKE 467,1
  68. 478 POKE &H3E3,SW    'SYNC window
  69. 480 POKE &H796,2   'Freq. calibration for tune display
  70. 530 O=1
  71. 540 IF AS=1 THEN GOTO 572
  72. 545 IF MPL=1 THEN GOTO 570
  73. 550 PRINT:PRINT"   What Mode (1)or(11)36sec (2)or(22)72sec (3)Scot1 (4)Scot2 (5)AVT90 (6)AVT94"
  74. 560 PRINT"(66)AVT188 (7)Martin1 (77)Martin2 (8)Wraase96 (9)FAX480 (96)ColorFAX (99)Wefax "
  75. 565 INPUT"--F8=AUTOVIS---F7=AUTO+SAVE---F5=BASIC---F10=DOS---F9=TRANSMIT--";I
  76. 570 IF I=0 THEN GOTO 550
  77. 571 IF I=97 THEN AS=1:N=96:KEY 1,"LIST ":GOTO 2670
  78. 572 IF I=98 THEN GOTO 2600
  79. 575 IF I=99 THEN BLOAD "stowxc.asm",&H100:POKE &H175,GT99:GOTO 260
  80. 580 IF I=1 THEN LL=306:FS=1:D%=240:LT=LT1:RE=0:GOTO 730
  81. 585 IF I=96 AND RE=0 THEN DEF SEG=&H6F00:LL=546:FS=1:D%=1440:LT=LT9:POKE &H175,GT96:GOTO 711
  82. 586 IF I=96 AND RE=1 THEN L=536:LL=546:FS=1:D%=1440:LT=LT9:POKE &H175,GT96:GOTO 730
  83. 590 IF I=11 THEN LL=288:FS=1:D%=240:LT=LT1:RE=0:GOTO 720
  84. 591 IF I=666 THEN COLOR 7,0,0:CLS:SYSTEM
  85. 592 IF I=222 THEN LOAD "vt.bas",R
  86. 593 IF I=888 THEN COLOR 7,0,0:CLS:PRINT:PRINT:PRINT"     F10 to DOS---F2 to ReRUN":KEY 10,"system"+CHR$(13):KEY 1,"LIST ":END
  87. 600 IF I=2 THEN LL=614:FS=1:D%=240:LT=LT2:RE=0:GOTO 730
  88. 610 IF I=22 THEN LL=597:FS=1:D%=240:LT=LT2:RE=0:GOTO 720
  89. 620 IF I=3 THEN LL=878:FS=1:D%=256:LT=LT3:L=288:GOTO 730
  90. 640 IF I=4 THEN LL=568:FS=1:D%=256:LT=LT4:L=184:GOTO 730
  91. 650 IF I=5 THEN LL=768:FS=0:D%=240:LT=LT5:L=256:GOTO 723
  92. 660 IF I=9 THEN LL=546:FS=1:D%=480:LT=LT9:L=536:GOTO 730
  93. 670 IF I=6 THEN LL=960:FS=0:D%=200:LT=LT6:L=320:GOTO 724
  94. 680 IF I=66 THEN LL=960:FS=1:D%=284:LT=LT6:L=320:GOTO 730
  95. 690 IF I=7 THEN LL=915:FS=1:D%=256:LT=LT7:L=302:GOTO 730
  96. 695 IF I=77 THEN LL=464:FS=1:D%=256:LT=LT77:L=152:GOTO 730
  97. 700 IF I=8 THEN LL=745:FS=0:D%=256:LT=LT8:L=248:GOTO 715
  98. 701 IF I=111 THEN MPL=0:KEY 1,"LIST ":GOTO 57
  99. 710 GOTO 550
  100. 711 POKE &H136,32:POKE &H3E3,SW:POKE &H18F,48:POKE &H190,0:POKE &H19C,82:POKE &H19D,9:POKE &H1A1,170:POKE &H1A2,6:POKE &H1B9,54:POKE &H1BA,6
  101. 712 IF CO=2 THEN POKE &H3C0,2:POKE &H1D8,2:POKE &H1E5,2
  102. 713 IF TI=0 THEN POKE 467,1
  103. 714 POKE &H3EC,45:POKE &H3ED,0:POKE &H3F0,235:POKE &H3F1,4:GOTO 730
  104. 715 POKE &H1C5,232:POKE &H1C6,160:POKE &H1C7,4:POKE &H669,253:GOTO 730
  105. 720 POKE &H264,235:POKE &H265,100:GOTO 730
  106. 723 POKE &H63F,65:POKE &H640,190:POKE &H669,47 'poke to 669 adjusts avt90 start
  107. 724 IF AS=1 THEN D%=D%+16
  108. 725 POKE &H1C5,232:POKE &H1C6,0:POKE &H1C7,4
  109. 726 IF AS=1 AND I=6 THEN POKE &H1C6,160:POKE &H669,108:POKE &H66A,1 'bypass AVT frame SYNC to avoid weak signal hangup in mode 97
  110. 727 IF AS=1 AND I=5 THEN POKE &H1C6,160:POKE &H669,174:POKE &H66A,0 'bypass AVT frame sync-&h669 and 66a are LSB/MSB for pixel delay b4 start pix in mode 97
  111. 730 LLB=INT(LL/256):LLA=LL-256*LLB         'LL=bytes per line for mode
  112. 735 KEY 10,"system"+CHR$(13)
  113. 740 LTB=INT(LT/256):LTA=LT-256*LTB         'line timing per lines 3000-5000
  114. 750 POKE &H25F,LTA:POKE &H260,LTB
  115. 760 POKE &H21D,LLA:POKE &H21E,LLB:POKE &H388,LLA:POKE &H389,LLB
  116. 770 IF FS=1 THEN POKE &H1C5,232:POKE &H1C6,211:POKE &H1C7,3:GOTO 2500 'FS=frame sync
  117. 775 IF RE=0 THEN POKE &H69F,184:POKE &H6A0,3:POKE &H6A1,10:POKE &H6A2,187:POKE &H6A3,4:POKE &H6A4,0:POKE &H6A5,185:POKE &H6A6,1
  118. 776 IF RE=0 THEN POKE &H6A7,0:POKE &H6A8,205:POKE &H6A9,16:POKE &H6AA,195:POKE &H679,235:POKE &H67A,36:POKE &H15A,18
  119. 777 'Remove apostrophe in 775 and 776 to add visual cue at ticking time-may delay pix start-add apostrophes after 775 and 776 line no. to delete cue
  120. 780 GOTO 810
  121. 790 POKE &H25F,L99A:POKE &H260,L99B
  122. 792 POKE &H7F0,ASC(DR$)  'DR$ is designated in the line 3050 (SYSTEM LIST)
  123. 795 IF RE=1 THEN POKE &H227,235:POKE &H228,82:POKE &H157,233:POKE &H158,63:POKE &H159,1:POKE &H43E,BS
  124. 800 GOTO 820
  125. 810 POKE &HA20,ASC(DR$)  'DR$ is designated in the line 3050 (SYSTEM LIST)
  126. 820 IF ST=1 THEN POKE &H484,219
  127. 821 IF I=99 THEN GOTO 855
  128. 830 IF RE=0 THEN GOTO 880
  129. 840 QB=(1920-3*L)/2+2:QC=(3*L)+1:QD=BL+3
  130. 842 IF I=7 OR I=77 THEN QB=(1920-3*L)/2+1
  131. 843 IF I=9 THEN QD=640-L:QB=52:POKE &H6B0,1:POKE &H6F0,1:POKE &H6F3,1:POKE &H6FC,235:POKE &H6FD,11:POKE &H44F,225:POKE &H450,2
  132. 844 QB2=INT(QB/256):QB1=QB-256*QB2:POKE &H26B,QB1:POKE &H26C,QB2
  133. 845 QC2=INT(QC/256):QC1=QC-256*QC2:POKE &H6FE,QC1:POKE &H6FF,QC2:POKE &H707,QC1:POKE &H708,QC2:POKE &H749,QC1:POKE &H74A,QC2:POKE &H752,QC1:POKE &H753,QC2
  134. 846 QD2=INT(QD/256):QD1=QD-256*QD2:POKE &H720,QD1:POKE &H721,QD2:POKE &H724,QD1:POKE &H725,QD2:POKE &H764,QD1:POKE &H765,QD2:POKE &H768,QD1:POKE &H769,QD2
  135. 847 IF I=5 OR I=6 OR I=66 THEN POKE &H70C,235:POKE &H70D,16:GOTO 851
  136. 848 IF I=9 THEN POKE &H70D,10:POKE &H722,235:POKE &H723,7:POKE &H6DD,235:POKE &H6DE,2:POKE &H449,1:GOTO 851
  137. 849 IF I=96 THEN GOTO 851
  138. 850 DD=LL-3*L:POKE &H70D,DD
  139. 851 LB=INT(L/256):LA=L-256*LB:POKE &H6B4,LA:POKE &H6B5,LB
  140. 852 IF RE=1 AND I=96 THEN POKE &H6FC,195:POKE &H71E,195:POKE &H1FA,69:POKE &H1FB,5:POKE &H70D,10
  141. 854 IF I<99 THEN GOTO 876
  142. 855 CLS:PRINT"   If FAX audio is present and you chose to copy NOW, press 'G' to start."
  143. 860 PRINT"You can Halt copying at any time by hitting H. If you chose AUTO-SYNC  and"
  144. 870 PRINT"the SYNC sigs don't occur, hit SPACEBAR to bypass AUTO-SYNC. If you are copy-"
  145. 871 PRINT"ing a map and want to print it, scroll over the map to put the upper left"
  146. 872 PRINT"corner of the screen where you want the print to start and lightly hit P to"
  147. 873 PRINT"print the map. Hit H to halt printing. Photo's will not print in shades of"
  148. 874 PRINT"gray. After you finish viewing hit Q or V to return to BASIC.":GOTO 880
  149. 876 IF RE=1 THEN POKE &H158,233:POKE &H159,237:POKE &H15A,2:POKE &H1E1,23
  150. 880 K=&H100:CALL K(A%,B%,C%,D%)
  151. 890 KEY OFF:CLS
  152. 900 X$="system"+CHR$(13):KEY 10,X$
  153. 910 DEF SEG=&H4F00
  154. 920 IF I=99 THEN BLOAD "vuwx.asm",&H100:GOTO 940
  155. 930 BLOAD "vu64ba.asm",&H100
  156. 940 IF I=99 THEN GOTO 1190
  157. 950 IF I=9 THEN GOTO 1700
  158. 960 IF I=2 THEN GOTO 1360
  159. 970 IF I=22 THEN GOTO 1360
  160. 980 IF I=1 THEN GOTO 1730
  161. 990 IF I=11 THEN GOTO 1730
  162. 991 IF TC>0 THEN GOTO 4000
  163. 1000 IF I=3 THEN L=288
  164. 1010 IF I=4 THEN L=184
  165. 1020 IF I=5 THEN L=256
  166. 1030 IF I=6 THEN L=320
  167. 1040 IF I=8 THEN L=248
  168. 1050 IF I=66 THEN L=320
  169. 1055 IF I=96 THEN L=546:LL=1638:P=528:GOTO 2700
  170. 1060 IF I=7 THEN GOTO 1340
  171. 1065 IF I=77 THEN GOTO 1340
  172. 1070 P=L:P2=INT(P/256):P1=P-P2*256
  173. 1080 POKE &H15D,P1:POKE &H15E,P2
  174. 1090 IF I=4 THEN POKE &H3EA,16:LL=568
  175. 1100 IF I=8 THEN POKE &H3EA,1:LL=745
  176. 1110 IF I=7 THEN POKE &H3EA,9:LL=915
  177. 1115 IF I=77 THEN POKE &H3EA,8:LL=464
  178. 1120 IF I=5 THEN POKE &H3EA,0:LL=768
  179. 1130 IF I=6 THEN POKE &H3EA,0:LL=960
  180. 1140 IF I=66 THEN POKE &H3EA,0:LL=960
  181. 1150 IF I=3 THEN POKE &H3EA,14:LL=878
  182. 1160 OF=(640-2*L)/2:OF2=INT(OF/256):OF1=OF-256*OF2:POKE &H13B,OF1:POKE &H13C,OF2
  183. 1170 LL2=INT(LL/256):LL1=LL-256*LL2:POKE &H1FD,LL1:POKE &H1FE,LL2:POKE &H242,LL1:POKE &H243,LL2
  184. 1180 POKE &H226,3  'number poked is pixels scrolled per left arrow depressions
  185. 1190 IF VC=1 THEN GOTO 1765
  186. 1200 IF VC=2 THEN GOTO 1260
  187. 1210 IF VC=3 THEN GOTO 1770
  188. 1220 IF VC=4 THEN GOTO 1830
  189. 1230 IF VC=5 THEN GOTO 1890
  190. 1240 IF VC=6 THEN GOTO 1940
  191. 1250 IF VC=7 THEN GOTO 2010
  192. 1260 POKE &H113,46:POKE &H142,205:POKE &H144,136:POKE &H145,216:POKE &H146,238:POKE &H147,195
  193. 1270 IF I=99 THEN POKE &H113,56
  194. 1280 A$=DR$+":a.p":K=&H100
  195. 1281 IF I=99 THEN CALL K(C%,S%,A$):GOTO 1290
  196. 1282 IF AS=1 THEN POKE &H1BA,235:POKE &H1BB,228
  197. 1283 IF MP=1 THEN A$=MP$
  198. 1284 CALL K(S%,A$)
  199. 1285 IF MP=1 THEN GOTO 1351
  200. 1288 IF AS=1 THEN GOTO 1440
  201. 1290 PRINT:PRINT:PRINT"           F5=BASIC     F10=DOS     F6=Receive     F9=Txmit new pix            "
  202. 1291 INPUT" S=Save pix   RT=Re-Transmit   T=Tuning display   (default=Receive)        ";TR$
  203. 1295 IF TR$="" THEN TR$="333"
  204. 1300 IF TR$="s" THEN GOTO 1440
  205. 1305 IF TR$="rt" THEN GOTO 2060
  206. 1307 IF TR$="t" THEN GOTO 2800
  207. 1310 IF TR$="222" THEN LOAD "vt.bas",R
  208. 1315 IF TR$="333" THEN LOAD "rt.bas",R
  209. 1320 IF TR$="888" THEN COLOR 7,0,0:GOTO 1330
  210. 1322 IF TR$="system" THEN SYSTEM
  211. 1325 GOTO 1290
  212. 1330 PRINT:PRINT:PRINT:PRINT:PRINT" Hit F2 for NEW PIX----F10 to goto DOS----type GOTO 1290 to re-select":KEY 10,"system"+CHR$(13):KEY 1,"LIST ":END
  213. 1340 POKE &H180,128:POKE &H3DA,128:POKE &H3CB,64:POKE &H3BC,192
  214. 1345 IF I=77 THEN L=152:GOTO 1070
  215. 1350 L=302:GOTO 1070
  216. 1351 MP=0:BLOAD "selectmo.asm",&H100
  217. 1352 POKE &H196,18  'No. poked is delay allowed  for 2nd character to be keyed in menu selection (18=1 sec)
  218. 1353 K=&H100:CALL K(H%)
  219. 1354 I=H%:MPL=1:KEY 1,"LIST ":GOTO 230
  220. 1360 L=282
  221. 1370 BLOAD "vurobol.asm",&H100
  222. 1371 POKE &H4BD,10:POKE &H350,10   'initial color offset--Robot 72
  223. 1372 IF BR=0 THEN POKE &H4EC,208:POKE &H4ED,232:POKE &H4EE,235:POKE &H4EF,4
  224. 1373 IF BR=2 THEN POKE &H4EC,235:POKE &H4ED,6
  225. 1380 OF=(640-2*L)/2:OF2=INT(OF/256):OF1=OF-256*OF2:POKE &H13B,OF1:POKE &H13C,OF2
  226. 1390  IF I=22 THEN GOTO 1410
  227. 1400 POKE &H226,1:POKE &H1FD,102:POKE &H242,102:LL1=102:LL2=2:POKE &H15D,102:GOTO 1190
  228. 1410 POKE &H226,1:POKE &H1FD,85:POKE &H242,85
  229. 1420 POKE &H15D,85:LL1=85:LL2=2
  230. 1430 GOTO 1190
  231. 1440 DEF SEG=&H4F00
  232. 1441 IF AS=1 THEN F$="n":GOTO 1450
  233. 1442 PRINT:PRINT:INPUT"    Save it in compressed format--y or n";F$
  234. 1443 IF F$="n" THEN GOTO 1450
  235. 1444 IF F$="y" THEN GOTO 1450
  236. 1445 GOTO 1442
  237. 1450 BLOAD "savepix.asm",&H100
  238. 1460 OF$=DR$+":a.p"
  239. 1470 PI=512:PO=512:K%=0:L%=0
  240. 1475 IF I=99 THEN POKE &H20D,255:POKE &H193,4:POKE &H1BA,4:POKE &H166,C%:GOTO 2520
  241. 1480 POKE &H192,LL1:POKE &H193,LL2:POKE &H1B9,LL1:POKE &H1BA,LL2
  242. 1485 BY=3*L-1:BYB=INT(BY/256):BYA=BY-256*BYB:POKE &H20D,BYA:POKE &H20E,BYB
  243. 1490 IF S%<0 THEN S!=65536!+S% ELSE S!=S%
  244. 1495 S2=INT(S!/256):S1=S!-256*S2:POKE &H163,S1:POKE &H164,S2
  245. 1499 IF AS=1 THEN N=N+1:PIX$=SP$+CHR$(N):GOTO 1530
  246. 1500 PRINT:PRINT:PRINT"   The program will add an appropiate Mode suffix.":PRINT
  247. 1510 IF F$="y" THEN INPUT"       What Name  for Picture (Default is DO NOT SAVE)";PIX$
  248. 1515 IF F$="n" THEN INPUT" What Path\Name for Full Format Pix (Default is DO NOT SAVE)";PIX$
  249. 1520 IF PIX$="" THEN GOTO 1290
  250. 1530 IF I=1 THEN MO$=".36":LE%=200
  251. 1540 IF I=11 THEN MO$=".36a":LE%=200
  252. 1550 IF I=2 THEN MO$=".72":LE%=300
  253. 1560 IF I=22 THEN MO$=".72a":LE%=300
  254. 1570 IF I=3 THEN MO$=".s1":LE%=410
  255. 1580 IF I=4 THEN MO$=".s2":LE%=300
  256. 1590 IF I=5 THEN MO$=".90":LE%=360
  257. 1600 IF I=66 THEN MO$=".188":LE%=640
  258. 1610 IF I=6 THEN MO$=".94":LE%=450
  259. 1620 IF I=9 THEN MO$=".fax":LE%=480
  260. 1625 IF I=96 THEN MO$=".cfx":LE%=1440
  261. 1630 IF I=99 THEN MO$=".wx"
  262. 1640 IF I=7 THEN MO$=".m1":LE%=420
  263. 1645 IF I=77 THEN MO$=".m2":LE%=300
  264. 1650 IF I=8 THEN MO$=".96":LE%=300
  265. 1660 L2=INT(LE%/256):L1=LE%-256*L2:POKE &H18B,L1:POKE &H18C,L2
  266. 1670 NF$=PIX$+MO$
  267. 1671 IF F$="y" THEN NF$=DR$+":"+NF$
  268. 1680 K=&H100:CALL K(K%,L%,OF$,NF$)
  269. 1681 IF AS=1 THEN I=98:I%=0:GOTO 470
  270. 1682 IF F$="n" THEN GOTO 1290
  271. 1683 IF F$="y" THEN PRINT:PRINT:INPUT"    What Path/Directory for Compressed file";X$
  272. 1684 IF F$="" THEN GOTO 1683
  273. 1685 SHELL "pk "+X$+" "+DR$+":"+" "+PIX$+" "+MO$
  274. 1690 CLS:GOTO 1290
  275. 1700 POKE &H15D,24:POKE &H15E,2:POKE &H184,235:POKE &H185,1:POKE &H180,0:POKE &H3A8,235:LL=546:L=179
  276. 1710 POKE &H3A9,57:POKE &H3EA,10:POKE &H3A2,224:POKE &H3A3,1:POKE &H13B,47:POKE &H13C,0
  277. 1720 POKE &H16A,128:POKE &H16B,2:GOTO 1170
  278. 1730 BLOAD "vuro36l.asm",&H100
  279. 1731 POKE &H4BD,8:POKE &H350,8   'initial color offset Robot 36
  280. 1732 IF BR=0 THEN POKE &H4EC,208:POKE &H4ED,232:POKE &H4EE,235:POKE &H4EF,4
  281. 1733 IF BR=2 THEN POKE &H4EC,235:POKE &H4ED,6
  282. 1740 L=141:LL=612:POKE &H13B,140:POKE &H15D,100:POKE &H226,1:POKE &H1F2,12
  283. 1750 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
  284. 1760 GOTO 1170
  285. 1765 IF I=6 THEN POKE &H113,&H5C
  286. 1766 GOTO 1280
  287. 1770 POKE &H113,&H62:POKE &H444,192:POKE 321,235:POKE 322,90  'ATI video mode 62
  288. 1780 POKE 324,136:POKE 325,196
  289. 1790 POKE 326,128:POKE 327,228:POKE 328,225:POKE 329,208:POKE 330,227:POKE 331,8
  290. 1800 POKE 332,220:POKE 333,176:POKE 334,178:POKE 335,254:POKE 336,202:POKE 337,239:POKE 338,195
  291. 1810 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
  292. 1815 IF I=6 THEN POKE &H113,&H61
  293. 1820 GOTO 1280
  294. 1830 POKE &H113,&H5F:POKE 321,186:POKE 322,206          'Paradise video mode 5f
  295. 1840 POKE 323,3:POKE 324,176:POKE 325,9:POKE 326,136:POKE 327,220:POKE 328,208
  296. 1850 POKE 329,228:POKE 330,208:POKE 331,228:POKE 332,208:POKE 333,228:POKE 334,208:POKE 335,228
  297. 1860 POKE 336,239:POKE 337,195
  298. 1870 IF I=99 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1
  299. 1875 'IF I=6 THEN POKE &H113,&H5E
  300. 1880 GOTO 1280
  301. 1890 POKE &H113,&H79:POKE 321,186:POKE 322,214            'Chips & Tech Mode 79
  302. 1900 POKE 323,3:POKE 324,176:POKE 325,16:POKE 326,136:POKE 327,220:POKE 328,208
  303. 1910 POKE 329,228:POKE 330,208:POKE 331,228:POKE 332,239:POKE 333,195
  304. 1920 IF I=99 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1
  305. 1925 IF I=6 THEN POKE &H113,&H78
  306. 1930 GOTO 1280
  307. 1940 POKE &H113,&H5C:POKE 321,186:POKE 322,196                   'Genoa mode 5c
  308. 1950 POKE 323,3:POKE 324,176:POKE 325,6:POKE 326,238:POKE 327,66:POKE 328,236
  309. 1960 POKE 329,36:POKE 330,199:POKE 331,128:POKE 332,227:POKE 333,7:POKE 334,208
  310. 1970 POKE 335,227:POKE 336,208:POKE 337,227:POKE 338,208:POKE 339,227:POKE 340,8
  311. 1980 POKE 341,216:POKE 342,238:POKE 343,195
  312. 1990 IF I=99 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1
  313. 1995 IF I=6 THEN POKE &H113,&H7E
  314. 2000 GOTO 1280
  315. 2010 POKE &H111,79:POKE &H113,2:POKE 321,177                   'VESA mode 101
  316. 2020 POKE 322,BS:POKE 323,210:POKE 324,227:POKE 325,136:POKE 326,218
  317. 2030 POKE 327,48:POKE 328,246:POKE 329,184:POKE 330,5:POKE 331,79:POKE 332,49:POKE 333,219:POKE 334,205
  318. 2031 POKE 335,16:POKE 336,195
  319. 2035 IF I=99 AND SI=1 THEN POKE &H44A,5:GOTO 2045
  320. 2040 IF I=99 THEN POKE &H16A,128:POKE &H16B,2:POKE &H155,224:POKE &H156,1
  321. 2045 'IF I=6 THEN POKE &H398,0
  322. 2050 GOTO 1280
  323. 2060 DEF SEG=&H4F00
  324. 2070 BLOAD "tx64gd.asm",&H100
  325. 2072 HFB=INT(HF/256):HFA=HF-256*HFB:POKE &H2E9,HFA:POKE &H2EA,HFB:POKE &H1FE,HFA:POKE &H1FF,HFB
  326. 2074 POKE &H3FD,4:POKE &H401,237 'affects space between initial VIS and pix bytes
  327. 2075 POKE &H46D,136:POKE &H464,204 'vary &h464 poke to tune fax480 244 cps. Use same number as line 3015 in VT.BAS
  328. 2078 IF I=96 THEN PRINT:PRINT"  ColorFAX retransmit not supported to avoid too much airtime on a single pix!":GOTO 1290
  329. 2079 IF I=99 THEN PRINT:PRINT"  Wefax transmission only available if SAVEd as a FAX480 file-then use VT.BAS.":GOTO 1290
  330. 2080 IF I=1 THEN LL=306:LT=LT1:LD=282:EA=26:SC=24:POKE &H1D8,240:POKE &H3A5,17:GOTO 2200
  331. 2090 IF I=2 THEN LL=614:LT=LT2:L=282:LD=589:EA=25:SC=24:POKE &H1D8,240:POKE &H3A5,48:GOTO 2200
  332. 2100 IF I=3 THEN LL=878:LT=LT3:L=288:EA=14:SC=14:POKE &H3A5,60:POKE &H523,96:POKE &H510,3:POKE &H52B,227:POKE &H373,233:POKE &H374,39:POKE &H375,1:GOTO 2210
  333. 2110 IF I=4 THEN LL=568:LT=LT4:L=184:EA=16:SC=15:POKE &H3A5,29:POKE &H373,233:POKE &H374,39:POKE &H375,1:POKE &H523,41:POKE &H510,2:POKE &H52B,227:GOTO 2210
  334. 2115 IF I=8 THEN LL=745:LT=LT8:L=248:EA=1:SC=1:POKE &H3A5,40:POKE &H373,233:POKE &H374,39:POKE &H375,1:POKE &H523,233:POKE &H510,2:POKE &H564,12:POKE &H52B,227:GOTO 2210
  335. 2120 IF I=5 THEN LL=768:LT=LT5:SC=21:POKE &H30F,235:POKE &H1D8,240:POKE &H3F8,0:POKE &H400,160:POKE &H3A5,34:POKE &H529,63:GOTO 2180
  336. 2130 IF I=7 THEN LL=915:LT=LT7:L=302:EA=9:SC=8:POKE &H3A5,53:POKE &H373,233:POKE &H374,39:POKE &H375,1:POKE &H564,12:GOTO 2210
  337. 2135 IF I=77 THEN LL=464:LT=LT77:L=152:EA=8:SC=8:POKE &H3A5,20:POKE &H373,233:POKE &H374,39:POKE &H375,1:POKE &H564,12:GOTO 2210
  338. 2140 IF I=6 THEN LL=960:LT=LT6:L=320:SC=21:POKE &H30F,235:POKE &H1D8,200:POKE &H3A5,18:POKE &H3F8,0:POKE &H529,63:GOTO 2180
  339. 2150 IF I=22 THEN LL=614:LT=LT2:L=282:LD=589:EA=8:SC=23:POKE &H1D8,240:POKE &H3A5,48:GOTO 2200
  340. 2160 IF I=11 THEN LL=308:LT=LT1:LD=282:EA=6:SC=24:POKE &H1D8,240:POKE &H3A5,17:GOTO 2200
  341. 2170 IF I=9 THEN LL=546:LT=LT9:LD=536:EA=10:SC=9:POKE &H1D8,224:POKE &H1D9,1:POKE &H172,232:POKE &H564,12:GOTO 2200
  342. 2180 LB=INT(LL/256):LA=LL-256*LB:LD=INT((LL-5)/256):LC=LL-5-256*LD
  343. 2181 POKE &H216,212:POKE &H217,2:POKE &H375,147:POKE &H376,1
  344. 2182 IF I=6 THEN BLOAD "avt94.asm",&H5B0
  345. 2183 IF I=5 THEN BLOAD "avt90.asm",&H5B0
  346. 2190 POKE &H1E8,LA:POKE &H1E9,LB:GOTO 2270
  347. 2200 LB=INT(LD/256):LA=LD-256*LB:GOTO 2220
  348. 2210 LB=INT(3*L/256):LA=3*L-256*LB:RB=INT((LL+4)/256):RA=LL+4-256*RB:POKE &H216,RA:POKE &H217,RB
  349. 2220 POKE &H1E8,LA:POKE &H1E9,LB
  350. 2230 L3B=INT((L-3)/256):L3A=L-3-256*L3B:POKE &H4C4,L3A:POKE &H4C5,L3B
  351. 2240 LLB=INT(LL/256):LLA=LL-256*LLB:POKE &H4D2,LLA:POKE &H4D3,LLB
  352. 2250 LL4=INT((4*LL)/256):LL5=4*LL-256*LL4:POKE &H4E0,LL5:POKE &H4E1,LL4
  353. 2260 LRB=INT((LL-40)/256):LRA=LL-40-256*LRB:POKE &H504,LRA:POKE &H505,LRB
  354. 2265 FOR K=&H58A TO &H5AC
  355. 2266 READ A:POKE K,A
  356. 2267 NEXT K
  357. 2270 LTB=INT(LT/256):LTA=LT-256*LTB
  358. 2280 POKE &H32A,LTA:POKE &H32B,LTB
  359. 2290 IF I=9 THEN POKE &H454,LTA:POKE &H455,LTB
  360. 2300 IF CO=2 THEN POKE &H2F7,2:POKE &H241,2
  361. 2310 POKE &H295,SW
  362. 2315 POKE &H4A0,91:POKE &H4EA,5:POKE &H55C,4
  363. 2320 POKE &H317,EA:POKE &H31A,EA:POKE &H310,SC 'EA=discarded bytes-SC=synch cycles
  364. 2330 POKE &H1A9,GT
  365. 2340 S2=INT(S%/256):S1=S%-256*S2:POKE &H443,S1:POKE &H444,S2
  366. 2345 IF TI=0 THEN POKE &H1DE,1
  367. 2350 PRINT:PRINT:PRINT:PRINT"     Hit key G to start Transmit"
  368. 2360 K=&H100:CALL K(A$)
  369. 2370 PRINT:PRINT:PRINT:PRINT:PRINT"           PICTURE TRANSMITTED!"
  370. 2380 GOTO 1290
  371. 2400 DATA &h11,&h38,&hf0,&he0,&h00:REM Call sign array-5 bytes/line=40 pixels
  372. 2410 DATA &h12,&h04,&h89,&h10,&h00:REM Array is 40 pixels wide and 7 pixels high
  373. 2420 DATA &h14,&h04,&h89,&h00,&h00:REM These DATA write out K3BC. If you take
  374. 2430 DATA &h18,&h18,&hf1,&h00,&h00:REM Each byte and write it out in binary form
  375. 2440 DATA &h14,&h04,&h89,&h00,&h00:REM on a 40x7 cross-ruled paper,you can see
  376. 2450 DATA &h12,&h04,&h89,&h10,&h00:REM the pattern. For example: &H11=00010001
  377. 2460 DATA &h11,&h38,&hf0,&he0,&h00:REM &h73=01110011; and &hCE=11001110
  378. 2500 IF DE>0 THEN POKE &H1C6,209:POKE &H1C7,4:POKE &H66A,0:POKE &H669,DE
  379. 2510 GOTO 775
  380. 2520 PRINT:PRINT:PRINT"   SAVE as a (1)WX file or (2)FAX480 file---FAX480 file only includes 536x480"
  381. 2525 INPUT"pixels in upper left corner of PIX as scrolled now (Default=1)";FI
  382. 2530 IF FI=0 THEN FI=1
  383. 2535 IF FI=1 THEN GOTO 2550
  384. 2540 IF FI=2 THEN I=9:POKE &H1B9,34:POKE &H1BA,2:GOTO 1490
  385. 2545 GOTO 2520
  386. 2550 PRINT:PRINT:INPUT"   How many lines do you want to SAVE (Default=1536)";LE%
  387. 2555 IF LE%=0 THEN LE%=1536
  388. 2560 GOTO 1490
  389. 2600 DEF SEG=&H5F00:AU=1
  390. 2601 PRINT:PRINT:PRINT:PRINT:PRINT"    The VIS decoder has found MODE------"
  391. 2605 POKE &H1CC,6         'no. of 1/18 sec periods allowed for VIS recognition
  392. 2606 POKE &H2E5,42:POKE &H2F5,42   'samples required to trigger
  393. 2607 POKE &H3A4,235:POKE &H3A5,42  'deletes final 1200 cps check after VIS
  394. 2609 IF CO=2 THEN POKE &H1E5,2:POKE &H16C,2
  395. 2610 K=&H100:CALL K(F%,G%,H%,I%)
  396. 2620 I=I%
  397. 2621 PRINT:PRINT
  398. 2628 IF I=9 THEN PRINT"     FAX B/W":GOTO 2644
  399. 2629 IF I=96 THEN PRINT"    K3BC COLORFAX":GOTO 2643
  400. 2630 IF I=11 THEN PRINT"     ROBOT 36":GOTO 2644
  401. 2631 IF I=22 THEN PRINT"     ROBOT 72":GOTO 2644
  402. 2632 IF I=7 THEN PRINT"     MARTIN 1":GOTO 2644
  403. 2633 IF I=77 THEN PRINT"     MARTIN 2":GOTO 2644
  404. 2634 IF I=3 THEN PRINT"     SCOTTIE 1":GOTO 2644
  405. 2635 IF I=4 THEN PRINT"     SCOTTIE 2":GOTO 2644
  406. 2636 IF I=5 THEN PRINT"     AVT-90":GOTO 2644
  407. 2637 IF I=6 THEN PRINT"     AVT-94":GOTO 2644
  408. 2638 IF I=66 THEN PRINT"     AVT-188":GOTO 2644
  409. 2639 IF I=8 THEN PRINT"     WRAASE 96":GOTO 2644
  410. 2640 DEF SEG=&H4F00:GOTO 570
  411. 2643 IF RE=0 THEN DEF SEG=&H6F00:GOTO 2646
  412. 2644 DEF SEG=&H4F00
  413. 2646 POKE &H191,235:POKE &H192,24   'jumps over 1200 cps in STOTVGB barriers
  414. 2647 IF RE=0 THEN POKE &H15B,144:POKE &H15C,144  'leaves text screen on while copying
  415. 2648 POKE &H1AC,20:POKE &H1C2,17 'trial for pix bytes before frame sync
  416. 2650 GOTO 570
  417. 2670 PRINT:PRINT:PRINT:INPUT"   What Drive\Path to store pictures (Default=RAMDISK)";SP$
  418. 2675 IF SP$="" THEN SP$=DR$+":":GOTO 2600
  419. 2700 BLOAD "trusho.asm",&H100
  420. 2705 P2=INT(P/256):P1=P-256*P2:POKE &H3B0,P1:POKE &H3B1,P2:POKE &H46B,P1:POKE &H46C,P2
  421. 2710 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
  422. 2715 Z=2*L:ZB=INT(Z/256):ZA=Z-256*ZB:POKE &H3CA,ZA:POKE &H3CB,ZB
  423. 2720 W=2*L+32:WB=INT(W/256):WA=W-256*WB:POKE &H3A9,WA:POKE &H3AA,WB:POKE &H3E5,WA:POKE &H3E6,WB
  424. 2725 LB=INT(L/256):LA=L-256*LB:POKE &H3BC,LA:POKE &H3BD,LB:POKE &H3C3,LA:POKE &H3C4,LB
  425. 2726 IF I=96 THEN POKE &H2F6,LA:POKE &H2F7,LB:POKE &H303,LA:POKE &H304,LB
  426. 2730 U=3*L:UB=INT(U/256):UA=U-256*UB:POKE &H55F,UA:POKE &H560,UB:POKE &H531,UA:POKE &H532,UB
  427. 2735 POKE &H427,10:POKE &H226,2  'poke to &h226 is pixels per left arrow depress
  428. 2740 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
  429. 2745 Q=BL-3*P:QB=INT(Q/256):QA=Q-256*QB:POKE &H3D6,QA:POKE &H3D7,QB
  430. 2750 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
  431. 2755 POKE &H3A2,224:POKE &H3A3,1
  432. 2760 GOTO 2010
  433. 2800 BLOAD "tune.asm",&H100
  434. 2801 POKE &H3AF,180:POKE &H3B0,1:POKE &H15D,LL1:POKE &H15E,LL2:POKE &H1FD,LL1:POKE &H1FE,LL2:POKE &H242,LL1:POKE &H243,LL2
  435. 2805 POKE &H3BD,2    'Freq. calibration for tune display
  436. 2810 K=&H100:CALL K(Z%,A$)
  437. 2811 GOTO 1290
  438. 3000                '            SYSTEM PARAMETERS
  439. 3010  '  33mhz 386          xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  440. 3020 TI=1      'Sound tick   ON=1    OFF=0
  441. 3030 VC=7      'VideoCard 1=Trident 2=Tseng 3=ATI 4=Paradise 5=Chips 6=Genoa
  442. 3040           '7=VESA (VESA card or VESA drivere.Pick BS below to get full pix
  443. 3045 BS=4      'Bank Shift for different VESA configurations-values from 0 to 6
  444. 3046 BL=2048   'Bytes/Line in TRUCOLOR modes--ATI=1920 and Diamond PRO=2048
  445. 3050 DR$="D"   'RAMDISK drive. Change the D to match your drive
  446. 3060 GT=136    'Gross timer (LSB). Move down 1 or 2 for slow computers
  447. 3070 GT99=135  'Gross timer for wx mode.This affected more by slow computers.
  448. 3075 GT96=135  'Gross timer for mode 96
  449. 3080 LT1=30270  'These are line timing for modes 1 thru 99. On any particular
  450. 3090 LT2=60540! 'mode, as you copy pictures from a major SSTV station like
  451. 3100 LT3=38825! 'W5ZR, if the pix top leans left then increase the LT by a
  452. 3110 LT4=7294   'little (about 5 counts /pixel out of square) and try again---
  453. 3120 LT5=42890! '-if it leans right decrease LT
  454. 3130 LT6=4487
  455. 3140 LT7=16795
  456. 3142 LT77=16930
  457. 3145 LT8=15860
  458. 3150 LT9=47959!'Used for both Mode 9 and Mode 96
  459. 3160 LT99=13500
  460. 3170 CO=1      'For COM2 port use CO=2 (other COM ports not supported)
  461. 3180 SW=50     'SYNC capture window in microseconds. Larger for slow machines
  462. 3190 ST=1      '0=OFF 1=ON   Automatically switches from copy program to VU
  463. 3195 BR=2      'Robot color brightness--low=0--med=1--high=2
  464. 3200 DE=10     'pixel delay to start pix on non-AVT modes(FS=1).Must be <255
  465. 3210 HF=2100   'Header Freq. adjust--see TVINFO.TXT--same value as in VT.BAS
  466. 3220 SI=1      'wefax size for VESA card--(1)=1024x768---(2)=640x480
  467. 3230 MP=1      'MP=0 Help screen--MP=1 Mode pix screen (MP$) ON--MP=3 fast with no Help or pix
  468. 3240 MP$="MODES.M1"    'file for Mode select screen--Mode number in next line
  469. 3245 I=7       'Mode number for MP$, menu picture screen
  470. 3250 TC=2      'TC=0 for 256 color on all pix--TC=1 for TRUCOLOR (except Robot)                 TC=2 for 256 on mode screen but Trucolor on all pix
  471. 3260 FR=1      'FR=1 Full size Trucolor--FR=2 small size Trucolor
  472. 3270 EX=2      'S2 and M2 aspect-EX=0 2xHoriz/2xVert--EX=1 4xH/2xV--EX=2 2xH/1xV
  473. 3280 RE=1      'RE=1 display in Realtime(requires Trucolor)--RE=0 NOT realtime
  474. 3998 L99B=INT(LT99/256):L99A=LT99-256*L99B
  475. 3999 GOTO 40
  476. 4000 BLOAD "trushoc.asm",&H100
  477. 4005 IF I=3 THEN L=288
  478. 4010 IF I=4 THEN L=184
  479. 4020 IF I=5 THEN L=257
  480. 4030 IF I=6 THEN L=321:PT=1
  481. 4040 IF I=7 THEN GOTO 4560
  482. 4050 IF I=77 THEN GOTO 4560
  483. 4060 IF I=8 THEN L=248
  484. 4070 IF I=96 THEN L=546:LL=1638:PT=10:POKE &H3AC,1:POKE &H3B4,1:POKE &H3A2,224:POKE &H3A3,1:FR=0
  485. 4080 U=3*L:UB=INT(U/256):UA=U-256*UB:POKE &H55F,UA:POKE &H560,UB:POKE &H531,UA:POKE &H532,UB
  486. 4090 POKE &H226,2  'No. poked here=pixels scrolled per left arrow depression
  487. 4100 POKE &H427,PT
  488. 4110 FOR C=&HD00 TO &HD50
  489. 4120 POKE C,0:NEXT C
  490. 4130 P=L-PT:P2=INT(P/256):P1=P-P2*256
  491. 4140 POKE &H3B0,P1:POKE &H3B1,P2:POKE &H46B,P1:POKE &H46C,P2:POKE &H5CF,P1:POKE &H5D0,P2:POKE &H601,P1:POKE &H602,P2
  492. 4150 LB=INT(L/256):LA=L-256*LB:POKE &H3BC,LA:POKE &H3BD,LB:POKE &H3C3,LA:POKE &H3C4,LB:POKE &H5BB,LA:POKE &H5BC,LB:POKE &H5C2,LA:POKE &H5C3,LB
  493. 4160 IF I=96 THEN POKE &H2F6,LA:POKE &H2F7,LB:POKE &H303,LA:POKE &H304,LB
  494. 4170 IF I=96 THEN Q=BL-3*P:GOTO 4190
  495. 4180 Q=BL-6*P
  496. 4190 Z=2*L:ZB=INT(Z/256):ZA=Z-256*ZB:POKE &H3CA,ZA:POKE &H3CB,ZB:POKE &H5C9,ZA:POKE &H5CA,ZB
  497. 4200 W=2*L+32:WB=INT(W/256):WA=W-256*WB:POKE &H3A9,WA:POKE &H3AA,WB:POKE &H3E5,WA:POKE &H3E6,WB:POKE &H5FE,WA:POKE &H5FF,WB:POKE &H6B2,WA:POKE &H6B3,WB
  498. 4210 IF I=7 THEN GOTO 4240
  499. 4220 IF I=77 THEN GOTO 4240
  500. 4230 GOTO 4270
  501. 4240 WM=L+32:WMB=INT(WM/256):WMA=WM-256*WMB:POKE &H3A9,WMA:POKE &H3AA,WMB:POKE &H3E5,WMA:POKE &H3E6,WMB:POKE &H5FE,WMA:POKE &H5FF,WMB:POKE &H6B2,WMA:POKE &H6B3,WMB
  502. 4250 X=2*L:XB=INT(X/256):XA=X-256*XB:POKE &H3C3,XA:POKE &H3C4,XB:POKE &H3C2,199:POKE &H5C2,XA:POKE &H5C3,XB:POKE &H5C1,199
  503. 4260 POKE &H3CA,LA:POKE &H3CB,LB:POKE &H3C9,239:POKE &H5C9,LA:POKE &H5CA,LB:POKE &H5C8,239
  504. 4270 IF I=4 THEN LL=568
  505. 4280 IF I=5 THEN LL=768
  506. 4290 IF I=7 THEN LL=915
  507. 4300 IF I=77 THEN LL=464
  508. 4310 IF I=8 THEN LL=745
  509. 4320 IF I=6 THEN LL=960
  510. 4330 IF I=3 THEN LL=878
  511. 4340 IF I=96 THEN OF=3*(640-P)/2:GOTO 4360
  512. 4350 OF=3*(640-2*P)/2
  513. 4355 IF FR=2 THEN OF=30*BL+(1920-3*P)/2
  514. 4360 OF2=INT(OF/256):OF1=OF-256*OF2:POKE &H13C,OF1:POKE &H13D,OF2:POKE &H512,OF1:POKE &H513,OF2
  515. 4365 LY=LL+1:LYB=INT(LY/256):LYA=LY-256*LYB:POKE &H697,LYA:POKE &H698,LYB
  516. 4366 LZ=2*LL:LZB=INT(LZ/256):LZA=LZ-256*LZB
  517. 4370 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
  518. 4371 POKE &H638,LL1:POKE &H639,LL2:POKE &H5AC,LL1:POKE &H5AD,LL2
  519. 4380 IF I=96 THEN GOTO 4430
  520. 4410 IF FR=1 THEN POKE &H3AB,233:POKE &H3AC,32:POKE &H3AD,2:POKE &H15D,LZA:POKE &H15E,LZB:GOTO 4430
  521. 4420 POKE &H2F1,33:POKE &H2F2,2:POKE &H3AC,1:POKE &H3B4,1:Q=BL-3*P
  522. 4430 IF EX=0 OR EX=2 THEN GOTO 4480
  523. 4440 IF FR>1 THEN GOTO 4480
  524. 4450   'next two lines expand S2 and M2 modes by 4 horizontally
  525. 4460 IF I=4 THEN P=160:Q=BL-12*P:POKE &H5CF,P:POKE &H5D0,0:POKE &H601,P:POKE &H602,0:POKE &H13C,0:POKE &H13D,0:POKE &H5D3,2:POKE &H605,2
  526. 4470 IF I=77 THEN Q=BL-12*P:POKE &H3B4,4:POKE &H13C,102:POKE &H13D,0:POKE &H512,102:POKE &H513,0:POKE &H5D3,2:POKE &H605,2
  527. 4480 QB=INT(Q/256):QA=Q-256*QB:POKE &H3D6,QA:POKE &H3D7,QB:POKE &H5F1,QA:POKE &H5F2,QB:POKE &H6A5,QA:POKE &H6A6,QB
  528. 4481 POKE &H39A,233:POKE &H39B,107:POKE &H39C,253:POKE &H11A,0:POKE &H11B,0:POKE &H2B8,235:POKE &H2B9,6
  529. 4482 POKE &H3A2,224:POKE &H3A3,1
  530. 4483 IF EX=2 AND I=4 THEN POKE &H600,235:POKE &H601,35
  531. 4484 IF EX=2 AND I=77 THEN POKE &H600,235:POKE &H601,35
  532. 4490 IF VC=1 THEN GOTO 1765
  533. 4500 IF VC=2 THEN GOTO 1260
  534. 4510 IF VC=3 THEN GOTO 1770
  535. 4520 IF VC=4 THEN GOTO 1830
  536. 4530 IF VC=5 THEN GOTO 1890
  537. 4540 IF VC=7 THEN GOTO 2010
  538. 4550 IF VC=6 THEN GOTO 1940
  539. 4560 POKE &H2D7,1:POKE &H341,2:POKE &H66C,1:POKE &H4D7,1:POKE &H4F3,2:POKE &H65D,1
  540. 4570 IF I=77 THEN L=152:GOTO 4080
  541. 4580 L=302:GOTO 4080
  542.