Prev: 28668 Up: Map Next: 28743
28669: Handler: Downhill
If you hit a downhill too fast the bike will launch (crash) and you fall off.
The parameters are quite wide though;
Direction Bike Range Crash Point
Lowest Highest
Left 105 127 < 106
Right 128 150 > 150
Handler_Downhill 28669 LD A,(30754) A=*Speed.
28672 CP 150 Jump to Initialise_CrashDownhill if the players speed is higher than or equal to 150.
28674 JR NC,Initialise_CrashDownhill
28676 CP 106 Return if A is higher than 106.
28678 RET NC
Initialise_CrashDownhill 28679 LD HL,48286 HL=48286.
28682 LD DE,(30766) DE=*30766.
28686 INC D Increment D by one.
28687 LD B,A Store speed in B temporarily.
28688 LD A,3 Write 3 to *Action.
28690 LD (30762),A
28693 LD A,B Restore the current speed back to A.
28694 RLCA RLCA.
28695 JR NC,Handler_Downhill_2 Jump to Handler_Downhill_2 if A is higher.
28697 INC E Increment E by one.
28698 JR NZ,Handler_Downhill_0 Jump to Handler_Downhill_0 if E is not zero.
28700 LD A,D D+=5.
28701 ADD A,5
28703 LD D,A
Handler_Downhill_0 28704 LD A,(DE) A=*DE.
28705 CP 11 Jump to Handler_Downhill_1 if A is equal to 11.
28707 JR Z,Handler_Downhill_1
28709 CP 30 Jump to Handler_Downhill_5 if A is not equal to 30.
28711 JR NZ,Handler_Downhill_5
Handler_Downhill_1 28713 LD L,179 L=179.
28715 JR Handler_Downhill_5 Jump to Handler_Downhill_5.
Handler_Downhill_2 28717 LD L,214 L=214.
28719 LD A,E A=E.
28720 DEC E Decrease E by one.
28721 AND A Jump to Handler_Downhill_3 if A is not zero.
28722 JR NZ,Handler_Downhill_3
28724 LD A,D D-=5.
28725 SUB 5
28727 LD D,A
Handler_Downhill_3 28728 LD A,(DE) A=*DE.
28729 CP 10 Jump to Handler_Downhill_4 if A is equal to 10.
28731 JR Z,Handler_Downhill_4
28733 CP 31 Jump to Handler_Downhill_5 if A is not equal to 31.
28735 JR NZ,Handler_Downhill_5
Handler_Downhill_4 28737 LD L,235 L=235.
Handler_Downhill_5 28739 LD (30778),HL Write HL to *30778.
28742 RET Return.
Prev: 28668 Up: Map Next: 28743