home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1985 January / Ahoy_Magazine_85-01_1985_Double_L.d64 / card_runner (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  2KB  |  87 lines

  1. 1 rem animate a runner
  2. 2 rem
  3. 3 rem press shift, commodore, or ctrl to quit
  4. 4 rem
  5. 10 dim cb(2),cm(2),ru$(2),bl$(2)
  6. 17 rem
  7. 18 rem go set up memory and variables
  8. 19 rem
  9. 20 gosub 400
  10. 95 rem
  11. 96 rem main movement loop
  12. 97 rem
  13. 98 rem if shift, commodore, or ctrl are pressed, jump to ending routine
  14. 99 rem
  15. 100 for i=0 to 38:if peek(653)<>0 then 200
  16. 107 rem
  17. 108 rem print left-facing and right-facing runners in new position
  18. 109 rem
  19. 110 print ""tab(39-i)bl$(0)ru$(0)""tab(i)bl$(2)ru$(2);
  20. 117 rem
  21. 118 rem cycle through the character sets
  22. 119 rem
  23. 120 am=am+1:if am>2 then am=0
  24. 127 rem
  25. 128 rem switch character set and wait a moment
  26. 129 rem
  27. 130 poke 53272,cm(am):for k=0 to 59:next:next
  28. 190 print "[147]":goto 100
  29. 197 rem
  30. 198 rem restore video memory to normal, re-enable interrupts,and end
  31. 199 rem
  32. 200 poke 808,237:poke 648,4:poke 53272,xx:poke 56578,peek(56578) or 3
  33. 210 poke 56576,(peek(56576)and 252)or 3:end
  34. 397 rem
  35. 398 rem set up video memory
  36. 399 rem
  37. 400 vm=1:sm=15:for i=0 to 2:cm(i)=i*2+8:next:xx=peek(53272)
  38. 407 rem
  39. 408 rem convert video pointers to memory addresses
  40. 409 rem
  41. 410 vb=16*1024*vm:sb=vb+1024*sm:for i=0 to 2:cb(i)=cm(i)*1024+vb:next
  42. 417 rem
  43. 418 rem loops to load character data
  44. 419 rem
  45. 420 for i=0 to 16 step 16:for j=0 to 2:b=cb(j)+i:for k=0 to 15
  46. 427 rem
  47. 428 rem read and poke data
  48. 429 rem
  49. 430 read a:poke b+k,a:next:next:next
  50. 437 rem
  51. 438 rem set character and screen memory
  52. 439 rem
  53. 440 sk=sm*16:poke 648,sb/256
  54. 445 for i=0 to 2:cm(i)=sk+cm(i):next:poke 53272,cm(0)
  55. 447 rem
  56. 448 rem set video block
  57. 449 rem
  58. 450 poke 56578,peek(56578)or 3:poke 56576,(peek(56576) and 252) or (3-vm)
  59. 457 rem
  60. 458 rem disable shift-commodore and keyboard interrupts
  61. 459 rem
  62. 460 print chr$(8):poke 808,234
  63. 467 rem
  64. 468 rem define runner strings
  65. 469 rem
  66. 470 ru$(0)="@[157]a":ru$(2)="b[157]c":bl$(0)=" [157] [145][157][157]":bl$(2)=" [157] [145]"
  67. 477 rem
  68. 478 rem poke in space characters
  69. 479 rem
  70. 480 for i=0 to 2:for j=32*8 to 32*8+7:poke cb(i)+j,0:next:next
  71. 490 print "[147]":return
  72. 997 rem
  73. 998 rem character data
  74. 999 rem
  75. 1000 data 24,56,24,12,78,45,30,12
  76. 1010 data 28,60,104,72,68,66,193,2
  77. 1020 data 24,56,24,12,12,14,62,28
  78. 1030 data 44,12,28,48,24,20,24,48
  79. 1040 data 24,56,24,12,12,14,125,13
  80. 1050 data 13,28,52,36,36,36,100,12
  81. 1060 data 24,28,24,48,114,180,120,48
  82. 1070 data 56,60,22,18,34,66,131,64
  83. 1080 data 24,28,24,48,48,112,124,56
  84. 1090 data 52,48,56,12,24,40,24,12
  85. 1100 data 24,28,24,48,48,112,190,176
  86. 1110 data 176,56,44,36,36,36,38,48
  87.