![]() |
Routines |
| Prev: 73D3 | Up: Map | Next: 7438 |
|
Adds points to the score of the active player, and then prints that score.
|
||||||||||||
|
Check the active player.
|
||||||||||||
| AddPointsToScore | 7415 | LD A,($5F21) | If Flag_ActivePlayer is not zero, jump to AddPointsToScore_2UP. | |||||||||
| 7418 | AND A | |||||||||||
| 7419 | JR NZ,AddPointsToScore_2UP | |||||||||||
|
Set the score address for 1UP.
|
||||||||||||
| 741B | LD HL,$5F10 | Point HL at the last byte of the 1UP score. | ||||||||||
| 741E | JR AddPointsToScore_Start | Jump to AddPointsToScore_Start. | ||||||||||
|
Set the score address for 2UP.
|
||||||||||||
| AddPointsToScore_2UP | 7420 | LD HL,$5F13 | Point HL at the last byte of the 2UP score. | |||||||||
|
Process adding the points to the appropriate score.
|
||||||||||||
| AddPointsToScore_Start | 7423 | LD A,(HL) | Fetch the last byte of the score. | |||||||||
| 7424 | ADD A,C | Add the points in C (in BCD). | ||||||||||
| 7425 | DAA | |||||||||||
| 7426 | LD (HL),A | Update the last byte of the score. | ||||||||||
| 7427 | DEC HL | Move on to the middle byte of the score. | ||||||||||
| 7428 | LD A,(HL) | Fetch the middle byte of the score. | ||||||||||
| 7429 | ADC A,B | Add the points in B (in BCD), with the carry. | ||||||||||
| 742A | DAA | |||||||||||
| 742B | LD (HL),A | Update the middle byte of the score. | ||||||||||
| 742C | DEC HL | Move on to the first byte of the score. | ||||||||||
| 742D | LD A,(HL) | Fetch the first byte of the score. | ||||||||||
| 742E | ADC A,$00 | Add the carry (in BCD). | ||||||||||
| 7430 | DAA | |||||||||||
| 7431 | LD (HL),A | Update the first byte of the score. | ||||||||||
|
Check the active player.
|
||||||||||||
| 7432 | LD A,($5F21) | If Flag_ActivePlayer is not zero, jump to Score_2UP. | ||||||||||
| 7435 | AND A | |||||||||||
| 7436 | JR NZ,Score_2UP | |||||||||||
|
View the equivalent code in;
|
||||||||||||
| Prev: 73D3 | Up: Map | Next: 7438 |