feat: chuniio

This commit is contained in:
2025-04-15 13:12:12 +00:00
parent ac18c34895
commit b82fcc942f
20 changed files with 150 additions and 61 deletions

View File

@ -239,20 +239,14 @@ impl Package {
if id == "rainycolor" {
flags |= Feature::Mod;
} else if id == "segatools" {
// Multiple features in the same dll (yubideck etc.) should be supported at some point
if let Some(serde_json::Value::String(module)) = installer.get("module") {
if module == "mu3hook" {
flags |= Feature::Mu3Hook;
} else if module == "chusanhook" {
flags |= Feature::ChusanHook;
} else if module == "amnet" {
flags |= Feature::AMNet | Feature::Aime;
} else if module == "aimeio" {
flags |= Feature::Aime;
} else if module == "mu3io" {
flags |= Feature::Mu3IO;
} else if module == "chuniio" {
flags |= Feature::ChuniIO;
flags |= Self::parse_segatools_module(&module);
}
if let Some(serde_json::Value::Array(arr)) = installer.get("module") {
for elem in arr {
if let serde_json::Value::String(module) = elem {
flags |= Self::parse_segatools_module(module);
}
}
}
} else if id == "native_mod" {
@ -280,4 +274,16 @@ impl Package {
Status::OK(flags, DLLs { game: game_dll, amd: amd_dll })
}
}
fn parse_segatools_module(module: &str) -> BitFlags<Feature, u16> {
match module {
"mu3hook" => make_bitflags!(Feature::Mu3Hook),
"chusanhook" => make_bitflags!(Feature::ChusanHook),
"amnet" => make_bitflags!(Feature::{AMNet | Aime}),
"aimeio" => make_bitflags!(Feature::Aime),
"mu3io" => make_bitflags!(Feature::Mu3IO),
"chuniio" => make_bitflags!(Feature::ChuniIO),
_ => BitFlags::default()
}
}
}