diff --git a/README.md b/README.md index 8689e16f..312383ac 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ This is a work in progress decompilation of Metroid - Zero Mission. -2467/2721 functions decompiled (90.67%, 254 left) +2468/2721 functions decompiled (90.70%, 253 left) Progress can be seen here : https://docs.google.com/spreadsheets/d/1X8XarD5evY8ZI7r_GQqh1pYmdVMbBcINYfRBUlogmKY/edit#gid=0 **This decomp is not shiftable, don't use it as a base to work on anything** diff --git a/include/data/menus/pause_screen_data.h b/include/data/menus/pause_screen_data.h index 1bbed044..6a624a28 100644 --- a/include/data/menus/pause_screen_data.h +++ b/include/data/menus/pause_screen_data.h @@ -12,6 +12,11 @@ extern const u16 sSamusWireframePal[4 * 16]; // ... +extern const u16 sPauseScreen_3fcef0[11 * 16]; +extern const u8 sMinimapAnimatedPaletteOffsets[MAX_AMOUNT_OF_AREAS + 1]; + +// ... + extern const struct PauseScreenAreaIconData sPauseScreenAreaIconsData[MAX_AMOUNT_OF_AREAS]; extern const u16 sPauseScreen_40d0d0[4][4]; diff --git a/src/menus/status_screen.c b/src/menus/status_screen.c index 130c9739..80c976b1 100644 --- a/src/menus/status_screen.c +++ b/src/menus/status_screen.c @@ -6,6 +6,7 @@ #include "data/menus/status_screen.h" #include "data/menus/pause_screen_data.h" +#include "constants/connection.h" #include "constants/demo.h" #include "constants/samus.h" #include "constants/text.h" @@ -24,9 +25,33 @@ void UpdateMinimapAnimatedPalette(void) } +/** + * @brief 6fe18 | cc | Loads the pause screen background palette (To document) + * + */ void LoadPauseScreenBgPalette(void) { + i32 i; + BitFill(3, sPauseScreen_3fcef0[79], &PAUSE_SCREEN_EWRAM.backgroundPalette[sMinimapAnimatedPaletteOffsets[MAX_AMOUNT_OF_AREAS]], + 16 + 2, 16); + + for (i = 0; i < MAX_AMOUNT_OF_AREAS - 1; i++) + { + if ((PAUSE_SCREEN_DATA.areasViewables >> i) & 1) + continue; + + PAUSE_SCREEN_EWRAM.backgroundPalette[sMinimapAnimatedPaletteOffsets[i]] = 0; + } + + if (gCurrentArea < MAX_AMOUNT_OF_AREAS) + PAUSE_SCREEN_EWRAM.backgroundPalette[sMinimapAnimatedPaletteOffsets[gCurrentArea]] = sMinimapAnimatedPalette[0]; + + PAUSE_SCREEN_EWRAM.backgroundPalette[sMinimapAnimatedPaletteOffsets[AREA_DEBUG]] = 0; + PAUSE_SCREEN_EWRAM.backgroundPalette[sMinimapAnimatedPaletteOffsets[MAX_AMOUNT_OF_AREAS]] = 0; + + DMATransfer(3, &PAUSE_SCREEN_EWRAM.backgroundPalette[sMinimapAnimatedPaletteOffsets[MAX_AMOUNT_OF_AREAS]], + PALRAM_BASE + sMinimapAnimatedPaletteOffsets[MAX_AMOUNT_OF_AREAS] * sizeof(u16), 16 + 2, 16); } /**