![]() |
Routines |
| Prev: 46111 | Up: Map | Next: 46186 |
|
Used by the routines at Handle_Sabreman_On_Rope, Handle_Sabreman_Walking, Handle_Sabreman_Falling, Handle_Sabreman_Tumbling, Handle_Flying_Creature, Move_Thrown_Weapon, Handle_Falling_Stalactite, Handle_Carrying_Eagle, Handle_Carried_Sabreman and Handle_Weapon_Pickup.
Checks whether an object touches one of the decorations, using Check_Object_Contact. In the special rooms (a room y below 16) 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'.
|
||||||||||||||
| Check_Decoration_Contact | 46142 | DI | Disable interrupts. | |||||||||||
| 46143 | PUSH IY | Stash IY on the stack. | ||||||||||||
| 46145 | LD A,(IX+4) | Fetch the room y of the object. | ||||||||||||
| 46148 | CP 16 | Jump to Check_Decoration_Contact_Cave_Room if the object is in a cave room. | ||||||||||||
| 46150 | JR NC,Check_Decoration_Contact_Cave_Room | |||||||||||||
| 46152 | LD IY,36730 | Point IY at Object_Record_8. | ||||||||||||
| 46156 | LD B,4 | Set a counter in B for the four records. | ||||||||||||
| 46158 | JR Check_Decoration_Contact_Set_Record_Size | Jump to Check_Decoration_Contact_Set_Record_Size. | ||||||||||||
| Check_Decoration_Contact_Cave_Room | 46160 | LD IY,36762 | Point IY at the first of the two records that are used in a cave room. | |||||||||||
| 46164 | LD B,2 | Set a counter in B for the two records. | ||||||||||||
| Check_Decoration_Contact_Set_Record_Size | 46166 | LD DE,16 | Set the size of an object record. | |||||||||||
| Check_Decoration_Contact_Loop | 46169 | CALL Check_Object_Contact | Check for contact with the object. | |||||||||||
| 46172 | BIT 2,C | Jump to Check_Decoration_Contact_Done if the object touches the decoration. | ||||||||||||
| 46174 | JR NZ,Check_Decoration_Contact_Done | |||||||||||||
| 46176 | ADD IY,DE | Move on to the next record. | ||||||||||||
| 46178 | DJNZ Check_Decoration_Contact_Loop | Decrease the record counter and loop back for the next record. | ||||||||||||
| Check_Decoration_Contact_Done | 46180 | POP IY | Restore IY from the stack. | |||||||||||
| 46182 | EX AF,AF' | Swap in the height that Check_Object_Contact left in AF'. | ||||||||||||
| 46183 | LD B,A | Copy it to B. | ||||||||||||
| 46184 | EI | Enable interrupts. | ||||||||||||
| 46185 | RET | Return. | ||||||||||||
| Prev: 46111 | Up: Map | Next: 46186 |