X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=frontend%2Fcspace.c;h=06167a9024cefe7e0e7d82cafd90420a2d8c3dab;hb=82d29ef8c8dceeceffe5a416425bda810c4eedcc;hp=fb7fba47edffab53939fa4a3cd134ca0f472c29f;hpb=5b5680983b7b3dde95acfe42f58e748d9f7fe1cb;p=pcsx_rearmed.git diff --git a/frontend/cspace.c b/frontend/cspace.c index fb7fba47..06167a90 100644 --- a/frontend/cspace.c +++ b/frontend/cspace.c @@ -8,6 +8,7 @@ * See the COPYING file in the top-level directory. */ +#include #include "cspace.h" /* @@ -30,7 +31,6 @@ || (defined(__GNUC__) && __GNUC__ >= 5)) \ && __BYTE_ORDER__ != __ORDER_BIG_ENDIAN__ -#include #include #if defined(__ARM_NEON) || defined(__ARM_NEON__) @@ -93,7 +93,8 @@ void bgr555_to_rgb565(void * __restrict__ dst_, const void * __restrict__ src_, void bgr555_to_rgb565(void *dst_, const void *src_, int bytes) { - const unsigned int *src = src_; + // source can be misaligned, but it's very rare, so just force + const unsigned int *src = (const void *)((intptr_t)src_ & ~3); unsigned int *dst = dst_; unsigned int x, p, r, g, b;