libmonochrome/src/ML_pixel_test.c

22 lines
964 B
C
Raw Normal View History

/* ************************************************************************** */
/* */
/* ML_pixel_test.c */
2016-04-22 07:06:40 +02:00
/* | Project : libmonochrome */
/* */
/* By: Pierre "PierrotLL" Le Gall <legallpierre89@gmail.com> */
/* Last updated: 2011/11/22 */
/* */
/* ************************************************************************** */
#include <monochrome/internals.h>
ML_Color ML_pixel_test(int x, int y)
{
if (x & ~127 || y & ~63)
return ML_TRANSPARENT;
char *vram = ML_vram_xy(x, y);
int byte = 128 >> (x & 7);
return (*vram & byte ? ML_BLACK : ML_WHITE);
}