summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorSND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2014-07-24 04:06:57 +0000
committerSND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2014-07-24 04:06:57 +0000
commit45979b673181c770b2a2e7c9c3c4c3faec337e31 (patch)
treed429e38fb676d983618992a5de9f00f3d4441a01 /libpcsxcore
parentd67ecf5d837b1781fae2b315e78b74729242c8e2 (diff)
New config param HackFix which enables compatibility hacks on certain games and is disabled by default.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@91052 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
-rwxr-xr-xlibpcsxcore/ix86_64/iR3000A-64.c2
-rwxr-xr-xlibpcsxcore/psxcommon.h1
-rwxr-xr-xlibpcsxcore/psxcounters.c25
-rwxr-xr-xlibpcsxcore/psxhw.c4
4 files changed, 24 insertions, 8 deletions
diff --git a/libpcsxcore/ix86_64/iR3000A-64.c b/libpcsxcore/ix86_64/iR3000A-64.c
index 2785c42c..13cb432c 100755
--- a/libpcsxcore/ix86_64/iR3000A-64.c
+++ b/libpcsxcore/ix86_64/iR3000A-64.c
@@ -1644,7 +1644,7 @@ static void recLW() {
// Delay is memread delay + 1 cycle.
// Seems to work nicely with games that require cycle accuracy like CART World Series.
// TODO: this could be needed with other L ops such as LB.
- INC32M((uptr)&psxRegs.cycle);
+ if (Config.HackFix)INC32M((uptr)&psxRegs.cycle);
}
extern u32 LWL_MASK[4];
diff --git a/libpcsxcore/psxcommon.h b/libpcsxcore/psxcommon.h
index 7e7713e8..fc1a0c02 100755
--- a/libpcsxcore/psxcommon.h
+++ b/libpcsxcore/psxcommon.h
@@ -159,6 +159,7 @@ typedef struct {
u8 PsxType; // PSX_TYPE_NTSC or PSX_TYPE_PAL
u32 RewindCount;
u32 RewindInterval;
+ u8 HackFix;
#ifdef _WIN32
char Lang[256];
#endif
diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c
index 38280d14..000a8929 100755
--- a/libpcsxcore/psxcounters.c
+++ b/libpcsxcore/psxcounters.c
@@ -65,9 +65,7 @@ static const u32 CountToOverflow = 0;
static const u32 CountToTarget = 1;
static const u32 FrameRate[] = { 60, 50 };
-//static const u32 VBlankStart[] = { 240, 256 };
static const u32 VBlankStart[] = { 243, 256 };
-static const u32 HSyncTotal[] = { 263, 313 };
static const u32 SpuUpdInterval[] = { 23, 22 };
#if defined(PSXHW_LOG) && defined(PSXMEM_LOG) && defined(PSXDMA_LOG) // automatic guess if we want trace level logging
@@ -84,6 +82,7 @@ static Rcnt rcnts[ CounterQuantity ];
static u32 hSyncCount = 0;
static u32 spuSyncCount = 0;
+u32 HSyncTotal[PSX_TYPE_PAL+1]; // 2
u32 psxNextCounter = 0, psxNextsCounter = 0;
/******************************************************************************/
@@ -309,8 +308,8 @@ void psxRcntUpdate()
//setIrq( 0x01 );
}
- // Update lace. (with InuYasha fix)
- if( hSyncCount >= (Config.VSyncWA ? HSyncTotal[Config.PsxType] / BIAS : HSyncTotal[Config.PsxType]) )
+ // Update lace. (calculated at psxHsyncCalculate() on init/defreeze)
+ if( hSyncCount >= HSyncTotal[Config.PsxType] )
{
hSyncCount = 0;
@@ -414,7 +413,7 @@ u32 psxRcntRcount( u32 index )
// Parasite Eve 2 fix - artificial clock jitter based on BIAS
// TODO: any other games depend on getting excepted value from RCNT?
- if( index == 2 && rcnts[index].counterState == CountToTarget && (Config.RCntFix || ((rcnts[index].mode & 0x2FF) == JITTER_FLAGS)) )
+ if( Config.HackFix && index == 2 && rcnts[index].counterState == CountToTarget && (Config.RCntFix || ((rcnts[index].mode & 0x2FF) == JITTER_FLAGS)) )
{
/*
*The problem is that...
@@ -466,10 +465,22 @@ u32 psxRcntRtarget( u32 index )
/******************************************************************************/
+void psxHsyncCalculate()
+{
+ HSyncTotal[PSX_TYPE_NTSC] = 263; HSyncTotal[PSX_TYPE_PAL] = 313;
+ if (Config.VSyncWA) {
+ HSyncTotal[Config.PsxType] = HSyncTotal[Config.PsxType] / BIAS;
+ } else if (Config.HackFix) {
+ HSyncTotal[Config.PsxType] = HSyncTotal[Config.PsxType]+1;
+ }
+}
+
void psxRcntInit()
{
s32 i;
+ psxHsyncCalculate();
+
// rcnt 0.
rcnts[0].rate = 1;
rcnts[0].irq = 0x10;
@@ -508,6 +519,10 @@ s32 psxRcntFreeze( gzFile f, s32 Mode )
gzfreeze( &psxNextCounter, sizeof(psxNextCounter) );
gzfreeze( &psxNextsCounter, sizeof(psxNextsCounter) );
+ if (Mode == 0) {
+ psxHsyncCalculate();
+ }
+
return 0;
}
diff --git a/libpcsxcore/psxhw.c b/libpcsxcore/psxhw.c
index c00b8ab8..91aa4b32 100755
--- a/libpcsxcore/psxhw.c
+++ b/libpcsxcore/psxhw.c
@@ -660,7 +660,7 @@ void psxHwWrite32(u32 add, u32 value) {
return;
}
DmaExec(2); // DMA2 chcr (GPU DMA)
- if (HW_DMA2_CHCR == 0x1000401)
+ if (Config.HackFix && HW_DMA2_CHCR == 0x1000401)
dmaGpuListHackEn=TRUE;
return;
@@ -749,7 +749,7 @@ void psxHwWrite32(u32 add, u32 value) {
// MML/Tronbonne is known to use this.
// TODO FIFO is not implemented properly so commands are not exact
// and thus we rely on hack that counter/cdrom irqs are enabled at same time
- if (SWAPu32(value) == 0x1f00000 && (psxHu32ref(0x1070) & 0x44)) {
+ if (Config.HackFix && SWAPu32(value) == 0x1f00000 && (psxHu32ref(0x1070) & 0x44)) {
setIrq( 0x01 );
}
GPU_writeData(value); return;