![]() |
Routines |
| Prev: 51795 | Up: Map | Next: 51824 |
|
Used by the routine at BlockMovement.
Stops an object from going through the floor. If the z position of the object after it has moved is below the floor of the room, the object is flagged as blocked along z, and its speed along z is brought closer to zero until the object no longer goes through the floor.
|
||||||||||||||
|
Test the floor and slow z.
|
||||||||||||||
| StopObjectAtFloor | 51802 | LD A,(23470) | Fetch FloorHeight. | |||||||||||
| 51805 | LD D,A | Copy it to D. | ||||||||||||
|
Test whether the object ends up below the floor.
|
||||||||||||||
| StopObjectAtFloor_Test | 51806 | LD A,(IX+3) | Fetch the z position of the object. | |||||||||||
| 51809 | ADD A,H | Return if the object does not end up below the floor. | ||||||||||||
| 51810 | CP D | |||||||||||||
| 51811 | RET NC | |||||||||||||
| 51812 | SET 2,(IX+12) | Flag the object as blocked in Z. | ||||||||||||
| 51816 | LD A,H | Copy H to A. | ||||||||||||
| 51817 | CALL BringSpeedCloserToZero | Call BringSpeedCloserToZero. | ||||||||||||
| 51820 | LD H,A | Copy it to H. | ||||||||||||
| 51821 | JR NZ,StopObjectAtFloor_Test | Jump to StopObjectAtFloor_Test if it is not yet zero. | ||||||||||||
| 51823 | RET | Return. | ||||||||||||
| Prev: 51795 | Up: Map | Next: 51824 |