libmonochrome/src/ML_pixel_test.c

22 lines
979 B
C

/* ************************************************************************** */
/* */
/* ML_pixel_test.c */
/* | 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)
{
char *vram, byte;
if(x&~127 || y&~63) return ML_TRANSPARENT;
vram = ML_vram_adress();
byte = 1<<(7-(x&7));
return (vram[(y<<4)+(x>>3)] & byte ? ML_BLACK : ML_WHITE);
}