mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-31 13:50:03 +00:00 
			
		
		
		
	audio_core/hle: move implementation of LoadComponent
This commit is contained in:
		
							parent
							
								
									9ab4e3c686
								
							
						
					
					
						commit
						4add509b20
					
				
					 4 changed files with 22 additions and 13 deletions
				
			
		|  | @ -88,6 +88,9 @@ public: | |||
|     /// Sets the dsp class that we trigger interrupts for
 | ||||
|     virtual void SetServiceToInterrupt(std::weak_ptr<Service::DSP::DSP_DSP> dsp) = 0; | ||||
| 
 | ||||
|     /// Loads the DSP program
 | ||||
|     virtual void LoadComponent(const std::vector<u8>& buffer) = 0; | ||||
| 
 | ||||
|     /// Select the sink to use based on sink id.
 | ||||
|     void SetSink(const std::string& sink_id, const std::string& audio_device); | ||||
|     /// Get the current sink
 | ||||
|  |  | |||
|  | @ -11,6 +11,7 @@ | |||
| #include "audio_core/sink.h" | ||||
| #include "common/assert.h" | ||||
| #include "common/common_types.h" | ||||
| #include "common/hash.h" | ||||
| #include "common/logging/log.h" | ||||
| #include "core/core.h" | ||||
| #include "core/core_timing.h" | ||||
|  | @ -399,4 +400,15 @@ void DspHle::SetServiceToInterrupt(std::weak_ptr<DSP_DSP> dsp) { | |||
|     impl->SetServiceToInterrupt(std::move(dsp)); | ||||
| } | ||||
| 
 | ||||
| void DspHle::LoadComponent(const std::vector<u8>& component_data) { | ||||
|     // HLE doesn't need DSP program. Only log some info here
 | ||||
|     LOG_INFO(Service_DSP, "Firmware hash: {:#018x}", | ||||
|              Common::ComputeHash64(component_data.data(), component_data.size())); | ||||
|     // Some versions of the firmware have the location of DSP structures listed here.
 | ||||
|     if (component_data.size() > 0x37C) { | ||||
|         LOG_INFO(Service_DSP, "Structures hash: {:#018x}", | ||||
|                  Common::ComputeHash64(component_data.data() + 0x340, 60)); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| } // namespace AudioCore
 | ||||
|  |  | |||
|  | @ -35,6 +35,8 @@ public: | |||
| 
 | ||||
|     void SetServiceToInterrupt(std::weak_ptr<Service::DSP::DSP_DSP> dsp) override; | ||||
| 
 | ||||
|     void LoadComponent(const std::vector<u8>& buffer) override; | ||||
| 
 | ||||
| private: | ||||
|     struct Impl; | ||||
|     friend struct Impl; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue