diff --git a/arch/nc200/supervisor/tty.inc b/arch/nc200/supervisor/tty.inc index 9dc11e4..fb922dd 100644 --- a/arch/nc200/supervisor/tty.inc +++ b/arch/nc200/supervisor/tty.inc @@ -288,6 +288,8 @@ tty_rawwrite: ld e, a ld d, 0 add hl, de ; hl = a*4 + a = a*5 + add hl, de ; hl = a*5 + a = a*6 + add hl, de ; hl = a*6 + a = a*7 ld de, FONT add hl, de ; hl points at font data @@ -296,53 +298,18 @@ tty_rawwrite: ld a, (hl) ; XXXXX???.???????? call draw_single_scanline - - ld b, (hl) ; ?????XXX.XX?????? - inc hl - ld a, (hl) - srl b - rra - srl b - rra - srl b - rra + ld a, (hl) ; XXXXX???.???????? call draw_single_scanline - - ld a, (hl) ; ??XXXXX? - add a, a - add a, a + ld a, (hl) ; XXXXX???.???????? call draw_single_scanline - - ld a, (hl) ; ???????X.XXXX???? - srl a - inc hl - ld a, (hl) - rra + ld a, (hl) ; XXXXX???.???????? call draw_single_scanline - - ld a, (hl) ; ????XXXX.X??????? - inc hl - ld b, (hl) - sll b - rla - add a, a - add a, a - add a, a + ld a, (hl) ; XXXXX???.???????? call draw_single_scanline - - ld a, (hl) ; ?XXXXX?? - add a, a + ld a, (hl) ; XXXXX???.???????? call draw_single_scanline - - ld b, (hl) ; ??????XX.XXX????? - inc hl - ld a, (hl) - srl b - rra - srl b - rra + ld a, (hl) ; XXXXX???.???????? ; fall through - ; On entry, the font data is in A, left justified. ; Font pointer is in HL. draw_single_scanline: @@ -392,6 +359,7 @@ scanline_shift_amount: ld (L_cursor_address), hl ex de, hl ; put font pointer back in HL + inc hl ; advance to next byte of font data ret ; vim: sw=4 ts=4 expandtab ft=asm diff --git a/arch/nc200/utils/fontconvert.c b/arch/nc200/utils/fontconvert.c index e8c6b94..fc8adfa 100644 --- a/arch/nc200/utils/fontconvert.c +++ b/arch/nc200/utils/fontconvert.c @@ -37,33 +37,18 @@ int main(int argc, const char* argv[]) /* The glyph data is a 7-element array of bytes. Each byte contains * one scanline, left justified. */ - uint64_t mask = 0; - const uint8_t* p = glyph->data; - + printf("\tdb "); int yy = 0; + const uint8_t* p = glyph->data; while (yy < LINEHEIGHT) { - /* We assume the right-most column is blank, and so only store five bits. */ - - mask = (mask << 5) | ((*p >> 3) & 0x1f); + if (yy != 0) + printf(", "); + printf("0x%02x", *p); p++; yy++; } - - /* The encoding expects 8 5-bit values in five bytes, *left* justified. */ - while (yy < 8) - { - mask <<= 5; - yy++; - } - - printf("\tdb 0x%02x, 0x%02x, 0x%02x, 0x%02x, 0x%02x ; char %d\n", - (uint32_t)((mask >> 32) & 0xff), - (uint32_t)((mask >> 24) & 0xff), - (uint32_t)((mask >> 16) & 0xff), - (uint32_t)((mask >> 8) & 0xff), - (uint32_t)(mask & 0xff), - c); + printf(" ; char %d\n", c); } return 0;