mirror of
https://github.com/YohannDR/mzm.git
synced 2024-10-07 02:23:20 +00:00
Match MinimapUpdateForCollectedItem
This commit is contained in:
parent
5d98bfcc29
commit
3423a2f2c0
@ -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.
|
||||||
|
|
||||||
2450/2721 functions decompiled (90.04%, 271 left)
|
2451/2721 functions decompiled (90.08%, 270 left)
|
||||||
Progress can be seen here : https://docs.google.com/spreadsheets/d/1X8XarD5evY8ZI7r_GQqh1pYmdVMbBcINYfRBUlogmKY/edit#gid=0
|
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**
|
**This decomp is not shiftable, don't use it as a base to work on anything**
|
||||||
|
@ -468,10 +468,14 @@ void MinimapSetDownloadedTiles(u8 area, u16* dst)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief 6cbd8 | 90 | Updates the minimap for a collected item
|
||||||
|
*
|
||||||
|
* @param xPosition X position
|
||||||
|
* @param yPosition Y position
|
||||||
|
*/
|
||||||
void MinimapUpdateForCollectedItem(u8 xPosition, u8 yPosition)
|
void MinimapUpdateForCollectedItem(u8 xPosition, u8 yPosition)
|
||||||
{
|
{
|
||||||
// https://decomp.me/scratch/pFd7R
|
|
||||||
|
|
||||||
u32 itemX;
|
u32 itemX;
|
||||||
u32 itemY;
|
u32 itemY;
|
||||||
u32 offset;
|
u32 offset;
|
||||||
@ -481,18 +485,18 @@ void MinimapUpdateForCollectedItem(u8 xPosition, u8 yPosition)
|
|||||||
|
|
||||||
if (gCurrentArea < MAX_AMOUNT_OF_AREAS)
|
if (gCurrentArea < MAX_AMOUNT_OF_AREAS)
|
||||||
{
|
{
|
||||||
itemX = (xPosition - 0x2) / 0xF + gCurrentRoomEntry.mapX;
|
itemX = (xPosition - 2) / 15 + gCurrentRoomEntry.mapX;
|
||||||
itemY = (yPosition - 0x2) / 0xA + gCurrentRoomEntry.mapY;
|
itemY = (yPosition - 2) / 10 + gCurrentRoomEntry.mapY;
|
||||||
|
|
||||||
offset = gCurrentArea * MINIMAP_SIZE;
|
offset = gCurrentArea * MINIMAP_SIZE;
|
||||||
ptr = gMinimapTilesWithObtainedItems + offset;
|
ptr = (u32*)(0x2033800) + offset; // gMinimapTilesWithObtainedItems
|
||||||
ptr[itemY] |= sExploredMinimapBitFlags[itemX];
|
ptr[itemY] |= sExploredMinimapBitFlags[itemX];
|
||||||
|
|
||||||
|
|
||||||
itemX += itemY * MINIMAP_SIZE;
|
itemX += itemY * MINIMAP_SIZE;
|
||||||
ptrU = gDecompressedMinimapVisitedTiles + itemX;
|
ptrU = (u16*)0x2034000; // gDecompressedMinimapVisitedTiles
|
||||||
(*ptrU)++;
|
ptrU[itemX]++;
|
||||||
ptrU = gDecompressedMinimapData;
|
ptrU = (u16*)0x2034800; // gDecompressedMinimapData
|
||||||
ptrU[itemX]++;
|
ptrU[itemX]++;
|
||||||
|
|
||||||
gUpdateMinimapFlag = MINIMAP_UPDATE_FLAG_LOWER_LINE;
|
gUpdateMinimapFlag = MINIMAP_UPDATE_FLAG_LOWER_LINE;
|
||||||
|
Loading…
Reference in New Issue
Block a user