Prev: B41F Up: Map Next: B46A
B43E: Check Decoration Contact
Checks whether an object touches one of the decorations, using Check_Object_Contact. In the special rooms (a room y below 10) the four records that start at Object_Record_8 are checked. In the cave rooms the two records that start at Object_Record_10 are checked. The check stops at the first decoration that the object touches.
Interrupts are disabled while the check is made, as the result is kept in AF'.
Input
IX Object record
Output
B A0 less the y position of the top of the decoration
C Contact result (see Check_Object_Contact)
Check_Decoration_Contact B43E DI Disable interrupts.
B43F PUSH IY Stash IY on the stack.
B441 LD A,(IX+$04) Fetch the room y of the object.
B444 CP $10 Jump to Check_Decoration_Contact_Cave_Room if the object is in a cave room.
B446 JR NC,Check_Decoration_Contact_Cave_Room
B448 LD IY,$8F7A Point IY at Object_Record_8.
B44C LD B,$04 Set a counter in B for the four records.
B44E JR Check_Decoration_Contact_Set_Record_Size Jump to Check_Decoration_Contact_Set_Record_Size.
Check_Decoration_Contact_Cave_Room B450 LD IY,$8F9A Point IY at the first of the two records that are used in a cave room.
B454 LD B,$02 Set a counter in B for the two records.
Check_Decoration_Contact_Set_Record_Size B456 LD DE,$0010 Set the size of an object record.
Check_Decoration_Contact_Loop B459 CALL Check_Object_Contact Check for contact with the object.
B45C BIT 2,C Jump to Check_Decoration_Contact_Done if the object touches the decoration.
B45E JR NZ,Check_Decoration_Contact_Done
B460 ADD IY,DE Move on to the next record.
B462 DJNZ Check_Decoration_Contact_Loop Decrease the record counter and loop back for the next record.
Check_Decoration_Contact_Done B464 POP IY Restore IY from the stack.
B466 EX AF,AF' Swap in the height that Check_Object_Contact left in AF'.
B467 LD B,A Copy it to B.
B468 EI Enable interrupts.
B469 RET Return.
Prev: B41F Up: Map Next: B46A