diff --git a/ion/platform/simulator/Makefile b/ion/platform/simulator/Makefile index de8721e3a..def0cfc01 100644 --- a/ion/platform/simulator/Makefile +++ b/ion/platform/simulator/Makefile @@ -1,4 +1,4 @@ -objs += $(addprefix ion/platform/simulator/, init.o platform.o) +objs += $(addprefix ion/platform/simulator/, init.o platform.o framebuffer.o) objs += $(addprefix ion/drivers/, fltklcd/fltklcd.o fltkkbd/fltkkbd.o fltkkbd/fltkkbdbutton.o) #SFLAGS += -I/usr/local/Cellar/fltk/1.3.3/include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_THREAD_SAFE -D_REENTRANT diff --git a/ion/platform/simulator/framebuffer.c b/ion/platform/simulator/framebuffer.c new file mode 100644 index 000000000..cae961c94 --- /dev/null +++ b/ion/platform/simulator/framebuffer.c @@ -0,0 +1,11 @@ +#include "framebuffer.h" +#include +#include + +void ion_set_pixel(uint8_t x, uint8_t y, uint8_t color) { + assert(x <= FRAMEBUFFER_WIDTH); + assert(y <= FRAMEBUFFER_HEIGHT); + + char * byte = FRAMEBUFFER_ADDRESS + ((y*FRAMEBUFFER_WIDTH)+x); + *byte = color; +} diff --git a/ion/platform/simulator/framebuffer.h b/ion/platform/simulator/framebuffer.h index ea0739dc9..4ffa25513 100644 --- a/ion/platform/simulator/framebuffer.h +++ b/ion/platform/simulator/framebuffer.h @@ -3,9 +3,9 @@ extern void * PlatformFramebuffer; -#define ION_FRAMEBUFFER_ADDRESS PlatformFramebuffer -#define ION_FRAMEBUFFER_WIDTH 320 -#define ION_FRAMEBUFFER_HEIGHT 240 -#define ION_FRAMEBUFFER_BITS_PER_PIXEL 8 +#define FRAMEBUFFER_ADDRESS PlatformFramebuffer +#define FRAMEBUFFER_WIDTH 320 +#define FRAMEBUFFER_HEIGHT 240 +#define FRAMEBUFFER_BITS_PER_PIXEL 8 #endif