diff options
author | jdgleaver | 2020-10-15 14:37:46 +0100 |
---|---|---|
committer | jdgleaver | 2020-10-15 14:37:46 +0100 |
commit | 8c24c86a49b23086941814e3ae1d58a2993dac7a (patch) | |
tree | c830b654a33225b1340cd6f8a32fd8bfd926bc3b /source/gfx.c | |
parent | 5f03bb288e72cc19c04060549b486a6311afe9c9 (diff) | |
download | snes9x2005-8c24c86a49b23086941814e3ae1d58a2993dac7a.tar.gz snes9x2005-8c24c86a49b23086941814e3ae1d58a2993dac7a.tar.bz2 snes9x2005-8c24c86a49b23086941814e3ae1d58a2993dac7a.zip |
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..e648259 100644 --- a/source/gfx.c +++ b/source/gfx.c @@ -226,6 +226,8 @@ bool S9xInitGFX(void) GFX.PPLx2 = GFX.Pitch; S9xFixColourBrightness(); +#if defined(PSP) + /* PSP uses 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(PSP) + /* PSP uses 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); |