Prev: BA21 Up: Map Next: BDFE
BDF1: Take Three Eighths
Used by the routine at CheckTerrainCollision.
Divides a signed number by eight and by four, and adds the two results.
Input
HL Number
Output
HL Three eighths of the number
TakeThreeEighths BDF1 CALL HalveNumber Call HalveNumber.
BDF4 CALL HalveNumber Call HalveNumber.
BDF7 PUSH HL Stash HL on the stack.
BDF8 POP DE Bring DE back off the stack.
BDF9 CALL HalveNumber Call HalveNumber.
BDFC ADD HL,DE HL gains DE.
BDFD RET Return.
Prev: BA21 Up: Map Next: BDFE