dungeon map documentation done

This commit is contained in:
DizzyEggg
2025-03-07 14:35:34 +01:00
parent ce798ff03e
commit 4734201c6d
35 changed files with 297 additions and 267 deletions

View File

@@ -1,7 +1,7 @@
#ifndef GUARD_DUNGEON_MAP_H
#define GUARD_DUNGEON_MAP_H
extern bool8 gUnknown_202EE00;
extern bool8 gShowMonsterDotsInDungeonMap;
extern bool8 gShowDungeonMap;
void SetDungeonMapToNotShown(void);
@@ -9,12 +9,12 @@ void OpenDungeonMapFile(void);
void InitDungeonMap(bool8 a0);
void CloseDungeonMapFile(void);
void LoadDungeonMapPalette(void);
void sub_80402AC(s32 x, s32 y);
void sub_8040788(void);
void ShowDungeonMapAtPos(s32 x, s32 y);
void CopyDungeonMapToVram(void);
void ShowPlayerDotOnMap(void);
void ResetMapPlayerDotFrames(void);
void sub_8040A84(void);
void sub_8040ABC(bool8 a0);
void sub_8040B60(void);
void ShowWholeRevealedDungeonMap(void);
void UpdateBgTilemapForDungeonMap(bool8 a0);
void TryResetDungeonMapTilesScheduledForCopy(void);
#endif

View File

@@ -52,6 +52,9 @@ enum SpawnFlags
SPAWN_FLAG_UNK7 = 1 << 7, // 0x80 - Not fully understood field. In the dungeon algorithm, it is set to true for all tiles in a Divider secondary structure room.
};
#define VISIBILITY_FLAG_REVEALED 1 // When using Luminous Orb - whole layout is shown, but grayed-out
#define VISIBILITY_FLAG_VISITED 2 // Tile was visited, show filled/white layout
// size: 0x18
typedef struct Tile
{

View File

@@ -82,7 +82,7 @@ typedef struct UnkDungeonGlobal_unk181E8_sub
u8 priority; // x20
/* 0x18209 */ u8 visibilityRange; // x21 Dungeon light level.
/* 0x1820A */ bool8 blinded; // x22 Blacks out the screen when the player has the Blinker status.
bool8 unk1820B; // x23
bool8 allTilesRevealed; // x23
bool8 unk1820C; // x24
bool8 unk1820D; // x25
bool8 showAllFloorItems; // x26
@@ -338,25 +338,27 @@ struct UnkDungeonGlobal_1822C_Sub
u32 arr[8];
};
#define UNK1822C_ARR_COUNT (DUNGEON_MAX_SIZE_Y / 2)
#define UNK1822C_ARR_COUNT_2 (DUNGEON_MAX_SIZE_X / 2)
#define DUNGEON_MAP_MAX_Y (DUNGEON_MAX_SIZE_Y / 2)
#define DUNGEON_MAP_MAX_X (DUNGEON_MAX_SIZE_X / 2)
struct UnkDungeonGlobal_unk1BBEC
struct DungeonMapVramCopy
{
u32 *ptr1;
u32 *ptr2;
u32 *vramPtr;
u32 *mapArrayPtr;
bool8 *boolPtr;
};
#define MAX_SCHEDULED_DUNGEON_MAP_COPIES 40
struct DungeonMap
{
struct UnkDungeonGlobal_1822C_Sub dungeonMap[UNK1822C_ARR_COUNT][UNK1822C_ARR_COUNT_2];
bool8 unk1BA2C[UNK1822C_ARR_COUNT][UNK1822C_ARR_COUNT_2];
struct UnkDungeonGlobal_unk1BBEC unk1BBEC[40];
s32 unk1BDCC;
u8 unk1BDD0;
u8 unk1BDD1;
u8 unk1BDD2;
struct UnkDungeonGlobal_1822C_Sub perTile[DUNGEON_MAP_MAX_Y][DUNGEON_MAP_MAX_X];
bool8 tileScheduledForCopy[DUNGEON_MAP_MAX_Y][DUNGEON_MAP_MAX_X];
struct DungeonMapVramCopy vramCopies[MAX_SCHEDULED_DUNGEON_MAP_COPIES];
s32 scheduledVramCopiesCount;
bool8 copyToVram;
bool8 copyAllAtOnce;
bool8 resetTilesScheduledForCopy;
};
// size: 0x1CEDC

View File

@@ -52,7 +52,13 @@ struct UnkDrawStringStruct
extern UnkTextStruct1 gUnknown_2027370[4];
extern u8 gUnknown_202749A[11];
extern bool8 gUnknown_20274A5;
extern u16 gUnknown_202B038[4][32][32]; // Usage points to these dimensions
// These should probably go to code_8009804.h
#define TILEMAP_TILE_NUM(num)(num & 0x3FF) // bits 0-9
#define TILEMAP_FLIP_HORIZONTAL(f)((f & 1) << 10) // bit 10
#define TILEMAP_FLIP_VERTICAL(f)((f & 1) << 11) // bit 11
#define TILEMAP_PAL(pal)((pal & 0xF) << 12) // bits 12-15
extern u16 gBgTilemaps[4][32][32]; // 4 bgs, 32x32 tiles, y dimension goes before x [bgId][y][x]
extern void (*gIwramTextFunc1)(s32 a0);
extern void (*gIwramTextFunc2)(s32 a0);
extern void (*gIwramTextFunc3)(s32 a0);