Prev: 38498 Up: Map Next: 38587
38544: 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 38544 LD A,(57083) Fetch the highest two digits of the score.
38547 CP D Compare them with the old highest two digits.
38548 CALL NZ,CollectItem_ExtraLife Call 54809 to award an extra life if they have changed.
This entry point is used by the routine at AddScore.
PrintScore_Digits 38551 LD HL,57083 Point HL at the highest two digits of the score.
38554 LD DE,57649 Point DE at the digits of the score in the text record at 57649.
38557 LD B,3 Set the byte counter in B to 3.
PrintScore_Convert 38559 LD A,(HL) Fetch two digits of the score.
38560 RRA Move the upper digit into the lower four bits...
38561 RRA
38562 RRA
38563 RRA
38564 AND %00001111 ...and keep only that digit.
38566 LD (DE),A Store it in the text record.
38567 INC DE Move onto the next character of the text record.
38568 LD A,(HL) Fetch the two digits again.
38569 AND %00001111 Keep the lower digit.
38571 LD (DE),A Store it in the text record.
38572 INC DE Move onto the next character of the text record.
38573 DEC HL Move onto the next two digits of the score.
38574 DJNZ PrintScore_Convert Decrease the byte counter by one and jump back to PrintScore_Convert until all six digits have been converted.
38576 LD A,133 A is 133 the length of the text with the flags for the double height.
38578 LD (57649),A Store it as the first character of the text record.
38581 LD DE,57646 Point DE at ScoreTextPlayerOne_Record.
38584 JP PrintText Jump to PrintText to print the score.
Prev: 38498 Up: Map Next: 38587