Match MinimapSetDownloadedTiles

This commit is contained in:
y.demaisonregne 2023-07-02 13:15:18 +02:00
parent d0d79dcfdf
commit 6b4cf3b608
2 changed files with 13 additions and 5 deletions

View File

@ -2,7 +2,7 @@
This is a work in progress decompilation of Metroid - Zero Mission. This is a work in progress decompilation of Metroid - Zero Mission.
2661/2721 functions decompiled (97.79%, 60 left) 2662/2721 functions decompiled (97.83%, 59 left)
0x350c18/0x76b014 bytes of data not in blobs (44.69%, 0x41a3fc left) 0x350c18/0x76b014 bytes of data not in blobs (44.69%, 0x41a3fc left)

View File

@ -567,13 +567,19 @@ void MinimapSetTilesWithObtainedItems(u8 area, u16* dst)
} }
} }
/**
* @brief 6cab0 | 128 | Updates the tiles of a minimap with the downloaded tiles
*
* @param area Area
* @param dst Destination pointer
*/
void MinimapSetDownloadedTiles(u8 area, u16* dst) void MinimapSetDownloadedTiles(u8 area, u16* dst)
{ {
// https://decomp.me/scratch/oSyZP
u32* pVisited; u32* pVisited;
s32 i; s32 i;
s32 j; s32 j;
u32 tmp;
u32 tmp2;
pVisited = &sVisitedMinimapTilesPointer[area * MINIMAP_SIZE]; pVisited = &sVisitedMinimapTilesPointer[area * MINIMAP_SIZE];
@ -583,7 +589,8 @@ void MinimapSetDownloadedTiles(u8 area, u16* dst)
{ {
for (j = 0; j < MINIMAP_SIZE; j++, dst++) for (j = 0; j < MINIMAP_SIZE; j++, dst++)
{ {
if (sExploredMinimapBitFlags[j] & *pVisited) tmp2 = *pVisited;
if (sExploredMinimapBitFlags[j] & tmp2)
{ {
if (!(*dst & 0xF000)) if (!(*dst & 0xF000))
*dst |= 0x1000; *dst |= 0x1000;
@ -605,7 +612,8 @@ void MinimapSetDownloadedTiles(u8 area, u16* dst)
{ {
for (j = 0; j < MINIMAP_SIZE; j++, dst++) for (j = 0; j < MINIMAP_SIZE; j++, dst++)
{ {
if (sExploredMinimapBitFlags[j] & *pVisited) tmp = *pVisited;
if (sExploredMinimapBitFlags[j] & tmp)
{ {
if (!(*dst & 0xF000)) if (!(*dst & 0xF000))
*dst |= 0x1000; *dst |= 0x1000;