mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 05:40:04 +00:00 
			
		
		
		
	Added DSP service serialization
This commit is contained in:
		
							parent
							
								
									30fe2bfe38
								
							
						
					
					
						commit
						452ae2e371
					
				
					 3 changed files with 34 additions and 1 deletions
				
			
		|  | @ -3,6 +3,7 @@ | |||
| // Refer to the license.txt file included.
 | ||||
| 
 | ||||
| #include "audio_core/audio_types.h" | ||||
| #include "common/archives.h" | ||||
| #include "common/assert.h" | ||||
| #include "common/logging/log.h" | ||||
| #include "core/core.h" | ||||
|  | @ -13,6 +14,19 @@ | |||
| using DspPipe = AudioCore::DspPipe; | ||||
| using InterruptType = Service::DSP::DSP_DSP::InterruptType; | ||||
| 
 | ||||
| SERIALIZE_EXPORT_IMPL(Service::DSP::DSP_DSP) | ||||
| 
 | ||||
| namespace boost::serialization { | ||||
|     template <class Archive> | ||||
|     void load_construct_data(Archive& ar, Service::DSP::DSP_DSP* t, const unsigned int) | ||||
|     { | ||||
|         ::new(t)Service::DSP::DSP_DSP(Core::Global<Core::System>()); | ||||
|     } | ||||
| 
 | ||||
|     template | ||||
|     void load_construct_data<iarchive>(iarchive& ar, Service::DSP::DSP_DSP* t, const unsigned int); | ||||
| } | ||||
| 
 | ||||
| namespace AudioCore { | ||||
| enum class DspPipe; | ||||
| } | ||||
|  |  | |||
|  | @ -264,8 +264,27 @@ private: | |||
| 
 | ||||
|     /// Each DSP pipe has an associated interrupt
 | ||||
|     std::array<std::shared_ptr<Kernel::Event>, AudioCore::num_dsp_pipe> pipes = {{}}; | ||||
| 
 | ||||
|     template <class Archive> | ||||
|     void serialize(Archive& ar, const unsigned int) | ||||
|     { | ||||
|         ar & boost::serialization::base_object<Kernel::SessionRequestHandler>(*this); | ||||
|         ar & semaphore_event; | ||||
|         ar & preset_semaphore; | ||||
|         ar & interrupt_zero; | ||||
|         ar & interrupt_one; | ||||
|         ar & pipes; | ||||
|     } | ||||
|     friend class boost::serialization::access; | ||||
| }; | ||||
| 
 | ||||
| void InstallInterfaces(Core::System& system); | ||||
| 
 | ||||
| } // namespace Service::DSP
 | ||||
| 
 | ||||
| BOOST_CLASS_EXPORT_KEY(Service::DSP::DSP_DSP) | ||||
| 
 | ||||
| namespace boost::serialization { | ||||
|     template <class Archive> | ||||
|     void load_construct_data(Archive& ar, Service::DSP::DSP_DSP* t, const unsigned int); | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue