diff --git a/src/core/hle/service/cam/cam.cpp b/src/core/hle/service/cam/cam.cpp index e247d998fd..c093ed7e55 100644 --- a/src/core/hle/service/cam/cam.cpp +++ b/src/core/hle/service/cam/cam.cpp @@ -30,6 +30,19 @@ void Module::serialize(Archive& ar, const unsigned int) { ar& cameras; ar& ports; ar& is_camera_reload_pending; + if (Archive::is_loading::value) { + for (int i = 0; i < NumCameras; i++) { + LoadCameraImplementation(cameras[i], i); + } + for (std::size_t i = 0; i < ports.size(); i++) { + if (ports[i].is_busy) { + cameras[ports[i].camera_id].impl->StartCapture(); + } + if (ports[i].is_receiving) { + StartReceiving(static_cast(i)); + } + } + } } SERIALIZE_IMPL(Module) diff --git a/src/core/hle/service/cam/cam.h b/src/core/hle/service/cam/cam.h index 04dc0e2ea5..7c36e02c5a 100644 --- a/src/core/hle/service/cam/cam.h +++ b/src/core/hle/service/cam/cam.h @@ -13,6 +13,7 @@ #include #include #include +#include #include "common/common_types.h" #include "common/swap.h" #include "core/global.h" @@ -792,8 +793,12 @@ private: private: template - void serialize(Archive& ar, const unsigned int) { - ar& impl; + void serialize(Archive& ar, const unsigned int file_version) { + // For compatibility: put a nullptr here + if (file_version == 0) { + std::unique_ptr x; + ar& x; + } ar& contexts; ar& current_context; ar& frame_rate; @@ -883,3 +888,4 @@ void InstallInterfaces(Core::System& system); } // namespace Service::CAM SERVICE_CONSTRUCT(Service::CAM::Module) +BOOST_CLASS_VERSION(Service::CAM::Module::CameraConfig, 1)