Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Raytwo committed Aug 30, 2024
1 parent b6e13e0 commit f5b70f4
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 36 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ edition = "2021"
[package.metadata.skyline]
titleid = "01005CA01580E000"
package-resources = [
{ local = "ModFiles/exefs", package = "atmosphere/contents/01005CA01580E000/exefs" },
{ local = "ModFiles/sd", package = "p5r" },
{ local = "ModFiles/sd", package = "atmosphere/contents/01005CA01580E000/romfs/CPK/BIND" },
{ local = "ModFiles/exefs", package = "atmosphere/contents/01005CA01580E000/exefs/" },
{ local = "ModFiles/sd", package = "p5r/" },
{ local = "ModFiles/sd", package = "atmosphere/contents/01005CA01580E000/romfs/CPK/BIND/" },
]

[lib]
Expand Down
Empty file.
File renamed without changes.
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(once_cell)]

use std::ffi::CStr;
use skyline::hooks::InlineCtx;

Expand Down
31 changes: 0 additions & 31 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,6 @@ use std::str::FromStr;
use skyline::nn;
use semver::Version;

pub mod env {
use std::sync::LazyLock;

#[non_exhaustive]
pub enum RunEnvironment {
Switch,
Ryujinx,
// Yuzu
}

static PLATFORM: LazyLock<RunEnvironment> = LazyLock::new(|| {
if unsafe { skyline::hooks::getRegionAddress(skyline::hooks::Region::Text) as u64 } == 0x8004000 {
RunEnvironment::Ryujinx
} else {
RunEnvironment::Switch
}
});

pub fn get_running_env() -> &'static RunEnvironment {
&PLATFORM
}

pub fn is_emulator() -> bool {
matches!(get_running_env(), RunEnvironment::Switch)
}

pub fn is_ryujinx() -> bool {
matches!(get_running_env(), RunEnvironment::Ryujinx)
}
}

/// Wrapper function for getting the version string of the game from nnSdk
pub fn get_game_version() -> Version {
unsafe {
Expand Down

0 comments on commit f5b70f4

Please sign in to comment.