Prev: E3EF Up: Map Next: E463
E44A: Remove Player Cursor Attributes
Used by the routines at DEED, Remove_PlayerCursor and F47A.
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 E44A LD HL,$E3DB Load HL with SavedAttributesBlock.
This is a pointer to the starting attribute buffer location of the players cursor.
E44D LD DE,($E3ED) Load DE with *Cursor_AttributePointer.
The cursor block is 04x04 (04 rows of 04 bytes).
E451 LD B,$04 Set a counter in B for 04 rows.
Remove_PlayerCursorAttributes_Loop E453 PUSH BC Stash the row counter on the stack.
E454 LD BC,$0004 Copy 0004 bytes from the stored attributes to the attribute buffer.
E457 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.
E459 EX DE,HL Add 001C to the attribute buffer position.
E45A LD BC,$001C
E45D ADD HL,BC
E45E EX DE,HL
E45F POP BC Restore the row counter from the stack.
E460 DJNZ Remove_PlayerCursorAttributes_Loop Decrease the row counter by one and loop back to Remove_PlayerCursorAttributes_Loop until all the rows have been updated.
E462 RET Return.
Prev: E3EF Up: Map Next: E463