Merge branch 'master' into stuff

This commit is contained in:
Kermalis
2025-03-10 00:26:55 -04:00
54 changed files with 1800 additions and 4022 deletions

20
include/dungeon_map.h Normal file
View File

@@ -0,0 +1,20 @@
#ifndef GUARD_DUNGEON_MAP_H
#define GUARD_DUNGEON_MAP_H
extern bool8 gShowMonsterDotsInDungeonMap;
extern bool8 gShowDungeonMap;
void SetDungeonMapToNotShown(void);
void OpenDungeonMapFile(void);
void InitDungeonMap(bool8 a0);
void CloseDungeonMapFile(void);
void LoadDungeonMapPalette(void);
void ShowDungeonMapAtPos(s32 x, s32 y);
void CopyDungeonMapToVram(void);
void ShowPlayerDotOnMap(void);
void ResetMapPlayerDotFrames(void);
void ShowWholeRevealedDungeonMap(void);
void UpdateBgTilemapForDungeonMap(bool8 a0);
void TryResetDungeonMapTilesScheduledForCopy(void);
#endif

View File

@@ -8,6 +8,10 @@
#include "constants/global.h"
#include "constants/monster.h"
#define VERSION_BLUE 0
#define VERSION_RED 1
#define GAME_VERSION VERSION_RED
// IDE support
#if defined(__APPLE__) || defined(__CYGWIN__)
#define _(x) x

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

@@ -1,11 +1,12 @@
#ifndef GUARD_STR_202ED28_H
#define GUARD_STR_202ED28_H
#include "structs/str_position.h"
struct unkStruct_202ED28
{
SpriteOAM sprite;
s16 x;
s16 y;
DungeonPos pos;
};
extern struct unkStruct_202ED28 gUnknown_202ED28[][6];

View File

@@ -0,0 +1,18 @@
#ifndef GUARD_STR_202EDE8_H
#define GUARD_STR_202EDE8_H
#include "structs/dungeon_entity.h"
struct UnkStruct_202EDE8
{
s16 unk0;
s16 unk2;
Entity *unk4;
s32 unk8;
s32 unkC;
s32 unk10;
};
extern struct UnkStruct_202EDE8 gUnknown_202EDE8;
#endif

View File

@@ -82,16 +82,16 @@ 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 unk1820E; // x26
bool8 unk1820F; // x27
bool8 showAllFloorItems; // x26
bool8 showInvisibleTrapsMonsters; // x27
/* 0x18210 */ bool8 hallucinating; // x28 Displays Substitute and flower sprites when the player has the Cross-Eyed status.
bool8 unk18211; // x29
u8 unk18212; // x2A
bool8 unk18213; // x2B
u8 unk18214; // x2C
bool8 inFloorMapMode; // x2C
u8 unk18215; // x2D
u8 unk18216; // x2E
u8 unk18217; // x2F
@@ -332,6 +332,35 @@ typedef struct unkDungeon57C
#define UNK12A18_ARR_COUNT 29
#define UNK12A18_ARR_COUNT_2 9
// Some palette?
struct UnkDungeonGlobal_1822C_Sub
{
u32 arr[8];
};
#define DUNGEON_MAP_MAX_Y (DUNGEON_MAX_SIZE_Y / 2)
#define DUNGEON_MAP_MAX_X (DUNGEON_MAX_SIZE_X / 2)
struct DungeonMapVramCopy
{
u32 *vramPtr;
u32 *mapArrayPtr;
bool8 *boolPtr;
};
#define MAX_SCHEDULED_DUNGEON_MAP_COPIES 40
struct DungeonMap
{
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
typedef struct Dungeon
{
@@ -447,8 +476,8 @@ typedef struct Dungeon
/* 0x17B44 */ OpenedFile *sprites[MONSTER_MAX];
/* 0x181E4 */ OpenedFile *paletFile;
/* 0x181E8 */ UnkDungeonGlobal_unk181E8_sub unk181e8;
u8 fill18220[0x1BDD4 - 0x1822C];
struct UnkStructDungeon1BDD4 unk1BDD4;
/* 0x1822C */ struct DungeonMap dungeonMap;
/* 0x1BDD4 */ struct UnkStructDungeon1BDD4 unk1BDD4;
/* 0x1BE14 */ struct MessageLogString messageLogStrings[MESSAGE_LOG_STRINGS_COUNT];
/* 0x1C570 */ DungeonLocation unk1C570;
/* 0x1C574 */ FloorProperties unk1C574;

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);