5-bits per component has a range of 0-31.
8-bits per component has a range of 0-255.
The simplest way to convert from 5-bit to 8-bit is to multiply each value by 8.
- Code: Select all
0 * 8 = 0
1 * 8 = 8
2 * 8 = 16
...
When you get to the higher numbers it doesn't quite scale properly. For example, a 5-bit [31,31,31] would be intended as pure white so [255,255,255], but multiplying 31 by 8 gives [248,248,248].
Some emulators and programs will use different algorithms to try and achieve a nicer distribution of values.
This post uses floating point to achieve that.
- Code: Select all
for (i = 0; i < 32; i++) {
spread_1[i] = i * 8;
spread_2[i] = i * 8.225807;
spread_3[i] = (i * 8) + (i / 4);
}
These are just a few examples, there are a lot of ways to achieve similar results. I don't know what most emulators use, other than ZSNES multiplying by 8. It was actually Qyzbud who pointed that out to me; he was doing all of the maps using ZSNES and I gave him an image with minisculely different colours and he was furious.
I don't imagine the 8MB version of ZSNES would have been changed to alter video output in any meaningful way, so I wonder if there is a setting in the program itself causing that. I recall it having a setting for the old/new graphics engine. The new engine notably had borked offset-per-tile (dizzy level in Yoshi's Island, probably Tetris Attack too), I wouldn't be surprised if it produced slightly different colours than the old engine too.
I'm led to believe that a real SNES has an uneven distribution when outputting colours over RGB, but this isn't something I got around to verifying. Things supposedly get even more complicated when the brightness bits in $2100 are used. I have a very pretty test ROM for this stuff from a few years back, but we all get inadvertently sidetracked for years at a time, don't we?
rainbowsprinklez wrote:...
Yes, it answered questions to which we already knew the answers and not even things we cared to know. It's typical of an AI to produce a wall of irrelevant, boring text when someone asks it a question. A real person wouldn't do that and I certainly wouldn't do that either...wait...
