aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraliaspider2015-10-03 04:42:55 +0100
committeraliaspider2015-10-03 04:42:55 +0100
commit0b7f536b486f3f411651573009c3da6063b560ea (patch)
tree2cc7fafb8005ee9181404e68e6cce3d1de1bf0fa
parente87329f47e398760890e8d02a343782fe766728f (diff)
downloadpcsx_rearmed-0b7f536b486f3f411651573009c3da6063b560ea.tar.gz
pcsx_rearmed-0b7f536b486f3f411651573009c3da6063b560ea.tar.bz2
pcsx_rearmed-0b7f536b486f3f411651573009c3da6063b560ea.zip
(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.
-rw-r--r--frontend/libretro.c8
-rw-r--r--libpcsxcore/new_dynarec/new_dynarec.c2
2 files changed, 8 insertions, 2 deletions
diff --git a/frontend/libretro.c b/frontend/libretro.c
index d834579..2964587 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 487f7f0..068ca1e 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