![]() |
Routines |
H | Character number (183-214) |
25581 | LD L,12 | Point HL at byte 12 of the character's buffer |
25583 | LD (HL),8 | Initialise this to 8 |
25585 | NOP | |
25586 | NOP | |
25587 | LD L,9 | Replace the address of this routine in bytes 9 and 10 of the character's buffer with 25591 (below) |
25589 | LD (HL),247 |
25591 | LD L,0 | Point HL at byte 0 of the character's buffer |
25593 | BIT 0,(HL) | Is the character midstride? |
25595 | JR Z,25618 | Jump if not |
25597 | CALL 25012 | Update SRB for the character's current animatory state and location |
25600 | INC E | E=1 + character's x-coordinate |
25601 | BIT 7,A | A=character's animatory state |
25603 | JR NZ,25607 | Jump if the character is facing right |
25605 | DEC E | |
25606 | DEC E | E=character's x-coordinate - 1 |
25607 | AND 252 | Set B to the base animatory state of the character by discarding bits 0 and 1 |
25609 | LD B,A | |
25610 | LD A,E | A=character's new x-coordinate (after finishing his stride) |
25611 | AND 1 | A=0 if the x-coordinate is even, 2 if it's odd |
25613 | ADD A,A | |
25614 | OR B | A=character's new animatory state (standing/walking phase 1 for even x-coordinates, phase 3 for odd) |
25615 | JP 24880 | Update SRB for the character's new animatory state and location |
25618 | LD L,12 | Point HL at byte 12 of the character's buffer |
25620 | DEC (HL) | Is it time to give the character-moving routine at 25296 a chance to check whether a command list restart has been requested? |
25621 | JP Z,25488 | Blank out the address of this routine in bytes 9 and 10 of the character's buffer if so |
25624 | DEC L | L=11 |
25625 | LD A,(HL) | A=character's destination x-coordinate |
25626 | LD L,1 | Byte 1 of the character's buffer holds his current x-coordinate |
25628 | CP (HL) | Has the character reached his destination? |
25629 | JP Z,25488 | Blank out the address of this routine in bytes 9 and 10 of the character's buffer if so |
25632 | DEC HL | L=0 |
25633 | BIT 7,(HL) | Is the character facing left? |
25635 | JR Z,25646 | Jump if so |
25637 | JR C,25648 | Jump if character will have to turn round first |
25639 | CALL 28814 | Check for doors |
25642 | INC A | A=character's new (midstride) animatory state |
25643 | JP 24880 | Update SRB for the character's new animatory state |
25646 | JR C,25639 | Jump if the character is facing the right way |
25648 | CALL 25012 | Update SRB for the character's current animatory state and location |
25651 | XOR 128 | Flip bit 7 of the character's animatory state, thus turning him round |
25653 | JP 24880 | Update SRB for the character's new animatory state |