Prev: 9AE9 Up: Map Next: 9B0D
9AF9: Place Flame In Row
Used by the routine at PlaceFlame.
Places a new flame at the same Y position as the player and at a random X position.
Input
IX Flame record
Output
F Carry flag set if the position is unsuitable
Use the same Y position as the player.
PlaceFlame_InRow 9AF9 LD A,($9706) Fetch the Y position of the player from 9706.
9AFC LD (IX+$04),A Set the Y position of the flame.
9AFF LD D,A Copy the Y position to D.
Use a random X position between 30 and AF.
9B00 LD A,($9695) Fetch the random seed from RandomNumber.
9B03 AND %01111111 Keep only bits 0-6.
9B05 ADD A,$30 Add 30.
9B07 LD E,A Copy the X position to E.
9B08 LD (IX+$03),A Set the X position of the flame.
9B0B JR ChoosePosition_Test Jump to ChoosePosition_Test to test the position.
Prev: 9AE9 Up: Map Next: 9B0D