From ea4a16e7665cf6b4a68f5c017b346547d6455470 Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 15 Sep 2011 01:33:57 +0300 Subject: add fixed frameskip option --- plugins/dfxvideo/gpu.c | 2 +- plugins/gpu_neon/gpu.c | 4 ++-- plugins/gpu_neon/gpu.h | 2 +- plugins/gpu_neon/vout_fb.c | 8 +++++--- plugins/gpu_unai/gpu.cpp | 2 +- 5 files changed, 10 insertions(+), 8 deletions(-) (limited to 'plugins') diff --git a/plugins/dfxvideo/gpu.c b/plugins/dfxvideo/gpu.c index 6af6447..d80a265 100644 --- a/plugins/dfxvideo/gpu.c +++ b/plugins/dfxvideo/gpu.c @@ -233,7 +233,7 @@ static void decideSkip(void) if(dwActFixes&0xa0) // -> pc fps calculation fix/old skipping fix { - int skip = (skip_advice && *skip_advice) || fps_skip < fFrameRateHz; + 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; diff --git a/plugins/gpu_neon/gpu.c b/plugins/gpu_neon/gpu.c index 03b0c71..c275d83 100644 --- a/plugins/gpu_neon/gpu.c +++ b/plugins/gpu_neon/gpu.c @@ -61,7 +61,7 @@ static noinline void decide_frameskip(void) { gpu.frameskip.frame_ready = !gpu.frameskip.active; - if (!gpu.frameskip.active && *gpu.frameskip.advice) + if (!gpu.frameskip.active && (*gpu.frameskip.advice || gpu.frameskip.set == 1)) gpu.frameskip.active = 1; else gpu.frameskip.active = 0; @@ -133,7 +133,7 @@ void GPUwriteStatus(uint32_t data) case 0x05: gpu.screen.x = data & 0x3ff; gpu.screen.y = (data >> 10) & 0x3ff; - if (gpu.frameskip.enabled) + if (gpu.frameskip.set) decide_frameskip(); break; case 0x06: diff --git a/plugins/gpu_neon/gpu.h b/plugins/gpu_neon/gpu.h index a0cdbf7..04f69ab 100644 --- a/plugins/gpu_neon/gpu.h +++ b/plugins/gpu_neon/gpu.h @@ -71,7 +71,7 @@ struct psx_gpu { } last_list; } state; struct { - uint32_t enabled:1; + int32_t set:3; /* -1 auto, 0 off, 1 fixed */ uint32_t active:1; uint32_t frame_ready:1; uint32_t skipped_blits:5; diff --git a/plugins/gpu_neon/vout_fb.c b/plugins/gpu_neon/vout_fb.c index b2b5b25..6b687b3 100644 --- a/plugins/gpu_neon/vout_fb.c +++ b/plugins/gpu_neon/vout_fb.c @@ -84,7 +84,7 @@ void GPUupdateLace(void) if (gpu.status.blanking || !gpu.state.fb_dirty) return; - if (gpu.frameskip.enabled) { + if (gpu.frameskip.set) { if (!gpu.frameskip.frame_ready && gpu.frameskip.skipped_blits < 9) { gpu.frameskip.skipped_blits++; return; @@ -100,8 +100,6 @@ void GPUupdateLace(void) long GPUopen(void) { - gpu.frameskip.enabled = cbs->frameskip; - gpu.frameskip.advice = &cbs->fskip_advice; gpu.frameskip.active = 0; gpu.frameskip.frame_ready = 1; @@ -119,6 +117,10 @@ long GPUclose(void) void GPUrearmedCallbacks(const struct rearmed_cbs *cbs_) { cbs = cbs_; + gpu.frameskip.set = cbs->frameskip; + gpu.frameskip.advice = &cbs->fskip_advice; + gpu.frameskip.active = 0; + gpu.frameskip.frame_ready = 1; } // vim:shiftwidth=2:expandtab diff --git a/plugins/gpu_unai/gpu.cpp b/plugins/gpu_unai/gpu.cpp index fefc277..3342d1e 100644 --- a/plugins/gpu_unai/gpu.cpp +++ b/plugins/gpu_unai/gpu.cpp @@ -901,7 +901,7 @@ void GPU_updateLace(void) wasSkip = isSkip = 0; } - skipFrame = cbs->fskip_advice; + skipFrame = cbs->fskip_advice || cbs->frameskip == 1; } long GPUopen(unsigned long *, char *, char *) -- cgit v1.2.3