mirror of
https://github.com/gopher64/gopher64.git
synced 2026-07-11 01:25:20 +02:00
Don't reload RDP processor (#968)
* change rdram pointer * more * more * more * more * more * more * more
This commit is contained in:
@@ -202,7 +202,6 @@ fn main() {
|
||||
.allowlist_function("rdp_process_commands")
|
||||
.allowlist_function("rdp_onscreen_message")
|
||||
.allowlist_function("rdp_check_callback")
|
||||
.allowlist_function("rdp_new_processor")
|
||||
.allowlist_function("rdp_check_framebuffers")
|
||||
.allowlist_function("rdp_state_size")
|
||||
.allowlist_function("rdp_save_state")
|
||||
|
||||
+10
-11
@@ -285,15 +285,7 @@ JoystickEvent get_joystick_event() {
|
||||
return joystick_event;
|
||||
}
|
||||
|
||||
void rdp_new_processor(GFX_INFO _gfx_info) {
|
||||
gfx_info = _gfx_info;
|
||||
|
||||
sync_signal = 0;
|
||||
rdram_dirty.assign(gfx_info.RDRAM_SIZE >> 3, false);
|
||||
|
||||
if (processor) {
|
||||
delete processor;
|
||||
}
|
||||
static void rdp_new_processor() {
|
||||
RDP::CommandProcessorFlags flags = 0;
|
||||
|
||||
if (gfx_info.upscale == 2) {
|
||||
@@ -380,7 +372,7 @@ void rdp_init(void *_window, GFX_INFO _gfx_info, const void *font,
|
||||
return;
|
||||
}
|
||||
|
||||
rdp_new_processor(gfx_info);
|
||||
rdp_new_processor();
|
||||
|
||||
if (!processor->device_is_supported()) {
|
||||
rdp_close();
|
||||
@@ -413,6 +405,9 @@ 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() {
|
||||
@@ -700,7 +695,11 @@ void rdp_save_state(uint8_t *state) {
|
||||
memcpy(state, &rdp_device, sizeof(RDP_DEVICE));
|
||||
}
|
||||
|
||||
void rdp_load_state(const uint8_t *state) {
|
||||
void rdp_load_state(GFX_INFO _gfx_info, const uint8_t *state) {
|
||||
sync_signal = 0;
|
||||
rdram_dirty.assign(gfx_info.RDRAM_SIZE >> 3, false);
|
||||
|
||||
gfx_info = _gfx_info;
|
||||
memcpy(&rdp_device, state, sizeof(RDP_DEVICE));
|
||||
}
|
||||
|
||||
|
||||
@@ -58,11 +58,10 @@ void rdp_render_frame();
|
||||
CALL_BACK rdp_check_callback();
|
||||
uint64_t rdp_process_commands();
|
||||
void rdp_onscreen_message(const char *message, MESSAGE_LENGTH milliseconds);
|
||||
void rdp_new_processor(GFX_INFO _gfx_info);
|
||||
void rdp_check_framebuffers(uint32_t address, uint32_t length);
|
||||
size_t rdp_state_size();
|
||||
void rdp_save_state(uint8_t *state);
|
||||
void rdp_load_state(const 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);
|
||||
|
||||
JoystickEvent get_joystick_event();
|
||||
|
||||
+1
-2
@@ -168,8 +168,7 @@ pub fn save_state(rdp_state: *mut u8) {
|
||||
pub fn load_state(device: &mut device::Device, rdp_state: *const u8) {
|
||||
let gfx_info = build_gfx_info(device);
|
||||
unsafe {
|
||||
rdp_new_processor(gfx_info);
|
||||
rdp_load_state(rdp_state);
|
||||
rdp_load_state(gfx_info, rdp_state);
|
||||
for reg in 0..device::vi::VI_REGS_COUNT {
|
||||
rdp_set_vi_register(reg as u32, device.vi.regs[reg])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user