From: notaz Date: Sun, 4 Dec 2011 22:11:01 +0000 (+0200) Subject: remove gpu vblank callbacks X-Git-Tag: r12~42 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=24de2dd4dbdd50e44c91c40ebbc7d59ee1c0ac9b;p=pcsx_rearmed.git remove gpu vblank callbacks we do it in core now --- diff --git a/frontend/plugin.c b/frontend/plugin.c index e741a1ad..a5f9830c 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 9003ff8b..e93c12f9 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 43c1a5f9..81a6b285 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 91253915..f7f62487 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 e8d2796b..6f82abd5 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 f9a49bb8..9fa08fe3 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 c275d834..12417e6e 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 c3e13bb2..5ededcb3 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 7da4ae26..344c755e 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