spu: clean up unneeded code
[pcsx_rearmed.git] / plugins / dfxvideo / gpu.c
index b384526..d80a265 100644 (file)
@@ -62,6 +62,7 @@ BOOL              bDoLazyUpdate=FALSE;
 uint32_t          lGPUInfoVals[16];
 static int        iFakePrimBusy=0;
 static uint32_t   vBlank=0;
+static const int  *skip_advice;
 
 ////////////////////////////////////////////////////////////////////////
 // some misc external display funcs
@@ -232,7 +233,8 @@ static void decideSkip(void)
 
  if(dwActFixes&0xa0)                                   // -> pc fps calculation fix/old skipping fix
   {
-   if((fps_skip < fFrameRateHz) && !bSkipNextFrame)    // -> skip max one in a row
+   int skip = (skip_advice && *skip_advice) || UseFrameSkip == 1 || fps_skip < fFrameRateHz;
+   if(skip && !bSkipNextFrame)                         // -> skip max one in a row
        {bSkipNextFrame = TRUE; fps_skip=fFrameRateHz;}
    else bSkipNextFrame = FALSE;
   }
@@ -647,7 +649,7 @@ void CALLBACK GPUwriteStatus(uint32_t gdata)      // WRITE STATUS
        }
       lGPUstatusRet|=GPUSTATUS_INTERLACED;
      }
-    else lGPUstatusRet&=~GPUSTATUS_INTERLACED;
+    else lGPUstatusRet&=~(GPUSTATUS_INTERLACED|0x80000000);
 
     if (PSXDisplay.PAL)
          lGPUstatusRet|=GPUSTATUS_PAL;
@@ -1040,6 +1042,7 @@ long CALLBACK GPUdmaChain(uint32_t * baseAddrL, uint32_t addr)
  uint32_t dmaMem;
  unsigned char * baseAddrB;
  short count;unsigned int DMACommandCounter = 0;
+ long dmaWords = 0;
 
  GPUIsBusy;
 
@@ -1054,6 +1057,7 @@ long CALLBACK GPUdmaChain(uint32_t * baseAddrL, uint32_t addr)
    if(CheckForEndlessLoop(addr)) break;
 
    count = baseAddrB[addr+3];
+   dmaWords += 1 + count;
 
    dmaMem=addr+4;
 
@@ -1065,7 +1069,7 @@ long CALLBACK GPUdmaChain(uint32_t * baseAddrL, uint32_t addr)
 
  GPUIsIdle;
 
- return 0;
+ return dmaWords;
 }
 
 ////////////////////////////////////////////////////////////////////////
@@ -1132,3 +1136,21 @@ void CALLBACK GPUvBlank(int val)
  vBlank=val?0x80000000:0;
 }
 
+// rearmed thing
+#include "../../frontend/plugin_lib.h"
+
+const struct rearmed_cbs *rcbs;
+
+void GPUrearmedCallbacks(const struct rearmed_cbs *cbs)
+{
+ // sync config
+ UseFrameSkip = cbs->frameskip;
+ iUseDither = cbs->gpu_peops.iUseDither;
+ dwActFixes = cbs->gpu_peops.dwActFixes;
+ fFrameRateHz = cbs->gpu_peops.fFrameRateHz;
+ dwFrameRateTicks = cbs->gpu_peops.dwFrameRateTicks;
+
+ skip_advice = &cbs->fskip_advice;
+ fps_skip = 100.0f;
+ rcbs = cbs;
+}