Prev: BF97 Up: Map Next: BFCD
BFBE: Unused Map Address
Part of a way to find the address of a map cell that is not used. It does not clear A first, so it would not work properly.
Input
D Row
E Column
Output
HL Address of the cell
MapAddress_Unused BFBE SRL D Divide the row by four, keeping the bits that come out in the top of A.
BFC0 RRA
BFC1 SRL D
BFC3 RRA
BFC4 AND $C0 Combine them with the column.
BFC6 OR E
BFC7 LD E,A
BFC8 LD HL,$C515 Add the offset to the address of the map.
BFCB ADD HL,DE
BFCC RET Return.
Prev: BF97 Up: Map Next: BFCD