void vbedrawcharbg(unsigned char c, int x, int y, argb32_t fg, argb32_t bg) { long cy; long incr = vbescreen.w * (vbescreen.nbpp >> 3); uint8_t *glyph = (uint8_t *)vgafontbuf + ((int)c << 3); uint8_t *ptr = vbepixadr(x, y); uint8_t mask; for (cy = 0 ; cy < VGAGLYPHH >> 1 ; cy++) { mask = *glyph; gfxsetrgb888((mask & 0x80) ? fg : bg, ptr); gfxsetrgb888((mask & 0x40) ? fg : bg, ptr + 3); gfxsetrgb888((mask & 0x20) ? fg : bg, ptr + 6); gfxsetrgb888((mask & 0x10) ? fg : bg, ptr + 9); gfxsetrgb888((mask & 0x08) ? fg : bg, ptr + 12); gfxsetrgb888((mask & 0x04) ? fg : bg, ptr + 15); gfxsetrgb888((mask & 0x02) ? fg : bg, ptr + 18); gfxsetrgb888((mask & 0x01) ? fg : bg, ptr + 21); glyph++; ptr += incr; } return; }
INLINE void vbeputpix(gfxpix32 pix, uint8_t *ptr) { gfxsetrgb888(pix, ptr); return; }
void vbeputpix(argb32_t pix, int x, int y) { uint8_t *ptr = vbepixadr(x, y); gfxsetrgb888(pix, ptr); return; }
void vbedrawchar(unsigned char c, int x, int y, argb32_t fg, argb32_t bg) { long cy; long incr = vbescreen.w * (vbescreen.nbpp >> 3); // uint8_t *glyph = (uint8_t *)vgafontbuf + ((int)c * vgafonth); uint16_t *glyph = (uint16_t *)vgafontbuf + (int)c * vgafonth; uint8_t *ptr = vbepixadr(x, y); uint16_t mask; for (cy = 0 ; cy < vgafonth ; cy++) { mask = *glyph; #if 0 if (mask & 0x80) { gfxsetrgb888(fg, ptr); } #endif if (mask & 0x40) { gfxsetrgb888(fg, ptr + 3); } if (mask & 0x20) { gfxsetrgb888(fg, ptr + 6); } if (mask & 0x10) { gfxsetrgb888(fg, ptr + 9); } if (mask & 0x08) { gfxsetrgb888(fg, ptr + 12); } if (mask & 0x04) { gfxsetrgb888(fg, ptr + 15); } if (mask & 0x02) { gfxsetrgb888(fg, ptr + 18); } if (mask & 0x01) { gfxsetrgb888(fg, ptr + 21); } glyph++; ptr += incr; } return; }
void vbedrawchar(unsigned char c, int x, int y, gfxpix32 fg) { long lim = vbefonth; long cy; long incr = vbescreen.w * (vbescreen.nbpp >> 3); // uint8_t *glyph = (uint8_t *)vgafontbuf + ((int)c * vbefonth); uint16_t *glyph = (uint16_t *)vgafontbuf + (int)c * vbefonth; uint8_t *ptr = vbepixadr(x, y); uint16_t mask; for (cy = 0 ; cy < lim ; cy++) { mask = *glyph; #if 0 if (mask & 0x80) { gfxsetrgb888(fg, ptr); } #endif if (mask & 0x40) { gfxsetrgb888(fg, ptr); } if (mask & 0x20) { gfxsetrgb888(fg, &ptr[3]); } if (mask & 0x10) { gfxsetrgb888(fg, &ptr[6]); } if (mask & 0x08) { gfxsetrgb888(fg, &ptr[9]); } if (mask & 0x04) { gfxsetrgb888(fg, &ptr[12]); } if (mask & 0x02) { gfxsetrgb888(fg, &ptr[15]); } if (mask & 0x01) { gfxsetrgb888(fg, &ptr[18]); } glyph++; ptr += incr; } return; }
void vbedrawchar(unsigned char c, int x, int y, gfxpix32 fg) { long cy; long incr = vbescreen.w * (vbescreen.nbpp >> 3); uint8_t *glyph = (uint8_t *)vgafontbuf + ((int)c << 3); uint8_t *ptr = vbepixadr(x, y); uint8_t mask; for (cy = 0 ; cy < VGAGLYPHH >> 1 ; cy++) { mask = *glyph; if (mask & 0x80) { gfxsetrgb888(fg, ptr); } if (mask & 0x40) { gfxsetrgb888(fg, ptr + 3); } if (mask & 0x20) { gfxsetrgb888(fg, ptr + 6); } if (mask & 0x10) { gfxsetrgb888(fg, ptr + 9); } if (mask & 0x08) { gfxsetrgb888(fg, ptr + 12); } if (mask & 0x04) { gfxsetrgb888(fg, ptr + 15); } if (mask & 0x02) { gfxsetrgb888(fg, ptr + 18); } if (mask & 0x01) { gfxsetrgb888(fg, ptr + 21); } glyph++; ptr += incr; } return; }
void vbedrawcharbg(unsigned char c, int x, int y, gfxpix32 fg, gfxpix32 bg) { long lim = vbefonth; long cy; long incr = vbescreen.w * (vbescreen.nbpp >> 3); uint16_t *glyph = (uint16_t *)vgafontbuf + (int)c * vbefonth; uint8_t *ptr = vbepixadr(x, y); uint32_t val; uint32_t mask; gfxpix32 pix; if (!bg) { for (cy = 0 ; cy < lim ; cy++) { val = *glyph; pix = fg; mask = -(val & 0x40); pix &= mask; gfxsetrgb888(pix, ptr); pix = fg; mask = -(val & 0x20); pix &= mask; gfxsetrgb888(pix, &ptr[3]); pix = fg; mask = -(val & 0x10); pix &= mask; gfxsetrgb888(pix, &ptr[6]); pix = fg; mask = -(val & 0x08); pix &= mask; gfxsetrgb888(pix, &ptr[9]); pix = fg; mask = -(val & 0x04); pix &= mask; gfxsetrgb888(pix, &ptr[12]); pix = fg; mask = -(val & 0x02); pix &= mask; gfxsetrgb888(pix, &ptr[15]); pix = fg; mask = -(val & 0x01); pix &= mask; gfxsetrgb888(pix, &ptr[18]); ptr += incr; glyph++; } } else { for (cy = 0 ; cy < lim ; cy++) { mask = *glyph; if (mask & 0x40) { gfxsetrgb888(fg, ptr); } else { gfxsetrgb888(bg, ptr); } if (mask & 0x20) { gfxsetrgb888(fg, &ptr[3]); } else { gfxsetrgb888(bg, &ptr[3]); } if (mask & 0x10) { gfxsetrgb888(fg, &ptr[6]); } else { gfxsetrgb888(bg, &ptr[6]); } if (mask & 0x08) { gfxsetrgb888(fg, &ptr[9]); } else { gfxsetrgb888(bg, &ptr[9]); } if (mask & 0x04) { gfxsetrgb888(fg, &ptr[12]); } else { gfxsetrgb888(bg, &ptr[12]); } if (mask & 0x02) { gfxsetrgb888(fg, &ptr[15]); } else { gfxsetrgb888(bg, &ptr[15]); } if (mask & 0x01) { gfxsetrgb888(fg, &ptr[18]); } else { gfxsetrgb888(bg, &ptr[18]); } ptr += incr; glyph++; } } return; }