aboutsummaryrefslogtreecommitdiff
path: root/src/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphics')
-rw-r--r--src/graphics/lfb.c3
-rw-r--r--src/graphics/lfb.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/src/graphics/lfb.c b/src/graphics/lfb.c
index 5e307f4..5494dde 100644
--- a/src/graphics/lfb.c
+++ b/src/graphics/lfb.c
@@ -4,6 +4,7 @@
#include "../graphics/homer.h"
#include "../graphics/glyphs.h"
+#define GRAPHICS_LFB_C
unsigned int width, height, pitch, isrgb; /* dimensions and channel order */
unsigned char *lfb; /* raw frame buffer address */
@@ -79,7 +80,7 @@ void lfb_showpicture()
unsigned char *ptr=lfb;
char *data=homer_data, pixel[4];
- ptr += (height-homer_height)/2*pitch + (width-homer_width)*2;
+ ptr = lfb + (height-homer_height)*pitch + (width-homer_width)*4;
for(y=0;y<homer_height;y++) {
for(x=0;x<homer_width;x++) {
HEADER_PIXEL(data, pixel);
diff --git a/src/graphics/lfb.h b/src/graphics/lfb.h
index ac2e284..2361ec4 100644
--- a/src/graphics/lfb.h
+++ b/src/graphics/lfb.h
@@ -4,6 +4,10 @@
#define GG_MAX_X 128
#define GG_MAX_Y 96
+#ifndef GRAPHICS_LFB_C
+extern unsigned int width, height, pitch, isrgb; /* dimensions and channel order */
+#endif
+
void lfb_init();
void lfb_showpicture();