1
0

Add basic framebuffer support (probably not working right yet?)

Possibly (probably) calculating wrong pixel values, addresses.
This commit is contained in:
2012-09-07 23:54:04 -04:00
parent 12e890bb8a
commit 38f87f12c5
2 changed files with 58 additions and 0 deletions

27
include/framebuffer.h Normal file
View File

@ -0,0 +1,27 @@
#ifndef FRAMEBUFFER_H
#define FRAMEBUFFER_H
// 1, 2, and 4 bit color are currently unsupported
//#define FB_COLOR_DEPTH_1 1
//#define FB_COLOR_DEPTH_2 2
//#define FB_COLOR_DEPTH_4 4
#define FB_COLOR_DEPTH_8 8
#define FB_COLOR_DEPTH_16 16
#define FB_COLOR_DEPTH_24 24
struct fbdev {
unsigned int pixelwidth, pixelheight;
unsigned int color_depth;
void *fbaddr; //start address of the frame buffer in memory
void *device_ptr; //passed into device
};
struct fb {
unsigned int width, height;
unsigned int color_depth;
struct fbdev *device;
};
int fb_write_pixel(struct fb *f, unsigned int x, unsigned int y, unsigned int r, unsigned int g, unsigned int b);
#endif /* FRAMEBUFFER_H */