Routines

62094: Deal with ERIC when he's been knocked over


This routine is called by the routine at 63405 when bit 7 at 32763 is set

62094 21DD7F LD HL,32733
62097 7E LD A,(HL)
62098 A7 AND A Is this the first time this routine's been called since ERIC was downed?
62099 280B JR Z,62112 Jump if so
62101 35 DEC (HL) Otherwise wait a while before enabling ERIC to stand up again
62102 C0 RET NZ
62103 2EF3 LD L,243 HL=32755
62105 3601 LD (HL),1
62107 2EFB LD L,251 HL=32763
62109 3604 LD (HL),4 Set bit 2: ERIC needs to stand up (hand over control to 62178)
62111 C9 RET
62112 3628 LD (HL),40 POKE 32733,40
62114 26D2 LD H,210 210=ERIC
62116 CDB461 CALL 25012 Update SRB for ERIC's current animatory state and location
62119 D5 PUSH DE
62120 F5 PUSH AF
62121 FE04 CP 4 4: Was ERIC sitting on a chair?
62123 2009 JR NZ,62134 Jump if not
62125 CD007D CALL 32000 Get details of ERIC's location
62128 0605 LD B,5 5: ERIC sitting on the floor
62130 FE06 CP 6 Is ERIC in a classroom?
62132 3002 JR NC,62136 Jump if so
62134 0606 LD B,6 6: ERIC lying on back
62136 F1 POP AF
62137 D1 POP DE
62138 E680 AND 128
62140 80 ADD A,B A=ERIC's new animatory state (sitting on floor or lying on back)
62141 CD3061 CALL 24880 Update SRB for ERIC's new animatory state
62144 CDA062 CALL 25248 Refresh display area
62147 211301 LD HL,275 Prepare sound effect parameters

This entry point is used by the routine at 23907:
62150 110000 LD DE,0
62153 3E02 LD A,2

This entry point is used by the routines at 62178 and 63861:
62155 AD XOR L Make a sound effect
62156 D3FE OUT (254),A
62158 43 LD B,E
62159 10FE DJNZ 62159
62161 47 LD B,A
62162 7B LD A,E
62163 84 ADD A,H
62164 5F LD E,A
62165 78 LD A,B
62166 15 DEC D
62167 20F2 JR NZ,62155

This entry point is used by the routine at 24477:
62169 FB EI
62170 3E01 LD A,1 BORDER 1
62172 D3FE OUT (254),A
62174 C9 RET