From: aliaspider Date: Sat, 3 Oct 2015 03:42:55 +0000 (+0100) Subject: (CTR/3DS) some performance tweaks: X-Git-Tag: r24l~868 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0b7f536b486f3f411651573009c3da6063b560ea;p=pcsx_rearmed.git (CTR/3DS) some performance tweaks: - use linearAlloc for vout_buf. - use svcFlushProcessDataCache to flush only the required range, invalidating icache doesn't seem to be required. --- diff --git a/frontend/libretro.c b/frontend/libretro.c index d834579a..29645875 100644 --- a/frontend/libretro.c +++ b/frontend/libretro.c @@ -1341,7 +1341,9 @@ void retro_init(void) exit(1); } -#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L) && !defined(VITA) +#ifdef _3DS + vout_buf = linearMemAlign(VOUT_MAX_WIDTH * VOUT_MAX_HEIGHT * 2, 0x80); +#elif defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L) && !defined(VITA) posix_memalign(&vout_buf, 16, VOUT_MAX_WIDTH * VOUT_MAX_HEIGHT * 2); #else vout_buf = malloc(VOUT_MAX_WIDTH * VOUT_MAX_HEIGHT * 2); @@ -1407,7 +1409,11 @@ void retro_init(void) void retro_deinit(void) { SysClose(); +#ifdef _3DS + linearFree(vout_buf); +#else free(vout_buf); +#endif vout_buf = NULL; } diff --git a/libpcsxcore/new_dynarec/new_dynarec.c b/libpcsxcore/new_dynarec/new_dynarec.c index 487f7f0f..068ca1e7 100644 --- a/libpcsxcore/new_dynarec/new_dynarec.c +++ b/libpcsxcore/new_dynarec/new_dynarec.c @@ -55,7 +55,7 @@ static void __clear_cache(void *start, void *end) { } #elif defined(_3DS) #include "3ds_utils.h" -#define __clear_cache(start,end) ctr_flush_invalidate_cache() +#define __clear_cache(start,end) svcFlushProcessDataCache(0xFFFF8001, start, (end)-(start)) #endif #define MAXBLOCK 4096