Routines

29194: Control bike when ERIC's standing on the saddle or has just dismounted


The address of this routine is placed into bytes 17 and 18 of the bike's buffer by the routine at 29278

29194 21F07F LD HL,32752
29197 7E LD A,(HL)
29198 D607 SUB 7 Is it time for the bike to come to rest?
29200 3015 JR NC,29223 Jump if not
29202 2EED LD L,237 HL=32749
29204 CB7E BIT 7,(HL) Is ERIC standing on the saddle of the bike?
29206 2802 JR Z,29210 Jump if not
29208 3610 LD (HL),16 Set bit 4: ERIC is falling and will not land on his feet
29210 26D3 LD H,211 211=bike
29212 CDB461 CALL 25012 Update SRB for bike's current animatory state and location
29215 3D DEC A A=animatory state of bike resting on floor
29216 2E12 LD L,18 Remove the address of this routine from the bike's buffer
29218 3600 LD (HL),0
29220 C33061 JP 24880 Update SRB for bike's new animatory state
29223 77 LD (HL),A
29224 2A00D3 LD HL,(54016) H=bike's x-coordinate, L=bike's animatory state
29227 7D LD A,L
29228 5C LD E,H
29229 CD0070 CALL 28672 Check for walls, closed doors or ALBERT in ERIC's path
29232 2EED LD L,237 HL=32749
29234 3006 JR NC,29242 Jump if ALBERT's not impeding ERIC's progress
29236 CB7E BIT 7,(HL) Is ERIC standing on the saddle of the bike?
29238 280C JR Z,29252 Jump if not
29240 3610 LD (HL),16
29242 2008 JR NZ,29252 Jump if there are no walls or closed doors in ERIC's path
29244 CB7E BIT 7,(HL) Is ERIC standing on the saddle of the bike?
29246 28DA JR Z,29210 Jump if not
29248 3640 LD (HL),64 Set bit 6: ERIC has hit a closed door or gate while standing on the saddle of the bike
29250 18D6 JR 29210
29252 26D3 LD H,211 211=bike
29254 CD5072 CALL 29264 Update SRB for bike and move it one space forward
29257 3AED7F LD A,(32749)
29260 07 RLCA Is ERIC standing on the saddle of the bike?
29261 D0 RET NC Return if not

This entry point is used by the routine at 29278:
29262 26D2 LD H,210 210=ERIC

This entry point is used by the routine at 30380:
29264 CDB461 CALL 25012 Update SRB for character's current animatory state and location
29267 07 RLCA
29268 0F RRCA
29269 3802 JR C,29273 Jump if character's facing right
29271 1D DEC E
29272 1D DEC E
29273 1C INC E Now E=x-coordinate in front of character
29274 C3EB7B JP 31723 Jump to update SRB for this new location of the character and scroll screen if necessary