Routines

29462: Deal with ERIC when he's standing on the saddle of the bike


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

29462 21F37F LD HL,32755
29465 35 DEC (HL) Is it time to deal with ERIC yet?
29466 C0 RET NZ Return if not
29467 34 INC (HL) (HL)=1
29468 CDFA71 CALL 29178 Get offset from keypress table into A
29471 C8 RET Z Return if no game key was pressed
29472 21F37F LD HL,32755
29475 FE72 CP 114 Was "jump" pressed?
29477 2826 JR Z,29517 Jump if so
29479 CBDF SET 3,A
29481 FE5C CP 92 Was "up" pressed?
29483 2820 JR Z,29517 Jump if so
29485 FE5E CP 94 Was "down" pressed?
29487 C0 RET NZ Return if not

This entry point is used by the routine at 29574 when ERIC has just got on the bike:
29488 3605 LD (HL),5
29490 2EED LD L,237 HL=32749
29492 3601 LD (HL),1 Set bit 0: ERIC is riding the bike
29494 26D2 LD H,210 210=ERIC
29496 CDB461 CALL 25012 Update SRB for ERIC's current animatory state and location
29499 24 INC H H=211: bike
29500 CDB461 CALL 25012 Update SRB for the bike's current animatory state and location
29503 2E01 LD L,1 Point to byte 1 of the bike's buffer
29505 36E0 LD (HL),224 Set the bike's x-coordinate to 224 (out of sight)
29507 2E12 LD L,18
29509 3600 LD (HL),0 Blank out the address at bytes 17 and 18 of the bike's buffer
29511 25 DEC H H=210: ERIC
29512 D60C SUB 12 A=animatory state of ERIC riding bike
29514 C33061 JP 24880 Jump to update SRB for ERIC's new animatory state

We come here if ERIC has tried to jump off the saddle of the bike.
29517 26D2 LD H,210 210=ERIC
29519 CDB461 CALL 25012 Update SRB for ERIC's current animatory state and location
29522 C602 ADD A,2 A=2 or 130
29524 15 DEC D
29525 15 DEC D
29526 CDDAFB CALL 64474 Prepare ERIC for his descent from the bike saddle
29529 26D2 LD H,210 210=ERIC
29531 AF XOR A
29532 6F LD L,A HL points to byte 0 of ERIC's buffer
29533 CB7E BIT 7,(HL) Is ERIC facing left?
29535 2802 JR Z,29539 Jump if so
29537 3E02 LD A,2
29539 2C INC L
29540 86 ADD A,(HL) Now A=x-coordinate of ERIC's arm
29541 5F LD E,A
29542 21EB7F LD HL,32747 Inventory flags
29545 CB56 BIT 2,(HL) Has ERIC got the frog?
29547 C8 RET Z Return if not
29548 CD0876 CALL 30216 Is ERIC's arm directly underneath a cup?
29551 C0 RET NZ Return if not
29552 CB96 RES 2,(HL) Signal: ERIC no longer has frog
29554 26D4 LD H,212 212=frog
29556 3E1C LD A,28 28: frog sitting (as on floor or in cup)
29558 1D DEC E E=frog's x-coordinate
29559 160B LD D,11 D=frog's y-coordinate
29561 CD3061 CALL 24880 Update SRB for frog's new animatory state and location
29564 C3C1F3 JP 62401 Print inventory and make sound effect