Prev: A07A Up: Map Next: A0A3
A08D: Draw Attributes Moving Right
The attribute routine for an entity which has moved right. Each row of cells under the entity is set to the attribute of the entity, and the cell just to the left 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
AttrDrawMovingRight A08D POP HL Restore the attribute address from the stack.
This entry point is used by the routine at AttrDrawMovingUpRight.
AttrDrawMovingRight_Row A08E PUSH BC Stash the width and the number of rows on the stack.
A08F PUSH HL Stash the attribute address on the stack.
A090 DEC L Move to the cell on the left.
A091 LD (HL),E Write the attribute of the room to the cell.
A092 INC L Move back to the first cell.
AttrDrawMovingRight_Cell A093 LD (HL),D Write the attribute of the entity to the cell.
A094 INC L Move to the next cell.
A095 DJNZ AttrDrawMovingRight_Cell Decrease the width by one and loop back to AttrDrawMovingRight_Cell until the row is done.
A097 POP HL Restore the attribute address from the stack.
A098 LD BC,$0020 BC=0020.
A09B AND A Move up a row.
A09C SBC HL,BC
A09E POP BC Restore the width and the number of rows from the stack.
A09F DEC C Decrease the number of rows by one and loop back to AttrDrawMovingRight_Row until all of the rows have been set.
A0A0 JR NZ,AttrDrawMovingRight_Row
A0A2 RET Return.
Prev: A07A Up: Map Next: A0A3