remove gpu vblank callbacks
authornotaz <notasas@gmail.com>
Sun, 4 Dec 2011 22:11:01 +0000 (00:11 +0200)
committernotaz <notasas@gmail.com>
Sun, 4 Dec 2011 23:08:36 +0000 (01:08 +0200)
we do it in core now

frontend/plugin.c
frontend/plugin_lib.c
frontend/plugin_lib.h
libpcsxcore/plugins.h
libpcsxcore/psxcounters.c
plugins/dfxvideo/gpu.c
plugins/gpu_neon/gpu.c
plugins/gpu_neon/gpu.h
plugins/gpu_neon/vout_fb.c

index e741a1a..a5f9830 100644 (file)
@@ -168,7 +168,7 @@ static const struct {
        DIRECT_GPU(GPUwriteDataMem),
        DIRECT_GPU(GPUdmaChain),
        DIRECT_GPU(GPUfreeze),
-       DIRECT_GPU(GPUvBlank),
+//     DIRECT_GPU(GPUvBlank), // unused
        DIRECT_GPU(GPUrearmedCallbacks),
 
        DUMMY_GPU(GPUdisplayText),
index 9003ff8..e93c12f 100644 (file)
@@ -475,8 +475,12 @@ void pl_start_watchdog(void)
 
 void pl_init(void)
 {
+       extern unsigned int hSyncCount; // from psxcounters
+
        pl_vout_w = pl_vout_h = 256;
        pl_vout_bpp = 16;
 
        tsdev = pl_gun_ts_init();
+
+       pl_rearmed_cbs.gpu_hcnt = &hSyncCount;
 }
index 43c1a5f..81a6b28 100644 (file)
@@ -47,6 +47,7 @@ struct rearmed_cbs {
        // gpu options
        int   frameskip;
        int   fskip_advice;
+       unsigned int *gpu_hcnt;
        struct {
                int   iUseDither;
                int   dwActFixes;
index 9125391..f7f6248 100644 (file)
@@ -94,7 +94,7 @@ typedef long (CALLBACK* GPUfreeze)(uint32_t, GPUFreeze_t *);
 typedef long (CALLBACK* GPUgetScreenPic)(unsigned char *);\r
 typedef long (CALLBACK* GPUshowScreenPic)(unsigned char *);\r
 typedef void (CALLBACK* GPUclearDynarec)(void (CALLBACK *callback)(void));\r
-typedef void (CALLBACK* GPUvBlank)(int, uint32_t *, uint32_t *);\r
+typedef void (CALLBACK* GPUvBlank)(int);\r
 \r
 // GPU function pointers\r
 extern GPUupdateLace    GPU_updateLace;\r
@@ -119,7 +119,7 @@ extern GPUfreeze        GPU_freeze;
 extern GPUgetScreenPic  GPU_getScreenPic;\r
 extern GPUshowScreenPic GPU_showScreenPic;\r
 extern GPUclearDynarec  GPU_clearDynarec;\r
-extern GPUvBlank        GPU_vBlank;\r
+extern GPUvBlank        GPU_vBlank; // unused\r
 \r
 // CD-ROM Functions\r
 typedef long (CALLBACK* CDRinit)(void);\r
index e8d2796..6f82abd 100644 (file)
@@ -71,12 +71,11 @@ static const s32 VerboseLevel     = VERBOSE_LEVEL;
 
 Rcnt rcnts[ CounterQuantity ];
 
-static u32 hSyncCount = 0;
+u32 hSyncCount = 0;
+u32 frame_counter = 0;
 static u32 spuSyncCount = 0;
 static u32 hsync_steps = 0;
-static u32 gpu_wants_hcnt = 0;
 static u32 base_cycle = 0;
-static u32 frame_counter = 0;
 
 u32 psxNextCounter = 0, psxNextsCounter = 0;
 
@@ -295,7 +294,6 @@ void psxRcntUpdate()
         // VSync irq.
         if( hSyncCount == VBlankStart[Config.PsxType] )
         {
-            GPU_vBlank( 1, &hSyncCount, &gpu_wants_hcnt );
             //if( !(HW_GPU_STATUS & PSXGPU_ILACE) ) // hmh
                 HW_GPU_STATUS |= PSXGPU_LCF;
 
@@ -309,7 +307,6 @@ void psxRcntUpdate()
             hSyncCount = 0;
             frame_counter++;
 
-            GPU_vBlank( 0, &hSyncCount, &gpu_wants_hcnt );
             setIrq( 0x01 );
 
             EmuUpdate();
@@ -328,8 +325,6 @@ void psxRcntUpdate()
             hsync_steps = next_vsync;
         if( next_lace && next_lace < hsync_steps )
             hsync_steps = next_lace;
-        if( gpu_wants_hcnt )
-            hsync_steps = 1;
 
         rcnts[3].cycleStart = cycle - leftover_cycles;
         if (Config.PsxType)
index f9a49bb..9fa08fe 100644 (file)
@@ -60,7 +60,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;
 
 ////////////////////////////////////////////////////////////////////////
@@ -472,7 +471,7 @@ uint32_t CALLBACK GPUreadStatus(void)             // READ STATUS
      GPUIsReadyForCommands;
     }
   }
- return lGPUstatusRet | vBlank;
+ return lGPUstatusRet;
 }
 
 ////////////////////////////////////////////////////////////////////////
@@ -1129,11 +1128,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"
 
index c275d83..12417e6 100644 (file)
@@ -94,7 +94,6 @@ long GPUinit(void)
   ret  = vout_init();
   ret |= renderer_init();
 
-  gpu.lcf_hc = &gpu.zero;
   gpu.state.frame_count = 0;
   gpu.state.hcnt = &gpu.zero;
   do_reset();
@@ -463,7 +462,7 @@ uint32_t GPUreadStatus(void)
   if (unlikely(gpu.cmd_len > 0))
     flush_cmd_buffer();
 
-  ret = gpu.status.reg | (*gpu.lcf_hc << 31);
+  ret = gpu.status.reg;
   log_io("gpu_read_status %08x\n", ret);
   return ret;
 }
@@ -506,22 +505,4 @@ long GPUfreeze(uint32_t type, GPUFreeze_t *freeze)
   return 1;
 }
 
-void GPUvBlank(int val, uint32_t *hcnt)
-{
-  gpu.lcf_hc = &gpu.zero;
-  if (gpu.status.interlace) {
-    if (val)
-      gpu.status.lcf ^= 1;
-  }
-  else {
-    gpu.status.lcf = 0;
-    if (!val)
-      gpu.lcf_hc = hcnt;
-  }
-  if (!val)
-    gpu.state.frame_count++;
-
-  gpu.state.hcnt = hcnt;
-}
-
 // vim:shiftwidth=2:expandtab
index c3e13bb..5ededcb 100644 (file)
@@ -61,7 +61,6 @@ struct psx_gpu {
     int offset;
   } dma;
   int cmd_len;
-  const uint32_t *lcf_hc;
   uint32_t zero;
   struct {
     uint32_t fb_dirty:1;
index 7da4ae2..344c755 100644 (file)
@@ -125,6 +125,7 @@ void GPUrearmedCallbacks(const struct rearmed_cbs *cbs_)
   gpu.frameskip.advice = &cbs->fskip_advice;
   gpu.frameskip.active = 0;
   gpu.frameskip.frame_ready = 1;
+  gpu.state.hcnt = cbs->gpu_hcnt;
 }
 
 // vim:shiftwidth=2:expandtab