"""The FSSM pixel-input decoder reads documented record fields, the directory identity and the fp16 mask. All blobs here are built by hand; no shader from the game is used. python -I tests/test_fssm_header.py """ import json import os import struct import subprocess import sys import tempfile import unittest from unittest import mock ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) TOOLS = os.path.join(ROOT, "tools") TOOL = os.path.join(TOOLS, "fssm_header.py") sys.path.insert(0, TOOLS) import fssm_header # noqa: E402 def blob(records=(), directory=(0x100, 0x20, 0x120), size=0x200, first=None, wave_flags=0): """Build a synthetic FSSM header. records are complete 8-byte input records.""" data = bytearray(size) data[0:4] = b"FSSM" if size >= 0xD8: struct.pack_into("