![]() |
Routines |
| Prev: 51978 | Up: Map | Next: 52032 |
|
Used by the routines at GameEntryPoint and 46884.
|
||||||||
|
An example of HL is Time_Remaining which would add the time remaining to the score when the level is complete.
|
||||||||
| AddPointsToScore | 52002 | LD IX,52118 | IX=ActivePlayer_Score. | |||||
|
Handle the "tens" units.
|
||||||||
| 52006 | LD A,(IX+0) | A=*IX+0. | ||||||
| 52009 | ADD A,(HL) | Add *HL to score byte #1 with BCD conversion. | ||||||
| 52010 | DAA | |||||||
| 52011 | LD (IX+0),A | Write A to *IX+0. | ||||||
|
Move onto the next score digit.
|
||||||||
| 52014 | INC HL | Increment HL by one. | ||||||
|
Handle the "thousands" units.
|
||||||||
| 52015 | LD A,(IX+1) | A=*IX+1. | ||||||
| 52018 | ADC A,(HL) | Add (with carry) *HL to score byte #2 with BCD conversion. | ||||||
| 52019 | DAA | |||||||
|
Handle the "hundreds of thousands" units.
|
||||||||
| 52020 | LD (IX+1),A | Write A to *IX+1. | ||||||
|
The final digit always has a base of 0.
|
||||||||
| 52023 | LD A,0 | Add (with carry) 0 to *IX+2 to score byte #3. | ||||||
| 52025 | ADC A,(IX+2) | |||||||
| 52028 | LD (IX+2),A | Write A to *IX+2. | ||||||
| 52031 | RET | Return. | ||||||
| Prev: 51978 | Up: Map | Next: 52032 |