CFLAGS += -Wall
CFLAGS += -I. -DINLINE=inline
ifndef DEBUG
+ifeq ($(platform), vita)
+CFLAGS += -O3 -DNDEBUG
+else
CFLAGS += -O2 -DNDEBUG -ffunction-sections
+endif
ifneq ($(APPLE),1)
LDFLAGS += -Wl,--gc-sections
endif
CC = arm-vita-eabi-gcc$(EXE_EXT)
AR = arm-vita-eabi-ar$(EXE_EXT)
CFLAGS += -DVITA
- CFLAGS += -mfloat-abi=hard -ffast-math -mword-relocations -fno-optimize-sibling-calls
- CFLAGS += -marm -mfpu=neon -mcpu=cortex-a9 -march=armv7-a
+ CFLAGS += -marm -mfpu=neon -mcpu=cortex-a9 -march=armv7-a -mfloat-abi=hard -ffast-math
+ CFLAGS += -fno-asynchronous-unwind-tables -ftree-vectorize -funroll-loops
+ CFLAGS += -mword-relocations -fno-unwind-tables
+ CFLAGS += -fno-optimize-sibling-calls
STATIC_LINKING = 1
NO_MMAP = 1
DONT_COMPILE_IN_ZLIB = 1
asm_render = 1
asm_ym2612 = 1
asm_misc = 1
- asm_cdpico = 0
- asm_cdmemory = 0
+ asm_cdpico = 1
+ asm_cdmemory = 1
asm_mix = 1
use_cyclone = 1
use_fame = 0
use_drz80 = 1
use_cz80 = 0
- use_sh2drc = 0
- use_svpdrc = 0
+ use_sh2drc = 1
+ use_svpdrc = 1
# Xbox 360
else ifeq ($(platform), xenon)
#ifdef _MSC_VER
u8 tcache[DRC_TCACHE_SIZE];
+#elif defined(VITA)
+#include <psp2/kernel/sysmem.h>
+u8 *tcache;
+static int sceBlock;
+int getVMBlock();
#else
u8 __attribute__((aligned(4096))) tcache[DRC_TCACHE_SIZE];
#endif
void drc_cmn_init(void)
{
+#ifdef VITA
+ sceBlock = getVMBlock();
+ sceKernelGetMemBlockBase(sceBlock, (void **)&tcache);
+#endif
+
int ret = plat_mem_set_exec(tcache, sizeof(tcache));
elprintf(EL_STATUS, "drc_cmn_init: %p, %zd bytes: %d",
tcache, sizeof(tcache), ret);
#define DRC_TCACHE_SIZE (2*1024*1024)
+#ifdef VITA
+extern u8 *tcache;
+#else
extern u8 tcache[DRC_TCACHE_SIZE];
+#endif
void drc_cmn_init(void);
void drc_cmn_cleanup(void);
void linearFree(void* mem);
static int ctr_svchack_successful = 0;
+
+#elif defined(VITA)
+#define TARGET_SIZE_2 24 // 2^24 = 16 megabytes
+
+#include <psp2/kernel/sysmem.h>
+static int sceBlock;
+int getVMBlock();
+int _newlib_vm_size_user = 1 << TARGET_SIZE_2;
+
#endif
#include <pico/pico_int.h>
void cache_flush_d_inval_i(void *start, void *end)
{
#ifdef __arm__
+ size_t len = (char *)end - (char *)start;
#if defined(__BLACKBERRY_QNX__)
msync(start, end - start, MS_SYNC | MS_CACHE_ONLY | MS_INVALIDATE_ICACHE);
#elif defined(__MACH__)
- size_t len = (char *)end - (char *)start;
sys_dcache_flush(start, len);
sys_icache_invalidate(start, len);
#elif defined(_3DS)
ctr_flush_invalidate_cache();
+#elif defined(VITA)
+ sceKernelSyncVMDomain(sceBlock, start, len);
#else
__clear_cache(start, end);
#endif
exit(1);
}
-
+#elif defined(VITA)
+ int ret = sceKernelOpenVMDomain();
#else
int ret = mprotect(ptr, size, PROT_READ | PROT_WRITE | PROT_EXEC);
if (ret != 0 && log_cb)
#ifdef _3DS
ctr_svchack_successful = ctr_svchack_init();
+#elif defined(VITA)
+ sceBlock = getVMBlock();
#endif
PicoOpt = POPT_EN_STEREO|POPT_EN_FM|POPT_EN_PSG|POPT_EN_Z80