Prev: 41196 Up: Map Next: 41232
41214: 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 41214 POP HL Restore the attribute address from the stack.
41215 PUSH BC Stash the width and the number of rows on the stack.
41216 PUSH HL Stash the attribute address on the stack.
41217 PUSH BC Stash the width and the number of rows on the stack again.
41218 LD BC,32 BC=0032.
41221 ADD HL,BC Move down a row.
41222 POP BC Restore the width.
41223 INC B Add one more cell to the width.
AttrDrawMovingUpLeft_Cell 41224 LD (HL),E Write the attribute of the room to the cell.
41225 INC L Move to the next cell.
41226 DJNZ AttrDrawMovingUpLeft_Cell Decrease the width by one and loop back to AttrDrawMovingUpLeft_Cell until the row is done.
41228 POP HL Restore the attribute address from the stack.
41229 POP BC Restore the width and the number of rows from the stack.
41230 JR AttrDrawMovingLeft_Row Jump to AttrDrawMovingLeft_Row to set the cells under the entity.
Prev: 41196 Up: Map Next: 41232