X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=plugins%2Fdfxvideo%2Fgpu.c;h=d80a265cd18c7c0b3544a2c75e4bb53f53d44037;hp=b3845263d0d435eb17fd4f637aae54658ddb8a82;hb=7e44d49d2a65d6e45d6f99f72a8cccdb02654aae;hpb=4215cb1fa3c1f545b2bac62c5fc4c478469a6a46 diff --git a/plugins/dfxvideo/gpu.c b/plugins/dfxvideo/gpu.c index b3845263..d80a265c 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) || UseFrameSkip == 1 || fps_skip < fFrameRateHz; + if(skip && !bSkipNextFrame) // -> skip max one in a row {bSkipNextFrame = TRUE; fps_skip=fFrameRateHz;} else bSkipNextFrame = FALSE; } @@ -647,7 +649,7 @@ void CALLBACK GPUwriteStatus(uint32_t gdata) // WRITE STATUS } lGPUstatusRet|=GPUSTATUS_INTERLACED; } - else lGPUstatusRet&=~GPUSTATUS_INTERLACED; + else lGPUstatusRet&=~(GPUSTATUS_INTERLACED|0x80000000); if (PSXDisplay.PAL) lGPUstatusRet|=GPUSTATUS_PAL; @@ -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,21 @@ void CALLBACK GPUvBlank(int val) vBlank=val?0x80000000:0; } +// rearmed thing +#include "../../frontend/plugin_lib.h" + +const struct rearmed_cbs *rcbs; + +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; + rcbs = cbs; +}