Prev: 54841 Up: Map Next: 54863
54844: 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 54844 PUSH DE Stash DE and HL on the stack.
54845 PUSH HL
54846 LD A,H Find the third of the screen from the high byte.
54847 RRCA
54848 RRCA
54849 RRCA
54850 AND %00000011 Keep the two bits of the third.
54852 LD H,A Make it the high byte of the attribute address.
54853 LD DE,22528 Add 22528 the start of the attribute buffer.
54856 ADD HL,DE
Write the attribute.
54857 EX AF,AF' Fetch the attribute.
54858 LD (HL),A Set the attribute.
54859 EX AF,AF' Keep it.
54860 POP HL Restore HL and DE from the stack.
54861 POP DE
54862 RET Return.
Prev: 54841 Up: Map Next: 54863