diff --git a/one-rust/src/one/heroes.rs b/one-rust/src/one/heroes.rs index 13adb27..aa86e82 100644 --- a/one-rust/src/one/heroes.rs +++ b/one-rust/src/one/heroes.rs @@ -12,6 +12,15 @@ const SIZE_OF_ENTRY: u32 = 3 * size_of::() as u32; const SIZE_OF_FILENAME: usize = 0x40; const TYPICAL_STRING_TABLE_COUNT: usize = 0x100; +// stats on version +// $ find . -name \*.one -exec bash -c "onear tf "{}" > "{}".txt" \; +// $ fd one.txt | xargs cat | grep '^HerOne{' | sort | uniq -c +// 3 HerOne{version: 0x1003ffff, ..} +// 725 HerOne{version: 0x1400ffff, ..} + +// FIXME: coverOpen*_gc.one are missing the first entry (they start with the string table entry) +// solve this by factoring out a struct that's just { id, size, version } and Option<> it + #[derive(BinRead, BinWrite)] #[br(little, assert( entries.iter().enumerate().all(|(i, ent)| ent.id as usize == i + 2 && ent.version == version) && @@ -27,7 +36,7 @@ pub struct HerOne { id_archive: u32, /// the size of the archive, not counting the "first entry" of these first three u32's archive_size_minus_12: u32, - /// presumably the archiver version. known values: 0x1400ffff from GCN version + /// presumably the archiver version. known values: 0x1400ffff and 0x1003ffff from GCN version version: u32, #[br(assert(id_string_table == 1))] /// 1. conceptually the ID of the (uncompressed) array of filenames, indexed by ID.