![]() |
Routines |
| Prev: 58326 | Up: Map | Next: 58367 |
|
Used by the routine at DrawObjectsInList.
Draws an object, if it is on the screen. The position of the object is worked out from its position in the world and the offsets of its sprite, and kept in the object.
|
||||||||||
|
Clip the X position of the sprite.
|
||||||||||
| DrawObject | 58329 | CALL ProjectObject | Work out the position of the object on the screen. | |||||||
| 58332 | LD HL,(48054) | Return if the position along the X axis is outside the screen. | ||||||||
| 58335 | LD A,H | |||||||||
| 58336 | AND A | |||||||||
| 58337 | RET NZ | |||||||||
| 58338 | LD A,L | Add the offset of the sprite along the X axis, and return if that is past the right edge of the window. | ||||||||
| 58339 | ADD A,(IX+12) | |||||||||
| 58342 | CP 203 | |||||||||
| 58344 | RET NC | |||||||||
| 58345 | CP 16 | Return if it is past the left edge, and set the X position of the sprite. | ||||||||
| 58347 | RET C | |||||||||
| 58348 | LD (IX+14),A | |||||||||
|
Clip the Y position of the sprite.
|
||||||||||
| 58351 | LD HL,(48056) | Return if the position along the Y axis is outside the screen. | ||||||||
| 58354 | LD A,H | |||||||||
| 58355 | AND A | |||||||||
| 58356 | RET NZ | |||||||||
| 58357 | LD A,L | Add the offset of the sprite along the Y axis, and return if that is past the top edge of the window. | ||||||||
| 58358 | ADD A,(IX+13) | |||||||||
| 58361 | CP 184 | |||||||||
| 58363 | RET NC | |||||||||
| 58364 | LD (IX+15),A | Set the Y position of the sprite. | ||||||||
| Prev: 58326 | Up: Map | Next: 58367 |