Reset static device state on core unload to ensure input descriptors refresh

This commit is contained in:
RTA 2025-03-16 12:46:31 +01:00 committed by flyinghead
parent 5c1249c55f
commit 8b35fb80b4
1 changed files with 4 additions and 0 deletions

View File

@ -311,6 +311,9 @@ static void retro_keyboard_event(bool down, unsigned keycode, uint32_t character
// Now comes the interesting stuff
void retro_init()
{
first_run = true;
memset(device_type, -1, sizeof(device_type));
static bool emuInited;
// Logging
@ -371,6 +374,7 @@ void retro_deinit()
{
INFO_LOG(COMMON, "retro_deinit");
first_run = true;
memset(device_type, -1, sizeof(device_type));
//When auto-save states are enabled this is needed to prevent the core from shutting down before
//any save state actions are still running - which results in partial saves