home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1990 June / 1990-06.d64 / billboard.bas (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  92 lines

  1. 10 rem copyright 1990 compute! publications, inc. - all rights reserved
  2. 15 print"[147][154]":poke53280,14:poke53281,6
  3. 20 c1=0 :rem background color
  4. 30 c2=3 :rem scrolling text color
  5. 40 c3=6 :rem border color
  6. 50 c4=6 :rem heading background color
  7. 60 c5=3 :rem heading text color
  8. 70 data"[201]nformation [195]enter":rem heading text
  9. 80 sp=5:rem scroll speed
  10. 90 mx=240:rem maximum data file length
  11. 100 df$="billboard.data":rem data file name
  12. 110 print"please wait":ad=828:f$="billboard.ml":gosub830:poke872,(sp+3)*5
  13. 120 ad=61440:f$="billboard.char":gosub830
  14. 130 dims1$(mx),s2$(mx):r1$="":r2$="[146]":s1%=sp*3:s2%=sp*5-5
  15. 140 sp$="                                       ":printchr$(14)chr$(8)
  16. 150 print"[147]"tab(5)"[197][204][197][195][212][210][207][206][201][195] [194][201][204][204][194][207][193][210][196]":print" [195]opyright 1990 [195][207][205][208][213][212][197]! [208]ubl."
  17. 155 printtab(5)"[193]ll [210]ights [210]eserved"
  18. 156 print" (1) [199]et message data from disk file"
  19. 160 print" (2) [212]ype in a message":input" [217]our choice";ch$
  20. 170 ifch$<>"1"andch$<>"2"then150
  21. 180 ifch$="1"thengosub330
  22. 190 ifch$="2"thengosub410
  23. 200 print" [208]ress [210][197][212][213][210][206] to start message scroll":print" or enter [209] to quit";
  24. 210 inputch$:ifch$="q"orch$="[209]"thensys2048:end
  25. 220 gosub690:poke53280,c3:poke53281,c1:poke646,c2:gosub710:printchr$(147)
  26. 230 fori=0to119:poke55296+i,c5:poke51200+i,160:next
  27. 240 l=l+1:a$=s1$(l):b$=s2$(l)
  28. 250 ifpeek(198)>0thenpoke198,0:poke808,237:poke648,4:sys2048:end
  29. 260 ifl=nthenl=0:goto240
  30. 270 ifa$="-"thena$=""
  31. 280 poke214,23:print:printsp$;:poke214,23:print:printa$;:sys828
  32. 290 ifa$=""thenfori=1tos1%:next
  33. 300 poke214,23:print:printsp$;:poke214,23:print:printb$;:sys828
  34. 310 ifa$=""andl>1thenfori=1tos2%:next:sys828
  35. 320 goto240
  36. 330 open1,8,2,"0:"+df$+",s,r":print" [210]eading message data, please wait."
  37. 340 n=n+1:print"[145] [204]ine";n:ifn>=mxthenprint" [196]ata file too large.":close1:end
  38. 350 ifst=64thenclose1:return
  39. 360 get#1,a$:ps=ps+1:ifa$<>chr$(13)andps<39thenc$=c$+a$:goto350
  40. 370 ifmid$(c$,len(c$),1)=" "thenc$=left$(c$,len(c$)-1)
  41. 380 s1$(n)=c$:c$="":ps=0:ifs1$(n)="-"thengoto340
  42. 390 ifs1$(n)="*"thens1$(n)="-":close1:n=n+1:return
  43. 400 gosub600:goto340
  44. 410 print"[147] [197]nter message text, pressing [210][197][212][213][210][206]"
  45. 420 print" after each line.":print" [197]nter - on a separate line after"
  46. 430 print" each message. [197]nter * to end input."
  47. 440 n=n+1:ifn<10thenprint" ";
  48. 450 ifn>99thens1$(n)="-":n=n+1:return
  49. 460 nn$=str$(n):printright$(nn$,len(nn$)-1)":";:zz$=chr$(20)
  50. 470 ps=0:c$=""
  51. 480 printchr$(166)chr$(157);
  52. 490 geta$:ifa$=""or(a$=chr$(24)andc$="")then490
  53. 500 print" "chr$(157);
  54. 510 ifa$=zz$andlen(c$)>0thenc$=left$(c$,len(c$)-1):printa$;:ps=ps-1:goto480
  55. 520 ifa$=chr$(24)thenforz=1tolen(c$):printzz$;:next:goto470
  56. 530 ifa$=chr$(13)andc$<>""thenprinta$;:goto570
  57. 540 if(asc(a$)and127)<32then480
  58. 550 ifps>34then480
  59. 560 printa$;:c$=c$+a$:poke212,0:ps=ps+1:goto480
  60. 570 s1$(n)=c$:ifs1$(n)="-"thengoto440
  61. 580 ifs1$(n)="*"thens1$(n)="-":n=n+1:return
  62. 590 gosub600:goto440
  63. 600 a$=s1$(n):s1$="":s2$="":iflen(a$)=0thenreturn
  64. 610 fori=1tolen(a$):ch=asc(mid$(a$,i,1))
  65. 620 ifch>32andch<64thens1$=s1$+r1$+chr$(ch+63)+r2$:s2$=s2$+r1$+chr$(ch+127)+r2$
  66. 630 ifch=65or(ch>66andch<94)thens1$=s1$+chr$(ch):s2$=s2$+chr$(ch-32)
  67. 640 ifch=66thens1$=s1$+"b":s2$=s2$+chr$(34)+chr$(34)+chr$(20)
  68. 650 ifch>192andch<218thens1$=s1$+chr$(ch):s2$=s2$+chr$(ch-32)
  69. 660 ifch=32thens1$=s1$+" ":s2$=s2$+" "
  70. 670 next:s1$(n)=left$(sp$,20-len(a$)/2)+s1$:s2$(n)=left$(sp$,20-len(a$)/2)+s2$
  71. 680 return
  72. 690 poke56576,peek(56576)and252:poke53272,44:poke648,200
  73. 700 poke53265,peek(53265)and247:printchr$(147):poke808,234:return
  74. 710 fori=52224to52672:pokei,255:next:fori=0to7:poke52216+i,48+i:next:v=53248
  75. 720 pokev+21,127:fori=39to46:pokev+i,c4:next:fori=1to15step2:pokev+i,36:next
  76. 730 pokev+29,255:pokev+23,255:fori=0to14step2:ii=24+i*24
  77. 740 pokev+i,ii+256*(ii>255):next:pokev+16,96:poke56334,peek(56334)and254
  78. 750 poke1,peek(1)and251:readn$:nn=len(n$):forx=1tonn:ps=int(10-nn/2)+x
  79. 760 sn=int(ps/3-.3):ifps=3orps=6orps=9orps=12orps=15orps=18thencn=2
  80. 770 ifps=1orps=4orps=7orps=10orps=13orps=16orps=19thencn=0
  81. 780 ifps=2orps=5orps=8orps=11orps=14orps=17orps=20thencn=1
  82. 790 ch=asc(mid$(n$,x,1)):ifch>=193andch<=218thench=ch-128:goto810
  83. 800 ifch>=64andch<=90thench=ch-64
  84. 810 sp=52251+64*sn+cn:fori=0to7:ii=peek(56320+ch*8+i):pokesp,ii:sp=sp+3:nexti,x
  85. 820 poke1,peek(1)or4:poke56334,peek(56334)or1:return
  86. 830 f$="0:"+f$:a2=int(ad/256):a1=ad-a2*256
  87. 840 t$=f$:zk=peek(53)+256*peek(54)-len(t$):poke782,zk/256
  88. 850 poke781,zk-peek(782)*256:poke780,len(t$):sys65469
  89. 860 poke780,1:poke781,8:poke782,0:sys65466:poke780,0:poke781,a1:poke782,a2
  90. 870 sys65493:if(peek(783)and1)or(191andst)thenprint"error loading "f$:end
  91. 880 return
  92.