diff --git a/core/hw/maple/maple_devs.cpp b/core/hw/maple/maple_devs.cpp index d0cf5bb92..6dae8924e 100755 --- a/core/hw/maple/maple_devs.cpp +++ b/core/hw/maple/maple_devs.cpp @@ -2500,7 +2500,7 @@ struct DreamLinkPurupuru : public maple_sega_purupuru static std::list> dreamLinkVmus[2]; static std::list> dreamLinkPurupurus; -void createDreamLinkDevices(std::shared_ptr dreamlink, bool gameStart) +void createDreamLinkDevices(std::shared_ptr dreamlink, bool gameStart, bool stateLoaded) { const int bus = dreamlink->getBus(); @@ -2522,7 +2522,7 @@ void createDreamLinkDevices(std::shared_ptr dreamlink, bool gameStart } } - if (gameStart || !vmuFound) + if (gameStart || stateLoaded || !vmuFound) { if (!vmu) { @@ -2531,6 +2531,13 @@ void createDreamLinkDevices(std::shared_ptr dreamlink, bool gameStart vmu->Setup(bus, i); + if (stateLoaded && vmu->useRealVmuMemory) + { + // Disconnect from real VMU memory when a state is loaded + vmu->useRealVmuMemory = false; + os_notify("WARNING: Disconnected from physical VMU memory due to load state", 6000); + } + if (!vmuFound && dev && dev->get_device_type() == MDT_SegaVMU && !vmu->useRealVmuMemory) { // Only copy data from virtual VMU if Physical VMU Only is disabled vmu->copyIn(std::static_pointer_cast(dev)); diff --git a/core/sdl/dreamlink.cpp b/core/sdl/dreamlink.cpp index 2c1974eb7..3f62d474f 100644 --- a/core/sdl/dreamlink.cpp +++ b/core/sdl/dreamlink.cpp @@ -46,7 +46,7 @@ #include #endif -void createDreamLinkDevices(std::shared_ptr dreamlink, bool gameStart); +void createDreamLinkDevices(std::shared_ptr dreamlink, bool gameStart, bool stateLoaded); void tearDownDreamLinkDevices(std::shared_ptr dreamlink); bool DreamLinkGamepad::isDreamcastController(int deviceIndex) @@ -146,21 +146,22 @@ void DreamLinkGamepad::registered() dreamlink->connect(); // Create DreamLink Maple Devices here just in case game is already running - createDreamLinkDevices(dreamlink, false); + createDreamLinkDevices(dreamlink, false, false); } } void DreamLinkGamepad::handleEvent(Event event, void *arg) { DreamLinkGamepad *gamepad = static_cast(arg); - if (gamepad->dreamlink != nullptr && event != Event::Terminate) { - createDreamLinkDevices(gamepad->dreamlink, event == Event::Start); + if (gamepad->dreamlink != nullptr) + { + if (event != Event::Terminate) { + createDreamLinkDevices(gamepad->dreamlink, event == Event::Start, event == Event::LoadState); + } + else { + gamepad->dreamlink->gameTermination(); + } } - - if (gamepad->dreamlink != nullptr && event == Event::Terminate) - { - gamepad->dreamlink->gameTermination(); - } } void DreamLinkGamepad::resetMappingToDefault(bool arcade, bool gamepad) { diff --git a/core/ui/settings_controls.cpp b/core/ui/settings_controls.cpp index b0a6576ed..20c699a60 100644 --- a/core/ui/settings_controls.cpp +++ b/core/ui/settings_controls.cpp @@ -937,7 +937,8 @@ void gui_settings_controls(bool& maple_devices_changed) { DisabledScope scope(game_started); OptionCheckbox("Use Physical VMU Memory", config::UsePhysicalVmuMemory, - "Enables direct read/write access to physical VMU memory via DreamPicoPort/DreamConn."); + "Enables direct read/write access to physical VMU memory via DreamPicoPort/DreamConn. " + "This is not compatible with load state."); } #endif