RARC: Decompress data first if necessary
@@ -3,6 +3,7 @@ import os
from io import BytesIO
from fs_helpers import *
+from yaz0_decomp import Yaz0Decompressor
from dzx import DZx
from events import EventList
@@ -13,6 +14,10 @@ class RARC:
self.file_path = file_path
with open(self.file_path, "rb") as file:
self.data = BytesIO(file.read())
+
+ if try_read_str(self.data, 0, 4) == "Yaz0":
+ self.data = BytesIO(Yaz0Decompressor.decompress(self.data))
+
data = self.data
self.file_data_list_offset = read_u32(data, 0xC) + 0x20
