Routines |
Prev: 6D73 | Up: Map | Next: 6ECB |
Used by the routine at HandlerAccelerate.
|
||||
6E32 | EX DE,HL | |||
6E33 | AND A | |||
6E34 | SBC HL,DE | |||
6E36 | SBC A,$00 | |||
6E38 | JR NZ,HandlerAccelerate_4 | |||
6E3A | EX AF,AF' | |||
6E3B | LD A,H | |||
6E3C | CP $80 | |||
6E3E | JR C,HandlerAccelerate_8 | |||
6E40 | EX AF,AF' | |||
6E41 | JR HandlerAccelerate_4 | |||
This entry point is used by the routine at HandlerAccelerate.
|
||||
6E43 | LD A,($5E45) | |||
6E46 | AND A | |||
6E47 | JR Z,$6E54 | |||
6E49 | DEC A | |||
6E4A | LD ($5E45),A | |||
6E4D | JR Z,$6E51 | |||
6E4F | LD A,$02 | |||
6E51 | LD ($5E47),A | |||
6E54 | CALL ReadInputLR | Call ReadInputLR. | ||
6E57 | LD HL,($5E10) | |||
6E5A | LD E,$18 | |||
6E5C | BIT 1,A | |||
6E5E | JP Z,$6E76 | |||
6E61 | BIT 0,A | |||
6E63 | JP Z,$6E6C | |||
6E66 | LD E,$00 | E=00. | ||
6E68 | JR HandlerFuel | Jump to HandlerFuel. | ||
6E6A | LD E,$18 | E=18. | ||
6E6C | LD D,$00 | D=00. | ||
6E6E | ADD HL,DE | |||
6E6F | LD ($5E10),HL | |||
6E72 | JR HandlerFuel | Jump to HandlerFuel. | ||
6E74 | LD E,$18 | E=18. | ||
6E76 | LD D,$00 | D=00. | ||
6E78 | AND A | |||
6E79 | SBC HL,DE | |||
6E7B | LD ($5E10),HL | |||
Don't "use fuel" on every frame. This routine uses the last two bits of the GameTimer (i.e. a number between 0-3) to only process every fourth frame.
|
||||
HandlerFuel | 6E7E | LD A,($5E29) | A=GameTimer. | |
6E81 | AND %00000011 | Keep only bits 0-1. | ||
6E83 | JR NZ,HandlerTemperatureGauge | If the result is not zero then jump to HandlerTemperatureGauge. | ||
Handles "using" fuel.
|
||||
6E85 | LD A,($5E0D) | B=00 C=Speed. | ||
6E88 | LD C,A | |||
6E89 | LD B,$00 | |||
6E8B | LD HL,($5E0A) | HL=Fuel_LSB. | ||
A higher speed uses more fuel.
|
||||
6E8E | SBC HL,BC | HL=HL (fuel) - BC (speed). | ||
6E90 | JR C,FuelSkipWrite | If there's "carry" (i.e. if the player has run out of fuel) jump to FuelSkipWrite. | ||
6E92 | LD ($5E0A),HL | Write HL to Fuel_LSB. | ||
FuelSkipWrite | 6E95 | CP $B0 | If the current speed is more than B0 (top speed) jump to TemperatureMaxSpeed. | |
6E97 | JR NC,TemperatureMaxSpeed | |||
6E99 | CP $60 | Compare current speed with 60. | ||
Handle the temperature gauge.
|
||||
HandlerTemperatureGauge | 6E9B | LD A,($5E0C) | A=Temperature. | |
6E9E | JR C,TemperatureDrop | If there's carry set (this could be either from 6E99 or 6E81) then jump to TemperatureDrop. | ||
DrawTemperatureGauge | 6EA0 | LD HL,$5162 | HL=5162 (screen location). | |
6EA3 | CALL DrawGaugeLine | Call DrawGaugeLine. | ||
Handle the fuel gauge.
|
||||
6EA6 | LD A,($5E0B) | A=Fuel_MSB. | ||
6EA9 | LD HL,$5122 | HL=5122 (screen location). | ||
6EAC | JP DrawGaugeLine | Jump to DrawGaugeLine. | ||
Handle the temperature gauge at maximum speed.
|
||||
TemperatureMaxSpeed | 6EAF | LD A,($5E0C) | A=Temperature. | |
Check if the temperature is already at the upper limit.
|
||||
6EB2 | CP $C0 | If the current temperature is more than C0 jump to DrawTemperatureGauge. | ||
6EB4 | JR NC,DrawTemperatureGauge | |||
Go ahead and increase the temperature...
|
||||
6EB6 | INC A | Increment A by one. | ||
UpdateTemperature | 6EB7 | LD ($5E0C),A | Write the updated A (temperature) back to Temperature. | |
6EBA | JR DrawTemperatureGauge | Jump to DrawTemperatureGauge. | ||
Handles dropping the temperature gauge.
|
||||
TemperatureDrop | 6EBC | AND A | If the current temperature is at zero jump to DrawTemperatureGauge. | |
6EBD | JR Z,DrawTemperatureGauge | |||
6EBF | DEC A | Decrease A (temperature) by one. | ||
6EC0 | JR UpdateTemperature | Jump to UpdateTemperature. | ||
This entry point is used by the routine at HandlerAccelerate.
|
||||
6EC2 | LD B,$05 | B=05. | ||
6EC4 | SRL H | |||
6EC6 | RR L | |||
6EC8 | DJNZ $6EC4 | Decrease counter by one and loop back to 6EC4 until counter is zero. | ||
6ECA | RET | Return. |
Prev: 6D73 | Up: Map | Next: 6ECB |