feat: initial chunithm support

This commit is contained in:
2025-03-19 17:39:12 +00:00
parent 1191cdd95c
commit 8ac45df3e1
31 changed files with 1368 additions and 884 deletions

View File

@ -1,6 +1,8 @@
use std::collections::{BTreeMap, BTreeSet};
use serde::Deserialize;
use crate::pkg::PkgKeyVersion;
use serde::{Deserialize, Serialize};
use crate::pkg::{Status, PkgKey, PkgKeyVersion};
use super::misc::Game;
// manifest.json
@ -13,4 +15,13 @@ pub struct PackageManifest {
#[serde(default)]
pub installers: Vec<BTreeMap<String, serde_json::Value>>
}
pub type PackageList = BTreeMap<PkgKey, PackageListEntry>;
#[derive(Serialize, Deserialize, Clone)]
pub struct PackageListEntry {
pub version: String,
pub status: Status,
pub games: Vec<Game>,
}

View File

@ -1,7 +1,7 @@
use serde::{Deserialize, Serialize};
use crate::pkg::PkgKey;
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq)]
#[derive(Clone, Serialize, Deserialize, Debug, PartialEq, Copy)]
pub enum Game {
#[serde(rename = "ongeki")]
Ongeki,
@ -17,6 +17,48 @@ impl Game {
_ => None
}
}
pub fn hook_exe(&self) -> &'static str {
match self {
Game::Ongeki => "mu3hook.dll",
Game::Chunithm => "chusanhook_x86.dll",
}
}
pub fn hook_amd(&self) -> &'static str {
match self {
Game::Ongeki => "mu3hook.dll",
Game::Chunithm => "chusanhook_x64.dll",
}
}
pub fn inject_exe(&self) -> &'static str {
match self {
Game::Ongeki => "inject.exe",
Game::Chunithm => "inject_x86.exe",
}
}
pub fn inject_amd(&self) -> &'static str {
match self {
Game::Ongeki => "inject.exe",
Game::Chunithm => "inject_x64.exe",
}
}
pub fn exe(&self) -> &'static str {
match self {
Game::Ongeki => "mu3.exe",
Game::Chunithm => "chusanApp.exe",
}
}
pub fn amd_args(&self) -> Vec<&'static str> {
match self {
Game::Ongeki => vec!["-f", "-c", "config_common.json", "config_server.json", "config_client.json"],
Game::Chunithm => vec!["-c", "config_common.json", "config_server.json", "config_client.json", "config_cvt.json", "config_sp.json", "config_hook.json"]
}
}
}
impl std::fmt::Display for Game {

View File

@ -2,7 +2,9 @@ use std::path::PathBuf;
use serde::{Deserialize, Serialize};
use crate::pkg::PkgKey;
#[derive(Deserialize, Serialize, Clone, Default, PartialEq)]
use super::misc::Game;
#[derive(Deserialize, Serialize, Clone, Default, PartialEq, Debug)]
pub enum Aime {
Disabled,
#[default] BuiltIn,
@ -10,7 +12,7 @@ pub enum Aime {
Other(PkgKey),
}
#[derive(Deserialize, Serialize, Clone)]
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct AMNet {
pub name: String,
pub addr: String,
@ -23,7 +25,7 @@ impl Default for AMNet {
}
}
#[derive(Deserialize, Serialize, Clone)]
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct Segatools {
pub target: PathBuf,
pub hook: Option<PkgKey>,
@ -38,11 +40,14 @@ pub struct Segatools {
pub amnet: AMNet,
}
impl Default for Segatools {
fn default() -> Self {
impl Segatools {
pub fn default_for(game: Game) -> Self {
Segatools {
target: PathBuf::default(),
hook: Some(PkgKey("segatools-mu3hook".to_owned())),
hook: match game {
Game::Ongeki => Some(PkgKey("segatools-mu3hook".to_owned())),
Game::Chunithm => Some(PkgKey("segatools-chusanhook".to_owned()))
},
io: None,
amfs: PathBuf::default(),
option: PathBuf::default(),
@ -54,14 +59,14 @@ impl Default for Segatools {
}
}
#[derive(Deserialize, Serialize, Clone, Default, PartialEq)]
#[derive(Deserialize, Serialize, Clone, Default, PartialEq, Debug)]
pub enum DisplayMode {
Window,
#[default] Borderless,
Fullscreen
}
#[derive(Deserialize, Serialize, Clone)]
#[derive(Deserialize, Serialize, Clone, Debug)]
pub struct Display {
pub target: String,
pub rez: (i32, i32),
@ -71,26 +76,32 @@ pub struct Display {
pub borderless_fullscreen: bool,
}
impl Default for Display {
fn default() -> Self {
impl Display {
pub fn default_for(game: Game) -> Self {
Display {
target: "default".to_owned(),
rez: (1080, 1920),
rez: match game {
Game::Chunithm => (1920, 1080),
Game::Ongeki => (1080, 1920),
},
mode: DisplayMode::Borderless,
rotation: 0,
frequency: 60,
frequency: match game {
Game::Chunithm => 120,
Game::Ongeki => 60,
},
borderless_fullscreen: true,
}
}
}
#[derive(Deserialize, Serialize, Clone, Default, PartialEq)]
#[derive(Deserialize, Serialize, Clone, Default, PartialEq, Debug)]
pub enum NetworkType {
#[default] Remote,
Artemis,
}
#[derive(Deserialize, Serialize, Clone, Default)]
#[derive(Deserialize, Serialize, Clone, Default, Debug)]
pub struct Network {
pub network_type: NetworkType,
@ -104,7 +115,7 @@ pub struct Network {
pub suffix: Option<i32>,
}
#[derive(Deserialize, Serialize, Clone, Default)]
#[derive(Deserialize, Serialize, Clone, Default, Debug)]
pub struct BepInEx {
pub console: bool,
}

View File

@ -1,4 +1,8 @@
pub fn segatools_base() -> String {
use super::misc::Game;
pub fn segatools_base(game: Game) -> String {
match game {
Game::Ongeki =>
"[vfd]
; Enable VFD emulation. Disable to use a real VFD
; GP1232A02A FUTABA assembly.
@ -76,5 +80,219 @@ right2=0x4B ; K
right3=0x4C ; L
leftMenu=0x55 ; U
rightMenu=0x4F ; O".to_owned()
rightMenu=0x4F ; O".to_owned(),
Game::Chunithm => "
[vfd]
; Enable VFD emulation. Disable to use a real VFD
; GP1232A02A FUTABA assembly.
enable=1
[system]
; Enable ALLS system settings.
enable=1
; Enable freeplay mode. This will disable the coin slot and set the game to
; freeplay. Keep in mind that some game modes (e.g. Freedom/Time Modes) will not
; allow you to start a game in freeplay mode.
freeplay=0
; LAN Install: If multiple machines are present on the same LAN then set
; this to 1 on exactly one machine and set this to 0 on all others.
dipsw1=1
; Monitor type: 0 = 120FPS, 1 = 60FPS
dipsw2=1
; Cab type: 0 = SP, 1 = CVT. SP will enable VFD and eMoney. This setting will switch
; the LED 837-15093-06 COM port and the AiMe reder hardware generation as well.
dipsw3=1
; -----------------------------------------------------------------------------
; Misc. hooks settings
; -----------------------------------------------------------------------------
[gfx]
; Enables the graphics hook.
enable=1
; Force the game to run windowed.
windowed=1
; Add a frame to the game window if running windowed.
framed=0
; Select the monitor to run the game on. (Fullscreen only, 0 =primary screen)
monitor=0
; -----------------------------------------------------------------------------
; LED settings
; -----------------------------------------------------------------------------
[led15093]
; Enable emulation of the 15093-06 controlled lights, which handle the air tower
; RGBs and the rear LED panel (billboard) on the cabinet.
enable=1
[led]
; Output billboard LED strip data to a named pipe called \"\\\\.\\pipe\\chuni_led\"
cabLedOutputPipe=1
; Output billboard LED strip data to serial
cabLedOutputSerial=0
; Output slider LED data to the named pipe
controllerLedOutputPipe=1
; Output slider LED data to the serial port
controllerLedOutputSerial=0
; Use the OpeNITHM protocol for serial LED output
controllerLedOutputOpeNITHM=0
; Serial port to send data to if using serial output. Default is COM5.
;serialPort=COM5
; Baud rate for serial data (set to 115200 if using OpeNITHM)
;serialBaud=921600
; Data output a sequence of bytes, with JVS-like framing.
; Each \"packet\" starts with 0xE0 as a sync. To avoid E0 appearing elsewhere,
; 0xD0 is used as an escape character -- if you receive D0 in the output, ignore
; it and use the next sent byte plus one instead.
;
; After the sync is one byte for the board number that was updated, followed by
; the red, green and blue values for each LED.
;
; Board 0 has 53 LEDs:
; [0]-[49]: snakes through left half of billboard (first column starts at top)
; [50]-[52]: left side partition LEDs
;
; Board 1 has 63 LEDs:
; [0]-[59]: right half of billboard (first column starts at bottom)
; [60]-[62]: right side partition LEDs
;
; Board 2 is the slider and has 31 LEDs:
; [0]-[31]: slider LEDs right to left BRG, alternating between keys and dividers
; -----------------------------------------------------------------------------
; Custom IO settings
; -----------------------------------------------------------------------------
[chuniio]
; Uncomment this if you have custom chuniio implementation comprised of a single 32bit DLL.
; (will use chu2to3 engine internally)
;path=
; Uncomment both of these if you have custom chuniio implementation comprised of two DLLs.
; x86 chuniio to path32, x64 to path64. Both are necessary.
;path32=
;path64=
; -----------------------------------------------------------------------------
; Input settings
; -----------------------------------------------------------------------------
; Keyboard bindings are specified as hexadecimal (prefixed with 0x) or decimal
; (not prefixed with 0x) virtual-key codes, a list of which can be found here:
;
; https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes
;
; This is, admittedly, not the most user-friendly configuration method in the
; world. An improved solution will be provided later.
[io3]
test=0x31
service=0x32
coin=0x33
ir=0x00
ir6=0x39
ir5=0x38
ir4=0x37
ir3=0x36
ir2=0x35
ir1=0x34
[ir]
ir6=0x39
ir5=0x38
ir4=0x37
ir3=0x36
ir2=0x35
ir1=0x34
[slider]
cell32=0x51
cell30=0x5A
cell28=0x53
cell26=0x45
cell24=0x43
cell22=0x46
cell20=0x54
cell18=0x42
cell16=0x48
cell14=0x55
cell12=0x4D
cell10=0x4B
cell8=0x4F
cell6=190
cell4=186
cell2=219
cell31=0x41
cell29=0x57
cell27=0x58
cell25=0x44
cell23=0x52
cell21=0x56
cell19=0x47
cell17=0x59
cell15=0x4E
cell13=0x4A
cell11=0x49
cell9=188
cell7=0x4C
cell5=0x50
cell3=191
cell1=222
".to_owned()
}
}