diff --git a/Cargo.toml b/Cargo.toml index d543088e1..dbd5c2545 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -56,7 +56,7 @@ msbt = { git = "https://github.com/RoccoDev/msbt-rs", branch = "feature/builder- # For patch3audio nus3audio = "1.2.0" # For motion list patching -motion_list_rs = { git = "https://github.com/WuBoytH/motion_lib", branch = "motion-lib-only" } +motion_list_rs = "1.4.3" serde_yaml = "0.8" # For inputs ninput = { git = "https://github.com/blu-dev/ninput" } diff --git a/src/fs/loaders.rs b/src/fs/loaders.rs index f7a05756c..ded0f0a3e 100644 --- a/src/fs/loaders.rs +++ b/src/fs/loaders.rs @@ -117,6 +117,7 @@ impl ApiLoadType { } pub fn load_path(self, local: &Path, usr_fn: ApiCallback) -> Result<(usize, Vec), ApiLoaderError> { + println!("[ARCropolis::loader] Patching {:#?}", local.as_os_str()); match self { ApiLoadType::Nus3bankPatch => { let data = ApiLoader::handle_load_vanilla_file(local)?; @@ -304,23 +305,24 @@ impl ApiLoadType { }; let data = ApiLoader::handle_load_base_file(local)?; + let mut reader = std::io::Cursor::new(data); - let mut motion = motion_lib::disasm::disassemble(&mut std::io::Cursor::new(data))?; + let mut motion = motion_lib::read_stream(&mut reader)?; for patch_path in patches.iter() { let mut contents: String = String::default(); std::fs::File::open(patch_path)?.read_to_string(&mut contents)?; if let Some(diff) = from_str(&contents)? { - println!("[ARCropolis::loader] Patching Motion List"); motion.apply(&diff); } else { return Err(ApiLoaderError::Other("This isn't a motion list patch file!".to_string())); } } + println!("[ARCropolis::loader] Motion List Patching finished, writing to file..."); let new_data : Vec = Vec::new(); let mut cursor = std::io::Cursor::new(new_data); - motion_lib::asm::assemble(&mut cursor, &motion)?; + motion_lib::write_stream(&mut cursor, &motion)?; let vec = cursor.into_inner(); Ok((vec.len(), vec)) }