![]() |
Routines |
| Prev: E8A2 | Up: Map | Next: E8D7 |
|
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 | E8BE | LD DE,$902A | Point DE at the first small object record. | |
| E8C1 | LD HL,$E9FD | Point HL at Weapon_Placement_Table. | ||
| E8C4 | LD A,($5C78) | Fetch the low byte of FRAMES. | ||
| E8C7 | RLA | Shift it left four times. | ||
| E8C8 | RLA | |||
| E8C9 | RLA | |||
| E8CA | RLA | |||
| E8CB | AND %01100000 | Keep only bits 5 and 6, which are the old bits 1 and 2. | ||
| E8CD | LD C,A | Store the result in C. | ||
| E8CE | LD B,$00 | Clear the high byte of the offset. | ||
| E8D0 | ADD HL,BC | Point HL at the chosen set of records. | ||
| E8D1 | LD BC,$0020 | Set the number of bytes to copy to 20 (four records). | ||
| E8D4 | LDIR | Copy the records. | ||
| E8D6 | RET | Return. | ||
| Prev: E8A2 | Up: Map | Next: E8D7 |