You are not logged in.

Read the FAQ and Knowledge Base before posting.
We won't make a 3DS/2DS emulator.



#1 2025-05-04 10:35:31

Adrot
Member
Registered: 2017-12-26
Posts: 2

Screenshot color value differences between 0.9.11 0.9.13

Salutations,
I have recently noticed that the screenshots taken in 0.9.11 have RGB values that actually differ from the observed gameplay (like pure white being 248 instead of 255). This issue seems to have been fixed in 0.9.13. Is it possible to know what file or part of Desmume's code has made this change? Just being directed to the file that has the code that handles these values would help too. I am in a bit of an issue with this late discovery, as it would mean having to retake a lot of screenshots, and I think that finding out the change or cause might help save a lot of time on my end. A theory I've heard of the cause is that it uses bit shifting to go from RGB555 to RGB888. Attempting to fix the screenshots themselves with math expansion still seems to make some color values to be off by 1 or more.

I apologize in advance if this causes more hassle than deemed necessary, considering that the version is fixed in the latest version.

Offline

#2 2025-05-04 16:17:39

zeromus
Radical Ninja
Registered: 2009-01-05
Posts: 6,251

Re: Screenshot color value differences between 0.9.11 0.9.13

Sorry, the GPU code is enormously huge. I doubt it's impossible to pin it down to any one place.
But since you seem technically adroit, let me advise you of the slick way of doing the bit shifting.
248 would have been 31<<3 so you can get back from 248 to 31.
Now, the slick way is to do (31<<3)|(31>>2) which uses the MSB of the source value to populate the bottom 3 bits of the destination value instead of just leaving them at 0.
I understand you need to do the REVERSE of that, probably. Hence: just mask off the bottom 3 bits
New version 255 & ~7 -> 248.

Offline

#3 2025-05-07 12:34:22

Adrot
Member
Registered: 2017-12-26
Posts: 2

Re: Screenshot color value differences between 0.9.11 0.9.13

Thanks (nice reference, too wink ) . Looks like I was on the right track after all. I remedied the situation with the help of a member from VGR, and now white and black values are accurate. Colors are another issue altogether, so I'll go on a case by case basis, as the tool is not that accurate on color values either.
I was thinking of replaying the games via 0.9.13, but it presented new issues too on some 2D images because it shifts them one pixel up and to the right, as presented here with Hotel Dusk: https://i.imgur.com/hqbtaT8.gif
This never happened on 0.9.11, so for now, case by case basis. The community is mostly fine with whatever outcome, so it won't be much of a dilemma.

Last edited by Adrot (2025-05-07 12:35:58)

Offline

Board footer

Powered by FluxBB