feat: chusanApp.exe patching

This commit is contained in:
2025-04-13 18:15:41 +00:00
parent 6270fce05f
commit 4247e19996
18 changed files with 406 additions and 187 deletions

View File

@ -8,6 +8,7 @@ use anyhow::Result;
pub struct PatchSelection(pub BTreeMap<String, PatchSelectionData>);
#[derive(Deserialize, Serialize, Clone, Debug)]
#[serde(rename_all = "snake_case")]
pub enum PatchSelectionData {
Enabled,
Number(i8),
@ -108,10 +109,10 @@ impl<'de> serde::Deserialize<'de> for Patch {
.and_then(Value::as_i64)
.ok_or_else(|| de::Error::missing_field("min"))?
).map_err(|_| de::Error::missing_field("min"))?,
max: i32::try_from(value.get("min")
max: i32::try_from(value.get("max")
.and_then(Value::as_i64)
.ok_or_else(|| de::Error::missing_field("min"))?
).map_err(|_| de::Error::missing_field("min"))?
.ok_or_else(|| de::Error::missing_field("max"))?
).map_err(|_| de::Error::missing_field("max"))?
}),
None => {
let mut patches = vec![];

View File

@ -164,8 +164,11 @@ pub struct Mu3Ini {
pub blacklist: Option<(i32, i32)>,
}
fn default_true() -> bool { true }
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct OngekiKeyboard {
#[serde(default = "default_true")] pub enabled: bool,
pub use_mouse: bool,
pub coin: i32,
pub svc: i32,
@ -185,6 +188,7 @@ pub struct OngekiKeyboard {
impl Default for OngekiKeyboard {
fn default() -> Self {
Self {
enabled: true,
use_mouse: true,
test: 0x70,
svc: 0x71,
@ -205,6 +209,7 @@ impl Default for OngekiKeyboard {
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct ChunithmKeyboard {
#[serde(default = "default_true")] pub enabled: bool,
pub coin: i32,
pub svc: i32,
pub test: i32,
@ -215,6 +220,7 @@ pub struct ChunithmKeyboard {
impl Default for ChunithmKeyboard {
fn default() -> Self {
Self {
enabled: true,
test: 0x70,
svc: 0x71,
coin: 0x72,