1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-25 04:02:42 +01:00

Fix USIO Backup behavior

This commit is contained in:
brian218 2022-10-15 19:32:51 +08:00 committed by Megamouse
parent 48f47de95c
commit 419e673d5b

View File

@ -80,6 +80,7 @@ usb_device_usio::usb_device_usio(const std::array<u8, 7>& location)
.bInterval = 16}));
g_fxo->get<usio_memory>().backup_memory.resize(0xB8);
g_fxo->get<usio_memory>().last_game_status.clear();
g_fxo->get<usio_memory>().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<usio_memory>().backup_memory.size() + g_fxo->get<usio_memory>().last_game_status.size();
const u64 file_size = g_fxo->get<usio_memory>().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<usio_memory>().backup_memory.data(), g_fxo->get<usio_memory>().backup_memory.size());
usio_backup_file.read(g_fxo->get<usio_memory>().last_game_status.data(), g_fxo->get<usio_memory>().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<usio_memory>().backup_memory.data(), g_fxo->get<usio_memory>().backup_memory.size());
usio_backup_file.write(g_fxo->get<usio_memory>().last_game_status.data(), g_fxo->get<usio_memory>().last_game_status.size());
}
void usb_device_usio::translate_input()