From 1b3e826575e05c45cfa0044b8a31c8cec86c37a1 Mon Sep 17 00:00:00 2001 From: jcm Date: Tue, 30 Apr 2024 04:43:07 -0500 Subject: [PATCH] n64: Unload and save before reset() on gamepad and disk (#1464) https://github.com/ares-emulator/ares/commit/7ad14ff6bfbd7a67fa6670101ef8a30bfa030e5e inadvertently made it so that .pak saves (and other save data) are not properly persisted to disk when unloading the n64 core. This PR resolves that, calling `unload()`, which itself calls `save()`, before resetting the gamepad and other memory. Co-authored-by: jcm --- desktop-ui/emulator/nintendo-64.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/desktop-ui/emulator/nintendo-64.cpp b/desktop-ui/emulator/nintendo-64.cpp index 9e8a9ac5d..294d9ad5e 100644 --- a/desktop-ui/emulator/nintendo-64.cpp +++ b/desktop-ui/emulator/nintendo-64.cpp @@ -193,11 +193,12 @@ auto Nintendo64::load(Menu menu) -> void { } auto Nintendo64::unload() -> void { + Emulator::unload(); + gamepad.reset(); disk.reset(); gb.reset(); - Emulator::unload(); diskInsertTimer.reset(); }