notaz.gp2x.de
/
pcsx_rearmed.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Improve SetLoc CDROM command from Duckstation
[pcsx_rearmed.git]
/
libpcsxcore
/
new_dynarec
/
new_dynarec.c
diff --git
a/libpcsxcore/new_dynarec/new_dynarec.c
b/libpcsxcore/new_dynarec/new_dynarec.c
index
f81e991
..
52deb85
100644
(file)
--- a/
libpcsxcore/new_dynarec/new_dynarec.c
+++ b/
libpcsxcore/new_dynarec/new_dynarec.c
@@
-3484,12
+3484,17
@@
void syscall_assemble(int i,struct regstat *i_regs)
void hlecall_assemble(int i,struct regstat *i_regs)
{
void hlecall_assemble(int i,struct regstat *i_regs)
{
+ extern void psxNULL();
signed char ccreg=get_reg(i_regs->regmap,CCREG);
assert(ccreg==HOST_CCREG);
assert(!is_delayslot);
(void)ccreg;
emit_movimm(start+i*4+4,0); // Get PC
signed char ccreg=get_reg(i_regs->regmap,CCREG);
assert(ccreg==HOST_CCREG);
assert(!is_delayslot);
(void)ccreg;
emit_movimm(start+i*4+4,0); // Get PC
- emit_movimm((int)psxHLEt[source[i]&7],1);
+ uint32_t hleCode = source[i] & 0x03ffffff;
+ if (hleCode >= (sizeof(psxHLEt) / sizeof(psxHLEt[0])))
+ emit_movimm((int)psxNULL,1);
+ else
+ emit_movimm((int)psxHLEt[hleCode],1);
emit_addimm(HOST_CCREG,CLOCK_ADJUST(ccadj[i]),HOST_CCREG); // XXX
emit_jmp((int)jump_hlecall);
}
emit_addimm(HOST_CCREG,CLOCK_ADJUST(ccadj[i]),HOST_CCREG); // XXX
emit_jmp((int)jump_hlecall);
}
@@
-7085,6
+7090,10
@@
void new_dynarec_init(void)
{
SysPrintf("Init new dynarec\n");
{
SysPrintf("Init new dynarec\n");
+#ifdef _3DS
+ check_rosalina();
+#endif
+
// allocate/prepare a buffer for translation cache
// see assem_arm.h for some explanation
#if defined(BASE_ADDR_FIXED)
// allocate/prepare a buffer for translation cache
// see assem_arm.h for some explanation
#if defined(BASE_ADDR_FIXED)
@@
-7105,6
+7114,8
@@
void new_dynarec_init(void)
int ret = sceKernelGetMemBlockBase(sceBlock, (void **)&translation_cache);
if (ret < 0)
SysPrintf("sceKernelGetMemBlockBase failed\n");
int ret = sceKernelGetMemBlockBase(sceBlock, (void **)&translation_cache);
if (ret < 0)
SysPrintf("sceKernelGetMemBlockBase failed\n");
+
+ sceKernelOpenVMDomain();
sceClibPrintf("translation_cache = 0x%08X \n ", translation_cache);
#elif defined(_MSC_VER)
base_addr = VirtualAlloc(NULL, 1<<TARGET_SIZE_2, MEM_COMMIT | MEM_RESERVE,
sceClibPrintf("translation_cache = 0x%08X \n ", translation_cache);
#elif defined(_MSC_VER)
base_addr = VirtualAlloc(NULL, 1<<TARGET_SIZE_2, MEM_COMMIT | MEM_RESERVE,
@@
-7121,7
+7132,7
@@
void new_dynarec_init(void)
#else
#ifndef NO_WRITE_EXEC
// not all systems allow execute in data segment by default
#else
#ifndef NO_WRITE_EXEC
// not all systems allow execute in data segment by default
- if (mprotect((void*)BASE_ADDR, 1<<TARGET_SIZE_2, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
+ if (mprotect((void
*)BASE_ADDR, 1<<TARGET_SIZE_2, PROT_READ | PROT_WRITE | PROT_EXEC) != 0)
SysPrintf("mprotect() failed: %s\n", strerror(errno));
#endif
#endif
SysPrintf("mprotect() failed: %s\n", strerror(errno));
#endif
#endif