home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1992 November / 1992-11.d64 / 136demo (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  3KB  |  126 lines

  1. 10 rem *** 136colors demo ***
  2. 20 rem copyright 1992 - compute publications intl ltd - all rights reserved
  3. 30 rem ......................
  4. 40 poke53281,0:poke53280,0:poke53269,0
  5. 45 ifpeek(52720)=49then90
  6. 50 printchr$(147)"please wait..."
  7. 60 iff=0thenf=1:load"136colors",8,1
  8. 70 iff=1thenf=2:load"136spr",8,1
  9. 80 sys52600
  10. 90 printchr$(147):poke198,0
  11. 100 poke52882,150:poke52884,174:poke52886,198:poke52888,1
  12. 110 poke52883,100:poke52885,100:poke52887,100:poke52889,1
  13. 120 poke52894,200:poke52895,202:poke52896,204
  14. 130 poke52890,13:poke52891,13:poke52892,13
  15. 135 ifpeek(52896)<>0then135
  16. 136 poke53269,255
  17. 140 forl=13to1step-1
  18. 150 poke52890,l:poke52891,l:poke52892,l
  19. 160 forw=1to10:nextw
  20. 170 nextl
  21. 180 print"";
  22. 190 dimcl(13,1)
  23. 200 forl=1to13
  24. 210 readcl(l,0),cl(l,1)
  25. 220 nextl
  26. 230 data 1,13,24,32,43,51,52,57,58,64,65,71,72,77,82,86,88,93,96,102,103,111
  27. 240 data 112,118,128,134
  28. 250 c=int(rnd(1)*13)+1:d=1
  29. 260 lo=cl(c,0)
  30. 270 poke52890,lo:poke52891,lo:poke52892,lo
  31. 280 lo=lo+d
  32. 285 ifpeek(198)>0anden=1thenpoke198,0:goto400
  33. 290 gosub2000
  34. 300 iflo=cl(c,1)thend=-1:goto270
  35. 310 iflo<cl(c,0)then250
  36. 320 goto270
  37. 330 data "colors*"
  38. 340 data "\12"
  39. 350 data "copyright 1992 - compute pubs intl ltd*"
  40. 360 data "\12345678"
  41. 370 data "*"
  42. 380 data "press any key to continue_"
  43. 400 poke53269,0
  44. 410 printchr$(147)
  45. 420 poke52882,0:poke52883,75:poke52894,206:poke52890,129
  46. 430 poke53269,3
  47. 440 forx=0to174step2:poke52882,x:nextx
  48. 450 en=0:sn$="":print""
  49. 460 c=int(rnd(1)*136)+1
  50. 470 poke52890,c
  51. 480 forw=1to30
  52. 490 gosub2000
  53. 500 ifpeek(198)>0anden=1thenpoke198,0:goto700
  54. 510 nextw
  55. 520 goto460
  56. 530 data "in addition to being able to produce*"
  57. 540 data "136 colors, this program can also*"
  58. 550 data "create 4 high resolution (1 pixel res-*"
  59. 560 data "olution) sprites, each with 4 colors.*"
  60. 570 data "of those 4 colors, 1 color is capable*"
  61. 580 data "of 136 colors. the other 3 colors are*"
  62. 590 data "restricted to the 16 colors of the*"
  63. 600 data "commodore 64. each high resolution*"
  64. 610 data "sprite is created from two sprites.*"
  65. 620 data "included with the program is an editor*"
  66. 630 data "to produce these 4 high resolution*"
  67. 640 data "sprites. there are also two interrupt*"
  68. 650 data "routines included to ease the usage*"
  69. 660 data "of 136 colors and hi-res sprites.*"
  70. 670 data "*"
  71. 680 data "press any key to continue_"
  72. 700 poke53269,0:printchr$(147)
  73. 710 poke52882,138:poke52884,162:poke52886,186:poke52888,210
  74. 720 poke52883,75:poke52885,75:poke52887,75:poke52889,75
  75. 730 poke52894,208:poke52895,208:poke52896,208:poke52897,208
  76. 740 poke52890,1:poke52891,2:poke52892,3:poke52893,4
  77. 745 ifpeek(52897)<>0then745
  78. 750 poke53269,255
  79. 754 print"";:en=0:sn$=""
  80. 755 gosub2000
  81. 756 ifen=0thengoto755
  82. 760 print"";tab(15);"^"
  83. 770 print"";tab(12);"color"
  84. 780 dimc(3):c(0)=1:c(1)=2:c(2)=3:c(3)=4:d=0
  85. 790 fors=0to3
  86. 800 poke52890+s,c(s)
  87. 810 nexts
  88. 815 print"";tab(17);"    "
  89. 816 print"[145]";tab(17);c(0)
  90. 820 geta$:ifa$=""then820
  91. 830 ifa$="j"thend=-1
  92. 840 ifa$="k"thend=1
  93. 850 forlr=0to3
  94. 860 c(lr)=c(lr)+d
  95. 870 ifc(lr)>136thenc(lr)=1
  96. 880 ifc(lr)<1thenc(lr)=136
  97. 890 nextlr:d=0
  98. 900 ifa$="e"then1020
  99. 910 goto790
  100. 920 data "now, you may observe the 136 colors*"
  101. 930 data "yourself by scrolling to the left by*"
  102. 940 data "pressing 'j' and scrolling to the right*"
  103. 950 data "by pressing 'k'. to end, press 'e'.*"
  104. 960 data "you will notice that the colors are*"
  105. 970 data "organized into several groups. i have*"
  106. 980 data "arranged each group from brightest to*"
  107. 990 data "darkest. each sprite has its own color*"
  108. 1000 data "address in which to poke its color*"
  109. 1010 data "number._"
  110. 1020 printchr$(147):poke53269,0
  111. 1030 poke53281,6:poke53280,14:poke646,14
  112. 1040 end
  113. 2000 ifen=1then2075
  114. 2010 ifsn$<>""then2045
  115. 2020 readsn$
  116. 2030 ifleft$(sn$,1)="\"then2080
  117. 2040 l=len(sn$):ch=0:printtab((41-l)/2);
  118. 2045 ch=ch+1
  119. 2050 ifmid$(sn$,ch,1)="*"thensn$="":print:goto2075
  120. 2060 ifmid$(sn$,ch,1)="_"thenen=1:goto2075
  121. 2070 printmid$(sn$,ch,1);
  122. 2075 return
  123. 2080 r=len(sn$)-1
  124. 2090 forrt=1tor:print:nextrt
  125. 2100 sn$="":goto2075
  126.