Prev: 56013 Up: Map Next: 56039
56028: Calculate Attribute Address
Used by the routines at 54793, 55498, 55689, 55792, 55894, 56039, 56436 and Draw_Cursor.
Input
HL Screen buffer address
Output
DE Attribute buffer address
Calculate_AttributeAddress 56028 LD A,H A=high byte of the screen address.
Isolate the screen third area.
56029 RRCA Move the relevant bits to positions 0-1.
56030 RRCA
56031 RRCA
56032 AND %00000011 Keep only those bits.
This sets 88 on top of the result, which is the base address for the attribute buffer. Will result in either: 88, 89 or 90.
56034 OR %01011000 Set bits 3-4 and 6.
56036 LD D,A Store the result in D, this is the high byte of the attribute buffer address.
56037 LD E,L E=low byte of the screen address.
56038 RET Return.
Prev: 56013 Up: Map Next: 56039