mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-18 21:30:38 +01:00
[ion] Fix the framebuffer for simulator
This commit is contained in:
@@ -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
|
||||
|
||||
11
ion/platform/simulator/framebuffer.c
Normal file
11
ion/platform/simulator/framebuffer.c
Normal 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;
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user