Prev: A0EC Up: Map Next: A110
A0FE: Draw Attributes Moving Up-Left
The attribute routine for an entity which has moved up and left. The row just below the entity, and one more cell to the right, is put back to the attribute of the room. Then each row of cells under the entity is set to the attribute of the entity, with the cell to the right of it 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
AttrDrawMovingUpLeft A0FE POP HL Restore the attribute address from the stack.
A0FF PUSH BC Stash the width and the number of rows on the stack.
A100 PUSH HL Stash the attribute address on the stack.
A101 PUSH BC Stash the width and the number of rows on the stack again.
A102 LD BC,$0020 BC=0020.
A105 ADD HL,BC Move down a row.
A106 POP BC Restore the width.
A107 INC B Add one more cell to the width.
AttrDrawMovingUpLeft_Cell A108 LD (HL),E Write the attribute of the room to the cell.
A109 INC L Move to the next cell.
A10A DJNZ AttrDrawMovingUpLeft_Cell Decrease the width by one and loop back to AttrDrawMovingUpLeft_Cell until the row is done.
A10C POP HL Restore the attribute address from the stack.
A10D POP BC Restore the width and the number of rows from the stack.
A10E JR AttrDrawMovingLeft_Row Jump to AttrDrawMovingLeft_Row to set the cells under the entity.
Prev: A0EC Up: Map Next: A110