Prev: D639 Up: Map Next: D64F
D63C: Set Tile Attribute
Sets the attribute of the character square that holds the screen address.
Input
HL The screen address
A' The attribute
Find the attribute address from the screen address.
SetTileAttribute D63C PUSH DE Stash DE and HL on the stack.
D63D PUSH HL
D63E LD A,H Find the third of the screen from the high byte.
D63F RRCA
D640 RRCA
D641 RRCA
D642 AND %00000011 Keep the two bits of the third.
D644 LD H,A Make it the high byte of the attribute address.
D645 LD DE,$5800 Add 5800 the start of the attribute buffer.
D648 ADD HL,DE
Write the attribute.
D649 EX AF,AF' Fetch the attribute.
D64A LD (HL),A Set the attribute.
D64B EX AF,AF' Keep it.
D64C POP HL Restore HL and DE from the stack.
D64D POP DE
D64E RET Return.
Prev: D639 Up: Map Next: D64F