![]() |
Routines |
| Prev: A0CB | Up: Map | Next: A115 |
|
The double-size half of the character printer print_char, reached through its self-modified JR at the end of print_char when print_string has patched that JR's displacement to $10 for a string whose attribute byte has bit 7 set. Each of the glyph's seven rows (stored bottom row first) is split into its two nibbles; each nibble is doubled to a whole byte through the table double_bits (bit n of the nibble becomes bits 2n and 2n+1), and the two bytes are written side by side on two pixel lines, so the character comes out 16 pixels wide and 14 lines high, drawn upwards from the line HL starts on.
HL must start on an odd pixel line within its cell (normally the bottom line, 7): the plain DEC H between the two lines of each row never crosses a cell boundary only because each pair starts on an odd line. Then a 2x2 block of attributes is coloured: the cell, the cell above, and the two to their right.
|
||||||||||||||||
| print_char_double | A0DB | LD A,$07 | Seven rows; B is the page of the nibble-doubling table double_bits | |||||||||||||
| A0DD | LD B,$5C | |||||||||||||||
| print_char_double_0 | A0DF | EX AF,AF' | Keep the row count in A' | |||||||||||||
| A0E0 | LD A,(DE) | The left half: the glyph byte's high nibble, doubled through the table | ||||||||||||||
| A0E1 | SRL A | |||||||||||||||
| A0E3 | SRL A | |||||||||||||||
| A0E5 | SRL A | |||||||||||||||
| A0E7 | SRL A | |||||||||||||||
| A0E9 | ADD A,$84 | |||||||||||||||
| A0EB | LD C,A | |||||||||||||||
| A0EC | LD A,(BC) | |||||||||||||||
| A0ED | LD (HL),A | Write it on this line and the one above | ||||||||||||||
| A0EE | DEC H | |||||||||||||||
| A0EF | LD (HL),A | |||||||||||||||
| A0F0 | INC H | |||||||||||||||
| A0F1 | INC HL | The right half: the low nibble, doubled | ||||||||||||||
| A0F2 | LD A,(DE) | |||||||||||||||
| A0F3 | AND $0F | |||||||||||||||
| A0F5 | ADD A,$84 | |||||||||||||||
| A0F7 | LD C,A | |||||||||||||||
| A0F8 | LD A,(BC) | |||||||||||||||
| A0F9 | LD (HL),A | Write it on both lines too, and step back to the left column (now on the upper line) | ||||||||||||||
| A0FA | DEC H | |||||||||||||||
| A0FB | LD (HL),A | |||||||||||||||
| A0FC | DEC HL | |||||||||||||||
| A0FD | INC DE | Next glyph row; move up one more pixel line | ||||||||||||||
| A0FE | CALL line_up_hl | |||||||||||||||
| A101 | EX AF,AF' | Until all seven rows are drawn | ||||||||||||||
| A102 | DEC A | |||||||||||||||
| A103 | JR NZ,print_char_double_0 | |||||||||||||||
| A105 | EXX | Colour the 2x2 block of cells: this one, the one above, above-right and right; HL' ends two cells on | ||||||||||||||
| A106 | LD (HL),B | |||||||||||||||
| A107 | SBC HL,DE | |||||||||||||||
| A109 | LD (HL),B | |||||||||||||||
| A10A | INC HL | |||||||||||||||
| A10B | LD (HL),B | |||||||||||||||
| A10C | ADD HL,DE | |||||||||||||||
| A10D | LD (HL),B | |||||||||||||||
| A10E | INC HL | |||||||||||||||
| A10F | EXX | |||||||||||||||
| A110 | POP HL | Restore the glyph pointer and step the screen address two columns on, for the next character | ||||||||||||||
| A111 | INC HL | |||||||||||||||
| A112 | INC HL | |||||||||||||||
| A113 | POP DE | |||||||||||||||
| A114 | RET | |||||||||||||||
| Prev: A0CB | Up: Map | Next: A115 |