diff options
Diffstat (limited to 'src/audio_core/renderer')
| -rw-r--r-- | src/audio_core/renderer/audio_renderer.cpp | 6 | ||||
| -rw-r--r-- | src/audio_core/renderer/audio_renderer.h | 6 | ||||
| -rw-r--r-- | src/audio_core/renderer/system.cpp | 10 | ||||
| -rw-r--r-- | src/audio_core/renderer/system.h | 6 |
4 files changed, 20 insertions, 8 deletions
diff --git a/src/audio_core/renderer/audio_renderer.cpp b/src/audio_core/renderer/audio_renderer.cpp index 09efe9be9..df03d03aa 100644 --- a/src/audio_core/renderer/audio_renderer.cpp +++ b/src/audio_core/renderer/audio_renderer.cpp | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include "audio_core/renderer/audio_renderer.h" | 6 | #include "audio_core/renderer/audio_renderer.h" |
| 7 | #include "audio_core/renderer/system_manager.h" | 7 | #include "audio_core/renderer/system_manager.h" |
| 8 | #include "core/core.h" | 8 | #include "core/core.h" |
| 9 | #include "core/hle/kernel/k_process.h" | ||
| 9 | #include "core/hle/kernel/k_transfer_memory.h" | 10 | #include "core/hle/kernel/k_transfer_memory.h" |
| 10 | #include "core/hle/service/audio/errors.h" | 11 | #include "core/hle/service/audio/errors.h" |
| 11 | 12 | ||
| @@ -17,7 +18,8 @@ Renderer::Renderer(Core::System& system_, Manager& manager_, Kernel::KEvent* ren | |||
| 17 | Result Renderer::Initialize(const AudioRendererParameterInternal& params, | 18 | Result Renderer::Initialize(const AudioRendererParameterInternal& params, |
| 18 | Kernel::KTransferMemory* transfer_memory, | 19 | Kernel::KTransferMemory* transfer_memory, |
| 19 | const u64 transfer_memory_size, const u32 process_handle, | 20 | const u64 transfer_memory_size, const u32 process_handle, |
| 20 | const u64 applet_resource_user_id, const s32 session_id) { | 21 | Kernel::KProcess& process, const u64 applet_resource_user_id, |
| 22 | const s32 session_id) { | ||
| 21 | if (params.execution_mode == ExecutionMode::Auto) { | 23 | if (params.execution_mode == ExecutionMode::Auto) { |
| 22 | if (!manager.AddSystem(system)) { | 24 | if (!manager.AddSystem(system)) { |
| 23 | LOG_ERROR(Service_Audio, | 25 | LOG_ERROR(Service_Audio, |
| @@ -28,7 +30,7 @@ Result Renderer::Initialize(const AudioRendererParameterInternal& params, | |||
| 28 | } | 30 | } |
| 29 | 31 | ||
| 30 | initialized = true; | 32 | initialized = true; |
| 31 | system.Initialize(params, transfer_memory, transfer_memory_size, process_handle, | 33 | system.Initialize(params, transfer_memory, transfer_memory_size, process_handle, process, |
| 32 | applet_resource_user_id, session_id); | 34 | applet_resource_user_id, session_id); |
| 33 | 35 | ||
| 34 | return ResultSuccess; | 36 | return ResultSuccess; |
diff --git a/src/audio_core/renderer/audio_renderer.h b/src/audio_core/renderer/audio_renderer.h index 24650278b..1219f74ca 100644 --- a/src/audio_core/renderer/audio_renderer.h +++ b/src/audio_core/renderer/audio_renderer.h | |||
| @@ -14,7 +14,8 @@ class System; | |||
| 14 | 14 | ||
| 15 | namespace Kernel { | 15 | namespace Kernel { |
| 16 | class KTransferMemory; | 16 | class KTransferMemory; |
| 17 | } | 17 | class KProcess; |
| 18 | } // namespace Kernel | ||
| 18 | 19 | ||
| 19 | namespace AudioCore { | 20 | namespace AudioCore { |
| 20 | struct AudioRendererParameterInternal; | 21 | struct AudioRendererParameterInternal; |
| @@ -44,7 +45,8 @@ public: | |||
| 44 | */ | 45 | */ |
| 45 | Result Initialize(const AudioRendererParameterInternal& params, | 46 | Result Initialize(const AudioRendererParameterInternal& params, |
| 46 | Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size, | 47 | Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size, |
| 47 | u32 process_handle, u64 applet_resource_user_id, s32 session_id); | 48 | u32 process_handle, Kernel::KProcess& process, u64 applet_resource_user_id, |
| 49 | s32 session_id); | ||
| 48 | 50 | ||
| 49 | /** | 51 | /** |
| 50 | * Finalize the renderer for shutdown. | 52 | * Finalize the renderer for shutdown. |
diff --git a/src/audio_core/renderer/system.cpp b/src/audio_core/renderer/system.cpp index 31f92087c..ca656edae 100644 --- a/src/audio_core/renderer/system.cpp +++ b/src/audio_core/renderer/system.cpp | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include "core/core.h" | 32 | #include "core/core.h" |
| 33 | #include "core/core_timing.h" | 33 | #include "core/core_timing.h" |
| 34 | #include "core/hle/kernel/k_event.h" | 34 | #include "core/hle/kernel/k_event.h" |
| 35 | #include "core/hle/kernel/k_process.h" | ||
| 35 | #include "core/hle/kernel/k_transfer_memory.h" | 36 | #include "core/hle/kernel/k_transfer_memory.h" |
| 36 | #include "core/memory.h" | 37 | #include "core/memory.h" |
| 37 | 38 | ||
| @@ -101,7 +102,8 @@ System::System(Core::System& core_, Kernel::KEvent* adsp_rendered_event_) | |||
| 101 | 102 | ||
| 102 | Result System::Initialize(const AudioRendererParameterInternal& params, | 103 | Result System::Initialize(const AudioRendererParameterInternal& params, |
| 103 | Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size, | 104 | Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size, |
| 104 | u32 process_handle_, u64 applet_resource_user_id_, s32 session_id_) { | 105 | u32 process_handle_, Kernel::KProcess& process_, |
| 106 | u64 applet_resource_user_id_, s32 session_id_) { | ||
| 105 | if (!CheckValidRevision(params.revision)) { | 107 | if (!CheckValidRevision(params.revision)) { |
| 106 | return Service::Audio::ResultInvalidRevision; | 108 | return Service::Audio::ResultInvalidRevision; |
| 107 | } | 109 | } |
| @@ -117,6 +119,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 117 | behavior.SetUserLibRevision(params.revision); | 119 | behavior.SetUserLibRevision(params.revision); |
| 118 | 120 | ||
| 119 | process_handle = process_handle_; | 121 | process_handle = process_handle_; |
| 122 | process = &process_; | ||
| 120 | applet_resource_user_id = applet_resource_user_id_; | 123 | applet_resource_user_id = applet_resource_user_id_; |
| 121 | session_id = session_id_; | 124 | session_id = session_id_; |
| 122 | 125 | ||
| @@ -129,7 +132,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 129 | render_device = params.rendering_device; | 132 | render_device = params.rendering_device; |
| 130 | execution_mode = params.execution_mode; | 133 | execution_mode = params.execution_mode; |
| 131 | 134 | ||
| 132 | core.ApplicationMemory().ZeroBlock(transfer_memory->GetSourceAddress(), transfer_memory_size); | 135 | process->GetMemory().ZeroBlock(transfer_memory->GetSourceAddress(), transfer_memory_size); |
| 133 | 136 | ||
| 134 | // Note: We're not actually using the transfer memory because it's a pain to code for. | 137 | // Note: We're not actually using the transfer memory because it's a pain to code for. |
| 135 | // Allocate the memory normally instead and hope the game doesn't try to read anything back | 138 | // Allocate the memory normally instead and hope the game doesn't try to read anything back |
| @@ -613,7 +616,8 @@ void System::SendCommandToDsp() { | |||
| 613 | static_cast<u64>((time_limit_percent / 100) * 2'880'000.0 * | 616 | static_cast<u64>((time_limit_percent / 100) * 2'880'000.0 * |
| 614 | (static_cast<f32>(render_time_limit_percent) / 100.0f))}; | 617 | (static_cast<f32>(render_time_limit_percent) / 100.0f))}; |
| 615 | audio_renderer.SetCommandBuffer(session_id, translated_addr, command_size, time_limit, | 618 | audio_renderer.SetCommandBuffer(session_id, translated_addr, command_size, time_limit, |
| 616 | applet_resource_user_id, reset_command_buffers); | 619 | applet_resource_user_id, process, |
| 620 | reset_command_buffers); | ||
| 617 | reset_command_buffers = false; | 621 | reset_command_buffers = false; |
| 618 | command_buffer_size = command_size; | 622 | command_buffer_size = command_size; |
| 619 | if (remaining_command_count == 0) { | 623 | if (remaining_command_count == 0) { |
diff --git a/src/audio_core/renderer/system.h b/src/audio_core/renderer/system.h index 8a8341710..753a0b796 100644 --- a/src/audio_core/renderer/system.h +++ b/src/audio_core/renderer/system.h | |||
| @@ -29,6 +29,7 @@ class System; | |||
| 29 | 29 | ||
| 30 | namespace Kernel { | 30 | namespace Kernel { |
| 31 | class KEvent; | 31 | class KEvent; |
| 32 | class KProcess; | ||
| 32 | class KTransferMemory; | 33 | class KTransferMemory; |
| 33 | } // namespace Kernel | 34 | } // namespace Kernel |
| 34 | 35 | ||
| @@ -80,7 +81,8 @@ public: | |||
| 80 | */ | 81 | */ |
| 81 | Result Initialize(const AudioRendererParameterInternal& params, | 82 | Result Initialize(const AudioRendererParameterInternal& params, |
| 82 | Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size, | 83 | Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size, |
| 83 | u32 process_handle, u64 applet_resource_user_id, s32 session_id); | 84 | u32 process_handle, Kernel::KProcess& process, u64 applet_resource_user_id, |
| 85 | s32 session_id); | ||
| 84 | 86 | ||
| 85 | /** | 87 | /** |
| 86 | * Finalize the system. | 88 | * Finalize the system. |
| @@ -275,6 +277,8 @@ private: | |||
| 275 | Common::Event terminate_event{}; | 277 | Common::Event terminate_event{}; |
| 276 | /// Does what locks do | 278 | /// Does what locks do |
| 277 | std::mutex lock{}; | 279 | std::mutex lock{}; |
| 280 | /// Process this audio render is operating within, used for memory reads/writes. | ||
| 281 | Kernel::KProcess* process{}; | ||
| 278 | /// Handle for the process for this system, unused | 282 | /// Handle for the process for this system, unused |
| 279 | u32 process_handle{}; | 283 | u32 process_handle{}; |
| 280 | /// Applet resource id for this system, unused | 284 | /// Applet resource id for this system, unused |