fixed fps limiting when using using virtual xfb, now fps = vps, in fact now real xfb is as fast as no using xfb, i'm thinking now that the correct thing is leave it enabled as default, and even remove the option.

the problem is one strange behavior i found, in opengl when xfb is enable, frame limit causes the frame rate to be limited exact half the correct speed, so if you choose auto and the game uses 30 fps you get 15 fps
so in opengl, you have to limit to the exact double of the game speed, 100 to pal games and 120 to ntsc.
in d3d this not happened every time, it just happen when you change some time consuming setting like changing the ssaa or resizing the window, in that case you have to disable and re enable frame limit to get the correct fps
to all the devs please if you can help me debug this, will give you a lot of thanks as i'm short in time to debug this error and is driving me crazy not to find the source of the problem.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5249 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Rodolfo Osvaldo Bogado
2010-03-28 23:51:32 +00:00
parent 6bcae13ff8
commit 49d568488c
7 changed files with 32 additions and 35 deletions

View File

@ -86,7 +86,6 @@ static bool s_bScreenshot = false;
static Common::CriticalSection s_criticalScreenshot;
static char s_sScreenshotName[1024];
static LPDIRECT3DSURFACE9 ScreenShootMEMSurface = NULL;
extern volatile u32 s_swapRequested;
// State translation lookup tables
@ -1013,13 +1012,14 @@ void Renderer::SetBlendMode(bool forceUpdate)
void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
{
if(!fbWidth || !fbHeight)
if (g_bSkipCurrentFrame || !XFBWrited || !fbWidth || !fbHeight)
{
g_VideoInitialize.pCopiedToXFB(false);
return;
}
// this function is called after the XFB field is changed, not after
// EFB is copied to XFB. In this way, flickering is reduced in games
// and seems to also give more FPS in ZTP
if(!XFBWrited)
return;
// and seems to also give more FPS in ZTP
if (field == FIELD_LOWER)
xfbAddr -= fbWidth * 2;
@ -1027,14 +1027,11 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
const XFBSource** xfbSourceList = FBManager.GetXFBSource(xfbAddr, fbWidth, fbHeight, xfbCount);
if (!xfbSourceList || xfbCount == 0)
{
g_VideoInitialize.pCopiedToXFB(false);
return;
}
if (g_bSkipCurrentFrame)
{
g_VideoInitialize.pCopiedToXFB(false);
return;
}
Renderer::ResetAPIState();
// Set the backbuffer as the rendering target