From 68329d146bff07b3e8a827ed718d86422cebb67b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 16 Aug 2020 04:18:22 +0200 Subject: [PATCH] Fix non-MSVC builds --- cpu/sh2/compiler.c | 2 +- pico/32x/memory.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cpu/sh2/compiler.c b/cpu/sh2/compiler.c index 455f6757..58a65898 100644 --- a/cpu/sh2/compiler.c +++ b/cpu/sh2/compiler.c @@ -462,7 +462,7 @@ static void rcache_free_tmp(int hr); // SR must and R0 should by all means be statically mapped. // XXX the static definition of SR MUST match that in compiler.h -#ifdef __arm__ || defined(_M_ARM) +#if defined(__arm__) || defined(_M_ARM) #include "../drc/emit_arm.c" #elif defined(__aarch64__) || defined(_M_ARM64) #include "../drc/emit_arm64.c" diff --git a/pico/32x/memory.c b/pico/32x/memory.c index d3998bee..7046cb42 100644 --- a/pico/32x/memory.c +++ b/pico/32x/memory.c @@ -1958,7 +1958,11 @@ int p32x_sh2_memcpy(u32 dst, u32 src, int count, int size, SH2 *sh2) return 0; if ((ps = p32x_sh2_get_mem_ptr(src, &mask, sh2)) == (void *)-1) return 0; +#if _MSC_VER (char*)ps += src & mask; +#else + ps += src & mask; +#endif len = count * size; // DRAM in byte access is always in overwrite mode @@ -1968,7 +1972,11 @@ int p32x_sh2_memcpy(u32 dst, u32 src, int count, int size, SH2 *sh2) // align dst to halfword if (dst & 1) { p32x_sh2_write8(dst, *(u8 *)((uptr)ps ^ 1), sh2); +#if _MSC_VER ((char*)ps)++, dst++, len --; +#else + ps++, dst++, len --; +#endif } // copy data