Prev: 63558 Up: Map Next: 63662
63614: Initialise the character buffers for characters 222-230
Used by the routine at 63662. Initialises the animatory states, locations and command list addresses for characters 222-230 for the next game mode.
Input
A Game mode (0-4)
63614 LD C,A Point HL at the last byte in the set of initialisation parameters for the current game mode for character 222 (see 56864)
63615 ADD A,A
63616 ADD A,C
63617 ADD A,A
63618 ADD A,37
63620 LD L,A
63621 LD H,222
63623 LD D,H Point DE at byte 31 of the character's buffer
63624 LD E,31
63626 LD A,(HL) Pick up the last byte in the set of initialisation parameters (the MSB of a command list address, or 1 if we're dealing with Sam)
63627 AND A Is there a command list address (or 1) here?
63628 JR Z,63655 Jump if not
63630 XOR A Prepare A for filling parts of the character's buffer with zeroes
63631 PUSH HL Save the pointer to the initialisation parameters
63632 LD BC,1794 B=7, C=2
63635 LD (DE),A Fill bytes 25-31 of the character's buffer with zeroes
63636 DEC E
63637 DJNZ 63635
63639 LDDR Copy the command list address (or message number and 1 if dealing with Sam) into bytes 23 and 24 of the character's buffer
63641 LD BC,4612 B=18, C=4
63644 LD (DE),A Fill bytes 5-22 of the character's buffer with zeroes
63645 DEC E
63646 DJNZ 63644
63648 LDD Copy the z-coordinate (or y-coordinate of the topmost row of the play area on screen if dealing with Sam) into byte 4 of the character's buffer
63650 LD (DE),A Reset all flags in byte 3 of the character's buffer
63651 DEC E Point DE at byte 2 of the character's buffer
63652 LDDR Copy the x- and y-coordinates and animatory state (or, if dealing with Sam, the x-coordinate of the leftmost column of the play area on screen, 32 or 34, and 0) into bytes 0-2 of the character's buffer
63654 POP HL Restore the pointer to the initialisation parameters to HL
63655 INC H Next character
63656 LD A,H Have we initialised all the character buffers yet?
63657 CP 231
63659 JR NZ,63623 Jump back if not
63661 RET
Prev: 63558 Up: Map Next: 63662