diff options
author | Autechre | 2020-10-15 18:54:26 +0200 |
---|---|---|
committer | GitHub | 2020-10-15 18:54:26 +0200 |
commit | fed55b71325a5cd2ead019b2fe355644f7a6e794 (patch) | |
tree | 976ef8cf2b58958ad4888f97fa736916d6064386 /source/gfx.c | |
parent | 5f03bb288e72cc19c04060549b486a6311afe9c9 (diff) | |
parent | 23294848d036e19ca45b8b511d343c95b9f914e6 (diff) | |
download | snes9x2005-fed55b71325a5cd2ead019b2fe355644f7a6e794.tar.gz snes9x2005-fed55b71325a5cd2ead019b2fe355644f7a6e794.tar.bz2 snes9x2005-fed55b71325a5cd2ead019b2fe355644f7a6e794.zip |
Merge pull request #76 from jdgleaver/optimisations
Backports: Colour operations from Snes9x 1.60 + MIPS optimisations from PocketSNES
Diffstat (limited to 'source/gfx.c')
-rw-r--r-- | source/gfx.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/gfx.c b/source/gfx.c index 00fb4d1..85b58f3 100644 --- a/source/gfx.c +++ b/source/gfx.c @@ -226,6 +226,8 @@ bool S9xInitGFX(void) GFX.PPLx2 = GFX.Pitch; S9xFixColourBrightness(); +#if defined(USE_OLD_COLOUR_OPS) + /* Pre-1.60 colour operations */ if (!(GFX.X2 = (uint16_t*) malloc(sizeof(uint16_t) * 0x10000))) return false; @@ -300,6 +302,10 @@ bool S9xInitGFX(void) } } } +#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. */ @@ -337,6 +343,8 @@ bool S9xInitGFX(void) void S9xDeinitGFX(void) { /* Free any memory allocated in S9xInitGFX */ +#if defined(USE_OLD_COLOUR_OPS) + /* Pre-1.60 colour operations */ if (GFX.X2) { free(GFX.X2); @@ -347,6 +355,7 @@ void S9xDeinitGFX(void) free(GFX.ZERO_OR_X2); GFX.ZERO_OR_X2 = NULL; } +#endif if (GFX.ZERO) { free(GFX.ZERO); |