Prev: 59554 Up: Map Next: 59607
59582: Place Weapon Pickups
Used by the routine at Select_Game_Options.
Puts the four weapons that Sabreman can pick up in their places at the start of a game (see Select_Game_Options). It copies one of four sets of four records from the table at Weapon_Placement_Table to the small object records at Small_Object_Records, and the set is chosen by bits 1 and 2 of the low byte of FRAMES.
Place_Weapon_Pickups 59582 LD DE,36906 Point DE at the first small object record.
59585 LD HL,59901 Point HL at Weapon_Placement_Table.
59588 LD A,(23672) Fetch the low byte of FRAMES.
59591 RLA Shift it left four times.
59592 RLA
59593 RLA
59594 RLA
59595 AND %01100000 Keep only bits 5 and 6, which are the old bits 1 and 2.
59597 LD C,A Store the result in C.
59598 LD B,0 Clear the high byte of the offset.
59600 ADD HL,BC Point HL at the chosen set of records.
59601 LD BC,32 Set the number of bytes to copy to 32 (four records).
59604 LDIR Copy the records.
59606 RET Return.
Prev: 59554 Up: Map Next: 59607