Prev: A4C9 Up: Map Next: A50A
A4EC: Prepare Top Score Text
Used by the routine at InitialiseGame.
Converts the top score into the digits shown on the telegram panel.
PrepareTopScoreText A4EC LD DE,$A5D2 Point DE at the top score.
A4EF LD HL,$A872 Point HL at TelegramLines_HighScoreDigits.
This entry point is used by the routines at CheckTopScore and PrintTelegram.
This entry point converts B bytes of packed decimal digits at DE into characters at HL.
ConvertDigits A4F2 LD B,$03 Set the number of bytes to convert to three.
PrepareTopScoreText_ConvertDigitsLoop A4F4 LD A,(DE) Fetch a pair of digits.
A4F5 RRCA Shift the first digit into the bottom half of the byte.
A4F6 RRCA
A4F7 RRCA
A4F8 RRCA
A4F9 AND %00001111 Keep just the digit.
A4FB ADD A,$30 Convert the digit to a character.
A4FD LD (HL),A Write it to the text.
A4FE INC HL Move on to the next character.
A4FF LD A,(DE) Fetch the pair of digits again.
A500 AND %00001111 Keep just the second digit.
A502 ADD A,$30 Convert it to a character.
A504 LD (HL),A Write it to the text.
A505 INC DE Move on to the next pair of digits and the next character.
A506 INC HL
A507 DJNZ PrepareTopScoreText_ConvertDigitsLoop Loop back until every pair has been converted.
A509 RET Return.
Prev: A4C9 Up: Map Next: A50A