X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?p=pcsx_rearmed.git;a=blobdiff_plain;f=plugins%2Fdfxvideo%2Fgpu.c;h=6af6447d4ba17d9f7f32ed285c3b64e8ec839261;hp=36171b5b3aa1d5e7138ae937c23d2634d2521abf;hb=76f7048eff4f5357df048268e40b5bc6b9387fe5;hpb=79f584137c0e0d77047e54e3ac220575cb4c3354 diff --git a/plugins/dfxvideo/gpu.c b/plugins/dfxvideo/gpu.c index 36171b5b..6af6447d 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 @@ -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; +}