Hi
I played this morning with the sources of dolphin, and I managed to fix the screen flickering problem in Fragile :p
The basic idea is that I check before each frame is displayed if the frame is black, and I dont display it in this case.
the source included is really basic, it checks only for 5 pixels, it should check for the full screen normally, so some screen wont be displayed... anyway, this is just a fix suggestion, so the devs should try to implement this hack and optimise it
This fix seems to slow the emulation a little, and may break other games...
Ok, here's how to implement it :
- Edit the file source\Plugins\Plugin_VideoOGL\Src\render.cpp
- find the line : OpenGL_SwapBuffers();
- replace it with this piece of code :
// [ fix for Fragile by kamui_kun ...
BYTE pixels [15] ;
glReadPixels(300, 200, 1, 1, GL_RED, GL_BYTE, &pixels[0]);
glReadPixels(300, 400, 1, 1, GL_RED, GL_BYTE, &pixels[1]);
glReadPixels(700, 200, 1, 1, GL_RED, GL_BYTE, &pixels[2]);
glReadPixels(700, 400, 1, 1, GL_RED, GL_BYTE, &pixels[3]);
glReadPixels(500, 300, 1, 1, GL_RED, GL_BYTE, &pixels[4]);
glReadPixels(300, 200, 1, 1, GL_GREEN, GL_BYTE, &pixels[5]);
glReadPixels(300, 400, 1, 1, GL_GREEN, GL_BYTE, &pixels[6]);
glReadPixels(700, 200, 1, 1, GL_GREEN, GL_BYTE, &pixels[7]);
glReadPixels(700, 400, 1, 1, GL_GREEN, GL_BYTE, &pixels[8]);
glReadPixels(500, 300, 1, 1, GL_GREEN, GL_BYTE, &pixels[9]);
glReadPixels(300, 200, 1, 1, GL_BLUE, GL_BYTE, &pixels[10]);
glReadPixels(300, 400, 1, 1, GL_BLUE, GL_BYTE, &pixels[11]);
glReadPixels(700, 200, 1, 1, GL_BLUE, GL_BYTE, &pixels[12]);
glReadPixels(700, 400, 1, 1, GL_BLUE, GL_BYTE, &pixels[13]);
glReadPixels(500, 300, 1, 1, GL_BLUE, GL_BYTE, &pixels[14]);
if((pixels[0] != 0) || (pixels[1] != 0) || (pixels[2] != 0) || (pixels[3] != 0) || (pixels[4] != 0)
|| (pixels[5] != 0) || (pixels[6] != 0) || (pixels[7] != 0) || (pixels[8] != 0) || (pixels[9] != 0)
|| (pixels[10] != 0) || (pixels[11] != 0) || (pixels[12] != 0) || (pixels[13] != 0) || (pixels[14] != 0)
) OpenGL_SwapBuffers();
// ... ]
- compile, and play
I played this morning with the sources of dolphin, and I managed to fix the screen flickering problem in Fragile :p
The basic idea is that I check before each frame is displayed if the frame is black, and I dont display it in this case.
the source included is really basic, it checks only for 5 pixels, it should check for the full screen normally, so some screen wont be displayed... anyway, this is just a fix suggestion, so the devs should try to implement this hack and optimise it
This fix seems to slow the emulation a little, and may break other games...
Ok, here's how to implement it :
- Edit the file source\Plugins\Plugin_VideoOGL\Src\render.cpp
- find the line : OpenGL_SwapBuffers();
- replace it with this piece of code :
// [ fix for Fragile by kamui_kun ...
BYTE pixels [15] ;
glReadPixels(300, 200, 1, 1, GL_RED, GL_BYTE, &pixels[0]);
glReadPixels(300, 400, 1, 1, GL_RED, GL_BYTE, &pixels[1]);
glReadPixels(700, 200, 1, 1, GL_RED, GL_BYTE, &pixels[2]);
glReadPixels(700, 400, 1, 1, GL_RED, GL_BYTE, &pixels[3]);
glReadPixels(500, 300, 1, 1, GL_RED, GL_BYTE, &pixels[4]);
glReadPixels(300, 200, 1, 1, GL_GREEN, GL_BYTE, &pixels[5]);
glReadPixels(300, 400, 1, 1, GL_GREEN, GL_BYTE, &pixels[6]);
glReadPixels(700, 200, 1, 1, GL_GREEN, GL_BYTE, &pixels[7]);
glReadPixels(700, 400, 1, 1, GL_GREEN, GL_BYTE, &pixels[8]);
glReadPixels(500, 300, 1, 1, GL_GREEN, GL_BYTE, &pixels[9]);
glReadPixels(300, 200, 1, 1, GL_BLUE, GL_BYTE, &pixels[10]);
glReadPixels(300, 400, 1, 1, GL_BLUE, GL_BYTE, &pixels[11]);
glReadPixels(700, 200, 1, 1, GL_BLUE, GL_BYTE, &pixels[12]);
glReadPixels(700, 400, 1, 1, GL_BLUE, GL_BYTE, &pixels[13]);
glReadPixels(500, 300, 1, 1, GL_BLUE, GL_BYTE, &pixels[14]);
if((pixels[0] != 0) || (pixels[1] != 0) || (pixels[2] != 0) || (pixels[3] != 0) || (pixels[4] != 0)
|| (pixels[5] != 0) || (pixels[6] != 0) || (pixels[7] != 0) || (pixels[8] != 0) || (pixels[9] != 0)
|| (pixels[10] != 0) || (pixels[11] != 0) || (pixels[12] != 0) || (pixels[13] != 0) || (pixels[14] != 0)
) OpenGL_SwapBuffers();
// ... ]
- compile, and play