21 lines
366 B
C
21 lines
366 B
C
#include <display.h>
|
|
|
|
void dhline(display_t *disp, int x, int y, int width)
|
|
{
|
|
// Check error
|
|
if (y < 0 || y >= 64 || x >= 128)
|
|
return;
|
|
|
|
// culling
|
|
if (x < 0) {
|
|
width = width + x;
|
|
x = 0;
|
|
}
|
|
if (x + width > 128)
|
|
width = 128 - x;
|
|
|
|
// Draw line pixel per pixel x___x
|
|
for ( ; x < width ; ++x)
|
|
disp->vram[(x >> 5) + (y << 2)] |= 0x80000000 >> (x & 31);
|
|
}
|