From 57193318a65b587c3ef870510357959d88d42feb Mon Sep 17 00:00:00 2001 From: Megamouse Date: Mon, 20 Jan 2025 22:51:38 +0100 Subject: [PATCH] cellCamera: start camera when loading savestates --- rpcs3/Emu/Cell/Modules/cellCamera.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/rpcs3/Emu/Cell/Modules/cellCamera.cpp b/rpcs3/Emu/Cell/Modules/cellCamera.cpp index 64135ca5fa..e8a6b656d7 100644 --- a/rpcs3/Emu/Cell/Modules/cellCamera.cpp +++ b/rpcs3/Emu/Cell/Modules/cellCamera.cpp @@ -151,6 +151,21 @@ void camera_context::save(utils::serial& ar) GET_OR_USE_SERIALIZATION_VERSION(ar.is_writing(), cellCamera); ar(notify_data_map, start_timestamp_us, read_mode, is_streaming, is_attached, is_open, info, attr, frame_num); + + if (!ar.is_writing()) + { + if (is_open) + { + if (!open_camera()) + { + cellCamera.error("Failed to open camera while loading savestate"); + } + else if (is_streaming && !start_camera()) + { + cellCamera.error("Failed to start camera while loading savestate"); + } + } + } } static bool check_dev_num(s32 dev_num)