Made a bunch of fields that should be private private

This commit is contained in:
2026-02-22 22:21:37 -05:00
parent 94e0be0eef
commit 836d5e912a
40 changed files with 1499 additions and 929 deletions

View File

@@ -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)?)?;
}

View File

@@ -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.

View File

@@ -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.

View File

@@ -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;