| 
									
										
										
										
											2017-12-20 18:44:32 +00:00
										 |  |  | // Copyright 2017 Citra Emulator Project
 | 
					
						
							|  |  |  | // Licensed under GPLv2 or any later version
 | 
					
						
							|  |  |  | // Refer to the license.txt file included.
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <array>
 | 
					
						
							|  |  |  | #include <memory>
 | 
					
						
							|  |  |  | #include <vector>
 | 
					
						
							| 
									
										
										
										
											2020-01-19 22:49:22 +00:00
										 |  |  | #include <boost/serialization/export.hpp>
 | 
					
						
							| 
									
										
										
										
											2017-12-20 18:44:32 +00:00
										 |  |  | #include "audio_core/audio_types.h"
 | 
					
						
							|  |  |  | #include "audio_core/dsp_interface.h"
 | 
					
						
							|  |  |  | #include "common/common_types.h"
 | 
					
						
							| 
									
										
										
										
											2018-07-24 19:54:33 +00:00
										 |  |  | #include "core/hle/service/dsp/dsp_dsp.h"
 | 
					
						
							| 
									
										
										
										
											2017-12-20 18:44:32 +00:00
										 |  |  | #include "core/memory.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-11-21 16:36:24 +00:00
										 |  |  | namespace Memory { | 
					
						
							|  |  |  | class MemorySystem; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-20 18:44:32 +00:00
										 |  |  | namespace AudioCore { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class DspHle final : public DspInterface { | 
					
						
							|  |  |  | public: | 
					
						
							| 
									
										
										
										
											2023-05-14 04:27:29 +00:00
										 |  |  |     explicit DspHle(Memory::MemorySystem& memory, Core::Timing& timing); | 
					
						
							| 
									
										
										
										
											2017-12-20 18:44:32 +00:00
										 |  |  |     ~DspHle(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-06 12:18:26 +00:00
										 |  |  |     u16 RecvData(u32 register_number) override; | 
					
						
							| 
									
										
										
										
											2018-12-06 12:28:47 +00:00
										 |  |  |     bool RecvDataIsReady(u32 register_number) const override; | 
					
						
							| 
									
										
										
										
											2018-12-06 12:35:07 +00:00
										 |  |  |     void SetSemaphore(u16 semaphore_value) override; | 
					
						
							| 
									
										
										
										
											2023-07-05 04:00:24 +00:00
										 |  |  |     std::vector<u8> PipeRead(DspPipe pipe_number, std::size_t length) override; | 
					
						
							| 
									
										
										
										
											2018-09-06 20:03:28 +00:00
										 |  |  |     std::size_t GetPipeReadableSize(DspPipe pipe_number) const override; | 
					
						
							| 
									
										
										
										
											2023-07-06 22:52:40 +00:00
										 |  |  |     void PipeWrite(DspPipe pipe_number, std::span<const u8> buffer) override; | 
					
						
							| 
									
										
										
										
											2017-12-20 18:44:32 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     std::array<u8, Memory::DSP_RAM_SIZE>& GetDspMemory() override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-29 18:26:41 +00:00
										 |  |  |     void SetServiceToInterrupt(std::weak_ptr<Service::DSP::DSP_DSP> dsp) override; | 
					
						
							| 
									
										
										
										
											2018-07-24 19:54:33 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-07-06 22:52:40 +00:00
										 |  |  |     void LoadComponent(std::span<const u8> buffer) override; | 
					
						
							| 
									
										
										
										
											2018-12-06 14:50:55 +00:00
										 |  |  |     void UnloadComponent() override; | 
					
						
							| 
									
										
										
										
											2018-12-06 13:35:21 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-20 18:44:32 +00:00
										 |  |  | private: | 
					
						
							|  |  |  |     struct Impl; | 
					
						
							|  |  |  |     friend struct Impl; | 
					
						
							|  |  |  |     std::unique_ptr<Impl> impl; | 
					
						
							| 
									
										
										
										
											2020-01-19 22:49:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     DspHle(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     template <class Archive> | 
					
						
							|  |  |  |     void serialize(Archive& ar, const unsigned int); | 
					
						
							|  |  |  |     friend class boost::serialization::access; | 
					
						
							| 
									
										
										
										
											2017-12-20 18:44:32 +00:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } // namespace AudioCore
 | 
					
						
							| 
									
										
										
										
											2020-01-19 22:49:22 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | BOOST_CLASS_EXPORT_KEY(AudioCore::DspHle) |