![]() |
Routines |
62094 | LD HL,32733 | 32733 holds ERIC's knockout delay counter |
62097 | LD A,(HL) | Is this the first time this routine's been called since ERIC was downed? |
62098 | AND A | |
62099 | JR Z,62112 | Jump if so |
62101 | DEC (HL) | Otherwise wait a while before enabling ERIC to stand up again |
62102 | RET NZ | |
62103 | LD L,243 | HL=32755 (ERIC's animation timer) |
62105 | LD (HL),1 | Set this to 1 so that the keyboard is checked on the next pass through the main loop |
62107 | LD L,251 | HL=32763 (ERIC's status flags) |
62109 | LD (HL),4 | Set bit 2: ERIC is sitting or lying down; the routine at 62178 handles ERIC from this point |
62111 | RET |
62112 | LD (HL),40 | Initialise ERIC's knockout delay counter at 32733 to 40 |
62114 | LD H,210 | 210=ERIC |
62116 | CALL 25012 | Update SRB for ERIC's current animatory state and location |
62119 | PUSH DE | Save ERIC's coordinates briefly |
62120 | PUSH AF | Save ERIC's current animatory state briefly |
62121 | CP 4 | 4: Was ERIC sitting on a chair? |
62123 | JR NZ,62134 | Jump if not |
62125 | CALL 32000 | Get details of ERIC's location |
62128 | LD B,5 | 5: ERIC sitting on the floor |
62130 | CP 6 | Is ERIC in a classroom? |
62132 | JR NC,62136 | Jump if so |
62134 | LD B,6 | 6: ERIC lying on his back |
62136 | POP AF | Restore ERIC's current animatory state to A |
62137 | POP DE | Restore ERIC's coordinates to DE |
62138 | AND 128 | Keep only the "direction" bit (bit 7) of ERIC's current animatory state |
62140 | ADD A,B | A=ERIC's new animatory state (sitting on the floor or lying on his back) |
62141 | CALL 24880 | Update SRB for ERIC's new animatory state |
62144 | CALL 25248 | Update the display |
62147 | LD HL,275 | H=1 (pitch adjustment), L=19 (border colour XOR mask) |
62150 | LD DE,0 | D=0 (duration), E=0 (initial pitch) |
62153 | LD A,2 | A=2 (initial border colour) |
62155 | XOR L | Make a sound effect |
62156 | OUT (254),A | |
62158 | LD B,E | |
62159 | DJNZ 62159 | |
62161 | LD B,A | |
62162 | LD A,E | |
62163 | ADD A,H | |
62164 | LD E,A | |
62165 | LD A,B | |
62166 | DEC D | |
62167 | JR NZ,62155 |
62169 | EI | Re-enable interrupts |
62170 | LD A,1 | Reset the border colour to blue |
62172 | OUT (254),A | |
62174 | RET |