Expand description
Library for parsing and converting Mii character data.
§Parsing
There are, roughly, two kinds of Mii data type.
CharInfo: an uncompressed format.StoreData: a packed format. This is space minimized for transit (e.g. on the flash memory of an NFC toy.)CharData:StoreDatawithout the checksum footer.
- … there are more that this library does not implement 1.
Supported by this library:
| .. | Ntr2 | Rvl2 | Ctr/Cafe | Nx | WebStudio |
|---|---|---|---|---|---|
CharInfo | ❌ | ❌ | ❌ | .charinfo | .. |
StoreData | .nsd | .rsd | .ffsd3 | ❌ | .. |
CoreData | .ncd | .rcd | ❌ | ❌ | .. |
| In-memory | .. | .. | .. | .. | 🏗️4 |
§Conversion
Under Construction
This part of the library is still in works. You can instantiate a GenericChar, but conversions have not been implemented yet.
This library provides a GenericChar struct, which provides a common ground for Char data formats.
Due to the changes in shape, color and texture indices between {Rvl, Ntr} and later formats,
only a one-way conversion can be infallably performed.
§Usage
use std::{env, fs::File, error::Error};
use vee_parse::{NxCharInfo, BinRead};
fn main() -> Result<(), Box<dyn Error>> {
let charinfo_path = "./Alice.charinfo";
let mut file = File::open(&charinfo_path)?;
let nx_char = NxCharInfo::read(&mut file)?;
let name = nx_char.nickname.to_string(); // "Alice"
Ok(())
}
Extra formats are used in Mii databases, and may need to be added if the library comes to require support for databases. ↩
These formats are the same, apart from Ntr being little-endian and Rvl being big-endian. ↩ 1 2
The official format is Cafe Face Store Data, probably due to CFSD being taken by Ctr src. ↩
Stored in the browser’s
localStorage. Often shared as a base64 string, or sometimes saved with the.mnmsextension. ↩
Re-exports§
pub use ctr::CtrStoreData;pub use generic::GenericChar;pub use nx::NxCharInfo;pub use rvl_ntr::NtrCharData;pub use rvl_ntr::NtrStoreData;pub use rvl_ntr::RvlCharData;pub use rvl_ntr::RvlStoreData;
Modules§
Structs§
- Fixed
Length Wide String - A UTF-16 String with a fixed length and non-enforced null termination. The string is allowed to reach the maximum length without a null terminator, and any nulls are stripped.
- Null
Wide String - A null-terminated 16-bit string.
Traits§
- BinRead
- The
BinReadtrait reads data from streams and converts it into objects.