summaryrefslogtreecommitdiff
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
parentd67ecf5d837b1781fae2b315e78b74729242c8e2 (diff)
downloadpcsxr-45979b673181c770b2a2e7c9c3c4c3faec337e31.tar.gz
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
-rw-r--r--data/pcsxr.ui17
-rwxr-xr-xgui/ConfDlg.c2
-rwxr-xr-xgui/Config.c4
-rwxr-xr-xlibpcsxcore/ix86_64/iR3000A-64.c2
-rwxr-xr-xlibpcsxcore/psxcommon.h1
-rwxr-xr-xlibpcsxcore/psxcounters.c25
-rwxr-xr-xlibpcsxcore/psxhw.c4
7 files changed, 47 insertions, 8 deletions
diff --git a/data/pcsxr.ui b/data/pcsxr.ui
index 573f07fb..0b1d94de 100644
--- a/data/pcsxr.ui
+++ b/data/pcsxr.ui
@@ -1846,6 +1846,23 @@
<property name="y_options"></property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton" id="GtkCheckButton_HackFix">
+ <property name="label" translatable="yes">Compatibility hacks (Raystorm/VH-D/MML/Cart World/...)</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="top_attach">13</property>
+ <property name="bottom_attach">14</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
</object>
</child>
<child type="label">
diff --git a/gui/ConfDlg.c b/gui/ConfDlg.c
index c0d774ff..966a58c0 100755
--- a/gui/ConfDlg.c
+++ b/gui/ConfDlg.c
@@ -938,6 +938,7 @@ void OnCpu_Clicked(GtkDialog *dialog, gint arg1, gpointer user_data) {
Config.VSyncWA = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "GtkCheckButton_VSyncWA")));
Config.NoMemcard = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "GtkCheckButton_NoMemcard")));
Config.Widescreen = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "GtkCheckButton_Widescreen")));
+ Config.HackFix = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "GtkCheckButton_HackFix")));
SaveConfig();
@@ -1011,6 +1012,7 @@ void OnConf_Cpu() {
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "GtkCheckButton_VSyncWA")), Config.VSyncWA);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "GtkCheckButton_NoMemcard")), Config.NoMemcard);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "GtkCheckButton_Widescreen")), Config.Widescreen);
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder, "GtkCheckButton_HackFix")), Config.HackFix);
// Setup a handler for when Close or Cancel is clicked
g_signal_connect_data(G_OBJECT(CpuDlg), "response",
diff --git a/gui/Config.c b/gui/Config.c
index 8d6253c2..b09c0f2d 100755
--- a/gui/Config.c
+++ b/gui/Config.c
@@ -145,6 +145,8 @@ int LoadConfig(PcsxConfig *Conf) {
Config.RewindCount = GetValuel(data, "RewindCount");
Config.RewindInterval = GetValuel(data, "RewindInterval");
+ Config.HackFix = GetValuel(data, "HackFix");
+
free(data);
return 0;
@@ -194,5 +196,7 @@ void SaveConfig() {
SetValuel("RewindCount", Config.RewindCount);
SetValuel("RewindInterval", Config.RewindInterval);
+ SetValuel("HackFix", Config.HackFix);
+
fclose(f);
}
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;