Prev: E420 Up: Map Next: E550
E542: Position to tinypos
This divides the three input 16-bit words (type: pos_t) by 8, with rounding to nearest, storing the result as bytes (type: tinypos_t).
Input
HL Pointer to input pos_t.
DE Pointer to output tinypos_t.
Output
HL Updated.
DE Updated.
pos_to_tinypos E542 LD B,$03 Set B for three iterations
Start loop
pos_to_tinypos_0 E544 LD A,(HL) Load (A, C)
E545 INC L
E546 LD C,(HL)
E547 CALL divide_by_8_with_rounding Divide (A, C) by 8, with rounding to nearest
E54A LD (DE),A Save the result
E54B INC L Advance HL to the next input pos
E54C INC DE Advance DE to the next output tinypos
E54D DJNZ pos_to_tinypos_0 ...loop
E54F RET Return
Prev: E420 Up: Map Next: E550