| Routines

63472: Initialise the character buffers for character groups 215-221

Used by the routine at 63662. Initialises the animatory state, location and command list address for every character in character groups 215-221.
63472 | LD HL,65198 | The initialisation parameters for character groups 215-221 are located at 65198 onwards
63475 | LD D,215 | Begin with the buffers for character group 215
63477 | LD E,0 | Point DE at the first byte of the first buffer in the group
63479 | LD C,5 | There are 5 characters in the group
63481 | LD B,3 | Initialise a character's animatory state and location
63483 | LD A,(HL)
63484 | INC HL
63485 | LD (DE),A
63486 | INC E
63487 | DJNZ 63483
63489 | XOR A | Reset the flags in byte 3 of the character's buffer
63490 | LD (DE),A
63491 | INC C | Increment C to compensate for the LDI instruction that follows
63492 | INC E | Initialise the character's z-coordinate
63493 | LDI
63495 | LD B,18 | Zero out bytes 5-22 of the character's buffer
63497 | LD (DE),A
63498 | INC E
63499 | DJNZ 63497
63501 | LD B,2 | Copy the command list address into bytes 23 and 24 of the character's buffer
63503 | LD A,(HL)
63504 | INC HL
63505 | LD (DE),A
63506 | INC E
63507 | DJNZ 63503
63509 | DEC C | Have we initialised the buffers of all 5 characters in the group yet?
63510 | JR NZ,63481 | Jump back if not
63512 | INC D | Point DE at the next character group
63513 | LD A,D | Have we initialised the buffers in every character group yet?
63514 | CP 222
63516 | JR NZ,63477 | Jump back if not
63518 | RET |