Prev: 35151 Up: Map Next: 35263
35228: Add Points To Score
Used by the routines at 38193, 38670, 44342, 45583 and 47120.
Input
BC Points to add to score
Check the active player.
AddPointsToScore 35228 LD A,(24165) If Flag_ActivePlayer is not zero, jump to AddPointsToScore_2UP.
35231 AND A
35232 JR NZ,AddPointsToScore_2UP
Set the score address for 1UP.
35234 LD HL,24161 HL=1UP_Score_3.
35237 JR AddPointsToScore_Start Jump to AddPointsToScore_Start.
Set the score address for 2UP.
AddPointsToScore_2UP 35239 LD HL,24164 HL=2UP_Score_3.
Process adding the points to the appropriate score.
AddPointsToScore_Start 35242 LD A,(HL) A=score byte #3.
35243 ADD A,C Add C to score byte #3 with BCD conversion.
35244 DAA
35245 LD (HL),A Update score byte #3.
35246 DEC HL Move onto the next score byte.
35247 LD A,(HL) A=score byte #2.
35248 ADC A,B Add (with carry) B to score byte #2 with BCD conversion.
35249 DAA
35250 LD (HL),A Update score byte #2.
35251 DEC HL Move onto the next score byte.
35252 LD A,(HL) A=score byte #1.
35253 ADC A,0 Add 0 (i.e. just the carry flag) to score byte #1 with BCD conversion.
35255 DAA
35256 LD (HL),A Update score byte #1.
Check the active player.
35257 LD A,(24165) If Flag_ActivePlayer is not zero, jump to Score_2UP.
35260 AND A
35261 JR NZ,Score_2UP
View the equivalent code in;
Prev: 35151 Up: Map Next: 35263