Prev: D2AA Up: Map Next: D2C9
D2B0: Draw Digits
Used by the routine at DrawBountyDigits.
Draws a number which is held as pairs of packed decimal digits, as double height characters from Font_Digits.
digits
Input
B The number of bytes of the number
DE The address of the number
HL The screen address
A' The attribute
Prepare the upper digit.
DrawDigits D2B0 LD A,(DE) Fetch the byte.
D2B1 RRCA Move the upper digit to the lower four bits.
D2B2 RRCA
D2B3 RRCA
D2B4 RRCA
D2B5 AND %00001111 Keep only bits 0-3.
D2B7 PUSH BC Stash the counter on the stack.
D2B8 LD BC,$8EB0 Point BC at Font_Digits.
Draw the upper digit.
D2BB CALL DrawCharacter Call DrawCharacter.
Prepare the lower digit.
D2BE LD A,(DE) Fetch the byte again, and move to the next one.
D2BF INC DE
D2C0 AND %00001111 Keep only bits 0-3.
Draw the lower digit.
D2C2 CALL DrawCharacter Call DrawCharacter.
D2C5 POP BC Restore the counter from the stack.
D2C6 DJNZ DrawDigits Jump to DrawDigits if there are any left.
D2C8 RET Return.
Prev: D2AA Up: Map Next: D2C9