Routines |
Prev: 6D07 | Up: Map | Next: 6D73 |
Used by the routine at 6A9B.
|
||||
6D12 | LD C,$00 | C=00. | ||
6D14 | LD A,($5E0D) | A=Speed. | ||
6D17 | RLA | |||
6D18 | RL C | |||
6D1A | RLA | |||
6D1B | RL C | |||
6D1D | LD HL,$5E30 | HL=Unknown. | ||
6D20 | ADD A,(HL) | |||
6D21 | LD (HL),A | |||
6D22 | LD A,C | |||
Working backwards, add onto the odometer.
|
||||
6D23 | LD B,$03 | B=03 (counter - miles are stored in three bytes). | ||
CalcMiles | 6D25 | DEC HL | Decrease the pointer to the miles counter held by HL by one. | |
6D26 | ADC A,(HL) | Adds A to the miles byte held at HL. | ||
6D27 | DAA | |||
6D28 | LD (HL),A | Write A to HL. | ||
6D29 | LD A,$00 | Reset A to 00 while maintaining the carry flag. | ||
6D2B | DJNZ CalcMiles | Decrease counter by one and loop back to CalcMiles until counter is zero. | ||
6D2D | LD A,($5E74) | L=5E74. | ||
6D30 | LD L,A | |||
6D31 | LD A,($5E2E) | A=5E2E. | ||
6D34 | CP L | |||
6D35 | JR Z,$6D40 | |||
6D37 | LD ($5E74),A | |||
6D3A | LD BC,$0010 | BC=0010. | ||
6D3D | CALL AddPointsToScore | Call AddPointsToScore. | ||
6D40 | LD HL,($5E05) | HL=PlayerMapPosition. | ||
Check fuel.
|
||||
6D43 | LD A,($5E0B) | If Fuel level is not zero then jump to 6D56. | ||
6D46 | AND A | |||
6D47 | JR NZ,$6D56 | |||
Handle being out of fuel.
|
||||
6D49 | LD A,($5E0D) | A=Speed. | ||
6D4C | CP $33 | |||
6D4E | JR C,$6D5D | |||
6D50 | DEC A | |||
6D51 | LD ($5E0D),A | |||
6D54 | JR $6D64 | Jump to 6D64. | ||
Check temperature.
|
||||
6D56 | LD A,($5E0C) | A=Temperature. | ||
6D59 | CP $A0 | |||
6D5B | JR NC,$6D49 | |||
6D5D | CALL ReadInputAccelerate | Call ReadInputAccelerate. | ||
6D60 | BIT 3,A | |||
6D62 | JR Z,HandlerCanAccelerate | |||
6D64 | CALL ReadInputBrake | Call ReadInputBrake. | ||
6D67 | BIT 2,A | |||
6D69 | JR NZ,HandlerAccelerate_0 | |||
6D6B | LD A,($5E0D) | A=Speed. | ||
6D6E | SUB $10 | |||
6D70 | JR NC,HandlerAccelerate | |||
6D72 | XOR A | A=00. |
Prev: 6D07 | Up: Map | Next: 6D73 |