diff --git a/patterns/db_files/AllChunks.pat b/patterns/db_files/AllChunks.pat index bb8836e..34f16cb 100644 --- a/patterns/db_files/AllChunks.pat +++ b/patterns/db_files/AllChunks.pat @@ -27,6 +27,7 @@ #include "db_files/chunks/FOGZONEVAR.hexpat" #include "db_files/chunks/HotRegions.hexpat" #include "db_files/chunks/L$_.hexpat" +#include "db_files/chunks/LD$_.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 031911c..f2f49fe 100644 --- a/patterns/db_files/DbFile.pat +++ b/patterns/db_files/DbFile.pat @@ -1,5 +1,5 @@ #pragma once -#pragma pattern_limit 262144 +#pragma pattern_limit 523288 #include #include @@ -90,9 +90,10 @@ 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); - // } + else if (std::string::starts_with(name, "LD$")) { + Chunk link_data @ offset [[name(name)]]; + // std::print("LD: {}", name); + } else if (std::string::starts_with(name, "L$")) { Chunk link_chunk @ offset [[name(name)]]; // std::print("L: {}", name); diff --git a/patterns/db_files/chunks/LD$_.hexpat b/patterns/db_files/chunks/LD$_.hexpat new file mode 100644 index 0000000..3b007fb --- /dev/null +++ b/patterns/db_files/chunks/LD$_.hexpat @@ -0,0 +1,20 @@ +#pragma once + +#include "db_files/chunks/L$_.hexpat" + +struct LinkData { + LinkId id; + u8 data[parent.real_data_size]; +}; + +struct LinkDataChunk { + s32 data_size; + // I have no idea why there are these exceptions + match (parent.parent.name) { + ("LD$arSrcDes"): s32 real_data_size = 108; + ("LD$Receptro"): s32 real_data_size = 88; + (_): s32 real_data_size = data_size; + } + u32 max = parent.parent.data_end; + LinkData data[while($ < max)]; +};