Routines |
Prev: 58351 | Up: Map | Next: 58467 |
|
||||
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 | 58442 | LD HL,58331 | Load HL with SavedAttributesBlock. | |
This is a pointer to the starting attribute buffer location of the players cursor.
|
||||
58445 | LD DE,(58349) | Load DE with *Cursor_AttributePointer. | ||
The cursor block is 4x4 (4 rows of 4 bytes).
|
||||
58449 | LD B,4 | Set a counter in B for 4 rows. | ||
Remove_PlayerCursorAttributes_Loop | 58451 | PUSH BC | Stash the row counter on the stack. | |
58452 | LD BC,4 | Copy 0004 bytes from the stored attributes to the attribute buffer. | ||
58455 | 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.
|
||||
58457 | EX DE,HL | Add 0028 to the attribute buffer position. | ||
58458 | LD BC,28 | |||
58461 | ADD HL,BC | |||
58462 | EX DE,HL | |||
58463 | POP BC | Restore the row counter from the stack. | ||
58464 | DJNZ Remove_PlayerCursorAttributes_Loop | Decrease the row counter by one and loop back to Remove_PlayerCursorAttributes_Loop until all the rows have been updated. | ||
58466 | RET | Return. |
Prev: 58351 | Up: Map | Next: 58467 |