Prev: 9690 Up: Map Next: 96D6
96BB: Create Pickup
Used by the routine at UpdateSpawnPoints.
Tries to create a pickup in one of the two entity slots starting at B5B2. The pickup is placed beside the view, on the side chosen by the low bits of a random number, at a position relative to the player, and it is given the type 0F.
CreatePickup 96BB LD IX,$B5B2 Point IX at the first of the two entity slots.
96BF LD B,$02 Set the number of slots to look at in B to 02.
96C1 CALL FindFreeEntity Call FindFreeEntity to find a free slot.
96C4 RET NZ Return if there is no free slot.
96C5 CALL ClearEntity Call ClearEntity to clear the slot.
96C8 LD A,($5F9B) Fetch the random number from 5F9B.
96CB AND %00000011 Keep only bits 0-1, to choose the side.
96CD JR NZ,CreatePickup_SecondSide Jump to CreatePickup_SecondSide unless the first side is chosen.
96CF LD DE,$0040 DE is 40 the offset for the first side.
96D2 LD C,E E moves into C.
96D3 LD B,D D moves into B, so the offset is also BC.
96D4 JR CreatePickup_Place Jump to CreatePickup_Place.
Prev: 9690 Up: Map Next: 96D6