mirror of
https://github.com/NinjaCheetah/rustii.git
synced 2026-03-10 03:57:48 -04:00
Made a bunch of fields that should be private private
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// nand/emunand.rs from rustii (c) 2025 NinjaCheetah & Contributors
|
||||
// https://github.com/NinjaCheetah/rustii
|
||||
// nand/emunand.rs from ruswtii (c) 2025 NinjaCheetah & Contributors
|
||||
// https://github.com/NinjaCheetah/rustwii
|
||||
//
|
||||
// Implements the structures and methods required for handling Wii EmuNANDs.
|
||||
|
||||
@@ -184,9 +184,9 @@ impl EmuNAND {
|
||||
}
|
||||
fs::create_dir(&title_dir)?;
|
||||
fs::write(title_dir.join("title.tmd"), title.tmd.to_bytes()?)?;
|
||||
for i in 0..title.content.content_records.borrow().len() {
|
||||
if matches!(title.content.content_records.borrow()[i].content_type, tmd::ContentType::Normal) {
|
||||
let content_path = title_dir.join(format!("{:08X}.app", title.content.content_records.borrow()[i].content_id).to_ascii_lowercase());
|
||||
for i in 0..title.content.content_records().len() {
|
||||
if matches!(title.content.content_records()[i].content_type, tmd::ContentType::Normal) {
|
||||
let content_path = title_dir.join(format!("{:08X}.app", title.content.content_records()[i].content_id).to_ascii_lowercase());
|
||||
fs::write(content_path, title.get_content_by_index(i)?)?;
|
||||
}
|
||||
}
|
||||
@@ -200,9 +200,9 @@ impl EmuNAND {
|
||||
} else {
|
||||
content::SharedContentMap::new()
|
||||
};
|
||||
for i in 0..title.content.content_records.borrow().len() {
|
||||
if matches!(title.content.content_records.borrow()[i].content_type, tmd::ContentType::Shared) {
|
||||
if let Some(file_name) = content_map.add(&title.content.content_records.borrow()[i].content_hash)? {
|
||||
for i in 0..title.content.content_records().len() {
|
||||
if matches!(title.content.content_records()[i].content_type, tmd::ContentType::Shared) {
|
||||
if let Some(file_name) = content_map.add(&title.content.content_records()[i].content_hash)? {
|
||||
let content_path = self.emunand_dirs["shared1"].join(format!("{}.app", file_name.to_ascii_lowercase()));
|
||||
fs::write(content_path, title.get_content_by_index(i)?)?;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// nand/mod.rs from rustii (c) 2025 NinjaCheetah & Contributors
|
||||
// https://github.com/NinjaCheetah/rustii
|
||||
// nand/mod.rs from ruswtii (c) 2025 NinjaCheetah & Contributors
|
||||
// https://github.com/NinjaCheetah/rustwii
|
||||
//
|
||||
// Root for all NAND-related modules.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// nand/setting.rs from rustii (c) 2025 NinjaCheetah & Contributors
|
||||
// https://github.com/NinjaCheetah/rustii
|
||||
// nand/setting.rs from ruswtii (c) 2025 NinjaCheetah & Contributors
|
||||
// https://github.com/NinjaCheetah/rustwii
|
||||
//
|
||||
// Implements the structures and methods required for parsing and editing setting.txt in the Wii
|
||||
// Menu's data.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// nand/sys.rs from rustii (c) 2025 NinjaCheetah & Contributors
|
||||
// https://github.com/NinjaCheetah/rustii
|
||||
// nand/sys.rs from ruswtii (c) 2025 NinjaCheetah & Contributors
|
||||
// https://github.com/NinjaCheetah/rustwii
|
||||
//
|
||||
// Implements the structures and methods required for parsing and editing files in /sys/ on the
|
||||
// Wii's NAND.
|
||||
@@ -27,12 +27,18 @@ pub struct UidSys {
|
||||
entries: Vec<UidSysEntry>,
|
||||
}
|
||||
|
||||
impl Default for UidSys {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl UidSys {
|
||||
/// Creates a new UidSys instance from the binary data of a uid.sys file.
|
||||
pub fn from_bytes(data: &[u8]) -> Result<Self, UidSysError> {
|
||||
// The uid.sys file must be divisible by a multiple of 12, or something is wrong, since each
|
||||
// entry is 12 bytes long.
|
||||
if (data.len() % 12) != 0 {
|
||||
if !data.len().is_multiple_of(12) {
|
||||
return Err(UidSysError::InvalidUidSysLength);
|
||||
}
|
||||
let entry_count = data.len() / 12;
|
||||
|
||||
Reference in New Issue
Block a user