-
Notifications
You must be signed in to change notification settings - Fork 2
POD File Format Derivates
Jon Daniel edited this page Oct 9, 2024
·
82 revisions
EPD POD1 POD2 POD3 POD4 POD5 POD6 Terminal Reality Home
enum version
{
none = 0,
pod1 = 1,
pod2 = 2,
pod3 = 3,
pod4 = 4,
pod5 = 5,
pod6 = 6,
epd = 7,
last = 8,
};
enum section
{
none = 0,
file = 1,
header = 2,
};
const std::pair<const char*, const char*> ident[last] =
{
{"NONE", "\0NONE"},
{"POD1", "\0POD1"},
{"POD2", "POD2\0"},
{"POD3", "POD3\0"},
{"POD4", "POD4\0"},
{"POD5", "POD5\0"},
{"POD6", "POD6\0"},
{"EPD" , "dtxe\0"}
};
const std::pair<u32<1>, enum section> range[last] =
{
{ 0u , section::none },
{ sizeof(tr::pod<1>::header) , section::file },
{ sizeof(tr::pod<2>::header::ident) + sizeof(tr::pod<2>::header::checksum), section::file },
{ sizeof(tr::pod<3>::header::ident) + sizeof(tr::pod<3>::header::checksum), section::header },
{ sizeof(tr::pod<4>::header::ident) + sizeof(tr::pod<4>::header::checksum), section::header },
{ sizeof(tr::pod<5>::header::ident) + sizeof(tr::pod<5>::header::checksum), section::header },
{ sizeof(tr::pod<6>::header) , section::file },
{ sizeof(tr::epd::header) , section::file },
};
template<enum version version>
constexpr inline size_t section_size(size_t size)
{
switch(range[version].second)
{
case section::file:
return size;
case section::header:
return sizeof(tr::pod<version>::header);
case section::none:
default:
return 0;
}
}
template<enum version version>
constexpr inline u32<1> checksum(uint8_t* buf, size_t size)
{
const u32<1>& offset = range[version].first;
crc32::mpeg2::compute(buf + offset, section_size<version>(size) - offset);
}
constexpr inline enum version id(const c8<4> magic)
{
for(int i = pod2; i < last; i++)
if(strncmp(ident[i].second, &magic[0], 4) == 0)
return (enum version)i;
return pod1;
}All information here is to my best knowledge, is is not proven by any official reference manual by Microsoft or Terminal Reality.