Routines |
Prev: E420 | Up: Map | Next: E550 |
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).
Used by the routines at drop_item_tail, in_permitted_area, reset_visible_character, character_behaviour and guards_follow_suspicious_character.
|
||||||||||||||||
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 |