Prev: AA9A Up: Map Next: AAE7
AAC4: Print Left Half Of Character
Used by the routine at PrintLargeText.
Draws the left half of four rows of a character in double size. The four bytes of pixels at DE each have their left four pixels widened to eight and written twice, so they fill the eight pixel rows of a character cell. The cell is coloured with the attribute and HL moves to the cell on its right.
Input
DE The address of the pixels of the character
HL The screen address
Output
HL The screen address of the cell to the right
Swap the pixels and the screen address.
PrintLeftHalfOfCharacter AAC4 PUSH DE Stash the address of the pixels on the stack.
AAC5 PUSH HL Stash the screen address on the stack.
AAC6 EX DE,HL Swap the pixels into HL and the screen address into DE.
AAC7 LD B,$04 Set the number of rows to four.
Widen the left four pixels of each row.
PrintLeftHalf_Loop AAC9 LD A,(HL) Fetch a row of pixels.
AACA INC HL Move on to the next row.
AACB RRCA Move the left four pixels into the bottom of the byte.
AACC RRCA
AACD RRCA
AACE RRCA
AACF AND %00001111 Keep them.
AAD1 PUSH HL Stash the address of the pixels on the stack.
AAD2 LD HL,$AB08 Point HL at WidenedPixels.
AAD5 CALL AddAToHL Point HL at the entry for the four pixels.
AAD8 LD A,(HL) Fetch the widened pixels.
AAD9 LD (DE),A Write them to the screen.
AADA INC D Move down a pixel row.
AADB LD (DE),A Write them again.
AADC INC D Move down a pixel row.
AADD POP HL Retrieve the address of the pixels.
AADE DJNZ PrintLeftHalf_Loop Loop back until four rows have been drawn.
Colour the cell and move to the right.
AAE0 POP HL Retrieve the screen address.
AAE1 POP DE Retrieve the address of the pixels.
AAE2 CALL SetTileAttribute Set the attribute of the cell.
AAE5 INC L Move across to the next cell.
AAE6 RET Return.
Prev: AA9A Up: Map Next: AAE7