Prev: 66F7 Up: Map Next: 670E
6704: Convert Attribute Address To Screen Buffer Address
Used by the routines at 6853, Print_Asterisk, 6926, 6A23, 7069, 70E7, 72C9, 7564, 75BF, 7616, 79B2 and Handler_Aliens.
Converts an attribute buffer address to its corresponding screen buffer address.
Input
HL Attribute buffer address
Output
HL Screen buffer address
ConvertAttributeToScreenBufferAddress 6704 LD A,H Copy the screen address high byte to A.
6705 SUB $58 Subtract 58 (start of attribute area offset).
6707 ADD A,A Multiply by 08.
6708 ADD A,A
6709 ADD A,A
670A ADD A,$40 Add 40 to set the base attribute area.
670C LD H,A Update the high byte of the address.
670D RET Return.
Prev: 66F7 Up: Map Next: 670E