![]() |
Routines |
| Prev: 957D | Up: Map | Next: 95D7 |
|
Used by the routine at HandlerPlayerVanishing.
Makes a tombstone (sprite ID 8F) where the player is. The four entities from ItemEntity_Tombstone_1 are searched for one that is not in use. If there is one, it is made a copy of the player, apart from the sprite ID, and with the attribute of the player set to 45 first. Then it is drawn.
|
||||
| MakeTombstone | 95A9 | LD HL,$EAE8 | HL=ItemEntity_Tombstone_1 (the first of the four entities to search). | |
| 95AC | LD DE,$0008 | DE=0008 (the size of an entity). | ||
| 95AF | LD B,$04 | B=04 (the number of entities to look at). | ||
| MakeTombstone_Loop | 95B1 | LD A,(HL) | Fetch the sprite ID of the entity. | |
| 95B2 | AND A | Jump to MakeTombstone_Create if the entity is not in use. | ||
| 95B3 | JR Z,MakeTombstone_Create | |||
| 95B5 | ADD HL,DE | Move HL on to the next entity. | ||
| 95B6 | DJNZ MakeTombstone_Loop | Decrease the entity counter by one and loop back to MakeTombstone_Loop until all four have been checked. | ||
| 95B8 | RET | Return. | ||
| MakeTombstone_Create | 95B9 | LD A,$45 | Write 45 to the attribute of the player. | |
| 95BB | LD ($EA95),A | |||
| 95BE | PUSH HL | Stash the address of the entity on the stack. | ||
| 95BF | LD (HL),$8F | Write 8F to the sprite ID of the entity. | ||
| 95C1 | EX DE,HL | Swap DE and HL, so that DE points at the entity. | ||
| 95C2 | INC DE | Move DE on to the room of the entity. | ||
| 95C3 | LD HL,$EA91 | Point HL at the room of the player at PlayerRoom. | ||
| 95C6 | LD BC,$0007 | BC=0007. | ||
| 95C9 | LDIR | Copy the seven bytes from the player to the entity. | ||
| 95CB | POP HL | Restore the address of the entity from the stack. | ||
|
This entry point is used by the routine at GameComplete.
Draw the entity that HL points to.
|
||||
| DrawEntityAtHL | 95CC | PUSH IX | Stash IX on the stack. | |
| 95CE | PUSH HL | Copy HL into IX, as the entity to draw. | ||
| 95CF | POP IX | |||
| 95D1 | CALL DrawEntity | Call DrawEntity to draw the entity. | ||
| 95D4 | POP IX | Restore IX from the stack. | ||
| 95D6 | RET | Return. | ||
| Prev: 957D | Up: Map | Next: 95D7 |