Prev: 41137 Up: Map Next: 41237
41179: Print Wide Character
Prints one character of text at double width, using the table at 23684 to double each nibble of the glyph into a byte. The character takes two cells across and two cells high of attributes.
Input
B' Attribute
DE Address of the character code
DE' Value of 32
HL Screen address
HL' Attribute address
Output
HL Screen address two cells to the right
HL' Attribute address two cells to the right
PrintWideCharacter 41179 LD A,7 Set the number of rows to seven.
41181 LD B,92 Use the table of doubled nibbles.
PrintWideCharacter_Row 41183 EX AF,AF' Save the number of rows.
41184 LD A,(DE) Fetch a row of the glyph.
41185 SRL A Move the top nibble to the bottom.
41187 SRL A
41189 SRL A
41191 SRL A
41193 ADD A,132 Add the offset of the table to the nibble.
41195 LD C,A Put it in C.
41196 LD A,(BC) Fetch the doubled nibble.
41197 LD (HL),A Draw it on the left.
41198 DEC H Move up a pixel row.
41199 LD (HL),A Draw it again.
41200 INC H Move back down.
41201 INC HL Move on to the right cell.
41202 LD A,(DE) Fetch the row of the glyph again.
41203 AND %00001111 Keep the bottom nibble.
41205 ADD A,132 Add the offset of the table.
41207 LD C,A Put it in C.
41208 LD A,(BC) Fetch the doubled nibble.
41209 LD (HL),A Draw it on the right.
41210 DEC H Move up a pixel row.
41211 LD (HL),A Draw it again.
41212 DEC HL Move back to the left cell.
41213 INC DE Move on to the next row of the glyph.
41214 CALL MoveUpARow Move up a row of the screen.
41217 EX AF,AF' Restore the number of rows.
41218 DEC A Decrease it.
41219 JR NZ,PrintWideCharacter_Row Loop back to PrintWideCharacter_Row for each row.
41221 EXX Switch to the attribute registers.
41222 LD (HL),B Set the attribute of the cell at the left.
41223 SBC HL,DE Move up to the attribute cell above.
41225 LD (HL),B Set its attribute.
41226 INC HL Move on to the right.
41227 LD (HL),B Set the attribute of the cell above on the right.
41228 ADD HL,DE Move back down.
41229 LD (HL),B Set the attribute of the cell on the right.
41230 INC HL Move on to the next cell.
41231 EXX Switch back to the screen registers.
41232 POP HL Restore the screen address.
41233 INC HL Move on two cells.
41234 INC HL
41235 POP DE Restore the address of the character code.
41236 RET Return.
Prev: 41137 Up: Map Next: 41237