-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDERBY.BAS
77 lines (77 loc) · 3 KB
/
DERBY.BAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
1 CLEAR 300
10 GOSUB8000
20 G%=8:FOR F%=BASE(8)TO BASE(8)+24STEP 4:VPOKE F%,G%:G%=G%+16:NEXT F%
30 X1%=10:X2%=10:X3%=10:X4%=10:X5%=10:X6%=10
40 VPOKE6915,2:VPOKE6919,13:VPOKE6923,4:VPOKE6927,10:VPOKE6931,8:VPOKE6935,5
50 VPOKE6913,X1%:VPOKE6917,X2%:VPOKE6921,X3%:VPOKE6925,X4%:VPOKE6929,X5%:VPOKE6933,X6%
1000 '
1010 P%=1:Q%=6:X%=100:Y%=174:N1%=0:N2%=4:N3%=8:XD%=X%:YD%=Y%:D%=0:DB%=0
1015 ON STRIG GOSUB 2000,2000
1016 STRIG(0) ON:STRIG(1) ON
1020 LOCATE 0,15:PRINTMID$(M$,P%,32)
1021 P%=P%+1:IF P%=19 THEN P%=1
1030 LOCATE 0,17:PRINTMID$(N$,Q%,32)
1031 Q%=Q%-1:IF Q%=0 THEN Q%=9
1040 A%=STICK(0) OR STICK(1)
1050 X%=X%-4*((A%=3)AND(X%<240))+4*((A%=7)AND(X%>0)):IF D%=0 THEN XD%=X%
1051 IF D%=1 THEN YD%=YD%-4:IF YD%=136 THEN GOSUB 3000 ELSE IF YD%=120 THEN GOSUB 4000
1055 PUT SPRITE7,(X%,174),4,4
1056 PUT SPRITE6,(XD%,YD%),8,3
1060 N1%=N2%:N2%=N3%:N3%=N3%+4+12*(N3%=8)
1070 VPOKE6914,N1%:VPOKE6918,N2%:VPOKE6922,N3%:VPOKE6926,N1%:VPOKE6930,N2%:VPOKE6934,N3%
1100 GOTO 1020
2000 '
2010 IF D%=1 THEN RETURN
2020 D%=1:YD%=172:XD%=X%:RETURN
3000 IF VPEEK(6688+INT(XD%/8))=210 THEN D%=0:XD%=X%:YD%=174:RETURN
3010 IF VPEEK(6688+INT(XD%/8))=223 THEN DB%=1 ELSE DB%=2
3020 RETURN
4000 C%=VPEEK(6624+INT(XD%/8)+1)
4010 C%=(C%-175)/8
4015 IF C%<0 THEN 4090
4020 VPOKE BASE(8)+C%*4+1,VPEEK(BASE(8)+C%*4+1)+4*DB%
4090 D%=0:XD%=X%:YD%=174:RETURN
8000 ' pantalla
8010 KEY OFF:SCREEN 1,2:WIDTH32:COLOR 5,1,1
8015 GOSUB 8500
8020 A=222:FOR F=0 TO 31
8030 LOCATE F,0:PRINT CHR$(A);
8040 LOCATE F,13:PRINT CHR$(A);
8045 A=A+8:IF A>238 THEN A=222
8050 NEXT F
8060 RESTORE 8085:M$="":FOR F=1 TO 18
8070 READ A:M$=M$+CHR$(A)+CHR$(A)+" ":NEXT F
8080 LOCATE 0,15:PRINT LEFT$(M$,32)
8085 DATA 175,183,191,199,207,215,175,183,191,199,207,215,175,183,191,199,207,215
8090 N$="":FOR F=1 TO 6
8100 N$=N$+CHR$(210)+CHR$(223)+CHR$(210)+" ":NEXT F
8110 LOCATE 0,17:PRINT LEFT$(N$,32)
8120 ' sprites
8130 G=BASE(9):RESTORE 8180
8140 FOR F=1 TO 160
8150 READ A$:VPOKE G,VAL("&H"+A$):G=G+1
8160 NEXT F
8170 RETURN
8180 DATA 00,00,00,80,c0,78,3f,3f,7f,77,f0,a0,50,48,00,00,00,00,00,10,38,7c,ee,e2,e0,70,50,28,c8,00,00,00
8190 DATA 00,00,20,20,20,1c,1f,3f,3f,37,70,50,58,2d,00,00,00,00,00,10,38,7c,ee,e2,e0,e0,e0,50,d0,20,00,00
8200 DATA 00,00,00,40,40,20,20,1f,3f,3f,38,1a,1d,06,00,00,00,00,00,00,08,3c,fe,f7,e1,c0,c0,40,c0,00,00,00
8210 DATA 00,00,01,03,03,03,03,03,00,00,00,00,00,00,00,00,00,00,00,80,c0,c0,c0,c0,00,00,00,00,00,00,00,00
8220 DATA 00,00,00,00,00,00,00,00,01,01,0f,03,7f,49,33,ff,00,00,00,00,00,00,00,00,80,80,f0,c0,fe,92,c9,ff
8500 ' definir graficos
8510 FOR F=BASE(7)+175*8 TO BASE(7)+255*8 STEP 64
8520 FOR G=F TO F+8
8530 VPOKE G,&HFF
8540 NEXT G:NEXT F
8550 RESTORE 8580:FOR F=BASE(6)+21 TO BASE(6)+31
8560 READ A:VPOKE F,A
8570 NEXT F
8580 DATA &H20,&Hd0,&H40,&Ha0,&H80,&H50,&He0,&Hb0,&H30,&He0,&he0,&he0
8590 A=BASE(7)+206*8
8600 FOR F=A TO A+7
8610 VPOKE F+128,VPEEK(F)
8615 VPOKE F+192,VPEEK(F)
8616 VPOKE F+256,VPEEK(F)
8620 NEXT F
8630 RETURN
9000 FOR F=BASE(6) TO BASE(6)+31:VPOKE F,&H50:NEXTF