X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=source%2Fgles2rice%2Fsrc%2FVideo.cpp;h=c4ce74580386be26dad4953493801e8eb12a2841;hb=ca22e7b76883b946060a6b40bb8709c1981e1cf6;hp=d49d8299625dab635d2512a9fb5809ea7f5eb3ea;hpb=468fb36e8cf80df8bbff5d2ad1b800556c010868;p=mupen64plus-pandora.git diff --git a/source/gles2rice/src/Video.cpp b/source/gles2rice/src/Video.cpp index d49d829..c4ce745 100644 --- a/source/gles2rice/src/Video.cpp +++ b/source/gles2rice/src/Video.cpp @@ -101,6 +101,11 @@ ptr_VidExt_GL_SetAttribute CoreVideo_GL_SetAttribute = NULL; ptr_VidExt_GL_GetAttribute CoreVideo_GL_GetAttribute = NULL; ptr_VidExt_GL_SwapBuffers CoreVideo_GL_SwapBuffers = NULL; +// For Fameskip +float mspervi = 1000.0f/60.0f; //default is shortest frame +float numvi = 0.0f; +bool skipping = false; + //--------------------------------------------------------------------------------------- // Forward function declarations @@ -171,12 +176,21 @@ static void UpdateScreenStep2 (void) } g_CritialSection.Lock(); + + //framskip, count vi + numvi++; + if( status.bHandleN64RenderTexture ) g_pFrameBufferManager->CloseRenderTexture(true); + + if (skipping) { + g_CritialSection.Unlock(); + return; + } g_pFrameBufferManager->SetAddrBeDisplayed(*g_GraphicsInfo.VI_ORIGIN_REG); - if( status.gDlistCount == 0 ) + if(status.gDlistCount == 0) { // CPU frame buffer update uint32 width = *g_GraphicsInfo.VI_WIDTH_REG; @@ -326,10 +340,13 @@ static bool StartVideo(void) GenerateCurrentRomOptions(); status.dwTvSystem = CountryCodeToTVSystem(g_curRomInfo.romheader.nCountryID); - if( status.dwTvSystem == TV_SYSTEM_NTSC ) + if( status.dwTvSystem == TV_SYSTEM_NTSC ) { status.fRatio = 0.75f; - else - status.fRatio = 9/11.0f;; + mspervi=1000.0f/60.0f; //for framskipping + } else { + status.fRatio = 9/11.0f; + mspervi=1000.0f/50.0f; //for framskipping + } InitExternalTextures();