Dolphin, the GameCube and Wii emulator - Forums

Full Version: XFB fix for single-core mode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
The text homebrews take forever to load without XFB enabled. XFB only worked in dual-core mode. I did a small fix that makes it work in single-core mode as well.

I modified the Video_UpdateXFB() function in the OGL plugin (main.cpp, line 321). The changed lines are prefixed with '+++'.

Code:
void Video_UpdateXFB(u8* _pXFB, u32 _dwWidth, u32 _dwHeight, s32 _dwYOffset, bool scheduling)
{
    if (g_Config.bUseXFB && XFB_isInit())
    {
        if (scheduling) // from CPU in DC without fifo&CP (some 2D homebrews)
        {
            XFB_SetUpdateArgs(_pXFB, _dwWidth, _dwHeight, _dwYOffset);
            g_XFBUpdateRequested = TRUE;
        }
        else
        {
            if (_pXFB) // from CPU in SC mode
+++            {
                XFB_Draw(_pXFB, _dwWidth, _dwHeight, _dwYOffset);
+++                g_VideoInitialize.pCopiedToXFB();
+++            }
            else // from GP in DC without fifo&CP (some 2D homebrews)
            {
                XFB_Draw();
                g_XFBUpdateRequested = FALSE;
            }
        }
    }
}

Is it right? Or has it already been tried but dropped it didn't work?

EDIT: attached a patch. I had to upload it as a text file. Rename it to 'xfb_single_core.patch' .

LuisR14

shown better Tongue (the "[code']" bbtag shows the "[b']" bbtag as text themselves Tongue)

Quote:void Video_UpdateXFB(u8* _pXFB, u32 _dwWidth, u32 _dwHeight, s32 _dwYOffset, bool scheduling)
{
if (g_Config.bUseXFB && XFB_isInit())
{
if (scheduling) // from CPU in DC without fifo&CP (some 2D homebrews)
{
XFB_SetUpdateArgs(_pXFB, _dwWidth, _dwHeight, _dwYOffset);
g_XFBUpdateRequested = TRUE;
}
else
{
if (_pXFB) // from CPU in SC mode
{
XFB_Draw(_pXFB, _dwWidth, _dwHeight, _dwYOffset);
g_VideoInitialize.pCopiedToXFB();
}
else // from GP in DC without fifo&CP (some 2D homebrews)
{
XFB_Draw();
g_XFBUpdateRequested = FALSE;
}
}
}
}
Hmm... the new parts are now boldened, but the tabs are completely lost. I'll stick to the [code] tags, but find another way to highlight the new lines.
Anyway thank you for pointing this out! Wink

LuisR14

yea i noticed that Undecided
Code with tabs lost is harder to copy-paste. Because you have to manually add the tabs. Annoying when the code snippet is big.
OR you could just post a patch/diff file Tongue
makes it easier for us al
I'm so new
I don't know how to make such files. Maybe I can make them with TortoiseSVN?
ye you can make them with tortoiseSVN Wink
right click in the folder where the adjusted file is
tortoisesvn->create patch
the rest should be logical
Thank you! I just uploaded a patch.
(04-23-2009, 08:53 PM)Luigi__ Wrote: [ -> ]Thank you! I just uploaded a patch.
where did you upload the patch? :/
Pages: 1 2