X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=source%2Fgles2n64%2Fsrc%2Fgles2N64.cpp;h=00fc63e0637155298255e1115f5b4bbabb541845;hb=90768f93ba2dcbda9e1f5b151a7de6cbad05658c;hp=69ec8ed2172a72653b50ed33618318f7348100ee;hpb=34cf40586ac07c54d9bfc5be30f28743232b6d67;p=mupen64plus-pandora.git diff --git a/source/gles2n64/src/gles2N64.cpp b/source/gles2n64/src/gles2N64.cpp index 69ec8ed..00fc63e 100755 --- a/source/gles2n64/src/gles2N64.cpp +++ b/source/gles2n64/src/gles2N64.cpp @@ -139,6 +139,39 @@ EXPORT void CALL ProcessDList(void) { OGL.frame_dl++; +#if 1 + if (config.autoFrameSkip) + { + OGL_UpdateFrameTime(); + + if (OGL.consecutiveSkips < 1) + { + unsigned t = 0; + for(int i = 0; i < OGL_FRAMETIME_NUM; i++) t += OGL.frameTime[i]; + t *= config.targetFPS; + if (config.romPAL) t = (t * 5) / 6; + if (t > (OGL_FRAMETIME_NUM * 1000)) + { + OGL.consecutiveSkips++; + OGL.frameSkipped++; + RSP.busy = FALSE; + RSP.DList++; + *REG.MI_INTR |= MI_INTR_SP | MI_INTR_DP; + CheckInterrupts(); + return; + } + } + } + else if ((OGL.frame_vsync % config.frameRenderRate) != 0) + { + OGL.frameSkipped++; + RSP.busy = FALSE; + RSP.DList++; + *REG.MI_INTR |= MI_INTR_SP | MI_INTR_DP; + CheckInterrupts(); + return; + } +#else if (frameSkipper.willSkipNext()) { OGL.frameSkipped++; @@ -146,13 +179,13 @@ EXPORT void CALL ProcessDList(void) RSP.DList++; /* avoid hang on frameskip */ - *REG.MI_INTR |= MI_INTR_DP; - CheckInterrupts(); - *REG.MI_INTR |= MI_INTR_SP; +// *REG.MI_INTR |= MI_INTR_DP; +// CheckInterrupts(); + *REG.MI_INTR |= MI_INTR_SP | MI_INTR_DP; CheckInterrupts(); return; } - +#endif OGL.consecutiveSkips = 0; RSP_ProcessDList(); OGL.mustRenderDlist = true;