home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1984 October / 64er_Magazin_84-10_1984_Markt__Technik_de.d64 / licht-tele(4baud (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  5KB  |  179 lines

  1. 0 rem *********************************       **                             **
  2. 1 rem **   l i c h t t e l e f o n   **       **                             **
  3. 2 rem **                             **       **                             **
  4. 3 rem **                             **       **          by m&t             **
  5. 4 rem **                             **       *********************************
  6. 5 :
  7. 6 ix=828
  8. 7 print"[147]":poke53280,0:poke53281,0:fori=49152to49172:reada:pokei,a:next
  9. 8 gosub14000
  10. 10 dimx$(255)
  11. 11 ix=828
  12. 13 print"[147]":poke53280,0:poke53281,0
  13. 20 poke56,145:poke650,128
  14. 28 fori=54272to54296:pokei,0:next
  15. 30 poke54272,1:poke54273,0:poke54277,100:poke54278,100:poke54276,17
  16. 31 poke54279,1:poke54280,0:poke54284,100:poke54285,100:poke54283,33
  17. 40 ifpeek(ix)=3thenpokeix,0:goto300
  18. 42 ifpeek(ix)=7then10000
  19. 100 print"[147][150][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]";
  20. 101 print"          h a u p t m e n u e           "
  21. 104 print"[154]'klingeln'   [155]==>   [150]< k >"
  22. 105 print"[154]senden      [155]==>   [150]< s >"
  23. 106 print"[154]empfangen   [155]==>   [150]< e >"
  24. 107 print"[154]ende        [155]==>   [150]< f8 >"
  25. 110 geta$:ifa$=""then110
  26. 111 ifa$="k"then20000
  27. 112 ifa$="s"then10000
  28. 113 ifa$="e"then305
  29. 114 ifa$="[140]"thenprint:end
  30. 115 goto110
  31. 300 rem---- empfang --------------------
  32. 305 print"[147][150][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]";
  33. 306 print"       e m p f a n g                    "
  34. 307 print"[159]* bei fehlern  _ [146][145][157][157][157][164][164][164] druecken *"
  35. 310 le=10:pp=38000:gosub500
  36. 320 l=0:forj=0to4
  37. 321 ifpeek(pp+j)=1thenl=l+2^(4-j)
  38. 322 nextj
  39. 330 h=0:forj=5to9
  40. 331 ifpeek(pp+j)=1thenh=h+2^(9-j)
  41. 332 nextj
  42. 340 print"[154]die nachricht enthaelt"h*32+l"zeichen."
  43. 350 le=5*(h*32+l):gosub500
  44. 400 print"[147]":add=0:pp=38000
  45. 402 print"[150][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]";
  46. 403 print"         t e x t a u s g a b e          "
  47. 404 print"[154]folgendes wurde aus dem aether gefischt:"
  48. 408 a$=" abcdefghijklmnopqrstuvwxyz     0123456789()'&+-*/.,:;><=?!#^ "
  49. 410 forj=1tolestep5
  50. 415 x$="":forjj=0to4:x$=x$+right$(str$(peek(pp+j-1+jj)),1):nextjj
  51. 420 x=0:fork=1to5:ifmid$(x$,k,1)="1"thenx=x+2^(5-k)
  52. 421 nextk
  53. 422 ifx=31thenx=0
  54. 425 ifx=27andadd=0thenadd=32:nextj
  55. 430 printmid$(a$,1+x+add,1);:add=0:nextj:goto470
  56. 470 fori=0to700:nexti:poke54296,0
  57. 471 print"[150][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]";
  58. 472 print"  zur fortsetzung bitte 'f1' druecken!  [146]";
  59. 473 fori=0to120:geta$:ifa$<>"[133]"thennexti:goto480
  60. 474 run10
  61. 480 print"[145][145]                                        ";
  62. 481 print"  zur fortsetzung bitte 'f1' druecken!  ";
  63. 482 fori=0to120:geta$:ifa$<>"[133]"thennexti:goto471
  64. 483 run10
  65. 500 rem---- empfangsschleife -----------
  66. 510 if(peek(56320)and16)=0then518
  67. 512 ifpeek(197)=57thenpokeix,7:run10
  68. 514 goto510
  69. 518 print"[150]l a e u f t"
  70. 520 if(peek(56320)and16)=0then520
  71. 530 ti$="000000"
  72. 540 ifti<54then540
  73. 550 z$=""
  74. 560 forl=1tole
  75. 562 ifpeek(197)=57thenpokeix,7:run10
  76. 565 ti$="000000"
  77. 570 if(peek(56320)and16)=0thena=ti:goto600
  78. 580 ifti<14then570
  79. 590 pokepp-1+l,0:nextl:return
  80. 600 if(peek(56320)and16)=0then600
  81. 610 b=ti
  82. 620 x=(12-b+a)/2
  83. 630 pokepp-1+l,1:ti$="000000"
  84. 640 ifti<x-6thengoto640
  85. 650 nextl:return
  86. 10000 rem---- senden -------------------
  87. 10001 print"[147][150][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]";
  88. 10002 print"              s e n d e n               "
  89. 10005 print"[154]ihr text?"
  90. 10006 print"bitte nach jeder zeile [159] return [146][145][157][157][157][157][157][157][157][157][164][164][164][164][164][164][164][164][154] druecken"
  91. 10010 a$="":fori=1to5:inputa$:t$=t$+a$:a$="":nexti
  92. 10011 iflen(t$)=0thenpokeix,0:run10
  93. 10020 pp=38000:poke54296,15
  94. 10030 b$="11111000010001000011001000010100110001110100001001010100101101100"
  95. 10032 b$=b$+"011010111001111100001000110010100111010010101101101011111000"
  96. 10034 b$=b$+"1100111010110111110011101111101111100000"
  97. 10036 c$="0123456789()'&+-*/.[166][;><=?!#^ "
  98. 10050 add=0:fori=1tolen(t$)
  99. 10060 m$=mid$(t$,i,1)
  100. 10070 ifm$=" "thenx$=mid$(b$,1,5):goto10100
  101. 10080 ifasc(m$)>64andasc(m$)<91thenx$=mid$(b$,(asc(m$)-64)*5+1,5):goto10100
  102. 10085 forii=1tolen(c$)
  103. 10086 ifmid$(c$,ii,1)=m$thenx$="11011"+mid$(b$,(ii-1)*5+1,5):add=add+1:goto10100
  104. 10087 nextii:x$="00000"
  105. 10100 forj=1tolen(x$)
  106. 10110 pokepp,(asc(mid$(x$,j,1))-48)
  107. 10120 pp=pp+1
  108. 10130 nextj:x$(i)=x$
  109. 10140 nexti
  110. 10200 rem---- laenge feststellen -------
  111. 10205 l=len(t$)+add
  112. 10206 print"die nachricht enthaelt"l"zeichen."
  113. 10210 h=int(l/32):l=l-h*32
  114. 10300 l$=mid$(b$,(l*5)+1-160*(l=0),5)+mid$(b$,(h*5)+1-160*(h=0),5)
  115. 12000 rem---- kontrollbytes senden -----
  116. 12100 print"[159]* sendung laeuft *[154]"
  117. 12105 poke54273,100:ti$="000000"
  118. 12106 ifti$<>"000003"then12106
  119. 12107 ifpeek(ix)=7thenifti$<>"000010"then12107
  120. 12108 poke54273,0:ifpeek(ix)=7thenpokeix,0
  121. 12110 ti$="000000"
  122. 12120 ifti<60then12120
  123. 12200 fori=1tolen(l$)
  124. 12210 ti$="000000"
  125. 12215 sys49152:ifpeek(54280)<>0thenpokeix,3:fori=0to2000:next:run10
  126. 12220 ifmid$(l$,i,1)="0"then12300
  127. 12230 ifti<3then12230
  128. 12235 poke54273,100
  129. 12240 ifti<11then12240
  130. 12245 poke54273,0
  131. 12300 ifti<15then12300
  132. 12320 nexti
  133. 12330 fori=0to3000:nexti
  134. 12400 rem---- hauptsendeschleife -------
  135. 12405 poke54273,100:ti$="000000"
  136. 12406 ifti$<>"000003"then12406
  137. 12407 poke54273,0
  138. 12420 ti$="000000"
  139. 12430 ifti<60then12430
  140. 12510 forzr=38000to38000+5*len(t$)+5*add-1
  141. 12520 ti$="000000"
  142. 12525 sys49152:ifpeek(54280)<>0thenpokeix,3:fori=0to2000:next:run10
  143. 12530 ifpeek(zr)=0then12600
  144. 12540 ifti<3then12540
  145. 12545 poke54273,100
  146. 12550 ifti<11then12550
  147. 12555 poke54273,0
  148. 12600 ifti<15then12600
  149. 12620 nextzr
  150. 12650 pokeix,3:run10
  151. 14000 rem---- bereitschaft melden ------
  152. 14001 print"[147][159]empfangsbereitschaft melden (j/n)?"
  153. 14010 geta$:ifa$="j"then14020
  154. 14011 ifa$<>"n"then14010
  155. 14012 return
  156. 14020 print"[154]* meldung wird gesendet *"
  157. 14030 poke54296,15:poke54273,100:ti$="000000"
  158. 14032 ifti$<>"000004"then14032
  159. 14034 poke54273,0:pokeix,3:return
  160. 20000 rem---- klingeln -----------------
  161. 20001 print"[147][150][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]";
  162. 20002 print"          ' k l i n g e l n '           [154]"
  163. 20010 poke54296,15
  164. 20020 ti$="000000"
  165. 20030 poke54273,100
  166. 20040 ifti$<>"000002"then20040
  167. 20050 poke54273,0:ti$="000000"
  168. 20052 ifti$<>"000001"then20052
  169. 20054 ti$="000000"
  170. 20060 if(peek(56320)and16)=0then20100
  171. 20062 ifti$<>"000001"then20060
  172. 20070 goto20020
  173. 20100 print"mark ist jetzt empfangsbereit!"
  174. 20110 ti$="000000"
  175. 20112 ifti$<>"000004"then20112
  176. 20120 goto10000:rem senden
  177. 21000 rem---- daten fuer mc-routine ----
  178. 21010 data173,0,220,201,111,208,13,232,138,201,20,208,7,162,0,169,152,141,8,212,96
  179.