Prev: C2ED Up: Map Next: C332
C314: Print B bytes of BCD from DE, two digits a byte
Used by the routine at PRINT_PERCENTAGE.
With the digits' font (FONT), whose first character is 0, so a digit's value is its code. Each digit's cell is coloured with A' (PRINT_CHAR_COLOURED). PRINT_BCD_LOW starts with the first byte's lower digit, for an odd number of digits -- and without setting the font (see PRINT_PERCENTAGE).
Input
DE the first byte
B how many bytes
HL the screen address
A' the attribute
PRINT_BCD C314 PUSH HL the digits' font
C315 LD HL,FONT
C318 LD (FONT_BASE),HL
C31B POP HL
PRINT_BCD_0 C31C LD A,(DE) the higher digit
C31D RRCA
C31E RRCA
C31F RRCA
C320 RRCA
C321 AND $0F
C323 CALL PRINT_CHAR_COLOURED
C326 INC L
This entry point is used by the routines at PRINT_PERCENTAGE and ADD_SCORE.
PRINT_BCD_LOW C327 LD A,(DE) PRINT_BCD_LOW: the lower digit
C328 AND $0F
C32A CALL PRINT_CHAR_COLOURED
C32D INC L
C32E INC DE the next byte
C32F DJNZ PRINT_BCD_0
C331 RET
Prev: C2ED Up: Map Next: C332