X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fonts.c;h=472cd452a275a6d9c078115ecd010d46d35509de;hb=20b143089cc395dbcd51cac516a9e36f4ab6f5ac;hp=cbad3c68d235f65b53088c883d6d176666241c82;hpb=e515f1a40bab340cb46f3be56b42b42e7d9c6910;p=libpicofe.git diff --git a/fonts.c b/fonts.c index cbad3c6..472cd45 100644 --- a/fonts.c +++ b/fonts.c @@ -250,13 +250,53 @@ void basic_text_out16_nf(void *fb, int w, int x, int y, const char *text) if (fd&0x02) s[6] = val; if (fd&0x01) s[7] = val; - // draw "shadow" + // draw "shadow" (RGB1555 compatible) if (l > 0) fdp = fontdata8x8[c * 8 + l - 1]; for (fd1 = 0x80; fd1 != 0; fd1 >>= 1, s++) if (!(fd & (fd1 >> 1)) && ((fdp | fd) & fd1)) - s[1] = (s[1] >> 1) & 0x7bef; + s[1] = (s[1] >> 1) & 0x39ef; + } + } +} + +void basic_text_out_uyvy_nf(void *fb, int w, int x, int y, const char *text) +{ + int i, l; + unsigned short *screen; + + screen = (unsigned short *)fb + x + y * w; + for (i = 0; ; i++, screen += 8) + { + char c = text[i]; + if (c == 0) + break; + if (c == ' ') + continue; + + for (l = 0; l < 8; l++) + { + unsigned char fd = fontdata8x8[c * 8 + l]; + unsigned char *s = (void *)(screen + l * w); + unsigned char fd1, fdp = 0; + + if (fd&0x80) s[0 * 2 + 1] = 235; + if (fd&0x40) s[1 * 2 + 1] = 235; + if (fd&0x20) s[2 * 2 + 1] = 235; + if (fd&0x10) s[3 * 2 + 1] = 235; + if (fd&0x08) s[4 * 2 + 1] = 235; + if (fd&0x04) s[5 * 2 + 1] = 235; + if (fd&0x02) s[6 * 2 + 1] = 235; + if (fd&0x01) s[7 * 2 + 1] = 235; + + // draw "shadow" + if (l > 0) + fdp = fontdata8x8[c * 8 + l - 1]; + + for (fd1 = 0x80; fd1 != 0; fd1 >>= 1, s += 2) + if (!(fd & (fd1 >> 1)) && ((fdp | fd) & fd1)) + s[1] /= 2; } } }