Routines

64416: Deal with ERIC when falling to floor to land on feet


This routine is called by the routine at 63405 when bit 3 at 32749 is set

64416 21F37F LD HL,32755
64419 35 DEC (HL) Is it time to deal with ERIC yet?
64420 C0 RET NZ Return if not
64421 EB EX DE,HL
64422 2102D2 LD HL,53762 HL points to byte 2 of ERIC's buffer
64425 34 INC (HL) Increment ERIC's y-coordinate temporarily (for testing purposes)
64426 CD4F77 CALL 30543 Has ERIC reached the floor yet?
64429 2015 JR NZ,64452 Jump if not
64431 FE11 CP 17
64433 2B DEC HL
64434 2805 JR Z,64441 Jump if ERIC has landed on the bottom floor
64436 7E LD A,(HL) A=ERIC's x-coordinate
64437 FE5F CP 95 95=right-hand limit of boys' skool
64439 300A JR NC,64451 Jump if ERIC is outside the boys' skool
64441 EB EX DE,HL Reset all bits at 32749 and 32763,
since ERIC has landed safely
64442 2EED LD L,237
64444 3600 LD (HL),0
64446 2EFB LD L,251
64448 3600 LD (HL),0
64450 EB EX DE,HL
64451 2C INC L
64452 35 DEC (HL) Restore ERIC's y-coordinate (we've finished testing)
64453 CDB461 CALL 25012 Update SRB for ERIC's current animatory state and location
64456 14 INC D Increment ERIC's y-coordinate (i.e. make him drop one level)
64457 C317F3 JP 62231 Update SRB for ERIC's new location, and set 32755 to 6