Prev: E5E4 Up: Map Next: E658
E63F: Remove Player Cursor Attributes
Used by the routines at E396, Remove_PlayerCursor and F85D.
Less "remove" and more "replace"; this routine erases the players cursor attributes, but it doesn't leave a hole - it replaces the attributes with the values they were prior to it being originally drawn.
This is the 4x4 block of attributes which were behind the cursor before it was initially painted.
Remove_PlayerCursorAttributes E63F LD HL,$E5D0 Load HL with SavedAttributesBlock.
This is a pointer to the starting attribute buffer location of the players cursor.
E642 LD DE,($E5E2) Load DE with *Cursor_AttributePointer.
The cursor block is 04x04 (04 rows of 04 bytes).
E646 LD B,$04 Set a counter in B for 04 rows.
Remove_PlayerCursorAttributes_Loop E648 PUSH BC Stash the row counter on the stack.
E649 LD BC,$0004 Copy 0004 bytes from the stored attributes to the attribute buffer.
E64C LDIR
One full row is 20 bytes, so this is 04 bytes less than one row. Hence this moves down one row, but back to the start of the line.
E64E EX DE,HL Add 001C to the attribute buffer position.
E64F LD BC,$001C
E652 ADD HL,BC
E653 EX DE,HL
E654 POP BC Restore the row counter from the stack.
E655 DJNZ Remove_PlayerCursorAttributes_Loop Decrease the row counter by one and loop back to Remove_PlayerCursorAttributes_Loop until all the rows have been updated.
E657 RET Return.
Prev: E5E4 Up: Map Next: E658