This commit is contained in:
Logan McNaughton
2026-06-08 15:23:22 +02:00
committed by GitHub
parent 42a4a46dd9
commit f691578698
5 changed files with 17 additions and 5 deletions
+1
View File
@@ -206,6 +206,7 @@ fn main() {
.allowlist_function("rdp_state_size")
.allowlist_function("rdp_save_state")
.allowlist_function("rdp_load_state")
.allowlist_function("rdp_idle")
.allowlist_function("rdp_set_fps")
.allowlist_function("get_joystick_event")
.parse_callbacks(Box::new(bindgen::CargoCallbacks::new()))
+9 -3
View File
@@ -298,6 +298,12 @@ JoystickEvent get_joystick_event() {
return joystick_event;
}
void rdp_idle() {
processor->idle();
sync_signal = 0;
rdram_dirty.assign(gfx_info.RDRAM_SIZE >> 3, false);
}
static void rdp_new_processor() {
RDP::CommandProcessorFlags flags =
RDP::COMMAND_PROCESSOR_FLAG_HOST_VISIBLE_HIDDEN_RDRAM_BIT |
@@ -327,6 +333,9 @@ static void rdp_new_processor() {
if (!g_hidden_rdram) {
printf("Failed to get hidden_rdram\n");
}
sync_signal = 0;
rdram_dirty.assign(gfx_info.RDRAM_SIZE >> 3, false);
}
static ImageHandle create_message_image(Vulkan::Device &device, int width,
@@ -429,9 +438,6 @@ void rdp_init(void *_window, GFX_INFO _gfx_info, const void *font,
achievement_progress_indicator_image = Vulkan::ImageHandle();
fps_image = Vulkan::ImageHandle();
display_fps = false;
sync_signal = 0;
rdram_dirty.assign(gfx_info.RDRAM_SIZE >> 3, false);
}
void rdp_close() {
+1
View File
@@ -58,6 +58,7 @@ void rdp_update_screen();
void rdp_render_frame();
CALL_BACK rdp_check_callback();
uint64_t rdp_process_commands();
void rdp_idle();
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();
+2 -2
View File
@@ -113,7 +113,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 {
ui::video::check_framebuffers(0, device.rdram.size);
ui::video::idle();
}
let mut rdp_state: Vec<u8> = vec![0; ui::video::state_size()];
@@ -264,7 +264,7 @@ pub fn load_savestate(device: &mut device::Device, rewind: bool, rewind_frame: O
&& device.rdram.size == state.device.rdram.size
{
if device.netplay.is_none() {
ui::video::check_framebuffers(0, device.rdram.size);
ui::video::idle();
}
device.savestate.last_rewind_saved = state.device.vi.elapsed_time;
+4
View File
@@ -165,6 +165,10 @@ pub fn save_state(rdp_state: *mut u8) {
unsafe { rdp_save_state(rdp_state) }
}
pub fn idle() {
unsafe { rdp_idle() }
}
pub fn load_state(device: &mut device::Device, rdp_state: *const u8) {
let gfx_info = build_gfx_info(device);
unsafe {