Prev: 58852 Up: Map Next: 58968
58943: Remove Player Cursor Attributes
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 58943 LD HL,58832 Load HL with SavedAttributesBlock.
This is a pointer to the starting attribute buffer location of the players cursor.
58946 LD DE,(58850) Load DE with *Cursor_AttributePointer.
The cursor block is 4x4 (4 rows of 4 bytes).
58950 LD B,4 Set a counter in B for 4 rows.
Remove_PlayerCursorAttributes_Loop 58952 PUSH BC Stash the row counter on the stack.
58953 LD BC,4 Copy 0004 bytes from the stored attributes to the attribute buffer.
58956 LDIR
One full row is 32 bytes, so this is 4 bytes less than one row. Hence this moves down one row, but back to the start of the line.
58958 EX DE,HL Add 0028 to the attribute buffer position.
58959 LD BC,28
58962 ADD HL,BC
58963 EX DE,HL
58964 POP BC Restore the row counter from the stack.
58965 DJNZ Remove_PlayerCursorAttributes_Loop Decrease the row counter by one and loop back to Remove_PlayerCursorAttributes_Loop until all the rows have been updated.
58967 RET Return.
Prev: 58852 Up: Map Next: 58968