Prev: CFA5 Up: Map Next: D000
CFE1: Replace Overlapping Special Object
Handles two objects that fill the same space. If one of them is a special object, it is replaced by a twinkling sprite.
Input
IX Address of the first object
IY Address of the other object
Replace a special object that fills the same space with a twinkling sprite.
ReplaceOverlappingSpecialObject CFE1 LD A,(IX+$00) Fetch the graphic number of the first object.
CFE4 SUB $60 Take 60 off it, to get the number of the special object.
CFE6 CP $07 Jump to ReplaceOverlappingSpecialObject_Other if it is not a special object.
CFE8 JR NC,ReplaceOverlappingSpecialObject_Other
CFEA LD (IX+$00),$BB Replace it with the twinkling sprite.
CFEE JR ReplaceOverlappingSpecialObject_Next Jump to ReplaceOverlappingSpecialObject_Next.
ReplaceOverlappingSpecialObject_Other CFF0 LD A,(IY+$00) Fetch the graphic number of the other object.
CFF3 SUB $60 Take 60 off it, to get the number of the special object.
CFF5 CP $07 Jump to ReplaceOverlappingSpecialObject_Next if it is not a special object.
CFF7 JR NC,ReplaceOverlappingSpecialObject_Next
CFF9 LD (IY+$00),$BB Replace it with the twinkling sprite.
ReplaceOverlappingSpecialObject_Next CFFD JP DrawObjectsInOrder_FindSecond Jump to DrawObjectsInOrder_FindSecond.
Prev: CFA5 Up: Map Next: D000