use check_framebuffers (#1031)

This commit is contained in:
Logan McNaughton
2026-06-07 17:10:49 +02:00
committed by GitHub
parent 577741907f
commit a1a7699516
5 changed files with 2 additions and 17 deletions
-1
View File
@@ -204,7 +204,6 @@ fn main() {
.allowlist_function("rdp_check_callback")
.allowlist_function("rdp_check_framebuffers")
.allowlist_function("rdp_state_size")
.allowlist_function("rdp_hard_sync")
.allowlist_function("rdp_save_state")
.allowlist_function("rdp_load_state")
.allowlist_function("rdp_set_fps")
-6
View File
@@ -702,12 +702,6 @@ void rdp_check_framebuffers(uint32_t address, uint32_t length) {
size_t rdp_state_size() { return sizeof(RDP_DEVICE); }
void rdp_hard_sync() {
processor->wait_for_timeline(processor->signal_timeline());
rdram_dirty.assign(gfx_info.RDRAM_SIZE >> 3, false);
sync_signal = 0;
}
void rdp_save_state(uint8_t *state) {
memcpy(state, &rdp_device, sizeof(RDP_DEVICE));
}
-1
View File
@@ -61,7 +61,6 @@ 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_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);
+2 -5
View File
@@ -114,7 +114,7 @@ pub fn process_savestates(device: &mut device::Device) {
pub fn create_savestate(device: &mut device::Device, rewind: bool, rewind_frame: Option<i32>) {
if !rewind {
// skipped on rewind as a speed hack
ui::video::hard_sync(); // to flush the RDP so the RDRAM is updated
ui::video::check_framebuffers(0, device.rdram.size); // to flush the RDP so the RDRAM is updated
}
let mut rdp_state: Vec<u8> = vec![0; ui::video::state_size()];
ui::video::save_state(rdp_state.as_mut_ptr());
@@ -263,10 +263,7 @@ pub fn load_savestate(device: &mut device::Device, rewind: bool, rewind_frame: O
if let Some(mut state) = state_data
&& device.rdram.size == state.device.rdram.size
{
if device.netplay.is_none() {
// skipped for netplay as a speed hack
ui::video::hard_sync(); // to flush the RDP so it doesn't overwrite the RDRAM
}
ui::video::check_framebuffers(0, device.rdram.size); // to flush the RDP so it doesn't overwrite the RDRAM
device.savestate.last_rewind_saved = state.device.vi.elapsed_time;
-4
View File
@@ -165,10 +165,6 @@ pub fn save_state(rdp_state: *mut u8) {
unsafe { rdp_save_state(rdp_state) }
}
pub fn hard_sync() {
unsafe { rdp_hard_sync() }
}
pub fn load_state(device: &mut device::Device, rdp_state: *const u8) {
let gfx_info = build_gfx_info(device);
unsafe {