| |
Trifox Account closed
Registered: Mar 2006 Posts: 108 |
sprite sprite collision interrupt ?
hi, i have tried to set bit 3 in $d01a and $d019
but somehow my interrupt is not initiated when 2 sprites overlap ... ;( i leave the interrupt with
asl $d019 ; ACK interrupt (to re-enable it)
pla
tay
pla
tax
pla
|
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
are you sure you want to use this irq? its practically useless :=P |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
you'll need an rti at the very end of the irq exit routine too.
AFAIK you can read any time some register ($d019?) for checking for collisions so an interrupt is not necessary. IIRC that register has to be cleared manually aswell. |
| |
hollowman
Registered: Dec 2001 Posts: 474 |
"Sprite to sprite collisions are recognized by the computer, or flagged,in the sprite to sprite collision register at location 53278 ($D01E in HEX) in the VIC-II chip control register. Each sprite has a bit in this register. If that bit is a 1, then that sprite is involved in a collision. The bits in this register will remain set until read (PEEKed). Once read, the register is automatically cleared, so it is a good idea to save the value in a variable until you are finished with it." |
| |
TNT Account closed
Registered: Oct 2004 Posts: 189 |
Try using bit 2... also, make sure you don't have other IRQs enabled if you use rmw instruction to ack interrupts.
|
| |
Krill
Registered: Apr 2002 Posts: 2980 |
why no other irq sources? |
| |
TNT Account closed
Registered: Oct 2004 Posts: 189 |
I was thinking of other VIC-II interrupts, sorry for not being more clear. Problem with that is ofcourse acking them too. No problem with CIA interrupts.
(But who would use sprite-background and/or light pen IRQs? Sprite-sprite collision IRQ *can* sometimes be used to cut down comparisons when combined creatively with raster IRQ.)
|
| |
MRT Account closed
Registered: Sep 2005 Posts: 149 |
cli ?
;-) |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
is there a priority amongst different vic interruts? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
i dont think so, they are all connected to the same irq line on the cpu afterall |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
You don't need a priority because you can read all IRQ sources via LDA $D019 and clear all IRQ flags as you like via setting their bits in $D019. |
| |
Danzig
Registered: Jun 2002 Posts: 440 |
you ment $D01A!? |
| |
TNT Account closed
Registered: Oct 2004 Posts: 189 |
You enable interrupts with $d01a, you read their status and ack them with $d019. |
| |
Danzig
Registered: Jun 2002 Posts: 440 |
yeah, shyte, I misread grahams posting...
like "clear all IRQ flags" reads "set all IRQ flags" to me...
*dumb* |