From bcf7013cdbd3ee29023bf6682a7dc010ea8f0fb0 Mon Sep 17 00:00:00 2001 From: Jarrod Doyle Date: Fri, 23 Aug 2024 15:25:08 +0100 Subject: [PATCH] Add Relations chunk pattern --- patterns/db_files/AllChunks.pat | 1 + patterns/db_files/DbFile.pat | 1 + patterns/db_files/chunks/Relations.hexpat | 13 +++++++++++++ 3 files changed, 15 insertions(+) create mode 100644 patterns/db_files/chunks/Relations.hexpat diff --git a/patterns/db_files/AllChunks.pat b/patterns/db_files/AllChunks.pat index 17b8301..a09a9f2 100644 --- a/patterns/db_files/AllChunks.pat +++ b/patterns/db_files/AllChunks.pat @@ -32,6 +32,7 @@ #include "db_files/chunks/MultiBrush.hexpat" #include "db_files/chunks/OBJ_MAP.hexpat" #include "db_files/chunks/P$_.hexpat" +#include "db_files/chunks/Relations.hexpat" #include "db_files/chunks/RENDPARAMS.hexpat" #include "db_files/chunks/ROOM_DB.hexpat" #include "db_files/chunks/ROOM_EAX.hexpat" diff --git a/patterns/db_files/DbFile.pat b/patterns/db_files/DbFile.pat index fba2e63..7bb753c 100644 --- a/patterns/db_files/DbFile.pat +++ b/patterns/db_files/DbFile.pat @@ -70,6 +70,7 @@ struct TOCEntry { ("MissionEAX"): Chunk mission_eax @ offset; ("MultiBrush"): Chunk multibrush @ offset; ("OBJ_MAP"): Chunk obj_map @ offset; + ("Relations"): Chunk relations @ offset; ("RENDPARAMS"): Chunk rend_params @ offset; ("ROOM_DB"): Chunk room_db @ offset; ("ROOM_EAX"): Chunk room_eax @ offset; diff --git a/patterns/db_files/chunks/Relations.hexpat b/patterns/db_files/chunks/Relations.hexpat new file mode 100644 index 0000000..3b3517b --- /dev/null +++ b/patterns/db_files/chunks/Relations.hexpat @@ -0,0 +1,13 @@ +#pragma once + +#include + +struct RelationString { + char name[]; + $ = $ + 32 - std::string::length(name); +}; + +struct Relations { + u32 max = parent.parent.data_end; + RelationString relations[while($ < max)]; +}; \ No newline at end of file