home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1985 January
/
Ahoy_Magazine_85-01_1985_Double_L.d64
/
card_runner
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
2KB
|
87 lines
1 rem animate a runner
2 rem
3 rem press shift, commodore, or ctrl to quit
4 rem
10 dim cb(2),cm(2),ru$(2),bl$(2)
17 rem
18 rem go set up memory and variables
19 rem
20 gosub 400
95 rem
96 rem main movement loop
97 rem
98 rem if shift, commodore, or ctrl are pressed, jump to ending routine
99 rem
100 for i=0 to 38:if peek(653)<>0 then 200
107 rem
108 rem print left-facing and right-facing runners in new position
109 rem
110 print ""tab(39-i)bl$(0)ru$(0)""tab(i)bl$(2)ru$(2);
117 rem
118 rem cycle through the character sets
119 rem
120 am=am+1:if am>2 then am=0
127 rem
128 rem switch character set and wait a moment
129 rem
130 poke 53272,cm(am):for k=0 to 59:next:next
190 print "[147]":goto 100
197 rem
198 rem restore video memory to normal, re-enable interrupts,and end
199 rem
200 poke 808,237:poke 648,4:poke 53272,xx:poke 56578,peek(56578) or 3
210 poke 56576,(peek(56576)and 252)or 3:end
397 rem
398 rem set up video memory
399 rem
400 vm=1:sm=15:for i=0 to 2:cm(i)=i*2+8:next:xx=peek(53272)
407 rem
408 rem convert video pointers to memory addresses
409 rem
410 vb=16*1024*vm:sb=vb+1024*sm:for i=0 to 2:cb(i)=cm(i)*1024+vb:next
417 rem
418 rem loops to load character data
419 rem
420 for i=0 to 16 step 16:for j=0 to 2:b=cb(j)+i:for k=0 to 15
427 rem
428 rem read and poke data
429 rem
430 read a:poke b+k,a:next:next:next
437 rem
438 rem set character and screen memory
439 rem
440 sk=sm*16:poke 648,sb/256
445 for i=0 to 2:cm(i)=sk+cm(i):next:poke 53272,cm(0)
447 rem
448 rem set video block
449 rem
450 poke 56578,peek(56578)or 3:poke 56576,(peek(56576) and 252) or (3-vm)
457 rem
458 rem disable shift-commodore and keyboard interrupts
459 rem
460 print chr$(8):poke 808,234
467 rem
468 rem define runner strings
469 rem
470 ru$(0)="@[157]a":ru$(2)="b[157]c":bl$(0)=" [157] [145][157][157]":bl$(2)=" [157] [145]"
477 rem
478 rem poke in space characters
479 rem
480 for i=0 to 2:for j=32*8 to 32*8+7:poke cb(i)+j,0:next:next
490 print "[147]":return
997 rem
998 rem character data
999 rem
1000 data 24,56,24,12,78,45,30,12
1010 data 28,60,104,72,68,66,193,2
1020 data 24,56,24,12,12,14,62,28
1030 data 44,12,28,48,24,20,24,48
1040 data 24,56,24,12,12,14,125,13
1050 data 13,28,52,36,36,36,100,12
1060 data 24,28,24,48,114,180,120,48
1070 data 56,60,22,18,34,66,131,64
1080 data 24,28,24,48,48,112,124,56
1090 data 52,48,56,12,24,40,24,12
1100 data 24,28,24,48,48,112,190,176
1110 data 176,56,44,36,36,36,38,48