From 419e673d5b02984d5299f8bf3b033fd337e9ed29 Mon Sep 17 00:00:00 2001 From: brian218 Date: Sat, 15 Oct 2022 19:32:51 +0800 Subject: [PATCH] Fix USIO Backup behavior --- rpcs3/Emu/Io/usio.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/rpcs3/Emu/Io/usio.cpp b/rpcs3/Emu/Io/usio.cpp index 5dfa082d09..abe1ff7ea5 100644 --- a/rpcs3/Emu/Io/usio.cpp +++ b/rpcs3/Emu/Io/usio.cpp @@ -80,6 +80,7 @@ usb_device_usio::usb_device_usio(const std::array& location) .bInterval = 16})); g_fxo->get().backup_memory.resize(0xB8); + g_fxo->get().last_game_status.clear(); g_fxo->get().last_game_status.resize(0x28); load_backup(); } @@ -115,7 +116,7 @@ void usb_device_usio::load_backup() return; } - const u64 file_size = g_fxo->get().backup_memory.size() + g_fxo->get().last_game_status.size(); + const u64 file_size = g_fxo->get().backup_memory.size(); if (usio_backup_file.size() != file_size) { @@ -125,7 +126,6 @@ void usb_device_usio::load_backup() } usio_backup_file.read(g_fxo->get().backup_memory.data(), g_fxo->get().backup_memory.size()); - usio_backup_file.read(g_fxo->get().last_game_status.data(), g_fxo->get().last_game_status.size()); } void usb_device_usio::save_backup() @@ -137,7 +137,6 @@ void usb_device_usio::save_backup() usio_backup_file.seek(0, fs::seek_set); usio_backup_file.write(g_fxo->get().backup_memory.data(), g_fxo->get().backup_memory.size()); - usio_backup_file.write(g_fxo->get().last_game_status.data(), g_fxo->get().last_game_status.size()); } void usb_device_usio::translate_input()