diff --git a/patterns/db_files/AllChunks.pat b/patterns/db_files/AllChunks.pat index b42f566..17b8301 100644 --- a/patterns/db_files/AllChunks.pat +++ b/patterns/db_files/AllChunks.pat @@ -26,6 +26,7 @@ #include "db_files/chunks/FLOW_TEX.hexpat" #include "db_files/chunks/FOGZONEVAR.hexpat" #include "db_files/chunks/HotRegions.hexpat" +#include "db_files/chunks/L$_.hexpat" #include "db_files/chunks/MAPISRC.hexpat" #include "db_files/chunks/Mission_GameSysEAX.hexpat" #include "db_files/chunks/MultiBrush.hexpat" diff --git a/patterns/db_files/DbFile.pat b/patterns/db_files/DbFile.pat index 4e717db..fba2e63 100644 --- a/patterns/db_files/DbFile.pat +++ b/patterns/db_files/DbFile.pat @@ -88,6 +88,13 @@ struct TOCEntry { if (std::string::starts_with(name, "P$")) { Chunk property_chunk @ offset [[name(name)]]; } + // if (std::string::starts_with(name, "LD$")) { + // std::print("LD: {}", name); + // } + if (std::string::starts_with(name, "L$")) { + Chunk link_chunk @ offset [[name(name)]]; + // std::print("L: {}", name); + } } } }; diff --git a/patterns/db_files/chunks/L$_.hexpat b/patterns/db_files/chunks/L$_.hexpat new file mode 100644 index 0000000..5035739 --- /dev/null +++ b/patterns/db_files/chunks/L$_.hexpat @@ -0,0 +1,24 @@ +#pragma once + +#include "Common.hexpat" + +bitfield LinkId { + id: 16; + concrete: 4; + relation: 12; +}; + +struct Link { + LinkId id; + s32 source; + s32 destination; + u16 relation; + // if (source > 0 || destination > 0) { + // std::print("Link: {}, Id: {}, Src: {}, Dest: {}, Flavor: {}", parent.parent.parent.name, id, source, destination, relation); + // } +}; + +struct LinkMap { + u32 max = parent.parent.data_end; + Link links[while($ < max)]; +};