ground bg map documentation

This commit is contained in:
DizzyEggg
2025-07-17 17:51:53 +02:00
parent 8efe6ea90b
commit 47cad2e720
5 changed files with 1197 additions and 1184 deletions

View File

@@ -9,7 +9,7 @@
#define UNK_E0_ARR_COUNT 32
#define UNK_3E0_ARR_COUNT 2
#define UNK_54C_ARR_COUNT 2
#define UNK_545_UNK6_ARR_COUNT 4
#define MAX_BPA_SLOTS 4
typedef struct SubStruct_0
{
@@ -20,11 +20,12 @@ typedef struct SubStruct_0
u8 fillC;
} SubStruct_0;
struct UnkFileStruct
struct BpaHeader
{
u8 unk0;
s16 unk2;
void *unk4[0]; // This is most likely wrong, will need to be fixed.
u8 numTiles; // The number of individual tiles.
s16 numFrames; // The number of frames for each tile.
s32 durationPerFrame[0]; // Settings for each frame. One entry per frame.
// Tiles data below
};
typedef struct SubStruct_3E0
@@ -33,8 +34,8 @@ typedef struct SubStruct_3E0
u8 unk1;
s16 unk2;
s16 unk4;
OpenedFile *unk8;
const struct UnkFileStruct *unkC;
OpenedFile *bpaFile;
const struct BpaHeader *unkC;
const void *unk10;
const void *unk14;
const void *unk18;
@@ -62,6 +63,25 @@ typedef struct SubStruct_488
PixelPos bgRegOffsets; // Either bg2 or bg3
} SubStruct_488;
typedef struct BmaHeader
{
// Map width/height that the camera in game will travel in tiles. Also the width/height of the collision and unknown data layers! For most maps (Map Width Chunks) * (Tiling Width) = (Map Width Camera).
u8 mapWidthTiles;
u8 mapHeightTiles;
// Width/Height of chunks in tiles. Always 3, the value is ignored for these.
u8 tilingWidth;
u8 tilingHeight;
// Map width/height in chunks. Also the width/height of the chunk mappings.
u8 mapWidthChunks;
u8 mapHeightChunks;
u16 numLayers; // Number of layers in this map. Must match BPC layer size. Allowed values are only 1 or 2.
u16 hasDataLayer; // Seems to be a boolean flag (0 or 1). If >0, the Unknown Data Layer exists.
u16 hasCollision; // Number of Collision layers. 0, 1 or 2.
} BmaHeader;
// size: 0x18?
typedef struct SubStruct_52C
{
@@ -75,30 +95,25 @@ typedef struct SubStruct_52C
s16 unkE; // 0x53A
s16 unk10; // 0x53C
s16 unk12; // 0x53E
void (*unk14)(void *, const void *, void *, s32); // TODO: fix void * to proper ptr types 0x540
void (*unk14)(void *, const void *, BmaHeader *, s32); // TODO: fix void * to proper ptr types 0x540
} SubStruct_52C;
typedef struct SubStruct_448
{
u8 unk0;
u8 unk1;
u8 unk2;
u8 unk3;
u8 unk4;
u8 unk5;
u16 unk6;
u16 unk8;
u16 unkA;
} SubStruct_448;
typedef struct SubStruct_545
typedef struct LayerSpecs
{
// Apparently these two fields are not present in pmd-sky?
s16 unk0;
s16 unk2;
s16 unk4;
s16 unk6[UNK_545_UNK6_ARR_COUNT];
s16 unkE;
} SubStruct_545;
s16 numTiles; // The number of tiles stored in the data + 1. The +1 is the null tile at the beginning of tiles.
s16 bpaSlotNumTiles[MAX_BPA_SLOTS]; // The number of tiles in the BPA on this slot. 0 if no BPA is assigned.
s16 numChunks; // Number of chunks in the tilemap + 1. The +1 is the null chunk at the beginning of tile mappings, that is not stored.
} LayerSpecs;
typedef struct BplHeader
{
s16 numPalettes;
s16 hasPalAnimations;
} BplHeader;
// size: 0x55C
typedef struct GroundBg
@@ -106,15 +121,15 @@ typedef struct GroundBg
SubStruct_0 unk0[UNK_0_ARR_COUNT];
unkStruct_202EE8C unkE0[UNK_E0_ARR_COUNT];
SubStruct_3E0 unk3E0[UNK_3E0_ARR_COUNT];
OpenedFile *unk430;
OpenedFile *unk434;
OpenedFile *unk438;
OpenedFile *bplFile;
OpenedFile *bpcFile;
OpenedFile *bmaFile;
OpenedFile *unk43C;
OpenedFile *unk440;
s16 mapFileId;
SubStruct_448 unk448;
SubStruct_545 unk454;
s16 unk464[2];
BmaHeader bmaHeader;
LayerSpecs layerSpecs;
BplHeader bplHeader;
const void *unk468;
const void *unk46C;
u8 unk470;