Prev: 40816 Up: Map Next: 40968
40962: Wrap World X
Add BC to a world X and keep bits 0-4 of the high byte.
Input
HL World X
BC Offset
Output
HL Wrapped world X
Add the offset and wrap the high byte to bits 0-4.
MaskWorldX 40962 ADD HL,BC Add the offset.
40963 LD A,H Fetch the high byte.
40964 AND %00011111 Keep only bits 0-4.
40966 LD H,A Write it back.
40967 RET Return.
Prev: 40816 Up: Map Next: 40968