diff --git a/build.rs b/build.rs index 201a331..c3093ce 100644 --- a/build.rs +++ b/build.rs @@ -204,7 +204,7 @@ fn main() { .allowlist_function("rdp_check_callback") .allowlist_function("rdp_check_framebuffers") .allowlist_function("rdp_state_size") - .allowlist_function("rdp_idle") + .allowlist_function("rdp_hard_sync") .allowlist_function("rdp_save_state") .allowlist_function("rdp_load_state") .allowlist_function("rdp_set_fps") diff --git a/parallel-rdp/interface.cpp b/parallel-rdp/interface.cpp index 39c6a7f..de79721 100644 --- a/parallel-rdp/interface.cpp +++ b/parallel-rdp/interface.cpp @@ -702,8 +702,8 @@ void rdp_check_framebuffers(uint32_t address, uint32_t length) { size_t rdp_state_size() { return sizeof(RDP_DEVICE); } -void rdp_idle() { - processor->idle(); +void rdp_hard_sync() { + processor->wait_for_timeline(processor->signal_timeline()); rdram_dirty.assign(gfx_info.RDRAM_SIZE >> 3, false); sync_signal = 0; } diff --git a/parallel-rdp/interface.hpp b/parallel-rdp/interface.hpp index 310bd7c..b9b006a 100644 --- a/parallel-rdp/interface.hpp +++ b/parallel-rdp/interface.hpp @@ -61,7 +61,7 @@ uint64_t rdp_process_commands(); void rdp_onscreen_message(const char *message, MESSAGE_LENGTH milliseconds); void rdp_check_framebuffers(uint32_t address, uint32_t length); size_t rdp_state_size(); -void rdp_idle(); +void rdp_hard_sync(); void rdp_save_state(uint8_t *state); void rdp_load_state(GFX_INFO _gfx_info, const uint8_t *state); void rdp_set_fps(uint32_t fps, uint32_t vis); diff --git a/src/savestates.rs b/src/savestates.rs index 800442b..c483135 100644 --- a/src/savestates.rs +++ b/src/savestates.rs @@ -113,7 +113,7 @@ pub fn process_savestates(device: &mut device::Device) { fn create_savestate(device: &mut device::Device, rewind: bool) { if !rewind { // skipped on rewind as a speed hack - ui::video::idle(); // to flush the RDP so the RDRAM is updated + ui::video::hard_sync(); // to flush the RDP so the RDRAM is updated } let mut rdp_state: Vec = vec![0; ui::video::state_size()]; ui::video::save_state(rdp_state.as_mut_ptr()); @@ -232,7 +232,7 @@ fn load_savestate(device: &mut device::Device, rewind: bool) { if let Some(mut state) = state_data && device.rdram.size == state.device.rdram.size { - ui::video::idle(); // to flush the RDP so it doesn't overwrite the RDRAM + ui::video::hard_sync(); // to flush the RDP so it doesn't overwrite the RDRAM device.savestate.last_rewind_saved = state.device.vi.elapsed_time; diff --git a/src/ui/video.rs b/src/ui/video.rs index 62d1fb1..e7bed84 100644 --- a/src/ui/video.rs +++ b/src/ui/video.rs @@ -165,8 +165,8 @@ pub fn save_state(rdp_state: *mut u8) { unsafe { rdp_save_state(rdp_state) } } -pub fn idle() { - unsafe { rdp_idle() } +pub fn hard_sync() { + unsafe { rdp_hard_sync() } } pub fn load_state(device: &mut device::Device, rdp_state: *const u8) {