[ion] Fix the framebuffer for simulator

This commit is contained in:
Romain Goyet
2015-09-12 21:12:39 +02:00
parent 32264c10ab
commit 1687bad6c2
3 changed files with 16 additions and 5 deletions

View File

@@ -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

View File

@@ -0,0 +1,11 @@
#include "framebuffer.h"
#include <ion.h>
#include <assert.h>
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;
}

View File

@@ -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