Prev: A110 Up: Map Next: A13B
A127: Draw Attributes Moving Up-Right
The attribute routine for an entity which has moved up and right. The row just below the entity, and one more cell to the left, 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 left 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
AttrDrawMovingUpRight A127 POP HL Restore the attribute address from the stack.
A128 PUSH BC Stash the width and the number of rows on the stack.
A129 PUSH HL Stash the attribute address on the stack.
A12A PUSH BC Stash the width and the number of rows on the stack again.
A12B LD BC,$0020 BC=0020.
A12E ADD HL,BC Move down a row.
A12F POP BC Restore the width.
A130 DEC L Move to the cell on the left.
A131 INC B Add one more cell to the width.
AttrDrawMovingUpRight_Cell A132 LD (HL),E Write the attribute of the room to the cell.
A133 INC L Move to the next cell.
A134 DJNZ AttrDrawMovingUpRight_Cell Decrease the width by one and loop back to AttrDrawMovingUpRight_Cell until the row is done.
A136 POP HL Restore the attribute address from the stack.
A137 POP BC Restore the width and the number of rows from the stack.
A138 JP AttrDrawMovingRight_Row Jump to AttrDrawMovingRight_Row to set the cells under the entity.
Prev: A110 Up: Map Next: A13B