From: kub Date: Thu, 18 Nov 2021 21:40:19 +0000 (+0100) Subject: 32x, fix DMA mem-2-mem copying for big endian X-Git-Tag: v2.00~408 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b55e4e1b2f5c8d4914b88974c164720ed832733e;p=picodrive.git 32x, fix DMA mem-2-mem copying for big endian --- diff --git a/pico/32x/memory.c b/pico/32x/memory.c index fe7bc078..9ce7eefd 100644 --- a/pico/32x/memory.c +++ b/pico/32x/memory.c @@ -1999,11 +1999,7 @@ int p32x_sh2_memcpy(u32 dst, u32 src, int count, int size, SH2 *sh2) u16 dl, dh = *sp++; for (i = 0; i < (len & ~1); i += 2, dst += 2, sp++) { dl = dh, dh = *sp; -#if CPU_IS_LE p32x_sh2_write16(dst, (dh >> 8) | (dl << 8), sh2); -#else - p32x_sh2_write16(dst, (dl >> 8) | (dh << 8), sh2); -#endif } if (len & 1) p32x_sh2_write8(dst, dh, sh2); @@ -2035,7 +2031,7 @@ int p32x_sh2_memcpy(u32 dst, u32 src, int count, int size, SH2 *sh2) dst += 2; } if (len & 1) - p32x_sh2_write8(dst, ((u8 *)sp)[MEM_BE2(0)], sh2); + p32x_sh2_write8(dst, *sp >> 8, sh2); } return count;