Routines |
Prev: CB0A | Up: Map | Next: CB40 |
Used by the routines at GameEntryPoint and B724.
|
||||||||
An example of HL is Time_Remaining which would add the time remaining to the score when the level is complete.
|
||||||||
AddPointsToScore | CB22 | LD IX,$CB96 | IX=ActivePlayer_Score. | |||||
Handle the "tens" units.
|
||||||||
CB26 | LD A,(IX+$00) | A=*IX+00. | ||||||
CB29 | ADD A,(HL) | Add *HL to score byte #1 with BCD conversion. | ||||||
CB2A | DAA | |||||||
CB2B | LD (IX+$00),A | Write A to *IX+00. | ||||||
Move onto the next score digit.
|
||||||||
CB2E | INC HL | Increment HL by one. | ||||||
Handle the "thousands" units.
|
||||||||
CB2F | LD A,(IX+$01) | A=*IX+01. | ||||||
CB32 | ADC A,(HL) | Add (with carry) *HL to score byte #2 with BCD conversion. | ||||||
CB33 | DAA | |||||||
Handle the "hundreds of thousands" units.
|
||||||||
CB34 | LD (IX+$01),A | Write A to *IX+01. | ||||||
The final digit always has a base of 00.
|
||||||||
CB37 | LD A,$00 | Add (with carry) 00 to *IX+02 to score byte #3. | ||||||
CB39 | ADC A,(IX+$02) | |||||||
CB3C | LD (IX+$02),A | Write A to *IX+02. | ||||||
CB3F | RET | Return. |
Prev: CB0A | Up: Map | Next: CB40 |