Prev: F7DA Up: Map Next: F81F
F7F0: Initialise the character buffers for character groups 0xD7-0xDD
Used by the routine at F8AE. Initialises the animatory state, location and command list address for every character in character groups 0xD7-0xDD.
F7F0 LD HL,$FEAE The initialisation parameters for character groups 0xD7-0xDD are located at FEAE onwards
F7F3 LD D,$D7 Begin with the buffers for character group 0xD7
F7F5 LD E,$00 Point DE at the first byte of the first buffer in the group
F7F7 LD C,$05 There are 5 characters in the group
F7F9 LD B,$03 Initialise a character's animatory state and location
F7FB LD A,(HL)
F7FC INC HL
F7FD LD (DE),A
F7FE INC E
F7FF DJNZ $F7FB
F801 XOR A Reset the flags in byte 0x03 of the character's buffer
F802 LD (DE),A
F803 INC C Increment C to compensate for the LDI instruction that follows
F804 INC E Initialise the character's z-coordinate
F805 LDI
F807 LD B,$12 Zero out bytes 0x05-0x16 of the character's buffer
F809 LD (DE),A
F80A INC E
F80B DJNZ $F809
F80D LD B,$02 Copy the command list address into bytes 0x17 and 0x18 of the character's buffer
F80F LD A,(HL)
F810 INC HL
F811 LD (DE),A
F812 INC E
F813 DJNZ $F80F
F815 DEC C Have we initialised the buffers of all 5 characters in the group yet?
F816 JR NZ,$F7F9 Jump back if not
F818 INC D Point DE at the next character group
F819 LD A,D Have we initialised the buffers in every character group yet?
F81A CP $DE
F81C JR NZ,$F7F5 Jump back if not
F81E RET
Prev: F7DA Up: Map Next: F81F