Dolphin, the GameCube and Wii emulator - Forums

Full Version: [fix] Fragile (and maybe others), source included
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5
More games:

Metroid Prime 2 Echoes doesn't show intro movie at all, but still goes ingame

Mario Kart Double Dash!! became very laggy

Sonic Heroes became laggy in intro and menus

Soul Calibur 2 became laggy at starting, but in game works well

These are Gamecube games I've tested
Thanks again nosound97
Orbb i don't think glReadPixels actually likes the continually changing x and y pos.

mo27772mo

death-droid, please test before commit to svn.
I did....
The hack worked plus i left the unused code there for a reason.

Code:
    u32 pixel = 0;
    glReadPixels(500, 300, 1, 1, GL_RGB, GL_BYTE, &pixel);
    return pixel == 0;

Tongue
Still need a way of checking the whole window for color.
Your code/hack has another issue death-droid. In Fragile at some occasions (mostly occurs when you use a fireplace to save/rest) there is a large horizontal rainbow colored line, and also when you start the game-and press continue to load a save-it hangs for a second with a black screen before it shows the save games. The OP's code and Luis's do not have those issues.
I'm no longer working on the hack Tongue
no need to-to be compteley honest. Luis and Orbb's codes runs fine

LuisR14

(05-23-2009, 05:39 AM)deathtotheweird Wrote: [ -> ]Back on topic-none all the games I own and are on my PC have been broken by this "fix".
obviously it won't break them, it only checks to see if the game is outputing a black screen Tongue

Quote:
(05-23-2009, 04:39 PM)orbb Wrote: [ -> ]// [ fix for Fragile by kamui_kun ...
bool Renderer::IsBlack()
{
char pixels [3];
int x, y;

for(x = 0; x < (int) OpenGL_GetBackbufferHeight(); x++)
{
for(y = 0; y < (int) OpenGL_GetBackbufferWidth(); y++)
{
glReadPixels(x, y, 1, 1, GL_RED, GL_BYTE, &pixels[0]);
glReadPixels(x, y, 1, 1, GL_GREEN, GL_BYTE, &pixels[1]);
glReadPixels(x, y, 1, 1, GL_BLUE, GL_BYTE, &pixels[2]);
if((pixels[0] != 0) || (pixels[1] != 0) || (pixels[2] != 0)) return false;
}
}
return true;
}

void Renderer::SwapBuffers()
{
// [ fix for Fragile by kamui_kun ...
bool pass = false;

if(Renderer::IsBlack()) pass = true;

// ...]

...

if (!pass) OpenGL_SwapBuffers();

...

(05-23-2009, 06:12 PM)orbb Wrote: [ -> ]glReadPixels(500, 300, 1, 1, color[c], GL_BYTE, &pixels[i]);

this check only for the pixel (500, 300)

it should be : glReadPixels(x, y, 1, 1, color[c], GL_BYTE, &pixels[i]);

for checking all the pixels in the screen ...
there is also a problem here :

for (int i = 0; i < 2;i++)
{
for (int c = 0; c < 2 ;c++)
{
glReadPixels(500, 300, 1, 1, color[c], GL_BYTE, &pixels[i]);
if(pixels[i] != 0)
return false;
else
return true;
}
}

it should be something like this :

for (int i = 0; i < 2;i++)
{
glReadPixels(x, y, 1, 1, color[i], GL_BYTE, &pixels[i]);
if(pixels[i] != 0)
return false;
else
return true;
}
*sigh* such wrong coding >_>, don't worry i'm on the job Tongue

LuisR14

woops hehe, forgot about this Big Grin

hmm, orbb's modifications look ok except for this code Smile
Code:
for(x = 0; x < (int) OpenGL_GetBackbufferHeight(); x++)
{
for(y = 0; y < (int) OpenGL_GetBackbufferWidth(); y++)

here it is fixed Smile
Code:
// [ fix for Fragile by kamui_kun ...
bool Renderer::IsBlack()
{
    //char pixels [3];
    int x, y;
    
    for( y = 0; y < (int)OpenGL_GetBackbufferHeight(); y++ ) {
        for( x = 0; x < (int) OpenGL_GetBackbufferWidth(); x++ ) {
            glReadPixels( x, y, 1, 1, GL_RED, GL_BYTE, &pixels[0]);
            glReadPixels( x, y, 1, 1, GL_GREEN, GL_BYTE, &pixels[1]);
            glReadPixels( x, y, 1, 1, GL_BLUE, GL_BYTE, &pixels[2]);
            if( (pixels[0] != 0 ) || (pixels[1] != 0) || (pixels[2] != 0) )
                return false;
        }
    }
    return true;
}

void Renderer::SwapBuffers()
{
    // [ fix for Fragile by kamui_kun ...
    bool pass = false;
    
    if( Renderer::IsBlack() )
        pass = true;
    
    // ...]
    
    ...
    
    if( !pass )
        OpenGL_SwapBuffers();
    
    ...
}

here's a different version that i think is quicker Smile
Code:
// [ fix for Fragile by kamui_kun ...
bool Renderer::IsBlack()
{
    //char pixels [3];
    int pixel;
    int x, y;
    
    for( y = 0; y < (int)OpenGL_GetBackbufferHeight(); y++ ) {
        for( x = 0; x < (int) OpenGL_GetBackbufferWidth(); x++ ) {
            glReadPixels( x, y, 1, 1, GL_RGB, GL_INT, &pixel );
            if( pixel != 0 )
                return false;
        }
    }
    return true;
}

void Renderer::SwapBuffers()
{
    // [ fix for Fragile by kamui_kun ...
    
    // ...]
    
    ...
    
    if( !Renderer::IsBlack() )
        OpenGL_SwapBuffers();
    
    ...
}
John Peterson work on the OpenGL plug-in may be able to add this feature.
Pages: 1 2 3 4 5