Prev: A0FE Up: Map Next: A127
A110: Draw Attributes Moving Down-Left
The attribute routine for an entity which has moved down and left. Each row of cells under the entity is set to the attribute of the entity, and the cell to the right of it is put back to the attribute of the room. So is the row above the entity, with one more cell to the right.
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
AttrDrawMovingDownLeft A110 POP HL Restore the attribute address from the stack.
AttrDrawMovingDownLeft_Row A111 PUSH BC Stash the width and the number of rows on the stack.
A112 PUSH HL Stash the attribute address on the stack.
AttrDrawMovingDownLeft_Cell A113 LD (HL),D Write the attribute of the entity to the cell.
A114 INC L Move to the next cell.
A115 DJNZ AttrDrawMovingDownLeft_Cell Decrease the width by one and loop back to AttrDrawMovingDownLeft_Cell until the row is done.
A117 LD (HL),E Write the attribute of the room to the cell on the right.
A118 POP HL Restore the attribute address from the stack.
A119 LD BC,$0020 BC=0020.
A11C AND A Move up a row.
A11D SBC HL,BC
A11F POP BC Restore the width and the number of rows from the stack.
A120 DEC C Decrease the number of rows by one and loop back to AttrDrawMovingDownLeft_Row until all of the rows have been set.
A121 JR NZ,AttrDrawMovingDownLeft_Row
A123 INC B Add one more cell to the width.
A124 JP AttrDrawMovingDown_Above Jump to AttrDrawMovingDown_Above to put the row above back to the attribute of the room.
Prev: A0FE Up: Map Next: A127