aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornotaz2011-12-05 00:11:01 +0200
committernotaz2011-12-05 01:08:36 +0200
commit24de2dd4dbdd50e44c91c40ebbc7d59ee1c0ac9b (patch)
tree91bba897e5778752e21366768661ae9cfe0494c3
parentddbaf678c49d33cf60f1eac5069e3275baa2c685 (diff)
downloadpcsx_rearmed-24de2dd4dbdd50e44c91c40ebbc7d59ee1c0ac9b.tar.gz
pcsx_rearmed-24de2dd4dbdd50e44c91c40ebbc7d59ee1c0ac9b.tar.bz2
pcsx_rearmed-24de2dd4dbdd50e44c91c40ebbc7d59ee1c0ac9b.zip
remove gpu vblank callbacks
we do it in core now
-rw-r--r--frontend/plugin.c2
-rw-r--r--frontend/plugin_lib.c4
-rw-r--r--frontend/plugin_lib.h1
-rw-r--r--libpcsxcore/plugins.h4
-rw-r--r--libpcsxcore/psxcounters.c9
-rw-r--r--plugins/dfxvideo/gpu.c8
-rw-r--r--plugins/gpu_neon/gpu.c21
-rw-r--r--plugins/gpu_neon/gpu.h1
-rw-r--r--plugins/gpu_neon/vout_fb.c1
9 files changed, 13 insertions, 38 deletions
diff --git a/frontend/plugin.c b/frontend/plugin.c
index e741a1a..a5f9830 100644
--- a/frontend/plugin.c
+++ b/frontend/plugin.c
@@ -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),
diff --git a/frontend/plugin_lib.c b/frontend/plugin_lib.c
index 9003ff8..e93c12f 100644
--- a/frontend/plugin_lib.c
+++ b/frontend/plugin_lib.c
@@ -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;
}
diff --git a/frontend/plugin_lib.h b/frontend/plugin_lib.h
index 43c1a5f..81a6b28 100644
--- a/frontend/plugin_lib.h
+++ b/frontend/plugin_lib.h
@@ -47,6 +47,7 @@ struct rearmed_cbs {
// gpu options
int frameskip;
int fskip_advice;
+ unsigned int *gpu_hcnt;
struct {
int iUseDither;
int dwActFixes;
diff --git a/libpcsxcore/plugins.h b/libpcsxcore/plugins.h
index 9125391..f7f6248 100644
--- a/libpcsxcore/plugins.h
+++ b/libpcsxcore/plugins.h
@@ -94,7 +94,7 @@ typedef long (CALLBACK* GPUfreeze)(uint32_t, GPUFreeze_t *);
typedef long (CALLBACK* GPUgetScreenPic)(unsigned char *);
typedef long (CALLBACK* GPUshowScreenPic)(unsigned char *);
typedef void (CALLBACK* GPUclearDynarec)(void (CALLBACK *callback)(void));
-typedef void (CALLBACK* GPUvBlank)(int, uint32_t *, uint32_t *);
+typedef void (CALLBACK* GPUvBlank)(int);
// GPU function pointers
extern GPUupdateLace GPU_updateLace;
@@ -119,7 +119,7 @@ extern GPUfreeze GPU_freeze;
extern GPUgetScreenPic GPU_getScreenPic;
extern GPUshowScreenPic GPU_showScreenPic;
extern GPUclearDynarec GPU_clearDynarec;
-extern GPUvBlank GPU_vBlank;
+extern GPUvBlank GPU_vBlank; // unused
// CD-ROM Functions
typedef long (CALLBACK* CDRinit)(void);
diff --git a/libpcsxcore/psxcounters.c b/libpcsxcore/psxcounters.c
index e8d2796..6f82abd 100644
--- a/libpcsxcore/psxcounters.c
+++ b/libpcsxcore/psxcounters.c
@@ -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)
diff --git a/plugins/dfxvideo/gpu.c b/plugins/dfxvideo/gpu.c
index f9a49bb..9fa08fe 100644
--- a/plugins/dfxvideo/gpu.c
+++ b/plugins/dfxvideo/gpu.c
@@ -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"
diff --git a/plugins/gpu_neon/gpu.c b/plugins/gpu_neon/gpu.c
index c275d83..12417e6 100644
--- a/plugins/gpu_neon/gpu.c
+++ b/plugins/gpu_neon/gpu.c
@@ -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
diff --git a/plugins/gpu_neon/gpu.h b/plugins/gpu_neon/gpu.h
index c3e13bb..5ededcb 100644
--- a/plugins/gpu_neon/gpu.h
+++ b/plugins/gpu_neon/gpu.h
@@ -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;
diff --git a/plugins/gpu_neon/vout_fb.c b/plugins/gpu_neon/vout_fb.c
index 7da4ae2..344c755 100644
--- a/plugins/gpu_neon/vout_fb.c
+++ b/plugins/gpu_neon/vout_fb.c
@@ -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