cdrom: change pause timing again
[pcsx_rearmed.git] / plugins / dfxvideo / gpu.c
index f9a49bb..1a3f25a 100644 (file)
 ////////////////////////////////////////////////////////////////////////
 
 unsigned char  *psxVub;
-signed   char  *psxVsb;
 unsigned short *psxVuw;
 unsigned short *psxVuw_eom;
-signed   short *psxVsw;
-uint32_t *psxVul;
-int32_t  *psxVsl;
 
 ////////////////////////////////////////////////////////////////////////
 // GPU globals
@@ -60,7 +56,6 @@ long              lSelectedSlot=0;
 BOOL              bDoLazyUpdate=FALSE;
 uint32_t          lGPUInfoVals[16];
 static int        iFakePrimBusy=0;
-static uint32_t   vBlank=0;
 static const int  *skip_advice;
 
 ////////////////////////////////////////////////////////////////////////
@@ -97,12 +92,7 @@ long CALLBACK GPUinit(void)                                // GPU INIT
  //!!! ATTENTION !!!
  psxVub=vram + 512 * 1024;                           // security offset into double sized psx vram!
 
- psxVsb=(signed char *)psxVub;                         // different ways of accessing PSX VRAM
- psxVsw=(signed short *)psxVub;
- psxVsl=(int32_t *)psxVub;
  psxVuw=(unsigned short *)psxVub;
- psxVul=(uint32_t *)psxVub;
-
  psxVuw_eom=psxVuw+1024*512;                    // pre-calc of end of vram
 
  memset(vram,0x00,(512*2)*1024 + (1024*1024));
@@ -472,7 +462,7 @@ uint32_t CALLBACK GPUreadStatus(void)             // READ STATUS
      GPUIsReadyForCommands;
     }
   }
- return lGPUstatusRet | vBlank;
+ return lGPUstatusRet;
 }
 
 ////////////////////////////////////////////////////////////////////////
@@ -986,7 +976,7 @@ ENDVRAM:
          if((gpuDataC==254 && gpuDataP>=3) ||
             (gpuDataC==255 && gpuDataP>=4 && !(gpuDataP&1)))
           {
-           if((gpuDataM[gpuDataP] & 0xF000F000) == 0x50005000)
+           if((gpuDataM[gpuDataP] & HOST2LE32(0xF000F000)) == HOST2LE32(0x50005000))
             gpuDataP=gpuDataC-1;
           }
         }
@@ -1061,8 +1051,8 @@ long CALLBACK GPUdmaChain(uint32_t * baseAddrL, uint32_t addr)
    if(count>0) GPUwriteDataMem(&baseAddrL[dmaMem>>2],count);
 
    addr = GETLE32(&baseAddrL[addr>>2])&0xffffff;
-  }
- while (addr != 0xffffff);
+   } while (!(addr & 0x800000)); // contrary to some documentation, the end-of-linked-list marker is not actually 0xFF'FFFF
+                                  // any pointer with bit 23 set will do.
 
  GPUIsIdle;
 
@@ -1129,11 +1119,6 @@ long CALLBACK GPUfreeze(uint32_t ulGetFreezeData,GPUFreeze_t * pF)
  return 1;
 }
 
-void CALLBACK GPUvBlank(int val)
-{
- vBlank=val?0x80000000:0;
-}
-
 // rearmed thing
 #include "../../frontend/plugin_lib.h"
 
@@ -1149,6 +1134,8 @@ void GPUrearmedCallbacks(const struct rearmed_cbs *cbs)
  dwFrameRateTicks = cbs->gpu_peops.dwFrameRateTicks;
  if (cbs->pl_vout_set_raw_vram)
   cbs->pl_vout_set_raw_vram(psxVub);
+ if (cbs->pl_set_gpu_caps)
+  cbs->pl_set_gpu_caps(0);
 
  skip_advice = &cbs->fskip_advice;
  fps_skip = 100.0f;