Advertisement
felixnardella

The Solar System v 1.0

Jul 11th, 2024
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.64 KB | None | 0 0
  1. 5 rem 'the solar system' by kimono v 1.0
  2. 10 poke53280,0:s=24576:sc=17408:dimsy(64)
  3. 15 x0=172:y0=148:rem planets center
  4. 20 rx=110:ry=100:xc=160:yc=108:rem orbitals radii & center
  5. 25 poke56576,(peek(56576)and252)or2:rem select bank 1
  6. 30 forx=0to62:ready:poke18496+x,y:next:rem sprite gen
  7. 35 poke53287,15:poke53288,10:poke53289,5:poke53290,2:poke53291,9:poke53292,8
  8. 40 poke53293,14:poke53294,6:rem sprites colors
  9. 45 poke53269,255:rem all 8 sprites visible
  10. 50 poke53272,peek(53272)or8:rem put bitmap in the 2nd half of vic bank 1 (24576)
  11. 55 poke53265,peek(53265)or32:rem enter in bitmap mode
  12. 60 poke648,68:rem screen ram pointer (17408/256)
  13. 65 rem clear graphic ram
  14. 70 cb$="":p1=peek(51):p2=peek(52)
  15. 75 poke51,64:poke52,127
  16. 80 forcn=1to125:cb$=cb$+chr$(0):next
  17. 85 poke51,p1:poke52,p2
  18. 90 rem clear color ram
  19. 95 cb$="pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp"
  20. 100 cb$=cb$+cb$:cb$=cb$+left$(cb$,121)
  21. 105 print"{clear}"cb$cb$cb$cb$;:print"ppp";:poke18407,16
  22. 110 tw(0)=1:fori=1to7:tw(i)=tw(i-1)*2:next
  23. 115 goto145
  24. 120 rem plot x,y
  25. 125 p=s+320*int(y/8)+8*int(x/8)+(yand7)
  26. 130 pokep,peek(p)ortw(7-(xand7))
  27. 135 return
  28. 140 rem plot ellipses
  29. 145 s1=pi/2:forj=0to7:rx=rx-10:ry=ry-10
  30. 150 forfi=0tos1step.05
  31. 155 y1=ry*sin(fi):x1=rx*cos(fi)
  32. 160 x=xc+x1:y=yc+y1:gosub125
  33. 165 y=yc-y1:gosub125
  34. 170 x=xc-x1:gosub125
  35. 175 y=yc+y1:gosub125
  36. 180 next:next
  37. 185 fori=0to7
  38. 190 poke18424+i,33:rem sprites pointers
  39. 195 next
  40. 200 fori=0to7:readrx(i):next:rem assign orbit x radius
  41. 205 fori=0to7:readry(i):next:rem assign orbit x radius
  42. 210 fori=0to7:readsp(i):next:rem planets speed
  43. 215 fori=0to7:z=int(rnd(1)*40)+1:an(i)=z*i:next:rem init random planets pos
  44. 220 rem symbols
  45. 225 fori=0to63:readsy(i):next
  46. 230 rem chars gen
  47. 235 poke17947,112:rem yellow 16*7
  48. 240 fori=0to7:readsu(i):poke28888+i,su(i):next
  49. 245 fori=0to6:readt(i):poke24672+i,t(i):next
  50. 250 fori=0to6:readh(i):poke24680+i,h(i):next
  51. 255 fori=0to6:reade(i):poke24688+i,e(i):next
  52. 260 fori=0to6:reads(i):poke24704+i,s(i):next
  53. 265 fori=0to6:reado(i):poke24712+i,o(i):next
  54. 270 fori=0to6:readl(i):poke24720+i,l(i):next
  55. 275 fori=0to6:reada(i):poke24728+i,a(i):next
  56. 280 fori=0to6:readr(i):poke24736+i,r(i):next
  57. 285 fori=0to6:poke24752+i,s(i):next
  58. 290 fori=0to6:ready(i):poke24760+i,y(i):next
  59. 295 fori=0to6:poke24768+i,s(i):next
  60. 300 fori=0to6:poke24776+i,t(i):next
  61. 305 fori=0to6:poke24784+i,e(i):next
  62. 310 fori=0to6:readm(i):poke24792+i,m(i):next
  63. 315 fori=0to8:readco(i):poke17608+80*i,co(i):next:rem chars colors
  64. 320 forj=0to8:fori=0to7:poke26176+i+640*j,su(i):next:next
  65. 325 fori=0to6:poke26192+i,s(i):next
  66. 330 fori=0to6:readu(i):poke26200+i,u(i):next
  67. 335 fori=0to6:readn(i):poke26208+i,n(i):next
  68. 340 fori=0to6:poke26832+i,h(i):next
  69. 345 fori=0to7:poke26848+i,sy(i):next
  70. 350 fori=0to6:readv(i):poke27472+i,v(i):next
  71. 355 fori=0to7:poke27488+i,sy(i+8):next
  72. 360 fori=0to6:poke28112+i,e(i):next
  73. 365 fori=0to7:poke28128+i,sy(i+16):next
  74. 370 fori=0to6:poke28752+i,m(i):next
  75. 375 fori=0to7:poke28768+i,sy(i+24):next
  76. 380 fori=0to6:readj(i):poke29392+i,j(i):next
  77. 385 fori=0to7:poke29408+i,sy(i+32):next
  78. 390 fori=0to6:poke30032+i,s(i):next
  79. 395 fori=0to7:poke30048+i,sy(i+40):next
  80. 400 fori=0to6:poke30672+i,u(i):next
  81. 405 fori=0to7:poke30688+i,sy(i+48):next
  82. 410 fori=0to6:poke31312+i,n(i):next
  83. 415 fori=0to7:poke31328+i,sy(i+56):next
  84. 420 fori=0to6:readb(i):poke32504+i,b(i):next
  85. 425 fori=0to6:poke32512+i,y(i):next
  86. 430 fori=0to6:readk(i):poke32528+i,k(i):next
  87. 435 fori=0to6:readi(i):poke32536+i,i(i):next
  88. 440 fori=0to6:poke32544+i,m(i):next
  89. 445 fori=0to6:poke32552+i,o(i):next
  90. 450 fori=0to6:poke32560+i,n(i):next
  91. 455 fori=0to6:poke32568+i,o(i):next
  92. 460 rem main loop
  93. 465 fort=0to255
  94. 470 fori=0to7
  95. 475 an(i)=an(i)-sp(i):fi=an(i):rem angular distances & speeds
  96. 480 x=x0+rx(i)*cos(fi*pi/128):rem calc x pos
  97. 485 y=y0+ry(i)*sin(fi*pi/128):rem calc y pos
  98. 490 ifx<256thenms=msand(255-tw(i)):rem reset msb
  99. 495 ifx>255thenms=msortw(i):x=x-255:rem set msb if x>255 & update x pos
  100. 500 poke53264,ms:rem update msb reg
  101. 505 poke53248+i*2,x:rem update x pos
  102. 510 poke53249+i*2,y:rem update y pos
  103. 515 next:next
  104. 520 goto465
  105. 525 rem sprite
  106. 530 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  107. 535 data 0,0,0,28,0,0,62,0,0,127,0,0,127,0,0,127
  108. 540 data 0,0,62,0,0,28,0,0,0,0,0,0,0,0,0,0
  109. 545 data 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
  110. 550 rem radius x
  111. 555 data 30,40,50,60,70,80,90,100
  112. 560 rem radius y
  113. 565 data 20,30,40,50,60,70,80,90
  114. 570 rem planets speed
  115. 575 data 14,6,4,2,.4,.14,.06,.02
  116. 580 rem hermes
  117. 585 data 20,28,34,34,28,8,28,8
  118. 590 rem venus
  119. 595 data 28,34,34,34,28,8,28,8
  120. 600 rem earth
  121. 605 data 62,73,73,127,73,73,62,0
  122. 610 rem mars
  123. 615 data 7,3,5,56,40,40,24,0
  124. 620 rem jupiter
  125. 625 data 50,74,18,34,66,127,2,0
  126. 630 rem saturn
  127. 635 data 112,32,32,60,34,36,2,0
  128. 640 rem uranus
  129. 645 data 8,28,42,28,34,42,34,28
  130. 650 rem neptune
  131. 655 data 153,153,153,90,60,24,126,24
  132. 660 rem su
  133. 665 data 60,126,255,255,255,255,126,60
  134. 670 rem t
  135. 675 data 127,24,24,28,28,28,28
  136. 680 rem h
  137. 685 data 97,97,97,127,115,115,115
  138. 690 rem e
  139. 695 data 127,96,96,127,112,112,127
  140. 700 rem s
  141. 705 data 127,99,96,127,3,99,127
  142. 710 rem o
  143. 715 data 127,103,103,99,99,99,127
  144. 720 rem l
  145. 725 data 96,96,96,112,112,112,127
  146. 730 rem a
  147. 735 data 62,54,54,127,115,115,115
  148. 740 rem r
  149. 745 data 126,102,102,126,115,115,115
  150. 750 rem y
  151. 755 data 99,99,99,127,28,28,28
  152. 760 rem m
  153. 765 data 127,219,219,219,219,219,219
  154. 770 rem planet colors
  155. 775 data 112,240,160,80,32,144,128,224,96
  156. 780 rem u
  157. 785 data 99,99,99,115,115,115,127
  158. 790 rem n
  159. 795 data 127,99,99,115,115,115,115
  160. 800 rem v
  161. 805 data 115,115,114,50,50,50,62
  162. 810 rem j
  163. 815 data 6,6,6,7,7,103,127
  164. 820 rem b
  165. 825 data 126,102,102,127,115,115,127
  166. 830 rem k
  167. 835 data 102,102,102,127,115,115,115
  168. 840 rem i
  169. 845 data 24,24,24,28,28,28,28
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement