Prev: 41232 Up: Map Next: 41275
41255: 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 41255 POP HL Restore the attribute address from the stack.
41256 PUSH BC Stash the width and the number of rows on the stack.
41257 PUSH HL Stash the attribute address on the stack.
41258 PUSH BC Stash the width and the number of rows on the stack again.
41259 LD BC,32 BC=0032.
41262 ADD HL,BC Move down a row.
41263 POP BC Restore the width.
41264 DEC L Move to the cell on the left.
41265 INC B Add one more cell to the width.
AttrDrawMovingUpRight_Cell 41266 LD (HL),E Write the attribute of the room to the cell.
41267 INC L Move to the next cell.
41268 DJNZ AttrDrawMovingUpRight_Cell Decrease the width by one and loop back to AttrDrawMovingUpRight_Cell until the row is done.
41270 POP HL Restore the attribute address from the stack.
41271 POP BC Restore the width and the number of rows from the stack.
41272 JP AttrDrawMovingRight_Row Jump to AttrDrawMovingRight_Row to set the cells under the entity.
Prev: 41232 Up: Map Next: 41275