• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › General Discussion v
« Previous 1 ... 364 365 366 367 368 Next »

[fix] Fragile (and maybe others), source included
View New Posts | View Today's Posts

Pages (5): « Previous 1 2 3 4 5 Next »
Thread Rating:
  • 3 Vote(s) - 2.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
[fix] Fragile (and maybe others), source included
05-23-2009, 04:39 PM
#21
orbb Offline
Junior Member
**
Posts: 15
Threads: 3
Joined: May 2009
hi Smile
here is a piece of code that should check for all the screen, and is faster than the previous code (stops checking after finding a pixel that is not black), but it seems to bug, if you could correct it :p

// [ 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();

...
Find
Reply
05-23-2009, 05:25 PM
#22
death-droid Offline
Member
***
Posts: 180
Threads: 0
Joined: Apr 2009
I'll look into it Tongue
Find
Reply
05-23-2009, 05:49 PM
#23
deathtotheweird Offline
Junior Member
**
Posts: 11
Threads: 1
Joined: Mar 2009
If I may ask, what is the difference between all these codes? I'm saying that because I haven't noticed any real speed difference in any of these (the ones that work properly that is).
Find
Reply
05-23-2009, 05:54 PM (This post was last modified: 05-23-2009, 06:02 PM by death-droid.)
#24
death-droid Offline
Member
***
Posts: 180
Threads: 0
Joined: Apr 2009
Woot got it to work perfectly.(Well almost)
There should now be no flickering.
Thank you very much for you're work Orbb.

Update to the latest svn for the updated version.
EDIT:
I just need people to test this with as much games as they can and tell me if any games are broken with the hack on.
Find
Reply
05-23-2009, 06:12 PM (This post was last modified: 05-23-2009, 06:22 PM by orbb.)
#25
orbb Offline
Junior Member
**
Posts: 15
Threads: 3
Joined: May 2009
no problem Smile
I've just checked your SVN update, and it seems to have a problem in this line :

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;
}
Find
Reply
05-23-2009, 06:28 PM (This post was last modified: 05-23-2009, 06:40 PM by death-droid.)
#26
death-droid Offline
Member
***
Posts: 180
Threads: 0
Joined: Apr 2009
glReadPixels(x, y, 1, 1, color[c], GL_BYTE, &pixels[i]);

The x and y causes the screen to stay black.
I can fix up the second one tho...

I think the problem is with the x and y thing is that nothing is being returned....
Find
Reply
05-23-2009, 06:39 PM (This post was last modified: 05-23-2009, 06:42 PM by orbb.)
#27
orbb Offline
Junior Member
**
Posts: 15
Threads: 3
Joined: May 2009
well this is maybe caused by OpenGL_GetBackbufferHeight() and OpenGL_GetBackbufferWidth()

I assumed that these two fonctions returns the current screen width and height, but its could be wrong...
or its perhaps caused by the fact that there maybe some pixels that are always in the buffer, like fps counter ect., and this code will display the frame because its not pure black...
Find
Reply
05-23-2009, 06:49 PM
#28
downloadaja Offline
Harvest Moon and Rune Factory Maniac
***
Posts: 158
Threads: 4
Joined: Mar 2009
Hey, I tried this option (r3276) and it made Virtua Quest GC won't start the game.
When it should be loading to the new game and continue screen, it hangs instead (there is a black screen before went to new game and continue screen).
Then I remove the check on the remove flicker and the game runs well.

So, I think this should made as an option. Cool
Find
Reply
05-23-2009, 06:52 PM
#29
nosound97 Offline
Cheetahmen on the N64 D:
*******
Posts: 3,552
Threads: 107
Joined: Mar 2009
Well, I've tried some games here. Brawl seems to work ok, but the game which had flickering (Megaman 9) doesn't flicker, but it became a lot slower than before. Going to test more soon...
[Image: 1147431.png]
YouTube channel | Xfire
Find
Reply
05-23-2009, 06:52 PM (This post was last modified: 05-23-2009, 06:57 PM by death-droid.)
#30
death-droid Offline
Member
***
Posts: 180
Threads: 0
Joined: Apr 2009
Ok cool thanks for checking.
orbb I'm pretty sure those are the right functions as well.
I have no idea what's wrong with it.
Find
Reply
« Next Oldest | Next Newest »
Pages (5): « Previous 1 2 3 4 5 Next »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode