Prev: 41101 Up: Map Next: 41143
41123: Draw Attributes Moving Left
The attribute routine for an entity which has moved left. Each row of cells under the entity is set to the attribute of the entity, and the cell just to the right of 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
AttrDrawMovingLeft 41123 POP HL Restore the attribute address from the stack.
This entry point is used by the routine at AttrDrawMovingUpLeft.
AttrDrawMovingLeft_Row 41124 PUSH BC Stash the width and the number of rows on the stack.
41125 PUSH HL Stash the attribute address on the stack.
AttrDrawMovingLeft_Cell 41126 LD (HL),D Write the attribute of the entity to the cell.
41127 INC L Move to the next cell.
41128 DJNZ AttrDrawMovingLeft_Cell Decrease the width by one and loop back to AttrDrawMovingLeft_Cell until the row is done.
41130 LD (HL),E Write the attribute of the room to the cell on the right.
41131 POP HL Restore the attribute address from the stack.
41132 LD BC,32 BC=0032.
41135 AND A Move up a row.
41136 SBC HL,BC
41138 POP BC Restore the width and the number of rows from the stack.
41139 DEC C Decrease the number of rows by one and loop back to AttrDrawMovingLeft_Row until all of the rows have been set.
41140 JR NZ,AttrDrawMovingLeft_Row
41142 RET Return.
Prev: 41101 Up: Map Next: 41143