Fix instant camera move with Fade to black
Force palette update imediatly to fix grapical garbage.
#include "DataManager.h"
#include "GameTime.h"
#include "FadeManager.h"
+#include "Palette.h"
#include "data_ptrs.h"
INT16 scroll_x = 0;
@@ -231,11 +232,18 @@ void RenderScreen() {
DISPLAY_OFF
} else if (!fade_timer == 0)
{
- // Set palette black if not already, then restore.
- temp = fade_timer;
- fade_timer = 0;
- ApplyPaletteChange();
- fade_timer = temp;
+ // Immediately set all palettes black while screen renders.
+ #ifdef CGB
+ if (_cpu == CGB_TYPE) {
+ for (UBYTE c = 0; c != 32; ++c) {
+ BkgPaletteBuffer[c] = RGB_BLACK;
+ }
+ set_bkg_palette(0, 8, BkgPaletteBuffer);
+ set_sprite_palette(0, 8, BkgPaletteBuffer);
+ } else
+ #endif
+ OBP0_REG = 0xFF;
+ BGP_REG = 0xFF;
}
// Clear pending rows/ columns
