Skip to content
Draft
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
3 changes: 3 additions & 0 deletions crates/mod-host/src/host/game_properties.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ fn bool_property_getter(
// and their values loaded in RCX, the queried property name in RDX and true/false in R8B
// as the default value in the case of the property missing from the map.
let function_call_re_str = match attach_config.game {
Game::DarkSoulsRemastered => {
r"(?s-u)(?:\x41\xb0\x01)\x48\x8d\x54\x24\x30\x48\x8b\x0d.{4}\xe8(.{4})"
}
Game::DarkSouls3 => {
r"(?s-u)(?:\x48\x8d\x54\x24\x30\x48\x8b\x0d.{4}\xe8(.{4})\x88\x05.{4}\x48\x83\x7c\x24\x48\x08\x72.)|(?:\x48\x8d\x54\x24\x30\x48\x8b\x0d.{4}\xe8(.{4})\x0f\xb6\xd8\x48\x83\x7c\x24\x48\x08\x72.)"
}
Expand Down
11 changes: 11 additions & 0 deletions crates/mod-protocol/src/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
rkyv::Deserialize,
)]
pub enum Game {
DarkSoulsRemastered,
DarkSouls3,
Sekiro,
EldenRing,
Expand All @@ -41,6 +42,7 @@
// TODO: we need a better way to deal with this.
const PROTON_STABLE: &str = "proton_10";
match self {
DarkSoulsRemastered => Some("proton_8"),
DarkSouls3 => Some("proton_8"),
Sekiro => Some(PROTON_STABLE),
EldenRing => Some("proton_8"),
Expand All @@ -53,6 +55,7 @@
pub const fn name(self) -> &'static str {
use Game::*;
match self {
DarkSoulsRemastered => "darksoulsremastered",
DarkSouls3 => "darksouls3",
Sekiro => "sekiro",
EldenRing => "eldenring",
Expand All @@ -65,6 +68,7 @@
pub const fn title(self) -> &'static str {
use Game::*;
match self {
DarkSoulsRemastered => "Dark Souls: Remastered",
DarkSouls3 => "Dark Souls III",
Sekiro => "Sekiro: Shadows Die Twice",
EldenRing => "Elden Ring",
Expand All @@ -77,6 +81,7 @@
pub fn possible_names(self) -> &'static [&'static str] {
use Game::*;
match self {
DarkSoulsRemastered => &[const { Game::DarkSoulsRemastered.name() }, "dsr"],
DarkSouls3 => &[const { DarkSouls3.name() }, "ds3"],
Sekiro => &[const { Sekiro.name() }, "sdt"],
EldenRing => &[const { EldenRing.name() }, "er", "elden-ring"],
Expand All @@ -99,9 +104,13 @@
DarkSouls3 | Sekiro | EldenRing | ArmoredCore6 | Nightreign => {
std::env::var_os("APPDATA").map(PathBuf::from)
}
DarkSoulsRemastered => {
std::env::var_os("CSIDL_MYDOCUMENTS").map(|home| PathBuf::from(home))

Check warning

Code scanning / clippy

redundant closure Warning

redundant closure
}
};

Some(match self {
DarkSoulsRemastered => base_dir?.join("nbgi\\DarkSoulsRemastered"),
DarkSouls3 => base_dir?.join("DarkSoulsIII"),
Sekiro => base_dir?.join("Sekiro"),
EldenRing => base_dir?.join("EldenRing"),
Expand Down Expand Up @@ -144,6 +153,7 @@
pub fn app_id(self) -> u32 {
use Game::*;
match self {
DarkSoulsRemastered => 570940,
DarkSouls3 => 374320,
Sekiro => 814380,
EldenRing => 1245620,
Expand All @@ -164,6 +174,7 @@
pub fn executable(self) -> &'static Path {
use Game::*;
Path::new(match self {
DarkSoulsRemastered => "DarkSoulsRemastered.exe",
DarkSouls3 => "Game/DarkSoulsIII.exe",
Sekiro => "sekiro.exe",
EldenRing => "Game/eldenring.exe",
Expand Down
Loading