File tree Expand file tree Collapse file tree 8 files changed +7
-31
lines changed
jgenesis-native-driver/src Expand file tree Collapse file tree 8 files changed +7
-31
lines changed Original file line number Diff line number Diff line change @@ -47,7 +47,6 @@ toml = "0.8"
47
47
wasm-bindgen = " 0.2"
48
48
wasm-bindgen-futures = " 0.4"
49
49
web-time = " 1"
50
- windows = " 0.58"
51
50
winit = " 0.30"
52
51
wgpu = " 23"
53
52
xrandr = " 0.2"
Original file line number Diff line number Diff line change @@ -21,9 +21,6 @@ log = { workspace = true }
21
21
serde = { workspace = true , optional = true }
22
22
time = { workspace = true }
23
23
24
- [target .'cfg(target_os = "windows")' .dependencies ]
25
- windows = { workspace = true , features = [" Win32_Media" ] }
26
-
27
24
[target .'cfg(target_arch = "wasm32")' .dependencies ]
28
25
js-sys = { workspace = true }
29
26
Original file line number Diff line number Diff line change @@ -5,26 +5,6 @@ pub mod input;
5
5
pub mod num;
6
6
pub mod timeutils;
7
7
8
- use cfg_if:: cfg_if;
9
- use std:: thread;
10
- use std:: time:: Duration ;
11
-
12
- #[ inline]
13
- pub fn sleep ( duration : Duration ) {
14
- cfg_if ! {
15
- if #[ cfg( target_os = "windows" ) ] {
16
- // SAFETY: thread::sleep cannot panic, so timeEndPeriod will always be called after timeBeginPeriod.
17
- unsafe {
18
- windows:: Win32 :: Media :: timeBeginPeriod( 1 ) ;
19
- thread:: sleep( duration) ;
20
- windows:: Win32 :: Media :: timeEndPeriod( 1 ) ;
21
- }
22
- } else {
23
- thread:: sleep( duration) ;
24
- }
25
- }
26
- }
27
-
28
8
#[ inline]
29
9
#[ must_use]
30
10
pub fn is_appimage_build ( ) -> bool {
Original file line number Diff line number Diff line change @@ -693,7 +693,7 @@ fn collect_input(
693
693
}
694
694
}
695
695
696
- jgenesis_common :: sleep ( Duration :: from_millis ( 10 ) ) ;
696
+ thread :: sleep ( Duration :: from_millis ( 10 ) ) ;
697
697
}
698
698
}
699
699
Original file line number Diff line number Diff line change @@ -48,11 +48,11 @@ use std::error::Error;
48
48
use std:: ffi:: NulError ;
49
49
use std:: fmt:: Debug ;
50
50
use std:: hash:: Hash ;
51
- use std:: io;
52
51
use std:: path:: { Path , PathBuf } ;
53
52
use std:: rc:: Rc ;
54
53
use std:: sync:: LazyLock ;
55
54
use std:: time:: Duration ;
55
+ use std:: { io, thread} ;
56
56
use thiserror:: Error ;
57
57
58
58
const MODAL_DURATION : Duration = Duration :: from_secs ( 3 ) ;
@@ -570,7 +570,7 @@ where
570
570
571
571
if !should_run_emulator {
572
572
// Don't spin loop when the emulator is paused or rewinding
573
- jgenesis_common :: sleep ( Duration :: from_millis ( 1 ) ) ;
573
+ thread :: sleep ( Duration :: from_millis ( 1 ) ) ;
574
574
}
575
575
576
576
Ok ( None )
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ use jgenesis_common::audio::DynamicResamplingRate;
3
3
use jgenesis_common:: frontend:: AudioOutput ;
4
4
use sdl2:: AudioSubsystem ;
5
5
use sdl2:: audio:: { AudioQueue , AudioSpecDesired } ;
6
+ use std:: thread;
6
7
use std:: time:: Duration ;
7
8
use thiserror:: Error ;
8
9
@@ -167,7 +168,7 @@ impl AudioOutput for SdlAudioOutput {
167
168
if self . audio_sync {
168
169
// Block until audio queue is not full
169
170
while self . audio_queue_len_samples ( ) > audio_buffer_threshold {
170
- jgenesis_common :: sleep ( Duration :: from_micros ( 250 ) ) ;
171
+ thread :: sleep ( Duration :: from_micros ( 250 ) ) ;
171
172
}
172
173
} else if self . audio_queue_len_samples ( ) > audio_buffer_threshold {
173
174
// Audio queue is full; drop samples
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ use std::collections::HashMap;
7
7
use std:: error:: Error ;
8
8
use std:: fmt:: Debug ;
9
9
use std:: time:: Duration ;
10
- use std:: { cmp, iter} ;
10
+ use std:: { cmp, iter, thread } ;
11
11
use thiserror:: Error ;
12
12
use wgpu:: util:: DeviceExt ;
13
13
@@ -960,7 +960,7 @@ impl FrameTimeTracker {
960
960
let mut now = timeutils:: current_time_nanos ( ) ;
961
961
let next_frame_time = self . last_frame_time_nanos + self . frame_interval_nanos ;
962
962
while now < next_frame_time {
963
- jgenesis_common :: sleep ( Duration :: from_micros ( 250 ) ) ;
963
+ thread :: sleep ( Duration :: from_micros ( 250 ) ) ;
964
964
now = timeutils:: current_time_nanos ( ) ;
965
965
}
966
966
You can’t perform that action at this time.
0 commit comments