Routines

29052: Open or close door


Used by several tables of A&P

H 204 (MISS TAKE) or 205 (ALBERT)

This routine works on two parameters. First the door or window identifier:
ID Door Tables of A&P
8 Boys' skool door 76, 78
16 Skool gate 76, 78
32 Drinks cabinet door 22, 24 26, 28

And then the action identifier:
0 Close it
1 Open it

29052 2E03 LD L,3 Replace the address of this routine in bytes 3 and 4 of the character's buffer with that of 29061 (below)
29054 3685 LD (HL),133
29056 2E13 LD L,19 Copy the door identifier and open/close parameter from the table of A&P into bytes 19 and 20 of the character's buffer
29058 CD6462 CALL 25188
29061 2E13 LD L,19
29063 7E LD A,(HL) A=door identifier
29064 FE08 CP 8 Is it the boys' skool door?
29066 2021 JR NZ,29101 Jump if not
29068 3A01D3 LD A,(54017) A=x-coordinate of bike
29071 FE5E CP 94 94: Is the bike in the boys' skool?
29073 380C JR C,29087 Jump if so
29075 116011 LD DE,4448 D=17, E=96

This entry point is used by the routine at 29101 with (E,D)=(136,17):
29078 BB CP E
29079 3A00D3 LD A,(54016) A=bike's animatory state
29082 DC8067 CALL C,26496 Move the bike if it's blocking the boys' skool door or the skool gate
29085 26CD LD H,205 205=ALBERT

This entry point is used by the routine at 29101:
29087 2E04 LD L,4 Remove the address of this routine from bytes 3 and 4 of the character's buffer
29089 3600 LD (HL),0
29091 C3A870 JP 28840 Open or close the door