Skip to main content

Crate vee_parse

Crate vee_parse 

Source
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: StoreData without the checksum footer.
  • … there are more that this library does not implement 1.

Supported by this library:

..Ntr2Rvl2Ctr/CafeNxWebStudio
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(())
}


  1. Extra formats are used in Mii databases, and may need to be added if the library comes to require support for databases. 

  2. These formats are the same, apart from Ntr being little-endian and Rvl being big-endian. ↩ 1 2

  3. The official format is Cafe Face Store Data, probably due to CFSD being taken by Ctr src

  4. Stored in the browser’s localStorage. Often shared as a base64 string, or sometimes saved with the .mnms extension. 

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§

ctr
generic
nx
rvl_ntr

Structs§

FixedLengthWideString
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.
NullWideString
A null-terminated 16-bit string.

Traits§

BinRead
The BinRead trait reads data from streams and converts it into objects.

Attribute Macros§

binrw

Derive Macros§

BinRead