summaryrefslogtreecommitdiff
path: root/src/audio_core/hle/pipe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/audio_core/hle/pipe.cpp')
-rw-r--r--src/audio_core/hle/pipe.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/audio_core/hle/pipe.cpp b/src/audio_core/hle/pipe.cpp
index 44dff1345..b472c81d8 100644
--- a/src/audio_core/hle/pipe.cpp
+++ b/src/audio_core/hle/pipe.cpp
@@ -4,14 +4,11 @@
4 4
5#include <array> 5#include <array>
6#include <vector> 6#include <vector>
7
8#include "audio_core/hle/dsp.h" 7#include "audio_core/hle/dsp.h"
9#include "audio_core/hle/pipe.h" 8#include "audio_core/hle/pipe.h"
10
11#include "common/assert.h" 9#include "common/assert.h"
12#include "common/common_types.h" 10#include "common/common_types.h"
13#include "common/logging/log.h" 11#include "common/logging/log.h"
14
15#include "core/hle/service/dsp_dsp.h" 12#include "core/hle/service/dsp_dsp.h"
16 13
17namespace DSP { 14namespace DSP {
@@ -44,8 +41,10 @@ std::vector<u8> PipeRead(DspPipe pipe_number, u32 length) {
44 std::vector<u8>& data = pipe_data[pipe_index]; 41 std::vector<u8>& data = pipe_data[pipe_index];
45 42
46 if (length > data.size()) { 43 if (length > data.size()) {
47 LOG_WARNING(Audio_DSP, "pipe_number = %zu is out of data, application requested read of %u but %zu remain", 44 LOG_WARNING(
48 pipe_index, length, data.size()); 45 Audio_DSP,
46 "pipe_number = %zu is out of data, application requested read of %u but %zu remain",
47 pipe_index, length, data.size());
49 length = static_cast<u32>(data.size()); 48 length = static_cast<u32>(data.size());
50 } 49 }
51 50
@@ -95,7 +94,7 @@ static void AudioPipeWriteStructAddresses() {
95 0x8000 + offsetof(SharedMemory, unknown11) / 2, 94 0x8000 + offsetof(SharedMemory, unknown11) / 2,
96 0x8000 + offsetof(SharedMemory, unknown12) / 2, 95 0x8000 + offsetof(SharedMemory, unknown12) / 2,
97 0x8000 + offsetof(SharedMemory, unknown13) / 2, 96 0x8000 + offsetof(SharedMemory, unknown13) / 2,
98 0x8000 + offsetof(SharedMemory, unknown14) / 2 97 0x8000 + offsetof(SharedMemory, unknown14) / 2,
99 }; 98 };
100 99
101 // Begin with a u16 denoting the number of structs. 100 // Begin with a u16 denoting the number of structs.
@@ -112,7 +111,8 @@ void PipeWrite(DspPipe pipe_number, const std::vector<u8>& buffer) {
112 switch (pipe_number) { 111 switch (pipe_number) {
113 case DspPipe::Audio: { 112 case DspPipe::Audio: {
114 if (buffer.size() != 4) { 113 if (buffer.size() != 4) {
115 LOG_ERROR(Audio_DSP, "DspPipe::Audio: Unexpected buffer length %zu was written", buffer.size()); 114 LOG_ERROR(Audio_DSP, "DspPipe::Audio: Unexpected buffer length %zu was written",
115 buffer.size());
116 return; 116 return;
117 } 117 }
118 118
@@ -120,7 +120,7 @@ void PipeWrite(DspPipe pipe_number, const std::vector<u8>& buffer) {
120 Initalize = 0, 120 Initalize = 0,
121 Shutdown = 1, 121 Shutdown = 1,
122 Wakeup = 2, 122 Wakeup = 2,
123 Sleep = 3 123 Sleep = 3,
124 }; 124 };
125 125
126 // The difference between Initialize and Wakeup is that Input state is maintained 126 // The difference between Initialize and Wakeup is that Input state is maintained
@@ -152,7 +152,9 @@ void PipeWrite(DspPipe pipe_number, const std::vector<u8>& buffer) {
152 dsp_state = DspState::Sleeping; 152 dsp_state = DspState::Sleeping;
153 break; 153 break;
154 default: 154 default:
155 LOG_ERROR(Audio_DSP, "Application has requested unknown state transition of DSP hardware %hhu", buffer[0]); 155 LOG_ERROR(Audio_DSP,
156 "Application has requested unknown state transition of DSP hardware %hhu",
157 buffer[0]);
156 dsp_state = DspState::Off; 158 dsp_state = DspState::Off;
157 break; 159 break;
158 } 160 }
@@ -160,7 +162,8 @@ void PipeWrite(DspPipe pipe_number, const std::vector<u8>& buffer) {
160 return; 162 return;
161 } 163 }
162 default: 164 default:
163 LOG_CRITICAL(Audio_DSP, "pipe_number = %zu unimplemented", static_cast<size_t>(pipe_number)); 165 LOG_CRITICAL(Audio_DSP, "pipe_number = %zu unimplemented",
166 static_cast<size_t>(pipe_number));
164 UNIMPLEMENTED(); 167 UNIMPLEMENTED();
165 return; 168 return;
166 } 169 }