![]() |
Routines |
Prev: 28735 | Up: Map | Next: 28767 |
ID | Door/window |
---|---|
1 | Left study door |
2 | Right study door |
4 | Science Lab storeroom door |
8 | Boys' skool door |
16 | Skool gate |
32 | Drinks cabinet door |
64 | Top floor window |
128 | Middle floor window |
A | Door/window identifier (see table above) |
B | 0 (close it) or 1 (open it) |
28736 | PUSH HL | |
28737 | LD HL,32756 | 32756 holds the doors flags |
28740 | LD C,A | Copy the door identifier to C |
28741 | LD A,(HL) | Pick up the doors flags in A |
28742 | OR C | |
28743 | DEC B | Are we opening the door/window? |
28744 | JR Z,28747 | Jump if so |
28746 | XOR C | |
28747 | LD (HL),A | Restore the doors flags with the appropriate bit set or reset |
28748 | LD A,C | A=door identifier |
28749 | LD HL,57685 | Point HL at the appropriate entry in the doors and windows table at 57686 |
28752 | INC L | |
28753 | INC L | |
28754 | RRCA | |
28755 | JR NC,28752 | |
28757 | LD A,(HL) | Pick up the MSB of the entry in A |
28758 | ADC A,B | Add 1 if opening the door/window |
28759 | DEC L | Point HL at the LSB of the entry |
28760 | LD L,(HL) | Pick this up in L |
28761 | LD H,A | Now HL=address from the doors and windows table (+256 if opening) |
28762 | CALL 27672 | Alter UDG references in the play area and update SRB for the newly opened/closed door/window |
28765 | POP HL | |
28766 | RET |
Prev: 28735 | Up: Map | Next: 28767 |