From e7da795663a6fc9e5adba70e8f061ab1914bb2a2 Mon Sep 17 00:00:00 2001 From: Deokishisu <6993375+Deokishisu@users.noreply.github.com> Date: Wed, 28 Aug 2024 21:26:04 -0400 Subject: [PATCH] Fix SDH leaving out needing to change the declaration of `sBasePaletteGammaTypes` if dynamic pals are in. --- ...and-Redundant-`BuildColorMaps()`-Function.md | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/Optimization-‐-Remove-Expensive-and-Redundant-`BuildColorMaps()`-Function.md b/Optimization-‐-Remove-Expensive-and-Redundant-`BuildColorMaps()`-Function.md index a1cc519..1cf8746 100644 --- a/Optimization-‐-Remove-Expensive-and-Redundant-`BuildColorMaps()`-Function.md +++ b/Optimization-‐-Remove-Expensive-and-Redundant-`BuildColorMaps()`-Function.md @@ -120,7 +120,7 @@ void StartWeather(void) } ``` -If using dynamic palettes, you will need to make the above changes but with an added for loop like so: +**If using dynamic palettes**, you will need to make the above changes but with an added for loop like so: ``` diff void StartWeather(void) { @@ -134,27 +134,24 @@ void StartWeather(void) + sPaletteColorMapTypes = sBasePaletteColorMapTypes; gWeatherPtr->contrastColorMapSpritePalIndex = index; gWeatherPtr->rainSpriteCount = 0; - gWeatherPtr->curRainSpriteIndex = 0; - gWeatherPtr->cloudSpritesCreated = 0; - gWeatherPtr->snowflakeSpriteCount = 0; - gWeatherPtr->ashSpritesCreated = 0; - gWeatherPtr->fogHSpritesCreated = 0; - gWeatherPtr->fogDSpritesCreated = 0; - gWeatherPtr->sandstormSpritesCreated = 0; - gWeatherPtr->sandstormSwirlSpritesCreated = 0; - gWeatherPtr->bubblesSpritesCreated = 0; - gWeatherPtr->lightenedFogSpritePalsCount = 0; - Weather_SetBlendCoeffs(16, 0); - gWeatherPtr->currWeather = 0; - gWeatherPtr->palProcessingState = WEATHER_PAL_STATE_IDLE; - gWeatherPtr->readyForInit = FALSE; - gWeatherPtr->weatherChangeComplete = TRUE; - gWeatherPtr->taskId = CreateTask(Task_WeatherInit, 80); +//... } } ``` -And remove the `BuildColorMaps()` function itself: +Also **if you have dynamic palettes**, make sure you change the definition of `sBasePaletteColorMapTypes`: +``` diff +-static const u8 ALIGNED(2) sBasePaletteColorMapTypes[32] = ++EWRAM_DATA u8 ALIGNED(2) sBasePaletteGammaTypes[32] = { +{ + // background palettes + COLOR_MAP_DARK_CONTRAST, + COLOR_MAP_DARK_CONTRAST, + COLOR_MAP_DARK_CONTRAST, +//... +``` + +And (from now on for both dynamic palettes and vanilla) remove the `BuildColorMaps()` function itself: ``` diff //...