Routines

29574: 'M' pressed - mount bike


The address of this routine is found in the keypress table at 58624

A ERIC's animatory state
D ERIC's y-coordinate
E ERIC's x-coordinate

29574 E680 AND 128 A=0 if ERIC's facing left, 128 if right
29576 C619 ADD A,25 A=25/153: bike standing upright
29578 47 LD B,A
29579 2102D3 LD HL,54018 H=211 (bike), L=2
29582 7A LD A,D
29583 BE CP (HL) Is ERIC on the same floor as the bike?
29584 C0 RET NZ Return if not
29585 2D DEC L
29586 7B LD A,E
29587 BE CP (HL) Is ERIC at the same x-coordinate as the bike?
29588 C0 RET NZ Return if not
29589 2D DEC L
29590 70 LD (HL),B Fill in the animatory state of the bike
29591 CD5471 CALL 29012 Make sound effect
29594 21FB7F LD HL,32763
29597 3602 LD (HL),2 Set bit 1: examine byte at 32749
29599 3E12 LD A,18
29601 2EEE LD L,238 HL=32750
29603 77 LD (HL),A
29604 2C INC L HL=32751
29605 77 LD (HL),A
29606 2C INC L HL=32752
29607 77 LD (HL),A
29608 2EF3 LD L,243 HL=32755
29610 C33073 JP 29488