Prev: A0A3 Up: Map Next: A0D2
A0B7: Draw Attributes Moving Down
The attribute routine for an entity which has moved down. Each row of cells under the entity is set to the attribute of the entity, and the row just above it (which the entity has left) is put back to the attribute of the room.
Input
B The width of the sprite in cells
C The number of rows of cells
D The attribute of the entity
E The attribute of the room
AttrDrawMovingDown A0B7 POP HL Restore the attribute address from the stack.
AttrDrawMovingDown_Row A0B8 PUSH BC Stash the width and the number of rows on the stack.
A0B9 PUSH HL Stash the attribute address on the stack.
AttrDrawMovingDown_Cell A0BA LD (HL),D Write the attribute of the entity to the cell.
A0BB INC L Move to the next cell.
A0BC DJNZ AttrDrawMovingDown_Cell Decrease the width by one and loop back to AttrDrawMovingDown_Cell until the row is done.
A0BE POP HL Restore the attribute address from the stack.
A0BF LD BC,$0020 BC=0020.
A0C2 AND A Move up a row.
A0C3 SBC HL,BC
A0C5 POP BC Restore the width and the number of rows from the stack.
A0C6 DEC C Decrease the number of rows by one and loop back to AttrDrawMovingDown_Row until all of the rows have been set.
A0C7 JR NZ,AttrDrawMovingDown_Row
This entry point is used by the routines at AttrDrawMovingDownRight and AttrDrawMovingDownLeft.
Put the row above the entity back to the attribute of the room, unless it is above the start of the attributes.
AttrDrawMovingDown_Above A0C9 LD A,H Fetch the high byte of the attribute address.
A0CA CP $58 Return if the row is above the start of the attributes.
A0CC RET C
AttrDrawMovingDown_Restore A0CD LD (HL),E Write the attribute of the room to the cell.
A0CE INC L Move to the next cell.
A0CF DJNZ AttrDrawMovingDown_Restore Decrease the width by one and loop back to AttrDrawMovingDown_Restore until the row is done.
A0D1 RET Return.
Prev: A0A3 Up: Map Next: A0D2