Prev: 53936 Up: Map Next: 53981
53961: Draw Character
Used by the routines at GameMenu, HandleMenuBullet and DrawDigits.
Draws a character which is 8 pixels wide and 16 high, from a font of 8 bytes for each character. The first four bytes are drawn as the upper half and the last four as the lower half, with every byte drawn on two lines.
Input
A The number of the character
BC The address of the font
HL The screen address
A' The attribute
Output
HL The screen address of the next character on the right
Find the character in the font.
DrawCharacter 53961 PUSH BC Stash the registers on the stack.
53962 PUSH DE
53963 PUSH HL
53964 EX DE,HL Keep the screen address in DE.
53965 LD L,A Move the number of the character to HL.
53966 LD H,0
53968 ADD HL,HL Multiply it by 8 and add the address of the font.
53969 ADD HL,HL
53970 ADD HL,HL
53971 ADD HL,BC
53972 EX DE,HL Put the address of the character in DE and the screen address in HL.
Draw the character.
53973 CALL DrawDoubleHeightCharacter Call DrawDoubleHeightCharacter.
53976 POP HL Restore the screen address from the stack.
53977 INC L Move on to the next column.
53978 POP DE Restore the registers from the stack.
53979 POP BC
53980 RET Return.
Prev: 53936 Up: Map Next: 53981