Vhex-kernel/src/lib/display/dvline.c

24 lines
417 B
C

#include <display.h>
void dvline(display_t *disp, int x, int y, int height)
{
// Check error
if (x < 0 || x >= 128 || y >= 64)
return;
// culling
if (y < 0) {
height = height + y;
y = 0;
}
if (y + height > 64)
height = 64 - y;
// get pixel mask
uint32_t pxmask = 0x80000000 >> (x & 31);
// Draw line pixel per pixel x___x
for ( ; y < height ; ++y)
disp->vram[(x >> 5) + (y << 2)] |= pxmask;
}