From 41b0802d6ad901f432ae30b5596012a7f516810d Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 25 Feb 2018 21:36:44 +0100 Subject: [PATCH] fb_generic: fix blit2FB for big endian processors Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/87b79858926ae305531d09e7c0bdbddae3b2deab Author: Stefan Seyfried Date: 2018-02-25 (Sun, 25 Feb 2018) --- src/driver/fb_generic.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index 083fbef92..b01698d32 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -41,6 +41,7 @@ #include #include #include +#include #include @@ -1704,7 +1705,14 @@ void CFrameBuffer::blit2FB(void *fbbuff, uint32_t width, uint32_t height, uint32 else { uint8_t *in = (uint8_t *)(pixpos + xp); uint8_t *out = (uint8_t *)d2; +#if __BYTE_ORDER == __LITTLE_ENDIAN int a = in[3]; /* TODO: big/little endian */ +#elif __BYTE_ORDER == __BIG_ENDIAN + int a = in[0]; + out++; in++; +#else +#error neither big nor little endian??? +#endif *out = (*out + ((*in - *out) * a) / 256); in++; out++; *out = (*out + ((*in - *out) * a) / 256);