Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,480 changes: 897 additions & 583 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pathdiff = "0.2"
petgraph = { version = "0.6", default-features = false }
serde = "1.0"
serde_json = "1.0"
serde_yml = "0.0"
serde_norway = "0.9"
snafu = { version = "0.8", features = ["backtrace"] }
tinytemplate = "1.2"
typed-path = "0.12"
Expand All @@ -49,7 +49,7 @@ unarm = { version = "1.8", default-features = false, features = [
] }

[dev-dependencies]
reqwest = { version = "0.12", features = ["blocking"] }
reqwest = { version = "0.13", features = ["blocking"] }
zip = "3.0"

[lints.clippy]
Expand Down
6 changes: 4 additions & 2 deletions cli/src/analysis/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,9 @@ impl Signatures {
pub fn list() -> Result<Vec<Self>> {
SIGNATURES
.iter()
.map(|(name, yaml)| serde_yml::from_str(yaml).map_err(|e| anyhow!("Failed to parse signature '{}': {}", name, e)))
.map(|(name, yaml)| {
serde_norway::from_str(yaml).map_err(|e| anyhow!("Failed to parse signature '{}': {}", name, e))
})
.collect::<Result<Vec<_>>>()
}

Expand All @@ -147,7 +149,7 @@ impl Signatures {
.iter()
.find(|(signature_name, _)| *signature_name == name)
.ok_or_else(|| anyhow!("Signature '{}' not found", name))?;
serde_yml::from_str(signature_str.1).map_err(|e| anyhow!("Failed to parse signature '{}': {}", name, e))
serde_norway::from_str(signature_str.1).map_err(|e| anyhow!("Failed to parse signature '{}': {}", name, e))
}

pub fn iter_names() -> impl Iterator<Item = &'static str> + 'static {
Expand Down
4 changes: 2 additions & 2 deletions cli/src/cmd/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl Init {
}

// Generate configs
let mut rom_config: RomConfig = serde_yml::from_reader(open_file(&self.rom_config)?)?;
let mut rom_config: RomConfig = serde_norway::from_reader(open_file(&self.rom_config)?)?;
rom_config.arm9_bin = self.build_path.join("build/arm9.bin");
rom_config.itcm.bin = self.build_path.join("build/itcm.bin");
rom_config.dtcm.bin = self.build_path.join("build/dtcm.bin");
Expand Down Expand Up @@ -130,7 +130,7 @@ impl Init {

if !self.dry {
create_dir_all(&arm9_output_path)?;
serde_yml::to_writer(create_file(arm9_config_path)?, &arm9_config)?;
serde_norway::to_writer(create_file(arm9_config_path)?, &arm9_config)?;
}

Ok(())
Expand Down
10 changes: 5 additions & 5 deletions cli/src/cmd/rom/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl ConfigRom {
self.config_autoloads(&object, &config, &rom, &mut rom_paths, new_rom_paths_dir)?;
self.config_overlays(&object, &config, &rom, &mut rom_paths, new_rom_paths_dir, rom_extract_dir)?;

serde_yml::to_writer(create_file(new_rom_paths_dir.join("rom_config.yaml"))?, &rom_paths)?;
serde_norway::to_writer(create_file(new_rom_paths_dir.join("rom_config.yaml"))?, &rom_paths)?;

Ok(())
}
Expand Down Expand Up @@ -160,7 +160,7 @@ impl ConfigRom {

let original_config = if let Some(arm9_overlays_path) = &rom_paths.arm9_overlays {
let original_config: OverlayTableConfig =
serde_yml::from_reader(open_file(rom_extract_dir.join(arm9_overlays_path))?)?;
serde_norway::from_reader(open_file(rom_extract_dir.join(arm9_overlays_path))?)?;
Some(original_config)
} else {
None
Expand All @@ -173,7 +173,7 @@ impl ConfigRom {
};

let yaml_path = config_path.join(&config.main_module.object).parent().unwrap().join("arm9_overlays.yaml");
serde_yml::to_writer(create_file(&yaml_path)?, &overlay_table_config)?;
serde_norway::to_writer(create_file(&yaml_path)?, &overlay_table_config)?;

rom_paths.arm9_overlays = Some(Self::make_path(yaml_path, rom_paths_dir));

Expand Down Expand Up @@ -222,7 +222,7 @@ impl ConfigRom {

let binary_path = config_path.join(&autoload.module.object);
let yaml_path = binary_path.parent().unwrap().join(file_name);
serde_yml::to_writer(create_file(&yaml_path)?, &autoload_info)?;
serde_norway::to_writer(create_file(&yaml_path)?, &autoload_info)?;

match autoload.kind {
AutoloadKind::Itcm => {
Expand Down Expand Up @@ -268,7 +268,7 @@ impl ConfigRom {

let binary_path = config_path.join(&config.main_module.object);
let yaml_path = binary_path.parent().unwrap().join("arm9.yaml");
serde_yml::to_writer(create_file(&yaml_path)?, &arm9_build_config)?;
serde_norway::to_writer(create_file(&yaml_path)?, &arm9_build_config)?;

rom_paths.arm9_bin = Self::make_path(binary_path, rom_paths_dir);
rom_paths.arm9_config = Self::make_path(yaml_path, rom_paths_dir);
Expand Down
2 changes: 1 addition & 1 deletion cli/src/cmd/sig/new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl NewSignature {
})?;
let signature = Signatures::from_function(function, &module, &symbol_maps)?;

let signature_yaml = serde_yml::to_string(&signature)?;
let signature_yaml = serde_norway::to_string(&signature)?;
print!("{signature_yaml}");

Ok(())
Expand Down
8 changes: 4 additions & 4 deletions lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ bytemuck = { version = "1.21", features = ["derive"] }
ds-rom = "0.6"
log = "0.4"
serde = "1.0"
serde_yml = "0.0"
serde_norway = "0.9"
snafu = { version = "0.8", features = ["backtrace"] }
unarm = { version = "1.8", default-features = false, features = [
"arm",
"thumb",
"v5te",
"arm",
"thumb",
"v5te",
] }

[lints.clippy]
Expand Down
4 changes: 2 additions & 2 deletions lib/src/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub enum ConfigParseError {
#[snafu(transparent)]
File { source: FileError },
#[snafu(display("Failed to parse dsd config file '{}': {error}\n{backtrace}", path.display()))]
SerdeYml { path: PathBuf, error: serde_yml::Error, backtrace: Backtrace },
SerdeYml { path: PathBuf, error: serde_norway::Error, backtrace: Backtrace },
}

#[derive(Debug, Snafu)]
Expand All @@ -55,7 +55,7 @@ pub enum LoadModuleError {
impl Config {
pub fn from_file(path: &Path) -> Result<Config, ConfigParseError> {
let file = open_file(path)?;
serde_yml::from_reader(file).map_err(|error| SerdeYmlSnafu { path, error }.build())
serde_norway::from_reader(file).map_err(|error| SerdeYmlSnafu { path, error }.build())
}

pub fn get_module_config_by_kind(&self, module_kind: ModuleKind) -> Option<&ConfigModule> {
Expand Down