Prev: 9662 Up: Map Next: 96BB
9690: Print Score
Used by the routine at AddScore.
Prints the score of the current player in the score panel. When it is entered at PrintScore, an extra life is awarded if the highest two digits of the score have changed.
Input
D The highest two digits of the score before the points were added
PrintScore 9690 LD A,($DEFB) Fetch the highest two digits of the score.
9693 CP D Compare them with the old highest two digits.
9694 CALL NZ,CollectItem_ExtraLife Call D619 to award an extra life if they have changed.
This entry point is used by the routine at AddScore.
PrintScore_Digits 9697 LD HL,$DEFB Point HL at the highest two digits of the score.
969A LD DE,$E131 Point DE at the digits of the score in the text record at E131.
969D LD B,$03 Set the byte counter in B to 03.
PrintScore_Convert 969F LD A,(HL) Fetch two digits of the score.
96A0 RRA Move the upper digit into the lower four bits...
96A1 RRA
96A2 RRA
96A3 RRA
96A4 AND %00001111 ...and keep only that digit.
96A6 LD (DE),A Store it in the text record.
96A7 INC DE Move onto the next character of the text record.
96A8 LD A,(HL) Fetch the two digits again.
96A9 AND %00001111 Keep the lower digit.
96AB LD (DE),A Store it in the text record.
96AC INC DE Move onto the next character of the text record.
96AD DEC HL Move onto the next two digits of the score.
96AE DJNZ PrintScore_Convert Decrease the byte counter by one and jump back to PrintScore_Convert until all six digits have been converted.
96B0 LD A,$85 A is 85 the length of the text with the flags for the double height.
96B2 LD ($E131),A Store it as the first character of the text record.
96B5 LD DE,$E12E Point DE at ScoreTextPlayerOne_Record.
96B8 JP PrintText Jump to PrintText to print the score.
Prev: 9662 Up: Map Next: 96BB