diff options
author | jdgleaver | 2020-10-19 16:07:23 +0100 |
---|---|---|
committer | jdgleaver | 2020-10-19 16:07:23 +0100 |
commit | aac31071fe29122c2a118c8ee50c7fca4e76a4f7 (patch) | |
tree | 200678a22fc96af9a40f7eb7cd735f5ca87f28aa /src/gfx16.c | |
parent | 8b76b5301822d92545e8f62b07f774715b1a1e8b (diff) | |
download | snes9x2002-aac31071fe29122c2a118c8ee50c7fca4e76a4f7.tar.gz snes9x2002-aac31071fe29122c2a118c8ee50c7fca4e76a4f7.tar.bz2 snes9x2002-aac31071fe29122c2a118c8ee50c7fca4e76a4f7.zip |
Backport colour operations from Snes9x 1.60
Diffstat (limited to 'src/gfx16.c')
-rw-r--r-- | src/gfx16.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gfx16.c b/src/gfx16.c index 51d1240..db35e6a 100644 --- a/src/gfx16.c +++ b/src/gfx16.c @@ -249,6 +249,7 @@ void DrawHiResTile16(uint32 Tile, uint32 Offset, bool8_32 S9xGraphicsInit() { + uint32 r, g, b; uint32 PixelOdd = 1; uint32 PixelEven = 2; @@ -366,6 +367,8 @@ bool8_32 S9xGraphicsInit() DrawHiResClippedTilePtr = DrawHiResClippedTile16; S9xFixColourBrightness(); +#if defined(USE_OLD_COLOUR_OPS) + /* Pre-1.60 colour operations */ if (!(GFX.X2 = (uint16*) malloc(sizeof(uint16) * 0x10000))) return (FALSE); @@ -384,7 +387,6 @@ bool8_32 S9xGraphicsInit() } return (FALSE); } - uint32 r, g, b; // Build a lookup table that multiplies a packed RGB value by 2 with // saturation. @@ -481,6 +483,10 @@ bool8_32 S9xGraphicsInit() } } #endif +#else + if (!(GFX.ZERO = (uint16_t*) malloc(sizeof(uint16_t) * 0x10000))) + return false; +#endif // Build a lookup table that if the top bit of the color value is zero // then the value is zero, otherwise its just the value. @@ -519,6 +525,8 @@ bool8_32 S9xGraphicsInit() void S9xGraphicsDeinit(void) { // Free any memory allocated in S9xGraphicsInit +#if defined(USE_OLD_COLOUR_OPS) + /* Pre-1.60 colour operations */ if (GFX.X2) { free((char*) GFX.X2); @@ -529,6 +537,7 @@ void S9xGraphicsDeinit(void) free((char*) GFX.ZERO_OR_X2); GFX.ZERO_OR_X2 = NULL; } +#endif if (GFX.ZERO) { free((char*) GFX.ZERO); |