From 585bb1ecb49bda5c3ec1112df67474922c2cc04e Mon Sep 17 00:00:00 2001 From: "SND\\ckain_cp" Date: Sat, 2 Mar 2013 21:39:52 +0000 Subject: Dynarec(x64): recompile instructions on FlushCache BIOS call - Fixes XG memcard access. Also added psxJumpText() for easier debugging. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@83304 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- libpcsxcore/ix86_64/iR3000A-64.c | 10 ++++++++++ libpcsxcore/psxbios.c | 2 +- libpcsxcore/psxmem.c | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'libpcsxcore') diff --git a/libpcsxcore/ix86_64/iR3000A-64.c b/libpcsxcore/ix86_64/iR3000A-64.c index e2478d61..9beae9f3 100755 --- a/libpcsxcore/ix86_64/iR3000A-64.c +++ b/libpcsxcore/ix86_64/iR3000A-64.c @@ -199,6 +199,7 @@ static void SetBranch() { MOV32MtoR(EAX, (uptr)&target); MOV32RtoM((uptr)&psxRegs.pc, EAX); CALLFunc((uptr)psxBranchTest); + CALLFunc((uptr)psxJumpTest); StackRes(); RET(); @@ -233,6 +234,7 @@ static void iJump(u32 branchPC) { iStoreCycle(); MOV32ItoM((uptr)&psxRegs.pc, branchPC); CALLFunc((uptr)psxBranchTest); + CALLFunc((uptr)psxJumpTest); StackRes(); @@ -297,6 +299,7 @@ static void iBranch(u32 branchPC, int savectx) { iStoreCycle(); MOV32ItoM((uptr)&psxRegs.pc, branchPC); CALLFunc((uptr)psxBranchTest); + CALLFunc((uptr)psxJumpTest); StackRes(); @@ -491,6 +494,13 @@ static void recError() { if (*p == 0) { recRecompile(); } + else if (psxRegs.ICache_valid == FALSE) { // Xenogears: fixes memory card access with original BIOS (0a_44_FlushCache issue) + //psxCpu->Clear(0x0, 0x20000); + memset(recRAM, 0, 0x10000 * PTRMULT); + recRecompile(); + p = (uptr *)PC_REC(psxRegs.pc); + psxRegs.ICache_valid == TRUE; + } if (*p < (uptr)recMem || *p >= (uptr)recMem + RECMEM_SIZE) { diff --git a/libpcsxcore/psxbios.c b/libpcsxcore/psxbios.c index c818a883..3492361f 100755 --- a/libpcsxcore/psxbios.c +++ b/libpcsxcore/psxbios.c @@ -1070,7 +1070,7 @@ void psxBios_FlushCache() { // 44 PSXBIOS_LOG("psxBios_%s\n", biosA0n[0x44]); #endif - psxRegs.ICache_valid = 0; + psxRegs.ICache_valid = FALSE; pc0 = ra; } diff --git a/libpcsxcore/psxmem.c b/libpcsxcore/psxmem.c index 8215bdaf..73f5bc76 100755 --- a/libpcsxcore/psxmem.c +++ b/libpcsxcore/psxmem.c @@ -334,7 +334,7 @@ void psxMemWrite32(u32 mem, u32 value) { memset(psxMemWLUT + 0x8000, 0, 0x80 * sizeof(void *)); memset(psxMemWLUT + 0xa000, 0, 0x80 * sizeof(void *)); - psxRegs.ICache_valid = 0; + psxRegs.ICache_valid = FALSE; break; case 0x00: case 0x1e988: if (writeok == 1) break; -- cgit v1.2.3