BUILTIN_GPU = neon
DYNAREC = ari64
- DRC_CACHE_BASE = 0
-
ARCH = arm
STATIC_LINKING = 1
BUILTIN_GPU = unai
THREAD_RENDERING = 1
DYNAREC = ari64
- DRC_CACHE_BASE = 0
ARCH = arm
HAVE_NEON = 0
STATIC_LINKING = 1
CC_AS = $(CC)
HAVE_NEON = 1
DYNAREC = ari64
- DRC_CACHE_BASE = 0
BUILTIN_GPU = neon
ARCH = arm
CFLAGS += -D__BLACKBERRY_QNX__ -marm -mcpu=cortex-a9 -mtune=cortex-a9 -mfpu=neon -mfloat-abi=softfp
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
HAVE_NEON = 0
- DRC_CACHE_BASE = 0
BUILTIN_GPU = peops
ifneq (,$(findstring cortexa8,$(platform)))
CFLAGS += -marm -mcpu=cortex-a8
static bool has_rosalina;
-static void check_rosalina() {
+static inline void check_rosalina() {
int64_t version;
uint32_t major;
#endif
memset(info, 0, sizeof(*info));
info->library_name = "PCSX-ReARMed";
- info->library_version = "r22" GIT_VERSION;
+ info->library_version = "r23l" GIT_VERSION;
info->valid_extensions = "bin|cue|img|mdf|pbp|toc|cbn|m3u|chd";
info->need_fullpath = true;
}
output_w32(0xe5900000|rd_rn_rm(rt,15,0));
}
+#ifdef HAVE_ARMV7
static void emit_movw(u_int imm,u_int rt)
{
assert(imm<65536);
assem_debug("movt %s,#%d (0x%x)\n",regname[rt],imm&0xffff0000,imm&0xffff0000);
output_w32(0xe3400000|rd_rn_rm(rt,0,0)|((imm>>16)&0xfff)|((imm>>12)&0xf0000));
}
+#endif
static void emit_movimm(u_int imm,u_int rt)
{
if((r&63)==0)
emit_zeroreg(hr);
else {
- int addr = (int)&psxRegs.GPR.r[r];
+ void *addr;
switch (r) {
//case HIREG: addr = &hi; break;
//case LOREG: addr = &lo; break;
- case CCREG: addr = (int)&cycle_count; break;
- case CSREG: addr = (int)&Status; break;
- case INVCP: addr = (int)&invc_ptr; break;
- case ROREG: addr = (int)&ram_offset; break;
- default: assert(r < 34); break;
+ case CCREG: addr = &cycle_count; break;
+ case CSREG: addr = &Status; break;
+ case INVCP: addr = &invc_ptr; break;
+ case ROREG: addr = &ram_offset; break;
+ default:
+ assert(r < 34);
+ addr = &psxRegs.GPR.r[r];
+ break;
}
- u_int offset = addr-(u_int)&dynarec_local;
+ u_int offset = (u_char *)addr - (u_char *)&dynarec_local;
assert(offset<4096);
assem_debug("ldr %s,fp+%d\n",regname[hr],offset);
output_w32(0xe5900000|rd_rn_rm(hr,FP,0)|offset);
}
#else
if(cv==3&&shift)
- emit_far_call((int)gteMVMVA_part_cv3sh12_arm);
+ emit_far_call(gteMVMVA_part_cv3sh12_arm);
else {
emit_movimm(shift,1);
- emit_far_call((int)(need_flags?gteMVMVA_part_arm:gteMVMVA_part_nf_arm));
+ emit_far_call(need_flags?gteMVMVA_part_arm:gteMVMVA_part_nf_arm);
}
if(need_flags||need_ir)
c2op_call_MACtoIR(lm,need_flags);
if (r == 0)
emit_zeroreg(hr);
else {
- void *addr = &psxRegs.GPR.r[r];
+ void *addr;
switch (r) {
//case HIREG: addr = &hi; break;
//case LOREG: addr = &lo; break;
case CSREG: addr = &Status; break;
case INVCP: addr = &invc_ptr; is64 = 1; break;
case ROREG: addr = &ram_offset; is64 = 1; break;
- default: assert(r < 34); break;
+ default:
+ assert(r < 34);
+ addr = &psxRegs.GPR.r[r];
+ break;
}
if (is64)
emit_readdword(addr, hr);
extern u32 inv_code_start, inv_code_end;
/* cycles/irqs */
-extern unsigned int next_interupt;
+extern u32 next_interupt;
extern int pending_exception;
/* called by drc */
{
SysPrintf("Init new dynarec\n");
+#ifdef _3DS
+ check_rosalina();
+#endif
#ifdef BASE_ADDR_DYNAMIC
#ifdef VITA
- sceBlock = sceKernelAllocMemBlockForVM("code", 1 << TARGET_SIZE_2);
+ sceBlock = getVMBlock(); //sceKernelAllocMemBlockForVM("code", sizeof(*ndrc));
if (sceBlock < 0)
SysPrintf("sceKernelAllocMemBlockForVM failed\n");
int ret = sceKernelGetMemBlockBase(sceBlock, (void **)&ndrc);
if (ret < 0)
SysPrintf("sceKernelGetMemBlockBase failed\n");
+ sceKernelOpenVMDomain();
+ sceClibPrintf("translation_cache = 0x%08lx\n ", (long)ndrc->translation_cache);
+ #elif defined(_MSC_VER)
+ ndrc = VirtualAlloc(NULL, sizeof(*ndrc), MEM_COMMIT | MEM_RESERVE,
+ PAGE_EXECUTE_READWRITE);
#else
uintptr_t desired_addr = 0;
#ifdef __ELF__
/* Pass 1 disassembly */
- for(i=0;!done;i++) {
- dops[i].bt=0;
- dops[i].ooo=0;
+ for (i = 0; !done; i++)
+ {
+ memset(&dops[i], 0, sizeof(dops[i]));
op2=0;
minimum_free_regs[i]=0;
dops[i].opcode=op=source[i]>>26;
do_in_intrp=1;
}
}
- if(do_in_intrp) {
- dops[i-1].rs1=CCREG;
- dops[i-1].rs2=dops[i-1].rt1=dops[i-1].rt2=0;
- ba[i-1]=-1;
- dops[i-1].itype=INTCALL;
- done=2;
+ if (do_in_intrp) {
+ memset(&dops[i-1], 0, sizeof(dops[i-1]));
+ dops[i-1].itype = INTCALL;
+ dops[i-1].rs1 = CCREG;
+ ba[i-1] = -1;
+ done = 2;
i--; // don't compile the DS
}
}
current.u=branch_unneeded_reg[i]&~((1LL<<dops[i+1].rs1)|(1LL<<dops[i+1].rs2));
current.u&=~((1LL<<dops[i].rs1)|(1LL<<dops[i].rs2));
current.u|=1;
- } else { SysPrintf("oops, branch at end of block with no delay slot\n");abort(); }
+ } else {
+ SysPrintf("oops, branch at end of block with no delay slot @%08x\n", start + i*4);
+ abort();
+ }
}
dops[i].is_ds=ds;
if(ds) {
#define USE_MINI_HT 1
//#define REG_PREFETCH 1
-#if defined(__MACH__) || defined(VITA)
+#if defined(__MACH__)
#define NO_WRITE_EXEC 1
#endif
#ifdef VITA
}
void psxBios_malloc() { // 0x33
- unsigned int *chunk, *newchunk = NULL;
+ u32 *chunk, *newchunk = NULL;
unsigned int dsize = 0, csize, cstat;
int colflag;
#ifdef PSXBIOS_LOG
#pragma GCC diagnostic ignored "-Wformat-overflow"
#pragma GCC diagnostic ignored "-Wstringop-truncation"
#endif
+// devkitpro has uint32_t as long, unfortunately
+#ifdef _3DS
+#pragma GCC diagnostic ignored "-Wformat"
+#endif
// System includes
#include <stdio.h>
spu.pSpuBuffer = (unsigned char *)malloc(32768); // alloc mixing buffer
spu.SSumLR = calloc(NSSIZE * 2, sizeof(spu.SSumLR[0]));
- spu.XAStart = // alloc xa buffer
- (uint32_t *)malloc(44100 * sizeof(uint32_t));
+ spu.XAStart = malloc(44100 * sizeof(uint32_t)); // alloc xa buffer
spu.XAEnd = spu.XAStart + 44100;
spu.XAPlay = spu.XAStart;
spu.XAFeed = spu.XAStart;
- spu.CDDAStart = // alloc cdda buffer
- (uint32_t *)malloc(CDDA_BUFFER_SIZE);
+ spu.CDDAStart = malloc(CDDA_BUFFER_SIZE); // alloc cdda buffer
spu.CDDAEnd = spu.CDDAStart + 16384;
spu.CDDAPlay = spu.CDDAStart;
spu.CDDAFeed = spu.CDDAStart;