![]() |
Routines |
| H | 210 (ERIC) |
| 63915 | LD B,84 | 84: animatory state of water, phase 1 (facing left) |
| 63917 | LD L,0 | Point HL at byte 0 of ERIC's buffer |
| 63919 | LD A,(HL) | A=ERIC's animatory state |
| 63920 | INC L | L=1 |
| 63921 | RLCA | Is ERIC facing left? |
| 63922 | JR NC,63926 | Jump if so |
| 63924 | LD B,212 | 212: animatory state of water, phase 1 (facing right) |
| 63926 | SBC A,A | Set A=-2 if ERIC's facing left, 2 if he's facing right |
| 63927 | ADD A,A | |
| 63928 | CPL | |
| 63929 | ADD A,A | |
| 63930 | ADD A,(HL) | Add ERIC's x-coordinate to get the initial x-coordinate of the water |
| 63931 | CP 191 | Is ERIC too close to (and facing) the far left wall of the boys' skool or the far right wall of the girls' skool? |
| 63933 | RET NC | Return if so |
| 63934 | LD E,A | Copy the water's initial x-coordinate to E |
| 63935 | INC L | L=2 |
| 63936 | LD D,(HL) | D=ERIC's y-coordinate |
| 63937 | DEC D | Subtract 2 to get the initial y-coordinate of the water |
| 63938 | DEC D | |
| 63939 | LD A,B | A=initial animatory state of the water |
| 63940 | PUSH AF | Save the water's initial animatory state briefly |
| 63941 | PUSH DE | Save the water's initial coordinates briefly |
| 63942 | CALL 63864 | Make a water pistol sound effect |
| 63945 | LD A,136 | Message 136: NO WATERPISTOLS |
| 63947 | CALL 63640 | Give ERIC lines if any teacher is nearby |
| 63950 | POP DE | Restore the water's initial coordinates to DE |
| 63951 | POP AF | Restore the water's initial animatory state to A |
| 63952 | LD HL,54803 | Point HL at byte 19 of the water's buffer |
| 63955 | LD (HL),151 | Initialise the water animation phase identifier |
| 63957 | CALL 30534 | Place address 63960 (below) into bytes 17 and 18 of the water's buffer and update SRB |
| 63960 | LD L,19 | Increment the water animation phase identifier (which starts off at 151) held in byte 19 of the buffer |
| 63962 | INC (HL) | |
| 63963 | LD B,(HL) | Pick up this identifier (152-156) in B |
| 63964 | LD C,255 | Point BC at the appropriate entry in the water animation table (see below) |
| 63966 | LD A,(BC) | Pick up the entry in A |
| 63967 | AND A | Deal with the water at phase 2 (when it can hit a cup), 5 (when it can hit a plant) or 6 (when it hits the floor) |
| 63968 | CALL NZ,64077 |
| 63971 | DEC C | C=254 |
| 63972 | PUSH BC | Save the water animation table pointer |
| 63973 | CALL 25012 | Update SRB for the water's current animatory state and location |
| 63976 | LD A,D | A=water's current y-coordinate |
| 63977 | POP HL | Restore the water animation table pointer to HL |
| 63978 | ADD A,(HL) | Add the entry from the table to obtain the water's new y-coordinate |
| 63979 | LD D,A | Copy this to D |
| 63980 | DEC L | L=253 |
| 63981 | LD C,(HL) | Pick up the x-coordinate increment in C |
| 63982 | DEC L | L=252 |
| 63983 | LD A,(HL) | A=water's new animatory state (facing left) |
| 63984 | LD HL,54784 | Point HL at byte 0 of the water's buffer |
| 63987 | RL (HL) | Set the carry flag if the water's travelling to the right |
| 63989 | RLA | Copy the carry flag into the "direction" bit (bit 7) of the animatory state |
| 63990 | RRCA | |
| 63991 | LD B,A | B=water's new animatory state (facing the correct way) |
| 63992 | LD A,E | A=water's current x-coordinate |
| 63993 | JP 64057 | Jump over the data table at 64000 to continue this routine |
| 152 | 153 | 154 | 155 | 156 | 2 | 3 | 4 | 5 | 6+ | animation phase | 252 | 92 | 108 | 116 | 124 | 124 | animatory state | 253 | 254 | 254 | 255 | 0 | 0 | x-coordinate increment | 254 | 255 | 0 | 0 | 1 | 1 | y-coordinate increment | 255 | 0 | 1 | 0 | 0 | 2 | passed to 64077 |
|---|