Skip to content

Commit

Permalink
Merge pull request #68 from FloppyDisck/system-features
Browse files Browse the repository at this point in the history
Add missing functions from the original API
  • Loading branch information
boozook committed Oct 1, 2023
2 parents d4a2fe1 + b48dca5 commit 3c99327
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ impl System {
pd_func_caller!((*self.0).getCrankChange,)
}

pub fn set_crank_sound_disabled(&self, disable: bool) -> Result<bool, Error> {
let last = pd_func_caller!((*self.0).setCrankSoundsDisabled, disable as i32)?;
Ok(last != 0)
}

pub fn set_auto_lock_disabled(&self, disable: bool) -> Result<(), Error> {
pd_func_caller!((*self.0).setAutoLockDisabled, disable as i32)
}

pub fn log_to_console(text: &str) {
unsafe {
if SYSTEM.0 != ptr::null_mut() {
Expand Down

0 comments on commit 3c99327

Please sign in to comment.