home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C64'er
/
C64'er.iso
/
87xx
/
8705.d64
/
sprite-irq
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
1995-03-30
|
2KB
|
100 lines
0 SYS32768:.OPT P,OO
10 .TIT "SPRITE-INTERRUPT"
11 .PAG 255
12 *= $C04D
13 VIC = $D000
15 IRQALT = $EA31
17 MASK = $D01A
18 REQUEST = $D019
22 ;
23 ;INITIALISIERUNG
24 ;===============
25 ;
26 SEI ;INTERRRUPT VERHINDERN
27 LDA #<IRQNEU
28 LDX #>IRQNEU
29 STA $0314 ;IRQ-VEKTOR AUF NEUE
30 STX $0315 ;ROUTINE SETZEN
36 LDA #%10000110 ;IRQ DURCH SPRITE-
37 STA MASK ;KOLLISION FESTLEGEN
38 CLI ;IRQ FREIGEBEN
39 RTS
40 ;
41 ;NEUE INTERRUPTROUTINE
42 ;=====================
43 ;
44 IRQNEU LDA REQUEST ;IRQ-REGISTER
45 STA REQUEST ;LOESCHEN
46 BMI RASTER ;ZUM RASTER - IRQ
47 ;
48 ;TIMER-INTERRUPT
49 ;===============
50 ;
51 LDA $DC0D ;IRQ-REG. LOESCHEN
52 CLI ;IRQ ZULASSEN
53 JMP IRQALT ;TIMER-IRQ-ROUTINE
54 ;
55 ;RASTERZEILEN-INTERRUPT
56 ;======================
57 ;
58 RASTER LDA VIC+31 ;SPR-HINTERGR
59 CMP #00:BNE BACK
60 ;
61 ;SPRITE-SPRITE KOLLISION
62 ;=======================
63 ;
66 LDX #35
67 L1 LDY #00
68 L2 TYA
69 STA VIC+39+1 ;SPRITE1 FARBE
70 EOR #15
71 STA VIC+39+2 ;SPRITE2 FARBE
72 INY
73 BNE L2
74 DEX
75 BNE L1
76 L3 INC VIC+3 ;SPRITE1 ABSTURZ
77 LDX #13
78 LP1 LDY #00
79 LP2 INY
80 BNE LP2
81 DEX
82 BNE LP1
87 LDA VIC+3
88 CMP #220
89 BNE L3
100 LDA VIC+21
101 AND #%11111101 ;SPRITE1 AUS
102 STA VIC+21
103 LDA #00
104 STA VIC+30 ;KOLLISION LOESCHEN
105 JMP $FEBC ;IRQ BEENDEN
106 ;
107 ;SPRITE-HINTERGRUNG KOLLISION
108 ;============================
109 ;
110 BACK LDX #35
111 L4 LDY #00
112 L5 TYA
113 STA VIC+39+2 ;SPRITE2 FARBE
114 INY
115 BNE L5
116 DEX
117 BNE L4
118 L6 INC VIC+5 ;SPRITE2 ABSTURZ
119 LDX #13
120 LP3 LDY #00
121 LP4 INY
122 BNE LP4
123 DEX
124 BNE LP3
125 LDA VIC+5
126 CMP #220
130 BNE L6
131 LDA VIC+21
132 AND #%11111011 ;SPRITE2 AUS
133 STA VIC+21
134 LDA #00
135 STA VIC+31 ;KOLLISION LOESCHEN
136 JMP $FEBC ;IRQ BEENDEN