X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=plugins%2Fdfxvideo%2Fgpu.c;h=0d105f890fb40231504097ab1f243f216a991cae;hp=36171b5b3aa1d5e7138ae937c23d2634d2521abf;hb=b03e0caf5e153551cb71065ffaa4361b7f7e492b;hpb=79f584137c0e0d77047e54e3ac220575cb4c3354 diff --git a/plugins/dfxvideo/gpu.c b/plugins/dfxvideo/gpu.c index 36171b5b..0d105f89 100644 --- a/plugins/dfxvideo/gpu.c +++ b/plugins/dfxvideo/gpu.c @@ -62,6 +62,7 @@ BOOL bDoLazyUpdate=FALSE; uint32_t lGPUInfoVals[16]; static int iFakePrimBusy=0; static uint32_t vBlank=0; +static const int *skip_advice; //////////////////////////////////////////////////////////////////////// // some misc external display funcs @@ -232,7 +233,8 @@ static void decideSkip(void) if(dwActFixes&0xa0) // -> pc fps calculation fix/old skipping fix { - if((fps_skip < fFrameRateHz) && !bSkipNextFrame) // -> skip max one in a row + int skip = (skip_advice && *skip_advice) || fps_skip < fFrameRateHz; + if(skip && !bSkipNextFrame) // -> skip max one in a row {bSkipNextFrame = TRUE; fps_skip=fFrameRateHz;} else bSkipNextFrame = FALSE; } @@ -575,9 +577,9 @@ void CALLBACK GPUwriteStatus(uint32_t gdata) // WRITE STATUS if (!(PSXDisplay.Interlaced)) // stupid frame skipping option { - if(UseFrameSkip) decideSkip(); if(dwActFixes&64) bDoLazyUpdate=TRUE; } + if(UseFrameSkip) decideSkip(); }return; //--------------------------------------------------// // setting width @@ -1040,6 +1042,7 @@ long CALLBACK GPUdmaChain(uint32_t * baseAddrL, uint32_t addr) uint32_t dmaMem; unsigned char * baseAddrB; short count;unsigned int DMACommandCounter = 0; + long dmaWords = 0; GPUIsBusy; @@ -1054,6 +1057,7 @@ long CALLBACK GPUdmaChain(uint32_t * baseAddrL, uint32_t addr) if(CheckForEndlessLoop(addr)) break; count = baseAddrB[addr+3]; + dmaWords += 1 + count; dmaMem=addr+4; @@ -1065,7 +1069,7 @@ long CALLBACK GPUdmaChain(uint32_t * baseAddrL, uint32_t addr) GPUIsIdle; - return 0; + return dmaWords; } //////////////////////////////////////////////////////////////////////// @@ -1132,3 +1136,18 @@ void CALLBACK GPUvBlank(int val) vBlank=val?0x80000000:0; } +// rearmed thing +#include "../../frontend/plugin_lib.h" + +void GPUrearmedCallbacks(const struct rearmed_cbs *cbs) +{ + // sync config + UseFrameSkip = cbs->frameskip; + iUseDither = cbs->gpu_peops.iUseDither; + dwActFixes = cbs->gpu_peops.dwActFixes; + fFrameRateHz = cbs->gpu_peops.fFrameRateHz; + dwFrameRateTicks = cbs->gpu_peops.dwFrameRateTicks; + + skip_advice = &cbs->fskip_advice; + fps_skip = 100.0f; +}