gint/src/render-fx/dpixel.c
lephe f33cb3cf80 core: better bootlog API and implementation
* Now uses topti instead of fxlib for text (including MMU failure)
* Fit .pretext into 4k for everything before MMU succeeds
* A short version of sprintf() for dynamic messages
* Support a driver function, status(), to allow early driver debug
* Expose more useful platform information in <gint/mpu.h>
* Expose the first of a few CASIOWIN syscalls
2019-03-06 14:32:51 +01:00

29 lines
494 B
C

#define GINT_NEED_VRAM
#include <gint/display.h>
#include <gint/defs/types.h>
/* dpixel() - change a pixel's color */
void dpixel(int x, int y, color_t color)
{
/* Sanity checks */
if((uint)x >= 128 || (uint)y >= 64) return;
uint32_t *lword = vram + (y << 2) + (x >> 5);
uint32_t mask = 1 << (~x & 31);
switch(color)
{
case color_white:
*lword &= ~mask;
break;
case color_black:
*lword |= mask;
break;
case color_reverse:
*lword ^= mask;
break;
default:
return;
}
}