- Migrate from bracket attributes to ui() function calls - Enhance chunk parsing with improved structure definitions - Add additional metadata fields to chunk handlers - Update Xbox 360 texture and archive definitions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
45 lines
1.2 KiB
Plaintext
45 lines
1.2 KiB
Plaintext
// Map file (Big Endian, Sniper Elite, AVP, etc.)
|
|
// XMemCompressed data containing Asura archive
|
|
|
|
type mapBE [root, display="Map (Big Endian)"] byteorder BE
|
|
{
|
|
criteria {
|
|
require _ext == "mapbe";
|
|
// XMemCompress signature: 0x0FF512ED or 0x0FF512EE followed by 0x01000000
|
|
sig1 = u32at(0);
|
|
sig2 = u32at(4);
|
|
require (sig1 == 0x0FF512ED || sig1 == 0x0FF512EE);
|
|
require sig2 == 0x01000000;
|
|
}
|
|
|
|
// Read signature info for display
|
|
u32 xmem_signature;
|
|
u32 xmem_flags;
|
|
xmem_signature = xmem_signature;
|
|
|
|
ui("xmem_signature", "XMem Signature");
|
|
xmem_flags = xmem_flags;
|
|
|
|
ui("xmem_flags", "XMem Flags");
|
|
|
|
seek(0);
|
|
|
|
// Read entire file and decompress
|
|
compressed_data = read(EOF);
|
|
decompressed_data = compressed_data |> xmem;
|
|
|
|
// Export decompressed data
|
|
write_file(_basename + ".map.decompressed", decompressed_data);
|
|
|
|
// Check if decompressed data is an Asura archive
|
|
dec_sig = ascii(bytesof(decompressed_data, 0, 8));
|
|
is_asura = (dec_sig == "Asura ");
|
|
|
|
ui("is_asura", "Is Asura Archive");
|
|
|
|
if (is_asura) {
|
|
archive = decompressed_data |> parse asura_archive;
|
|
ui("archive", "Asura Archive");
|
|
}
|
|
}
|