Snes9x - Proper 16-bit color conversion. Core version number 1.60

Proper 16-bit color conversion
Core version number 1.60
This commit is contained in:
bladeoner 2019-03-26 04:06:43 +01:00 committed by dborth
parent f513ac5e2f
commit 6dcba441ea
3 changed files with 6 additions and 2 deletions

View File

@ -136,6 +136,10 @@ inline uint16 COLOR_ADD(uint16 C1, uint16 C2)
{ {
return ((brightness_cap[ (C1 >> RED_SHIFT_BITS) + (C2 >> RED_SHIFT_BITS) ] << RED_SHIFT_BITS) | return ((brightness_cap[ (C1 >> RED_SHIFT_BITS) + (C2 >> RED_SHIFT_BITS) ] << RED_SHIFT_BITS) |
(brightness_cap[((C1 >> GREEN_SHIFT_BITS) & 0x1f) + ((C2 >> GREEN_SHIFT_BITS) & 0x1f)] << GREEN_SHIFT_BITS) | (brightness_cap[((C1 >> GREEN_SHIFT_BITS) & 0x1f) + ((C2 >> GREEN_SHIFT_BITS) & 0x1f)] << GREEN_SHIFT_BITS) |
// Proper 15->16bit color conversion moves the high bit of green into the low bit.
#if GREEN_SHIFT_BITS == 6
((brightness_cap[((C1 >> 6) & 0x1f) + ((C2 >> 6) & 0x1f)] & 0x10) << 1) |
#endif
(brightness_cap[ (C1 & 0x1f) + (C2 & 0x1f)] )); (brightness_cap[ (C1 & 0x1f) + (C2 & 0x1f)] ));
} }

View File

@ -8,7 +8,7 @@
#define _PIXFORM_H_ #define _PIXFORM_H_
/* RGB565 format */ /* RGB565 format */
#define BUILD_PIXEL_RGB565(R, G, B) (((int)(R) << 11) | ((int)(G) << 6) | (int)(B)) #define BUILD_PIXEL_RGB565(R, G, B) (((int)(R) << 11) | ((int)(G) << 6) | (((int)(G) & 0x10) << 1) | (int)(B))
#define BUILD_PIXEL2_RGB565(R, G, B) (((int)(R) << 11) | ((int)(G) << 5) | (int)(B)) #define BUILD_PIXEL2_RGB565(R, G, B) (((int)(R) << 11) | ((int)(G) << 5) | (int)(B))
#define DECOMPOSE_PIXEL_RGB565(PIX, R, G, B) \ #define DECOMPOSE_PIXEL_RGB565(PIX, R, G, B) \
{ \ { \

View File

@ -8,7 +8,7 @@
#define _SNES9X_H_ #define _SNES9X_H_
#ifndef VERSION #ifndef VERSION
#define VERSION "1.59.2" #define VERSION "1.60"
#endif #endif
#include "port.h" #include "port.h"