mirror of https://github.com/mgba-emu/mgba.git
GB Video: Darken colors in GBA mode
This commit is contained in:
parent
d620faba0a
commit
4767ae42d2
1
CHANGES
1
CHANGES
|
@ -66,6 +66,7 @@ Misc:
|
|||
- GB Audio: Improved audio quality
|
||||
- GB, GBA Audio: Increase max audio volume
|
||||
- GB: Fix VRAM/palette locking (fixes mgba.io/i/1109)
|
||||
- GB Video: Darken colors in GBA mode
|
||||
|
||||
0.6.3: (2017-04-14)
|
||||
Bugfixes:
|
||||
|
|
|
@ -437,10 +437,29 @@ static void GBVideoSoftwareRendererWritePalette(struct GBVideoRenderer* renderer
|
|||
color = softwareRenderer->palette[0];
|
||||
}
|
||||
}
|
||||
softwareRenderer->palette[index] = color;
|
||||
if (renderer->cache) {
|
||||
mCacheSetWritePalette(renderer->cache, index, color);
|
||||
}
|
||||
if (softwareRenderer->model == GB_MODEL_AGB) {
|
||||
unsigned r = M_R5(value);
|
||||
unsigned g = M_G5(value);
|
||||
unsigned b = M_B5(value);
|
||||
r = r * r;
|
||||
g = g * g;
|
||||
b = b * b;
|
||||
#ifdef COLOR_16_BIT
|
||||
r /= 31;
|
||||
g /= 31;
|
||||
b /= 31;
|
||||
color = mColorFrom555(r | (g << 5) | (b << 10));
|
||||
#else
|
||||
r >>= 2;
|
||||
g >>= 2;
|
||||
b >>= 2;
|
||||
color = r | (g << 8) | (b << 16);
|
||||
#endif
|
||||
}
|
||||
softwareRenderer->palette[index] = color;
|
||||
|
||||
if (softwareRenderer->model == GB_MODEL_SGB && !index && GBRegisterLCDCIsEnable(softwareRenderer->lcdc)) {
|
||||
renderer->writePalette(renderer, 0x04, value);
|
||||
|
|
Loading…
Reference in New Issue