drc: optional address error exception support
[pcsx_rearmed.git] / libpcsxcore / psxcounters.c
index fba2f5c..18bd6a4 100644 (file)
@@ -358,17 +358,23 @@ void psxRcntUpdate()
             }
         }
         
-        // Update lace. (with InuYasha fix)
-        if( hSyncCount >= (Config.VSyncWA ? HSyncTotal[Config.PsxType] / BIAS : HSyncTotal[Config.PsxType]) )
+        // Update lace.
+        if( hSyncCount >= HSyncTotal[Config.PsxType] )
         {
+            u32 status, field = 0;
             rcnts[3].cycleStart += Config.PsxType ? PSXCLK / 50 : PSXCLK / 60;
             hSyncCount = 0;
             frame_counter++;
 
             gpuSyncPluginSR();
-            if ((HW_GPU_STATUS & SWAP32(PSXGPU_ILACE_BITS)) == SWAP32(PSXGPU_ILACE_BITS))
-                HW_GPU_STATUS |= SWAP32(frame_counter << 31);
-            GPU_vBlank(0, SWAP32(HW_GPU_STATUS) >> 31);
+            status = SWAP32(HW_GPU_STATUS) | PSXGPU_FIELD;
+            if ((status & PSXGPU_ILACE_BITS) == PSXGPU_ILACE_BITS) {
+                field = frame_counter & 1;
+                status |= field << 31;
+                status ^= field << 13;
+            }
+            HW_GPU_STATUS = SWAP32(status);
+            GPU_vBlank(0, field);
         }
 
         scheduleRcntBase();
@@ -376,7 +382,7 @@ void psxRcntUpdate()
 
     psxRcntSet();
 
-#ifndef NDEBUG
+#if 0 //ndef NDEBUG
     DebugVSync();
 #endif
 }
@@ -420,18 +426,6 @@ u32 psxRcntRcount( u32 index )
 
     count = _psxRcntRcount( index );
 
-    // Parasite Eve 2 fix.
-    if( Config.RCntFix )
-    {
-        if( index == 2 )
-        {
-            if( rcnts[index].counterState == CountToTarget )
-            {
-                count /= BIAS;
-            }
-        }
-    }
-
     verboseLog( 2, "[RCNT %i] rcount: %x\n", index, count );
 
     return count;