Add YATF ImHex pattern and add libpixel submodule

This commit is contained in:
Lily Tsuru 2022-09-04 22:21:59 -05:00
parent 62862d832f
commit 7fd4c470af
4 changed files with 70 additions and 0 deletions

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "third_party/libpixel"]
path = third_party/libpixel
url = https://github.com/modeco80/libpixel.git

View File

@ -1,3 +1,10 @@
//
// EuropaTools
//
// (C) 2021-2022 modeco80 <lily.modeco80@protonmail.ch>
//
// SPDX-License-Identifier: LGPL-3.0-or-later
//
#pragma endian little

59
hexpat/yatf.hexpat Normal file
View File

@ -0,0 +1,59 @@
//
// EuropaTools
//
// (C) 2021-2022 modeco80 <lily.modeco80@protonmail.ch>
//
// SPDX-License-Identifier: LGPL-3.0-or-later
//
// YATF pattern
#include <std/io.pat>
#pragma endian little
namespace europa {
// YATF header.
struct TexHeader {
char magic[4]; // 'YATF'
// Flag descriptions:
//
// 0x1 - unknown? (always pressent)
// 0x30000 - direct color (no palette)
// 0x1000000 - uses alpha
u32 flags;
// Always zeroed.
u32 zero;
// these are swapped backwards
// for some reason.
u32 height;
u32 width;
};
// A YATF file.
struct TexFile {
TexHeader header;
if(header.flags & 0x1000000) {
std::print("[YATF] this YATF uses alpha?");
}
if(!(header.flags & 0x30000)) {
std::print("[YATF] this YATF is palettized");
u32 palette[256];
u8 bitmap[header.width * header.height];
} else {
std::print("[YATF] this YATF is direct color");
u32 bitmap[header.width * header.height];
}
};
} // namespace europa
europa::TexFile tex @ 0x0;

1
third_party/libpixel vendored Submodule

@ -0,0 +1 @@
Subproject commit e7be1115575317e9b80c5c1be04fa2e950badb97