diff options
| author | 2023-03-06 19:04:12 -0500 | |
|---|---|---|
| committer | 2023-03-06 20:58:42 -0500 | |
| commit | 1d0fe75e7cca27d79006654dcc56c44cb4096d3a (patch) | |
| tree | 3291e0ad973cd3c0e07ded22c968f40c2c6dd955 | |
| parent | Merge pull request #9890 from Kelebek1/reverb_fix (diff) | |
| download | yuzu-1d0fe75e7cca27d79006654dcc56c44cb4096d3a.tar.gz yuzu-1d0fe75e7cca27d79006654dcc56c44cb4096d3a.tar.xz yuzu-1d0fe75e7cca27d79006654dcc56c44cb4096d3a.zip | |
hle: rename legacy errors to Results
35 files changed, 169 insertions, 183 deletions
diff --git a/src/audio_core/audio_in_manager.cpp b/src/audio_core/audio_in_manager.cpp index f39fb4002..3dfb613cb 100644 --- a/src/audio_core/audio_in_manager.cpp +++ b/src/audio_core/audio_in_manager.cpp | |||
| @@ -20,7 +20,7 @@ Manager::Manager(Core::System& system_) : system{system_} { | |||
| 20 | Result Manager::AcquireSessionId(size_t& session_id) { | 20 | Result Manager::AcquireSessionId(size_t& session_id) { |
| 21 | if (num_free_sessions == 0) { | 21 | if (num_free_sessions == 0) { |
| 22 | LOG_ERROR(Service_Audio, "All 4 AudioIn sessions are in use, cannot create any more"); | 22 | LOG_ERROR(Service_Audio, "All 4 AudioIn sessions are in use, cannot create any more"); |
| 23 | return Service::Audio::ERR_MAXIMUM_SESSIONS_REACHED; | 23 | return Service::Audio::ResultOutOfSessions; |
| 24 | } | 24 | } |
| 25 | session_id = session_ids[next_session_id]; | 25 | session_id = session_ids[next_session_id]; |
| 26 | next_session_id = (next_session_id + 1) % MaxInSessions; | 26 | next_session_id = (next_session_id + 1) % MaxInSessions; |
diff --git a/src/audio_core/audio_manager.cpp b/src/audio_core/audio_manager.cpp index 2acde668e..10b56f214 100644 --- a/src/audio_core/audio_manager.cpp +++ b/src/audio_core/audio_manager.cpp | |||
| @@ -19,7 +19,7 @@ void AudioManager::Shutdown() { | |||
| 19 | 19 | ||
| 20 | Result AudioManager::SetOutManager(BufferEventFunc buffer_func) { | 20 | Result AudioManager::SetOutManager(BufferEventFunc buffer_func) { |
| 21 | if (!running) { | 21 | if (!running) { |
| 22 | return Service::Audio::ERR_OPERATION_FAILED; | 22 | return Service::Audio::ResultOperationFailed; |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | std::scoped_lock l{lock}; | 25 | std::scoped_lock l{lock}; |
| @@ -35,7 +35,7 @@ Result AudioManager::SetOutManager(BufferEventFunc buffer_func) { | |||
| 35 | 35 | ||
| 36 | Result AudioManager::SetInManager(BufferEventFunc buffer_func) { | 36 | Result AudioManager::SetInManager(BufferEventFunc buffer_func) { |
| 37 | if (!running) { | 37 | if (!running) { |
| 38 | return Service::Audio::ERR_OPERATION_FAILED; | 38 | return Service::Audio::ResultOperationFailed; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | std::scoped_lock l{lock}; | 41 | std::scoped_lock l{lock}; |
diff --git a/src/audio_core/audio_out_manager.cpp b/src/audio_core/audio_out_manager.cpp index 1766efde1..f22821360 100644 --- a/src/audio_core/audio_out_manager.cpp +++ b/src/audio_core/audio_out_manager.cpp | |||
| @@ -19,7 +19,7 @@ Manager::Manager(Core::System& system_) : system{system_} { | |||
| 19 | Result Manager::AcquireSessionId(size_t& session_id) { | 19 | Result Manager::AcquireSessionId(size_t& session_id) { |
| 20 | if (num_free_sessions == 0) { | 20 | if (num_free_sessions == 0) { |
| 21 | LOG_ERROR(Service_Audio, "All 12 Audio Out sessions are in use, cannot create any more"); | 21 | LOG_ERROR(Service_Audio, "All 12 Audio Out sessions are in use, cannot create any more"); |
| 22 | return Service::Audio::ERR_MAXIMUM_SESSIONS_REACHED; | 22 | return Service::Audio::ResultOutOfSessions; |
| 23 | } | 23 | } |
| 24 | session_id = session_ids[next_session_id]; | 24 | session_id = session_ids[next_session_id]; |
| 25 | next_session_id = (next_session_id + 1) % MaxOutSessions; | 25 | next_session_id = (next_session_id + 1) % MaxOutSessions; |
diff --git a/src/audio_core/audio_render_manager.cpp b/src/audio_core/audio_render_manager.cpp index 7aba2b423..320715727 100644 --- a/src/audio_core/audio_render_manager.cpp +++ b/src/audio_core/audio_render_manager.cpp | |||
| @@ -28,7 +28,7 @@ SystemManager& Manager::GetSystemManager() { | |||
| 28 | Result Manager::GetWorkBufferSize(const AudioRendererParameterInternal& params, | 28 | Result Manager::GetWorkBufferSize(const AudioRendererParameterInternal& params, |
| 29 | u64& out_count) const { | 29 | u64& out_count) const { |
| 30 | if (!CheckValidRevision(params.revision)) { | 30 | if (!CheckValidRevision(params.revision)) { |
| 31 | return Service::Audio::ERR_INVALID_REVISION; | 31 | return Service::Audio::ResultInvalidRevision; |
| 32 | } | 32 | } |
| 33 | 33 | ||
| 34 | out_count = System::GetWorkBufferSize(params); | 34 | out_count = System::GetWorkBufferSize(params); |
diff --git a/src/audio_core/in/audio_in.cpp b/src/audio_core/in/audio_in.cpp index 91ccd5ad7..df8c44d1f 100644 --- a/src/audio_core/in/audio_in.cpp +++ b/src/audio_core/in/audio_in.cpp | |||
| @@ -46,7 +46,7 @@ Result In::AppendBuffer(const AudioInBuffer& buffer, u64 tag) { | |||
| 46 | if (system.AppendBuffer(buffer, tag)) { | 46 | if (system.AppendBuffer(buffer, tag)) { |
| 47 | return ResultSuccess; | 47 | return ResultSuccess; |
| 48 | } | 48 | } |
| 49 | return Service::Audio::ERR_BUFFER_COUNT_EXCEEDED; | 49 | return Service::Audio::ResultBufferCountReached; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | void In::ReleaseAndRegisterBuffers() { | 52 | void In::ReleaseAndRegisterBuffers() { |
diff --git a/src/audio_core/in/audio_in_system.cpp b/src/audio_core/in/audio_in_system.cpp index 934ef8c1c..e23e51758 100644 --- a/src/audio_core/in/audio_in_system.cpp +++ b/src/audio_core/in/audio_in_system.cpp | |||
| @@ -45,11 +45,11 @@ Result System::IsConfigValid(const std::string_view device_name, | |||
| 45 | const AudioInParameter& in_params) const { | 45 | const AudioInParameter& in_params) const { |
| 46 | if ((device_name.size() > 0) && | 46 | if ((device_name.size() > 0) && |
| 47 | (device_name != GetDefaultDeviceName() && device_name != GetDefaultUacDeviceName())) { | 47 | (device_name != GetDefaultDeviceName() && device_name != GetDefaultUacDeviceName())) { |
| 48 | return Service::Audio::ERR_INVALID_DEVICE_NAME; | 48 | return Service::Audio::ResultNotFound; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | if (in_params.sample_rate != TargetSampleRate && in_params.sample_rate > 0) { | 51 | if (in_params.sample_rate != TargetSampleRate && in_params.sample_rate > 0) { |
| 52 | return Service::Audio::ERR_INVALID_SAMPLE_RATE; | 52 | return Service::Audio::ResultInvalidSampleRate; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | return ResultSuccess; | 55 | return ResultSuccess; |
| @@ -80,7 +80,7 @@ Result System::Initialize(std::string device_name, const AudioInParameter& in_pa | |||
| 80 | 80 | ||
| 81 | Result System::Start() { | 81 | Result System::Start() { |
| 82 | if (state != State::Stopped) { | 82 | if (state != State::Stopped) { |
| 83 | return Service::Audio::ERR_OPERATION_FAILED; | 83 | return Service::Audio::ResultOperationFailed; |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | session->Initialize(name, sample_format, channel_count, session_id, handle, | 86 | session->Initialize(name, sample_format, channel_count, session_id, handle, |
diff --git a/src/audio_core/out/audio_out.cpp b/src/audio_core/out/audio_out.cpp index d3ee4f0eb..b7ea13405 100644 --- a/src/audio_core/out/audio_out.cpp +++ b/src/audio_core/out/audio_out.cpp | |||
| @@ -46,7 +46,7 @@ Result Out::AppendBuffer(const AudioOutBuffer& buffer, const u64 tag) { | |||
| 46 | if (system.AppendBuffer(buffer, tag)) { | 46 | if (system.AppendBuffer(buffer, tag)) { |
| 47 | return ResultSuccess; | 47 | return ResultSuccess; |
| 48 | } | 48 | } |
| 49 | return Service::Audio::ERR_BUFFER_COUNT_EXCEEDED; | 49 | return Service::Audio::ResultBufferCountReached; |
| 50 | } | 50 | } |
| 51 | 51 | ||
| 52 | void Out::ReleaseAndRegisterBuffers() { | 52 | void Out::ReleaseAndRegisterBuffers() { |
diff --git a/src/audio_core/out/audio_out_system.cpp b/src/audio_core/out/audio_out_system.cpp index e096a1dac..bd13f7219 100644 --- a/src/audio_core/out/audio_out_system.cpp +++ b/src/audio_core/out/audio_out_system.cpp | |||
| @@ -33,11 +33,11 @@ std::string_view System::GetDefaultOutputDeviceName() const { | |||
| 33 | Result System::IsConfigValid(std::string_view device_name, | 33 | Result System::IsConfigValid(std::string_view device_name, |
| 34 | const AudioOutParameter& in_params) const { | 34 | const AudioOutParameter& in_params) const { |
| 35 | if ((device_name.size() > 0) && (device_name != GetDefaultOutputDeviceName())) { | 35 | if ((device_name.size() > 0) && (device_name != GetDefaultOutputDeviceName())) { |
| 36 | return Service::Audio::ERR_INVALID_DEVICE_NAME; | 36 | return Service::Audio::ResultNotFound; |
| 37 | } | 37 | } |
| 38 | 38 | ||
| 39 | if (in_params.sample_rate != TargetSampleRate && in_params.sample_rate > 0) { | 39 | if (in_params.sample_rate != TargetSampleRate && in_params.sample_rate > 0) { |
| 40 | return Service::Audio::ERR_INVALID_SAMPLE_RATE; | 40 | return Service::Audio::ResultInvalidSampleRate; |
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | if (in_params.channel_count == 0 || in_params.channel_count == 2 || | 43 | if (in_params.channel_count == 0 || in_params.channel_count == 2 || |
| @@ -45,7 +45,7 @@ Result System::IsConfigValid(std::string_view device_name, | |||
| 45 | return ResultSuccess; | 45 | return ResultSuccess; |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | return Service::Audio::ERR_INVALID_CHANNEL_COUNT; | 48 | return Service::Audio::ResultInvalidChannelCount; |
| 49 | } | 49 | } |
| 50 | 50 | ||
| 51 | Result System::Initialize(std::string device_name, const AudioOutParameter& in_params, u32 handle_, | 51 | Result System::Initialize(std::string device_name, const AudioOutParameter& in_params, u32 handle_, |
| @@ -80,7 +80,7 @@ size_t System::GetSessionId() const { | |||
| 80 | 80 | ||
| 81 | Result System::Start() { | 81 | Result System::Start() { |
| 82 | if (state != State::Stopped) { | 82 | if (state != State::Stopped) { |
| 83 | return Service::Audio::ERR_OPERATION_FAILED; | 83 | return Service::Audio::ResultOperationFailed; |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | session->Initialize(name, sample_format, channel_count, session_id, handle, | 86 | session->Initialize(name, sample_format, channel_count, session_id, handle, |
diff --git a/src/audio_core/renderer/audio_renderer.cpp b/src/audio_core/renderer/audio_renderer.cpp index 51aa17599..a8257eb2e 100644 --- a/src/audio_core/renderer/audio_renderer.cpp +++ b/src/audio_core/renderer/audio_renderer.cpp | |||
| @@ -22,7 +22,7 @@ Result Renderer::Initialize(const AudioRendererParameterInternal& params, | |||
| 22 | if (!manager.AddSystem(system)) { | 22 | if (!manager.AddSystem(system)) { |
| 23 | LOG_ERROR(Service_Audio, | 23 | LOG_ERROR(Service_Audio, |
| 24 | "Both Audio Render sessions are in use, cannot create any more"); | 24 | "Both Audio Render sessions are in use, cannot create any more"); |
| 25 | return Service::Audio::ERR_MAXIMUM_SESSIONS_REACHED; | 25 | return Service::Audio::ResultOutOfSessions; |
| 26 | } | 26 | } |
| 27 | system_registered = true; | 27 | system_registered = true; |
| 28 | } | 28 | } |
diff --git a/src/audio_core/renderer/behavior/info_updater.cpp b/src/audio_core/renderer/behavior/info_updater.cpp index 574cf0982..e312eb166 100644 --- a/src/audio_core/renderer/behavior/info_updater.cpp +++ b/src/audio_core/renderer/behavior/info_updater.cpp | |||
| @@ -48,7 +48,7 @@ Result InfoUpdater::UpdateVoiceChannelResources(VoiceContext& voice_context) { | |||
| 48 | LOG_ERROR(Service_Audio, | 48 | LOG_ERROR(Service_Audio, |
| 49 | "Consumed an incorrect voice resource size, header size={}, consumed={}", | 49 | "Consumed an incorrect voice resource size, header size={}, consumed={}", |
| 50 | in_header->voice_resources_size, consumed_input_size); | 50 | in_header->voice_resources_size, consumed_input_size); |
| 51 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 51 | return Service::Audio::ResultInvalidUpdateInfo; |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | input += consumed_input_size; | 54 | input += consumed_input_size; |
| @@ -123,7 +123,7 @@ Result InfoUpdater::UpdateVoices(VoiceContext& voice_context, | |||
| 123 | if (consumed_input_size != in_header->voices_size) { | 123 | if (consumed_input_size != in_header->voices_size) { |
| 124 | LOG_ERROR(Service_Audio, "Consumed an incorrect voices size, header size={}, consumed={}", | 124 | LOG_ERROR(Service_Audio, "Consumed an incorrect voices size, header size={}, consumed={}", |
| 125 | in_header->voices_size, consumed_input_size); | 125 | in_header->voices_size, consumed_input_size); |
| 126 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 126 | return Service::Audio::ResultInvalidUpdateInfo; |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | out_header->voices_size = consumed_output_size; | 129 | out_header->voices_size = consumed_output_size; |
| @@ -184,7 +184,7 @@ Result InfoUpdater::UpdateEffectsVersion1(EffectContext& effect_context, const b | |||
| 184 | if (consumed_input_size != in_header->effects_size) { | 184 | if (consumed_input_size != in_header->effects_size) { |
| 185 | LOG_ERROR(Service_Audio, "Consumed an incorrect effects size, header size={}, consumed={}", | 185 | LOG_ERROR(Service_Audio, "Consumed an incorrect effects size, header size={}, consumed={}", |
| 186 | in_header->effects_size, consumed_input_size); | 186 | in_header->effects_size, consumed_input_size); |
| 187 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 187 | return Service::Audio::ResultInvalidUpdateInfo; |
| 188 | } | 188 | } |
| 189 | 189 | ||
| 190 | out_header->effects_size = consumed_output_size; | 190 | out_header->effects_size = consumed_output_size; |
| @@ -239,7 +239,7 @@ Result InfoUpdater::UpdateEffectsVersion2(EffectContext& effect_context, const b | |||
| 239 | if (consumed_input_size != in_header->effects_size) { | 239 | if (consumed_input_size != in_header->effects_size) { |
| 240 | LOG_ERROR(Service_Audio, "Consumed an incorrect effects size, header size={}, consumed={}", | 240 | LOG_ERROR(Service_Audio, "Consumed an incorrect effects size, header size={}, consumed={}", |
| 241 | in_header->effects_size, consumed_input_size); | 241 | in_header->effects_size, consumed_input_size); |
| 242 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 242 | return Service::Audio::ResultInvalidUpdateInfo; |
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | out_header->effects_size = consumed_output_size; | 245 | out_header->effects_size = consumed_output_size; |
| @@ -267,7 +267,7 @@ Result InfoUpdater::UpdateMixes(MixContext& mix_context, const u32 mix_buffer_co | |||
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | if (mix_buffer_count == 0) { | 269 | if (mix_buffer_count == 0) { |
| 270 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 270 | return Service::Audio::ResultInvalidUpdateInfo; |
| 271 | } | 271 | } |
| 272 | 272 | ||
| 273 | std::span<const MixInfo::InParameter> in_params{ | 273 | std::span<const MixInfo::InParameter> in_params{ |
| @@ -281,13 +281,13 @@ Result InfoUpdater::UpdateMixes(MixContext& mix_context, const u32 mix_buffer_co | |||
| 281 | total_buffer_count += params.buffer_count; | 281 | total_buffer_count += params.buffer_count; |
| 282 | if (params.dest_mix_id > static_cast<s32>(mix_context.GetCount()) && | 282 | if (params.dest_mix_id > static_cast<s32>(mix_context.GetCount()) && |
| 283 | params.dest_mix_id != UnusedMixId && params.mix_id != FinalMixId) { | 283 | params.dest_mix_id != UnusedMixId && params.mix_id != FinalMixId) { |
| 284 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 284 | return Service::Audio::ResultInvalidUpdateInfo; |
| 285 | } | 285 | } |
| 286 | } | 286 | } |
| 287 | } | 287 | } |
| 288 | 288 | ||
| 289 | if (total_buffer_count > mix_buffer_count) { | 289 | if (total_buffer_count > mix_buffer_count) { |
| 290 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 290 | return Service::Audio::ResultInvalidUpdateInfo; |
| 291 | } | 291 | } |
| 292 | 292 | ||
| 293 | bool mix_dirty{false}; | 293 | bool mix_dirty{false}; |
| @@ -317,7 +317,7 @@ Result InfoUpdater::UpdateMixes(MixContext& mix_context, const u32 mix_buffer_co | |||
| 317 | if (mix_dirty) { | 317 | if (mix_dirty) { |
| 318 | if (behaviour.IsSplitterSupported() && splitter_context.UsingSplitter()) { | 318 | if (behaviour.IsSplitterSupported() && splitter_context.UsingSplitter()) { |
| 319 | if (!mix_context.TSortInfo(splitter_context)) { | 319 | if (!mix_context.TSortInfo(splitter_context)) { |
| 320 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 320 | return Service::Audio::ResultInvalidUpdateInfo; |
| 321 | } | 321 | } |
| 322 | } else { | 322 | } else { |
| 323 | mix_context.SortInfo(); | 323 | mix_context.SortInfo(); |
| @@ -327,7 +327,7 @@ Result InfoUpdater::UpdateMixes(MixContext& mix_context, const u32 mix_buffer_co | |||
| 327 | if (consumed_input_size != in_header->mix_size) { | 327 | if (consumed_input_size != in_header->mix_size) { |
| 328 | LOG_ERROR(Service_Audio, "Consumed an incorrect mixes size, header size={}, consumed={}", | 328 | LOG_ERROR(Service_Audio, "Consumed an incorrect mixes size, header size={}, consumed={}", |
| 329 | in_header->mix_size, consumed_input_size); | 329 | in_header->mix_size, consumed_input_size); |
| 330 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 330 | return Service::Audio::ResultInvalidUpdateInfo; |
| 331 | } | 331 | } |
| 332 | 332 | ||
| 333 | input += mix_count * sizeof(MixInfo::InParameter); | 333 | input += mix_count * sizeof(MixInfo::InParameter); |
| @@ -384,7 +384,7 @@ Result InfoUpdater::UpdateSinks(SinkContext& sink_context, std::span<MemoryPoolI | |||
| 384 | if (consumed_input_size != in_header->sinks_size) { | 384 | if (consumed_input_size != in_header->sinks_size) { |
| 385 | LOG_ERROR(Service_Audio, "Consumed an incorrect sinks size, header size={}, consumed={}", | 385 | LOG_ERROR(Service_Audio, "Consumed an incorrect sinks size, header size={}, consumed={}", |
| 386 | in_header->sinks_size, consumed_input_size); | 386 | in_header->sinks_size, consumed_input_size); |
| 387 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 387 | return Service::Audio::ResultInvalidUpdateInfo; |
| 388 | } | 388 | } |
| 389 | 389 | ||
| 390 | input += consumed_input_size; | 390 | input += consumed_input_size; |
| @@ -411,7 +411,7 @@ Result InfoUpdater::UpdateMemoryPools(std::span<MemoryPoolInfo> memory_pools, | |||
| 411 | state != MemoryPoolInfo::ResultState::MapFailed && | 411 | state != MemoryPoolInfo::ResultState::MapFailed && |
| 412 | state != MemoryPoolInfo::ResultState::InUse) { | 412 | state != MemoryPoolInfo::ResultState::InUse) { |
| 413 | LOG_WARNING(Service_Audio, "Invalid ResultState from updating memory pools"); | 413 | LOG_WARNING(Service_Audio, "Invalid ResultState from updating memory pools"); |
| 414 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 414 | return Service::Audio::ResultInvalidUpdateInfo; |
| 415 | } | 415 | } |
| 416 | } | 416 | } |
| 417 | 417 | ||
| @@ -423,7 +423,7 @@ Result InfoUpdater::UpdateMemoryPools(std::span<MemoryPoolInfo> memory_pools, | |||
| 423 | LOG_ERROR(Service_Audio, | 423 | LOG_ERROR(Service_Audio, |
| 424 | "Consumed an incorrect memory pool size, header size={}, consumed={}", | 424 | "Consumed an incorrect memory pool size, header size={}, consumed={}", |
| 425 | in_header->memory_pool_size, consumed_input_size); | 425 | in_header->memory_pool_size, consumed_input_size); |
| 426 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 426 | return Service::Audio::ResultInvalidUpdateInfo; |
| 427 | } | 427 | } |
| 428 | 428 | ||
| 429 | input += consumed_input_size; | 429 | input += consumed_input_size; |
| @@ -453,7 +453,7 @@ Result InfoUpdater::UpdatePerformanceBuffer(std::span<u8> performance_output, | |||
| 453 | LOG_ERROR(Service_Audio, | 453 | LOG_ERROR(Service_Audio, |
| 454 | "Consumed an incorrect performance size, header size={}, consumed={}", | 454 | "Consumed an incorrect performance size, header size={}, consumed={}", |
| 455 | in_header->performance_buffer_size, consumed_input_size); | 455 | in_header->performance_buffer_size, consumed_input_size); |
| 456 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 456 | return Service::Audio::ResultInvalidUpdateInfo; |
| 457 | } | 457 | } |
| 458 | 458 | ||
| 459 | input += consumed_input_size; | 459 | input += consumed_input_size; |
| @@ -467,18 +467,18 @@ Result InfoUpdater::UpdateBehaviorInfo(BehaviorInfo& behaviour_) { | |||
| 467 | const auto in_params{reinterpret_cast<const BehaviorInfo::InParameter*>(input)}; | 467 | const auto in_params{reinterpret_cast<const BehaviorInfo::InParameter*>(input)}; |
| 468 | 468 | ||
| 469 | if (!CheckValidRevision(in_params->revision)) { | 469 | if (!CheckValidRevision(in_params->revision)) { |
| 470 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 470 | return Service::Audio::ResultInvalidUpdateInfo; |
| 471 | } | 471 | } |
| 472 | 472 | ||
| 473 | if (in_params->revision != behaviour_.GetUserRevision()) { | 473 | if (in_params->revision != behaviour_.GetUserRevision()) { |
| 474 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 474 | return Service::Audio::ResultInvalidUpdateInfo; |
| 475 | } | 475 | } |
| 476 | 476 | ||
| 477 | behaviour_.ClearError(); | 477 | behaviour_.ClearError(); |
| 478 | behaviour_.UpdateFlags(in_params->flags); | 478 | behaviour_.UpdateFlags(in_params->flags); |
| 479 | 479 | ||
| 480 | if (in_header->behaviour_size != sizeof(BehaviorInfo::InParameter)) { | 480 | if (in_header->behaviour_size != sizeof(BehaviorInfo::InParameter)) { |
| 481 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 481 | return Service::Audio::ResultInvalidUpdateInfo; |
| 482 | } | 482 | } |
| 483 | 483 | ||
| 484 | input += sizeof(BehaviorInfo::InParameter); | 484 | input += sizeof(BehaviorInfo::InParameter); |
| @@ -500,7 +500,7 @@ Result InfoUpdater::UpdateErrorInfo(const BehaviorInfo& behaviour_) { | |||
| 500 | Result InfoUpdater::UpdateSplitterInfo(SplitterContext& splitter_context) { | 500 | Result InfoUpdater::UpdateSplitterInfo(SplitterContext& splitter_context) { |
| 501 | u32 consumed_size{0}; | 501 | u32 consumed_size{0}; |
| 502 | if (!splitter_context.Update(input, consumed_size)) { | 502 | if (!splitter_context.Update(input, consumed_size)) { |
| 503 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 503 | return Service::Audio::ResultInvalidUpdateInfo; |
| 504 | } | 504 | } |
| 505 | 505 | ||
| 506 | input += consumed_size; | 506 | input += consumed_size; |
| @@ -529,9 +529,9 @@ Result InfoUpdater::UpdateRendererInfo(const u64 elapsed_frames) { | |||
| 529 | 529 | ||
| 530 | Result InfoUpdater::CheckConsumedSize() { | 530 | Result InfoUpdater::CheckConsumedSize() { |
| 531 | if (CpuAddr(input) - CpuAddr(input_origin.data()) != expected_input_size) { | 531 | if (CpuAddr(input) - CpuAddr(input_origin.data()) != expected_input_size) { |
| 532 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 532 | return Service::Audio::ResultInvalidUpdateInfo; |
| 533 | } else if (CpuAddr(output) - CpuAddr(output_origin.data()) != expected_output_size) { | 533 | } else if (CpuAddr(output) - CpuAddr(output_origin.data()) != expected_output_size) { |
| 534 | return Service::Audio::ERR_INVALID_UPDATE_DATA; | 534 | return Service::Audio::ResultInvalidUpdateInfo; |
| 535 | } | 535 | } |
| 536 | return ResultSuccess; | 536 | return ResultSuccess; |
| 537 | } | 537 | } |
diff --git a/src/audio_core/renderer/memory/pool_mapper.cpp b/src/audio_core/renderer/memory/pool_mapper.cpp index 2baf2ce08..7fd2b5f47 100644 --- a/src/audio_core/renderer/memory/pool_mapper.cpp +++ b/src/audio_core/renderer/memory/pool_mapper.cpp | |||
| @@ -92,7 +92,7 @@ bool PoolMapper::TryAttachBuffer(BehaviorInfo::ErrorInfo& error_info, AddressInf | |||
| 92 | address_info.Setup(address, size); | 92 | address_info.Setup(address, size); |
| 93 | 93 | ||
| 94 | if (!FillDspAddr(address_info)) { | 94 | if (!FillDspAddr(address_info)) { |
| 95 | error_info.error_code = Service::Audio::ERR_POOL_MAPPING_FAILED; | 95 | error_info.error_code = Service::Audio::ResultInvalidAddressInfo; |
| 96 | error_info.address = address; | 96 | error_info.address = address; |
| 97 | return force_map; | 97 | return force_map; |
| 98 | } | 98 | } |
diff --git a/src/audio_core/renderer/system.cpp b/src/audio_core/renderer/system.cpp index 31cbee282..28f063641 100644 --- a/src/audio_core/renderer/system.cpp +++ b/src/audio_core/renderer/system.cpp | |||
| @@ -101,15 +101,15 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 101 | Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size, | 101 | Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size, |
| 102 | u32 process_handle_, u64 applet_resource_user_id_, s32 session_id_) { | 102 | u32 process_handle_, u64 applet_resource_user_id_, s32 session_id_) { |
| 103 | if (!CheckValidRevision(params.revision)) { | 103 | if (!CheckValidRevision(params.revision)) { |
| 104 | return Service::Audio::ERR_INVALID_REVISION; | 104 | return Service::Audio::ResultInvalidRevision; |
| 105 | } | 105 | } |
| 106 | 106 | ||
| 107 | if (GetWorkBufferSize(params) > transfer_memory_size) { | 107 | if (GetWorkBufferSize(params) > transfer_memory_size) { |
| 108 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 108 | return Service::Audio::ResultInsufficientBuffer; |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | if (process_handle_ == 0) { | 111 | if (process_handle_ == 0) { |
| 112 | return Service::Audio::ERR_INVALID_PROCESS_HANDLE; | 112 | return Service::Audio::ResultInvalidHandle; |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | behavior.SetUserLibRevision(params.revision); | 115 | behavior.SetUserLibRevision(params.revision); |
| @@ -143,19 +143,19 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 143 | samples_workbuffer = | 143 | samples_workbuffer = |
| 144 | allocator.Allocate<s32>((voice_channels + mix_buffer_count) * sample_count, 0x10); | 144 | allocator.Allocate<s32>((voice_channels + mix_buffer_count) * sample_count, 0x10); |
| 145 | if (samples_workbuffer.empty()) { | 145 | if (samples_workbuffer.empty()) { |
| 146 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 146 | return Service::Audio::ResultInsufficientBuffer; |
| 147 | } | 147 | } |
| 148 | 148 | ||
| 149 | auto upsampler_workbuffer{allocator.Allocate<s32>( | 149 | auto upsampler_workbuffer{allocator.Allocate<s32>( |
| 150 | (voice_channels + mix_buffer_count) * TargetSampleCount * upsampler_count, 0x10)}; | 150 | (voice_channels + mix_buffer_count) * TargetSampleCount * upsampler_count, 0x10)}; |
| 151 | if (upsampler_workbuffer.empty()) { | 151 | if (upsampler_workbuffer.empty()) { |
| 152 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 152 | return Service::Audio::ResultInsufficientBuffer; |
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | depop_buffer = | 155 | depop_buffer = |
| 156 | allocator.Allocate<s32>(Common::AlignUp(static_cast<u32>(mix_buffer_count), 0x40), 0x40); | 156 | allocator.Allocate<s32>(Common::AlignUp(static_cast<u32>(mix_buffer_count), 0x40), 0x40); |
| 157 | if (depop_buffer.empty()) { | 157 | if (depop_buffer.empty()) { |
| 158 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 158 | return Service::Audio::ResultInsufficientBuffer; |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | // invalidate samples_workbuffer DSP cache | 161 | // invalidate samples_workbuffer DSP cache |
| @@ -166,12 +166,12 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | if (voice_infos.empty()) { | 168 | if (voice_infos.empty()) { |
| 169 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 169 | return Service::Audio::ResultInsufficientBuffer; |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | auto sorted_voice_infos{allocator.Allocate<VoiceInfo*>(params.voices, 0x10)}; | 172 | auto sorted_voice_infos{allocator.Allocate<VoiceInfo*>(params.voices, 0x10)}; |
| 173 | if (sorted_voice_infos.empty()) { | 173 | if (sorted_voice_infos.empty()) { |
| 174 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 174 | return Service::Audio::ResultInsufficientBuffer; |
| 175 | } | 175 | } |
| 176 | 176 | ||
| 177 | std::memset(sorted_voice_infos.data(), 0, sorted_voice_infos.size_bytes()); | 177 | std::memset(sorted_voice_infos.data(), 0, sorted_voice_infos.size_bytes()); |
| @@ -183,12 +183,12 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | if (voice_channel_resources.empty()) { | 185 | if (voice_channel_resources.empty()) { |
| 186 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 186 | return Service::Audio::ResultInsufficientBuffer; |
| 187 | } | 187 | } |
| 188 | 188 | ||
| 189 | auto voice_cpu_states{allocator.Allocate<VoiceState>(params.voices, 0x10)}; | 189 | auto voice_cpu_states{allocator.Allocate<VoiceState>(params.voices, 0x10)}; |
| 190 | if (voice_cpu_states.empty()) { | 190 | if (voice_cpu_states.empty()) { |
| 191 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 191 | return Service::Audio::ResultInsufficientBuffer; |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | for (auto& voice_state : voice_cpu_states) { | 194 | for (auto& voice_state : voice_cpu_states) { |
| @@ -198,7 +198,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 198 | auto mix_infos{allocator.Allocate<MixInfo>(params.sub_mixes + 1, 0x10)}; | 198 | auto mix_infos{allocator.Allocate<MixInfo>(params.sub_mixes + 1, 0x10)}; |
| 199 | 199 | ||
| 200 | if (mix_infos.empty()) { | 200 | if (mix_infos.empty()) { |
| 201 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 201 | return Service::Audio::ResultInsufficientBuffer; |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | u32 effect_process_order_count{0}; | 204 | u32 effect_process_order_count{0}; |
| @@ -208,7 +208,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 208 | effect_process_order_count = params.effects * (params.sub_mixes + 1); | 208 | effect_process_order_count = params.effects * (params.sub_mixes + 1); |
| 209 | effect_process_order_buffer = allocator.Allocate<s32>(effect_process_order_count, 0x10); | 209 | effect_process_order_buffer = allocator.Allocate<s32>(effect_process_order_count, 0x10); |
| 210 | if (effect_process_order_buffer.empty()) { | 210 | if (effect_process_order_buffer.empty()) { |
| 211 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 211 | return Service::Audio::ResultInsufficientBuffer; |
| 212 | } | 212 | } |
| 213 | } | 213 | } |
| 214 | 214 | ||
| @@ -222,7 +222,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 222 | 222 | ||
| 223 | auto sorted_mix_infos{allocator.Allocate<MixInfo*>(params.sub_mixes + 1, 0x10)}; | 223 | auto sorted_mix_infos{allocator.Allocate<MixInfo*>(params.sub_mixes + 1, 0x10)}; |
| 224 | if (sorted_mix_infos.empty()) { | 224 | if (sorted_mix_infos.empty()) { |
| 225 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 225 | return Service::Audio::ResultInsufficientBuffer; |
| 226 | } | 226 | } |
| 227 | 227 | ||
| 228 | std::memset(sorted_mix_infos.data(), 0, sorted_mix_infos.size_bytes()); | 228 | std::memset(sorted_mix_infos.data(), 0, sorted_mix_infos.size_bytes()); |
| @@ -235,7 +235,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 235 | auto edge_matrix_workbuffer{allocator.Allocate<u8>(edge_matrix_size, 1)}; | 235 | auto edge_matrix_workbuffer{allocator.Allocate<u8>(edge_matrix_size, 1)}; |
| 236 | 236 | ||
| 237 | if (node_states_workbuffer.empty() || edge_matrix_workbuffer.size() == 0) { | 237 | if (node_states_workbuffer.empty() || edge_matrix_workbuffer.size() == 0) { |
| 238 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 238 | return Service::Audio::ResultInsufficientBuffer; |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | mix_context.Initialize(sorted_mix_infos, mix_infos, params.sub_mixes + 1, | 241 | mix_context.Initialize(sorted_mix_infos, mix_infos, params.sub_mixes + 1, |
| @@ -250,7 +250,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 250 | 250 | ||
| 251 | upsampler_manager = allocator.Allocate<UpsamplerManager>(1, 0x10).data(); | 251 | upsampler_manager = allocator.Allocate<UpsamplerManager>(1, 0x10).data(); |
| 252 | if (upsampler_manager == nullptr) { | 252 | if (upsampler_manager == nullptr) { |
| 253 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 253 | return Service::Audio::ResultInsufficientBuffer; |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | memory_pool_workbuffer = allocator.Allocate<MemoryPoolInfo>(memory_pool_count, 0x10); | 256 | memory_pool_workbuffer = allocator.Allocate<MemoryPoolInfo>(memory_pool_count, 0x10); |
| @@ -259,18 +259,18 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | if (memory_pool_workbuffer.empty() && memory_pool_count > 0) { | 261 | if (memory_pool_workbuffer.empty() && memory_pool_count > 0) { |
| 262 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 262 | return Service::Audio::ResultInsufficientBuffer; |
| 263 | } | 263 | } |
| 264 | 264 | ||
| 265 | if (!splitter_context.Initialize(behavior, params, allocator)) { | 265 | if (!splitter_context.Initialize(behavior, params, allocator)) { |
| 266 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 266 | return Service::Audio::ResultInsufficientBuffer; |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | std::span<EffectResultState> effect_result_states_cpu{}; | 269 | std::span<EffectResultState> effect_result_states_cpu{}; |
| 270 | if (behavior.IsEffectInfoVersion2Supported() && params.effects > 0) { | 270 | if (behavior.IsEffectInfoVersion2Supported() && params.effects > 0) { |
| 271 | effect_result_states_cpu = allocator.Allocate<EffectResultState>(params.effects, 0x10); | 271 | effect_result_states_cpu = allocator.Allocate<EffectResultState>(params.effects, 0x10); |
| 272 | if (effect_result_states_cpu.empty()) { | 272 | if (effect_result_states_cpu.empty()) { |
| 273 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 273 | return Service::Audio::ResultInsufficientBuffer; |
| 274 | } | 274 | } |
| 275 | std::memset(effect_result_states_cpu.data(), 0, effect_result_states_cpu.size_bytes()); | 275 | std::memset(effect_result_states_cpu.data(), 0, effect_result_states_cpu.size_bytes()); |
| 276 | } | 276 | } |
| @@ -289,7 +289,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 289 | upsampler_workbuffer); | 289 | upsampler_workbuffer); |
| 290 | 290 | ||
| 291 | if (upsampler_infos.empty()) { | 291 | if (upsampler_infos.empty()) { |
| 292 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 292 | return Service::Audio::ResultInsufficientBuffer; |
| 293 | } | 293 | } |
| 294 | 294 | ||
| 295 | auto effect_infos{allocator.Allocate<EffectInfoBase>(params.effects, 0x40)}; | 295 | auto effect_infos{allocator.Allocate<EffectInfoBase>(params.effects, 0x40)}; |
| @@ -298,14 +298,14 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 298 | } | 298 | } |
| 299 | 299 | ||
| 300 | if (effect_infos.empty() && params.effects > 0) { | 300 | if (effect_infos.empty() && params.effects > 0) { |
| 301 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 301 | return Service::Audio::ResultInsufficientBuffer; |
| 302 | } | 302 | } |
| 303 | 303 | ||
| 304 | std::span<EffectResultState> effect_result_states_dsp{}; | 304 | std::span<EffectResultState> effect_result_states_dsp{}; |
| 305 | if (behavior.IsEffectInfoVersion2Supported() && params.effects > 0) { | 305 | if (behavior.IsEffectInfoVersion2Supported() && params.effects > 0) { |
| 306 | effect_result_states_dsp = allocator.Allocate<EffectResultState>(params.effects, 0x40); | 306 | effect_result_states_dsp = allocator.Allocate<EffectResultState>(params.effects, 0x40); |
| 307 | if (effect_result_states_dsp.empty()) { | 307 | if (effect_result_states_dsp.empty()) { |
| 308 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 308 | return Service::Audio::ResultInsufficientBuffer; |
| 309 | } | 309 | } |
| 310 | std::memset(effect_result_states_dsp.data(), 0, effect_result_states_dsp.size_bytes()); | 310 | std::memset(effect_result_states_dsp.data(), 0, effect_result_states_dsp.size_bytes()); |
| 311 | } | 311 | } |
| @@ -319,14 +319,14 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 319 | } | 319 | } |
| 320 | 320 | ||
| 321 | if (sinks.empty()) { | 321 | if (sinks.empty()) { |
| 322 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 322 | return Service::Audio::ResultInsufficientBuffer; |
| 323 | } | 323 | } |
| 324 | 324 | ||
| 325 | sink_context.Initialize(sinks, params.sinks); | 325 | sink_context.Initialize(sinks, params.sinks); |
| 326 | 326 | ||
| 327 | auto voice_dsp_states{allocator.Allocate<VoiceState>(params.voices, 0x40)}; | 327 | auto voice_dsp_states{allocator.Allocate<VoiceState>(params.voices, 0x40)}; |
| 328 | if (voice_dsp_states.empty()) { | 328 | if (voice_dsp_states.empty()) { |
| 329 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 329 | return Service::Audio::ResultInsufficientBuffer; |
| 330 | } | 330 | } |
| 331 | 331 | ||
| 332 | for (auto& voice_state : voice_dsp_states) { | 332 | for (auto& voice_state : voice_dsp_states) { |
| @@ -344,7 +344,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 344 | 0xC}; | 344 | 0xC}; |
| 345 | performance_workbuffer = allocator.Allocate<u8>(perf_workbuffer_size, 0x40); | 345 | performance_workbuffer = allocator.Allocate<u8>(perf_workbuffer_size, 0x40); |
| 346 | if (performance_workbuffer.empty()) { | 346 | if (performance_workbuffer.empty()) { |
| 347 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 347 | return Service::Audio::ResultInsufficientBuffer; |
| 348 | } | 348 | } |
| 349 | std::memset(performance_workbuffer.data(), 0, performance_workbuffer.size_bytes()); | 349 | std::memset(performance_workbuffer.data(), 0, performance_workbuffer.size_bytes()); |
| 350 | performance_manager.Initialize(performance_workbuffer, performance_workbuffer.size_bytes(), | 350 | performance_manager.Initialize(performance_workbuffer, performance_workbuffer.size_bytes(), |
| @@ -360,7 +360,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params, | |||
| 360 | command_workbuffer_size = allocator.GetRemainingSize(); | 360 | command_workbuffer_size = allocator.GetRemainingSize(); |
| 361 | command_workbuffer = allocator.Allocate<u8>(command_workbuffer_size, 0x40); | 361 | command_workbuffer = allocator.Allocate<u8>(command_workbuffer_size, 0x40); |
| 362 | if (command_workbuffer.empty()) { | 362 | if (command_workbuffer.empty()) { |
| 363 | return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE; | 363 | return Service::Audio::ResultInsufficientBuffer; |
| 364 | } | 364 | } |
| 365 | 365 | ||
| 366 | command_buffer_size = 0; | 366 | command_buffer_size = 0; |
diff --git a/src/audio_core/renderer/voice/voice_info.cpp b/src/audio_core/renderer/voice/voice_info.cpp index 1849eeb57..c0bfb23fc 100644 --- a/src/audio_core/renderer/voice/voice_info.cpp +++ b/src/audio_core/renderer/voice/voice_info.cpp | |||
| @@ -181,7 +181,7 @@ void VoiceInfo::UpdateWaveBuffer(std::span<BehaviorInfo::ErrorInfo> error_info, | |||
| 181 | if (wave_buffer_internal.start_offset * byte_size > wave_buffer_internal.size || | 181 | if (wave_buffer_internal.start_offset * byte_size > wave_buffer_internal.size || |
| 182 | wave_buffer_internal.end_offset * byte_size > wave_buffer_internal.size) { | 182 | wave_buffer_internal.end_offset * byte_size > wave_buffer_internal.size) { |
| 183 | LOG_ERROR(Service_Audio, "Invalid PCM16 start/end wavebuffer sizes!"); | 183 | LOG_ERROR(Service_Audio, "Invalid PCM16 start/end wavebuffer sizes!"); |
| 184 | error_info[0].error_code = Service::Audio::ERR_INVALID_UPDATE_DATA; | 184 | error_info[0].error_code = Service::Audio::ResultInvalidUpdateInfo; |
| 185 | error_info[0].address = wave_buffer_internal.address; | 185 | error_info[0].address = wave_buffer_internal.address; |
| 186 | return; | 186 | return; |
| 187 | } | 187 | } |
| @@ -192,7 +192,7 @@ void VoiceInfo::UpdateWaveBuffer(std::span<BehaviorInfo::ErrorInfo> error_info, | |||
| 192 | if (wave_buffer_internal.start_offset * byte_size > wave_buffer_internal.size || | 192 | if (wave_buffer_internal.start_offset * byte_size > wave_buffer_internal.size || |
| 193 | wave_buffer_internal.end_offset * byte_size > wave_buffer_internal.size) { | 193 | wave_buffer_internal.end_offset * byte_size > wave_buffer_internal.size) { |
| 194 | LOG_ERROR(Service_Audio, "Invalid PCMFloat start/end wavebuffer sizes!"); | 194 | LOG_ERROR(Service_Audio, "Invalid PCMFloat start/end wavebuffer sizes!"); |
| 195 | error_info[0].error_code = Service::Audio::ERR_INVALID_UPDATE_DATA; | 195 | error_info[0].error_code = Service::Audio::ResultInvalidUpdateInfo; |
| 196 | error_info[0].address = wave_buffer_internal.address; | 196 | error_info[0].address = wave_buffer_internal.address; |
| 197 | return; | 197 | return; |
| 198 | } | 198 | } |
| @@ -216,7 +216,7 @@ void VoiceInfo::UpdateWaveBuffer(std::span<BehaviorInfo::ErrorInfo> error_info, | |||
| 216 | if (start > static_cast<s64>(wave_buffer_internal.size) || | 216 | if (start > static_cast<s64>(wave_buffer_internal.size) || |
| 217 | end > static_cast<s64>(wave_buffer_internal.size)) { | 217 | end > static_cast<s64>(wave_buffer_internal.size)) { |
| 218 | LOG_ERROR(Service_Audio, "Invalid ADPCM start/end wavebuffer sizes!"); | 218 | LOG_ERROR(Service_Audio, "Invalid ADPCM start/end wavebuffer sizes!"); |
| 219 | error_info[0].error_code = Service::Audio::ERR_INVALID_UPDATE_DATA; | 219 | error_info[0].error_code = Service::Audio::ResultInvalidUpdateInfo; |
| 220 | error_info[0].address = wave_buffer_internal.address; | 220 | error_info[0].address = wave_buffer_internal.address; |
| 221 | return; | 221 | return; |
| 222 | } | 222 | } |
| @@ -228,7 +228,7 @@ void VoiceInfo::UpdateWaveBuffer(std::span<BehaviorInfo::ErrorInfo> error_info, | |||
| 228 | 228 | ||
| 229 | if (wave_buffer_internal.start_offset < 0 || wave_buffer_internal.end_offset < 0) { | 229 | if (wave_buffer_internal.start_offset < 0 || wave_buffer_internal.end_offset < 0) { |
| 230 | LOG_ERROR(Service_Audio, "Invalid input start/end wavebuffer sizes!"); | 230 | LOG_ERROR(Service_Audio, "Invalid input start/end wavebuffer sizes!"); |
| 231 | error_info[0].error_code = Service::Audio::ERR_INVALID_UPDATE_DATA; | 231 | error_info[0].error_code = Service::Audio::ResultInvalidUpdateInfo; |
| 232 | error_info[0].address = wave_buffer_internal.address; | 232 | error_info[0].address = wave_buffer_internal.address; |
| 233 | return; | 233 | return; |
| 234 | } | 234 | } |
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 4a1a8bb43..75e0c4f38 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -454,7 +454,6 @@ add_library(core STATIC | |||
| 454 | hle/service/filesystem/fsp_srv.h | 454 | hle/service/filesystem/fsp_srv.h |
| 455 | hle/service/fgm/fgm.cpp | 455 | hle/service/fgm/fgm.cpp |
| 456 | hle/service/fgm/fgm.h | 456 | hle/service/fgm/fgm.h |
| 457 | hle/service/friend/errors.h | ||
| 458 | hle/service/friend/friend.cpp | 457 | hle/service/friend/friend.cpp |
| 459 | hle/service/friend/friend.h | 458 | hle/service/friend/friend.h |
| 460 | hle/service/friend/friend_interface.cpp | 459 | hle/service/friend/friend_interface.cpp |
diff --git a/src/core/hle/kernel/k_process.h b/src/core/hle/kernel/k_process.h index 09bf2f1d0..549809000 100644 --- a/src/core/hle/kernel/k_process.h +++ b/src/core/hle/kernel/k_process.h | |||
| @@ -310,10 +310,10 @@ public: | |||
| 310 | /// Clears the signaled state of the process if and only if it's signaled. | 310 | /// Clears the signaled state of the process if and only if it's signaled. |
| 311 | /// | 311 | /// |
| 312 | /// @pre The process must not be already terminated. If this is called on a | 312 | /// @pre The process must not be already terminated. If this is called on a |
| 313 | /// terminated process, then ERR_INVALID_STATE will be returned. | 313 | /// terminated process, then ResultInvalidState will be returned. |
| 314 | /// | 314 | /// |
| 315 | /// @pre The process must be in a signaled state. If this is called on a | 315 | /// @pre The process must be in a signaled state. If this is called on a |
| 316 | /// process instance that is not signaled, ERR_INVALID_STATE will be | 316 | /// process instance that is not signaled, ResultInvalidState will be |
| 317 | /// returned. | 317 | /// returned. |
| 318 | Result Reset(); | 318 | Result Reset(); |
| 319 | 319 | ||
diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index ddc3a6dbe..120282aa4 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp | |||
| @@ -30,12 +30,6 @@ | |||
| 30 | 30 | ||
| 31 | namespace Service::Account { | 31 | namespace Service::Account { |
| 32 | 32 | ||
| 33 | constexpr Result ERR_INVALID_USER_ID{ErrorModule::Account, 20}; | ||
| 34 | constexpr Result ERR_INVALID_APPLICATION_ID{ErrorModule::Account, 22}; | ||
| 35 | constexpr Result ERR_INVALID_BUFFER{ErrorModule::Account, 30}; | ||
| 36 | constexpr Result ERR_INVALID_BUFFER_SIZE{ErrorModule::Account, 31}; | ||
| 37 | constexpr Result ERR_FAILED_SAVE_DATA{ErrorModule::Account, 100}; | ||
| 38 | |||
| 39 | // Thumbnails are hard coded to be at least this size | 33 | // Thumbnails are hard coded to be at least this size |
| 40 | constexpr std::size_t THUMBNAIL_SIZE = 0x24000; | 34 | constexpr std::size_t THUMBNAIL_SIZE = 0x24000; |
| 41 | 35 | ||
| @@ -384,7 +378,7 @@ protected: | |||
| 384 | if (user_data.size() < sizeof(UserData)) { | 378 | if (user_data.size() < sizeof(UserData)) { |
| 385 | LOG_ERROR(Service_ACC, "UserData buffer too small!"); | 379 | LOG_ERROR(Service_ACC, "UserData buffer too small!"); |
| 386 | IPC::ResponseBuilder rb{ctx, 2}; | 380 | IPC::ResponseBuilder rb{ctx, 2}; |
| 387 | rb.Push(ERR_INVALID_BUFFER); | 381 | rb.Push(Account::ResultInvalidArrayLength); |
| 388 | return; | 382 | return; |
| 389 | } | 383 | } |
| 390 | 384 | ||
| @@ -394,7 +388,7 @@ protected: | |||
| 394 | if (!profile_manager.SetProfileBaseAndData(user_id, base, data)) { | 388 | if (!profile_manager.SetProfileBaseAndData(user_id, base, data)) { |
| 395 | LOG_ERROR(Service_ACC, "Failed to update user data and base!"); | 389 | LOG_ERROR(Service_ACC, "Failed to update user data and base!"); |
| 396 | IPC::ResponseBuilder rb{ctx, 2}; | 390 | IPC::ResponseBuilder rb{ctx, 2}; |
| 397 | rb.Push(ERR_FAILED_SAVE_DATA); | 391 | rb.Push(Account::ResultAccountUpdateFailed); |
| 398 | return; | 392 | return; |
| 399 | } | 393 | } |
| 400 | 394 | ||
| @@ -417,7 +411,7 @@ protected: | |||
| 417 | if (user_data.size() < sizeof(UserData)) { | 411 | if (user_data.size() < sizeof(UserData)) { |
| 418 | LOG_ERROR(Service_ACC, "UserData buffer too small!"); | 412 | LOG_ERROR(Service_ACC, "UserData buffer too small!"); |
| 419 | IPC::ResponseBuilder rb{ctx, 2}; | 413 | IPC::ResponseBuilder rb{ctx, 2}; |
| 420 | rb.Push(ERR_INVALID_BUFFER); | 414 | rb.Push(Account::ResultInvalidArrayLength); |
| 421 | return; | 415 | return; |
| 422 | } | 416 | } |
| 423 | 417 | ||
| @@ -432,7 +426,7 @@ protected: | |||
| 432 | !profile_manager.SetProfileBaseAndData(user_id, base, data)) { | 426 | !profile_manager.SetProfileBaseAndData(user_id, base, data)) { |
| 433 | LOG_ERROR(Service_ACC, "Failed to update profile data, base, and image!"); | 427 | LOG_ERROR(Service_ACC, "Failed to update profile data, base, and image!"); |
| 434 | IPC::ResponseBuilder rb{ctx, 2}; | 428 | IPC::ResponseBuilder rb{ctx, 2}; |
| 435 | rb.Push(ERR_FAILED_SAVE_DATA); | 429 | rb.Push(Account::ResultAccountUpdateFailed); |
| 436 | return; | 430 | return; |
| 437 | } | 431 | } |
| 438 | 432 | ||
| @@ -764,7 +758,7 @@ void Module::Interface::InitializeApplicationInfoRestricted(HLERequestContext& c | |||
| 764 | Result Module::Interface::InitializeApplicationInfoBase() { | 758 | Result Module::Interface::InitializeApplicationInfoBase() { |
| 765 | if (application_info) { | 759 | if (application_info) { |
| 766 | LOG_ERROR(Service_ACC, "Application already initialized"); | 760 | LOG_ERROR(Service_ACC, "Application already initialized"); |
| 767 | return ERR_ACCOUNTINFO_ALREADY_INITIALIZED; | 761 | return Account::ResultApplicationInfoAlreadyInitialized; |
| 768 | } | 762 | } |
| 769 | 763 | ||
| 770 | // TODO(ogniK): This should be changed to reflect the target process for when we have multiple | 764 | // TODO(ogniK): This should be changed to reflect the target process for when we have multiple |
| @@ -775,7 +769,7 @@ Result Module::Interface::InitializeApplicationInfoBase() { | |||
| 775 | 769 | ||
| 776 | if (launch_property.Failed()) { | 770 | if (launch_property.Failed()) { |
| 777 | LOG_ERROR(Service_ACC, "Failed to get launch property"); | 771 | LOG_ERROR(Service_ACC, "Failed to get launch property"); |
| 778 | return ERR_ACCOUNTINFO_BAD_APPLICATION; | 772 | return Account::ResultInvalidApplication; |
| 779 | } | 773 | } |
| 780 | 774 | ||
| 781 | switch (launch_property->base_game_storage_id) { | 775 | switch (launch_property->base_game_storage_id) { |
| @@ -791,7 +785,7 @@ Result Module::Interface::InitializeApplicationInfoBase() { | |||
| 791 | default: | 785 | default: |
| 792 | LOG_ERROR(Service_ACC, "Invalid game storage ID! storage_id={}", | 786 | LOG_ERROR(Service_ACC, "Invalid game storage ID! storage_id={}", |
| 793 | launch_property->base_game_storage_id); | 787 | launch_property->base_game_storage_id); |
| 794 | return ERR_ACCOUNTINFO_BAD_APPLICATION; | 788 | return Account::ResultInvalidApplication; |
| 795 | } | 789 | } |
| 796 | 790 | ||
| 797 | LOG_WARNING(Service_ACC, "ApplicationInfo init required"); | 791 | LOG_WARNING(Service_ACC, "ApplicationInfo init required"); |
| @@ -899,20 +893,20 @@ void Module::Interface::StoreSaveDataThumbnail(HLERequestContext& ctx, const Com | |||
| 899 | 893 | ||
| 900 | if (tid == 0) { | 894 | if (tid == 0) { |
| 901 | LOG_ERROR(Service_ACC, "TitleID is not valid!"); | 895 | LOG_ERROR(Service_ACC, "TitleID is not valid!"); |
| 902 | rb.Push(ERR_INVALID_APPLICATION_ID); | 896 | rb.Push(Account::ResultInvalidApplication); |
| 903 | return; | 897 | return; |
| 904 | } | 898 | } |
| 905 | 899 | ||
| 906 | if (uuid.IsInvalid()) { | 900 | if (uuid.IsInvalid()) { |
| 907 | LOG_ERROR(Service_ACC, "User ID is not valid!"); | 901 | LOG_ERROR(Service_ACC, "User ID is not valid!"); |
| 908 | rb.Push(ERR_INVALID_USER_ID); | 902 | rb.Push(Account::ResultInvalidUserId); |
| 909 | return; | 903 | return; |
| 910 | } | 904 | } |
| 911 | const auto thumbnail_size = ctx.GetReadBufferSize(); | 905 | const auto thumbnail_size = ctx.GetReadBufferSize(); |
| 912 | if (thumbnail_size != THUMBNAIL_SIZE) { | 906 | if (thumbnail_size != THUMBNAIL_SIZE) { |
| 913 | LOG_ERROR(Service_ACC, "Buffer size is empty! size={:X} expecting {:X}", thumbnail_size, | 907 | LOG_ERROR(Service_ACC, "Buffer size is empty! size={:X} expecting {:X}", thumbnail_size, |
| 914 | THUMBNAIL_SIZE); | 908 | THUMBNAIL_SIZE); |
| 915 | rb.Push(ERR_INVALID_BUFFER_SIZE); | 909 | rb.Push(Account::ResultInvalidArrayLength); |
| 916 | return; | 910 | return; |
| 917 | } | 911 | } |
| 918 | 912 | ||
diff --git a/src/core/hle/service/acc/errors.h b/src/core/hle/service/acc/errors.h index e9c16b951..433ebfe9d 100644 --- a/src/core/hle/service/acc/errors.h +++ b/src/core/hle/service/acc/errors.h | |||
| @@ -7,7 +7,13 @@ | |||
| 7 | 7 | ||
| 8 | namespace Service::Account { | 8 | namespace Service::Account { |
| 9 | 9 | ||
| 10 | constexpr Result ERR_ACCOUNTINFO_BAD_APPLICATION{ErrorModule::Account, 22}; | 10 | constexpr Result ResultCancelledByUser{ErrorModule::Account, 1}; |
| 11 | constexpr Result ERR_ACCOUNTINFO_ALREADY_INITIALIZED{ErrorModule::Account, 41}; | 11 | constexpr Result ResultNoNotifications{ErrorModule::Account, 15}; |
| 12 | constexpr Result ResultInvalidUserId{ErrorModule::Account, 20}; | ||
| 13 | constexpr Result ResultInvalidApplication{ErrorModule::Account, 22}; | ||
| 14 | constexpr Result ResultNullptr{ErrorModule::Account, 30}; | ||
| 15 | constexpr Result ResultInvalidArrayLength{ErrorModule::Account, 32}; | ||
| 16 | constexpr Result ResultApplicationInfoAlreadyInitialized{ErrorModule::Account, 41}; | ||
| 17 | constexpr Result ResultAccountUpdateFailed{ErrorModule::Account, 100}; | ||
| 12 | 18 | ||
| 13 | } // namespace Service::Account | 19 | } // namespace Service::Account |
diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index f74c7b550..f17df5124 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp | |||
| @@ -39,9 +39,9 @@ | |||
| 39 | 39 | ||
| 40 | namespace Service::AM { | 40 | namespace Service::AM { |
| 41 | 41 | ||
| 42 | constexpr Result ERR_NO_DATA_IN_CHANNEL{ErrorModule::AM, 2}; | 42 | constexpr Result ResultNoDataInChannel{ErrorModule::AM, 2}; |
| 43 | constexpr Result ERR_NO_MESSAGES{ErrorModule::AM, 3}; | 43 | constexpr Result ResultNoMessages{ErrorModule::AM, 3}; |
| 44 | constexpr Result ERR_SIZE_OUT_OF_BOUNDS{ErrorModule::AM, 503}; | 44 | constexpr Result ResultInvalidOffset{ErrorModule::AM, 503}; |
| 45 | 45 | ||
| 46 | enum class LaunchParameterKind : u32 { | 46 | enum class LaunchParameterKind : u32 { |
| 47 | ApplicationSpecific = 1, | 47 | ApplicationSpecific = 1, |
| @@ -758,7 +758,7 @@ void ICommonStateGetter::ReceiveMessage(HLERequestContext& ctx) { | |||
| 758 | 758 | ||
| 759 | if (message == AppletMessageQueue::AppletMessage::None) { | 759 | if (message == AppletMessageQueue::AppletMessage::None) { |
| 760 | LOG_ERROR(Service_AM, "Message queue is empty"); | 760 | LOG_ERROR(Service_AM, "Message queue is empty"); |
| 761 | rb.Push(ERR_NO_MESSAGES); | 761 | rb.Push(AM::ResultNoMessages); |
| 762 | rb.PushEnum<AppletMessageQueue::AppletMessage>(message); | 762 | rb.PushEnum<AppletMessageQueue::AppletMessage>(message); |
| 763 | return; | 763 | return; |
| 764 | } | 764 | } |
| @@ -1028,7 +1028,7 @@ private: | |||
| 1028 | LOG_DEBUG(Service_AM, | 1028 | LOG_DEBUG(Service_AM, |
| 1029 | "storage is a nullptr. There is no data in the current normal channel"); | 1029 | "storage is a nullptr. There is no data in the current normal channel"); |
| 1030 | IPC::ResponseBuilder rb{ctx, 2}; | 1030 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1031 | rb.Push(ERR_NO_DATA_IN_CHANNEL); | 1031 | rb.Push(AM::ResultNoDataInChannel); |
| 1032 | return; | 1032 | return; |
| 1033 | } | 1033 | } |
| 1034 | 1034 | ||
| @@ -1059,7 +1059,7 @@ private: | |||
| 1059 | LOG_DEBUG(Service_AM, | 1059 | LOG_DEBUG(Service_AM, |
| 1060 | "storage is a nullptr. There is no data in the current interactive channel"); | 1060 | "storage is a nullptr. There is no data in the current interactive channel"); |
| 1061 | IPC::ResponseBuilder rb{ctx, 2}; | 1061 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1062 | rb.Push(ERR_NO_DATA_IN_CHANNEL); | 1062 | rb.Push(AM::ResultNoDataInChannel); |
| 1063 | return; | 1063 | return; |
| 1064 | } | 1064 | } |
| 1065 | 1065 | ||
| @@ -1138,7 +1138,7 @@ void IStorageAccessor::Write(HLERequestContext& ctx) { | |||
| 1138 | backing.GetSize(), size, offset); | 1138 | backing.GetSize(), size, offset); |
| 1139 | 1139 | ||
| 1140 | IPC::ResponseBuilder rb{ctx, 2}; | 1140 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1141 | rb.Push(ERR_SIZE_OUT_OF_BOUNDS); | 1141 | rb.Push(AM::ResultInvalidOffset); |
| 1142 | return; | 1142 | return; |
| 1143 | } | 1143 | } |
| 1144 | 1144 | ||
| @@ -1161,7 +1161,7 @@ void IStorageAccessor::Read(HLERequestContext& ctx) { | |||
| 1161 | backing.GetSize(), size, offset); | 1161 | backing.GetSize(), size, offset); |
| 1162 | 1162 | ||
| 1163 | IPC::ResponseBuilder rb{ctx, 2}; | 1163 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1164 | rb.Push(ERR_SIZE_OUT_OF_BOUNDS); | 1164 | rb.Push(AM::ResultInvalidOffset); |
| 1165 | return; | 1165 | return; |
| 1166 | } | 1166 | } |
| 1167 | 1167 | ||
| @@ -1502,7 +1502,7 @@ void IApplicationFunctions::PopLaunchParameter(HLERequestContext& ctx) { | |||
| 1502 | 1502 | ||
| 1503 | LOG_ERROR(Service_AM, "Attempted to load launch parameter but none was found!"); | 1503 | LOG_ERROR(Service_AM, "Attempted to load launch parameter but none was found!"); |
| 1504 | IPC::ResponseBuilder rb{ctx, 2}; | 1504 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1505 | rb.Push(ERR_NO_DATA_IN_CHANNEL); | 1505 | rb.Push(AM::ResultNoDataInChannel); |
| 1506 | } | 1506 | } |
| 1507 | 1507 | ||
| 1508 | void IApplicationFunctions::CreateApplicationAndRequestToStartForQuest(HLERequestContext& ctx) { | 1508 | void IApplicationFunctions::CreateApplicationAndRequestToStartForQuest(HLERequestContext& ctx) { |
| @@ -1799,7 +1799,7 @@ void IApplicationFunctions::TryPopFromFriendInvitationStorageChannel(HLERequestC | |||
| 1799 | LOG_WARNING(Service_AM, "(STUBBED) called"); | 1799 | LOG_WARNING(Service_AM, "(STUBBED) called"); |
| 1800 | 1800 | ||
| 1801 | IPC::ResponseBuilder rb{ctx, 2}; | 1801 | IPC::ResponseBuilder rb{ctx, 2}; |
| 1802 | rb.Push(ERR_NO_DATA_IN_CHANNEL); | 1802 | rb.Push(AM::ResultNoDataInChannel); |
| 1803 | } | 1803 | } |
| 1804 | 1804 | ||
| 1805 | void IApplicationFunctions::GetNotificationStorageChannelEvent(HLERequestContext& ctx) { | 1805 | void IApplicationFunctions::GetNotificationStorageChannelEvent(HLERequestContext& ctx) { |
diff --git a/src/core/hle/service/am/applets/applet_controller.cpp b/src/core/hle/service/am/applets/applet_controller.cpp index b418031de..58484519b 100644 --- a/src/core/hle/service/am/applets/applet_controller.cpp +++ b/src/core/hle/service/am/applets/applet_controller.cpp | |||
| @@ -19,10 +19,9 @@ | |||
| 19 | 19 | ||
| 20 | namespace Service::AM::Applets { | 20 | namespace Service::AM::Applets { |
| 21 | 21 | ||
| 22 | // This error code (0x183ACA) is thrown when the applet fails to initialize. | 22 | [[maybe_unused]] constexpr Result ResultControllerSupportCanceled{ErrorModule::HID, 3101}; |
| 23 | [[maybe_unused]] constexpr Result ERR_CONTROLLER_APPLET_3101{ErrorModule::HID, 3101}; | 23 | [[maybe_unused]] constexpr Result ResultControllerSupportNotSupportedNpadStyle{ErrorModule::HID, |
| 24 | // This error code (0x183CCA) is thrown when the u32 result in ControllerSupportResultInfo is 2. | 24 | 3102}; |
| 25 | [[maybe_unused]] constexpr Result ERR_CONTROLLER_APPLET_3102{ErrorModule::HID, 3102}; | ||
| 26 | 25 | ||
| 27 | static Core::Frontend::ControllerParameters ConvertToFrontendParameters( | 26 | static Core::Frontend::ControllerParameters ConvertToFrontendParameters( |
| 28 | ControllerSupportArgPrivate private_arg, ControllerSupportArgHeader header, bool enable_text, | 27 | ControllerSupportArgPrivate private_arg, ControllerSupportArgHeader header, bool enable_text, |
diff --git a/src/core/hle/service/am/applets/applet_profile_select.cpp b/src/core/hle/service/am/applets/applet_profile_select.cpp index c738db028..1d69f5447 100644 --- a/src/core/hle/service/am/applets/applet_profile_select.cpp +++ b/src/core/hle/service/am/applets/applet_profile_select.cpp | |||
| @@ -7,13 +7,12 @@ | |||
| 7 | #include "common/string_util.h" | 7 | #include "common/string_util.h" |
| 8 | #include "core/core.h" | 8 | #include "core/core.h" |
| 9 | #include "core/frontend/applets/profile_select.h" | 9 | #include "core/frontend/applets/profile_select.h" |
| 10 | #include "core/hle/service/acc/errors.h" | ||
| 10 | #include "core/hle/service/am/am.h" | 11 | #include "core/hle/service/am/am.h" |
| 11 | #include "core/hle/service/am/applets/applet_profile_select.h" | 12 | #include "core/hle/service/am/applets/applet_profile_select.h" |
| 12 | 13 | ||
| 13 | namespace Service::AM::Applets { | 14 | namespace Service::AM::Applets { |
| 14 | 15 | ||
| 15 | constexpr Result ERR_USER_CANCELLED_SELECTION{ErrorModule::Account, 1}; | ||
| 16 | |||
| 17 | ProfileSelect::ProfileSelect(Core::System& system_, LibraryAppletMode applet_mode_, | 16 | ProfileSelect::ProfileSelect(Core::System& system_, LibraryAppletMode applet_mode_, |
| 18 | const Core::Frontend::ProfileSelectApplet& frontend_) | 17 | const Core::Frontend::ProfileSelectApplet& frontend_) |
| 19 | : Applet{system_, applet_mode_}, frontend{frontend_}, system{system_} {} | 18 | : Applet{system_, applet_mode_}, frontend{frontend_}, system{system_} {} |
| @@ -63,8 +62,8 @@ void ProfileSelect::SelectionComplete(std::optional<Common::UUID> uuid) { | |||
| 63 | output.result = 0; | 62 | output.result = 0; |
| 64 | output.uuid_selected = *uuid; | 63 | output.uuid_selected = *uuid; |
| 65 | } else { | 64 | } else { |
| 66 | status = ERR_USER_CANCELLED_SELECTION; | 65 | status = Account::ResultCancelledByUser; |
| 67 | output.result = ERR_USER_CANCELLED_SELECTION.raw; | 66 | output.result = Account::ResultCancelledByUser.raw; |
| 68 | output.uuid_selected = Common::InvalidUUID; | 67 | output.uuid_selected = Common::InvalidUUID; |
| 69 | } | 68 | } |
| 70 | 69 | ||
diff --git a/src/core/hle/service/audio/audren_u.cpp b/src/core/hle/service/audio/audren_u.cpp index 0a6830ffa..7086d4750 100644 --- a/src/core/hle/service/audio/audren_u.cpp +++ b/src/core/hle/service/audio/audren_u.cpp | |||
| @@ -170,7 +170,7 @@ private: | |||
| 170 | 170 | ||
| 171 | if (impl->GetSystem().GetExecutionMode() == AudioCore::ExecutionMode::Manual) { | 171 | if (impl->GetSystem().GetExecutionMode() == AudioCore::ExecutionMode::Manual) { |
| 172 | IPC::ResponseBuilder rb{ctx, 2}; | 172 | IPC::ResponseBuilder rb{ctx, 2}; |
| 173 | rb.Push(ERR_NOT_SUPPORTED); | 173 | rb.Push(Audio::ResultNotSupported); |
| 174 | return; | 174 | return; |
| 175 | } | 175 | } |
| 176 | 176 | ||
| @@ -448,7 +448,7 @@ void AudRenU::OpenAudioRenderer(HLERequestContext& ctx) { | |||
| 448 | if (impl->GetSessionCount() + 1 > AudioCore::MaxRendererSessions) { | 448 | if (impl->GetSessionCount() + 1 > AudioCore::MaxRendererSessions) { |
| 449 | LOG_ERROR(Service_Audio, "Too many AudioRenderer sessions open!"); | 449 | LOG_ERROR(Service_Audio, "Too many AudioRenderer sessions open!"); |
| 450 | IPC::ResponseBuilder rb{ctx, 2}; | 450 | IPC::ResponseBuilder rb{ctx, 2}; |
| 451 | rb.Push(ERR_MAXIMUM_SESSIONS_REACHED); | 451 | rb.Push(Audio::ResultOutOfSessions); |
| 452 | return; | 452 | return; |
| 453 | } | 453 | } |
| 454 | 454 | ||
| @@ -461,7 +461,7 @@ void AudRenU::OpenAudioRenderer(HLERequestContext& ctx) { | |||
| 461 | if (session_id == -1) { | 461 | if (session_id == -1) { |
| 462 | LOG_ERROR(Service_Audio, "Tried to open a session that's already in use!"); | 462 | LOG_ERROR(Service_Audio, "Tried to open a session that's already in use!"); |
| 463 | IPC::ResponseBuilder rb{ctx, 2}; | 463 | IPC::ResponseBuilder rb{ctx, 2}; |
| 464 | rb.Push(ERR_MAXIMUM_SESSIONS_REACHED); | 464 | rb.Push(Audio::ResultOutOfSessions); |
| 465 | return; | 465 | return; |
| 466 | } | 466 | } |
| 467 | 467 | ||
diff --git a/src/core/hle/service/audio/errors.h b/src/core/hle/service/audio/errors.h index d706978cb..3d3d3d97a 100644 --- a/src/core/hle/service/audio/errors.h +++ b/src/core/hle/service/audio/errors.h | |||
| @@ -7,17 +7,17 @@ | |||
| 7 | 7 | ||
| 8 | namespace Service::Audio { | 8 | namespace Service::Audio { |
| 9 | 9 | ||
| 10 | constexpr Result ERR_INVALID_DEVICE_NAME{ErrorModule::Audio, 1}; | 10 | constexpr Result ResultNotFound{ErrorModule::Audio, 1}; |
| 11 | constexpr Result ERR_OPERATION_FAILED{ErrorModule::Audio, 2}; | 11 | constexpr Result ResultOperationFailed{ErrorModule::Audio, 2}; |
| 12 | constexpr Result ERR_INVALID_SAMPLE_RATE{ErrorModule::Audio, 3}; | 12 | constexpr Result ResultInvalidSampleRate{ErrorModule::Audio, 3}; |
| 13 | constexpr Result ERR_INSUFFICIENT_BUFFER_SIZE{ErrorModule::Audio, 4}; | 13 | constexpr Result ResultInsufficientBuffer{ErrorModule::Audio, 4}; |
| 14 | constexpr Result ERR_MAXIMUM_SESSIONS_REACHED{ErrorModule::Audio, 5}; | 14 | constexpr Result ResultOutOfSessions{ErrorModule::Audio, 5}; |
| 15 | constexpr Result ERR_BUFFER_COUNT_EXCEEDED{ErrorModule::Audio, 8}; | 15 | constexpr Result ResultBufferCountReached{ErrorModule::Audio, 8}; |
| 16 | constexpr Result ERR_INVALID_CHANNEL_COUNT{ErrorModule::Audio, 10}; | 16 | constexpr Result ResultInvalidChannelCount{ErrorModule::Audio, 10}; |
| 17 | constexpr Result ERR_INVALID_UPDATE_DATA{ErrorModule::Audio, 41}; | 17 | constexpr Result ResultInvalidUpdateInfo{ErrorModule::Audio, 41}; |
| 18 | constexpr Result ERR_POOL_MAPPING_FAILED{ErrorModule::Audio, 42}; | 18 | constexpr Result ResultInvalidAddressInfo{ErrorModule::Audio, 42}; |
| 19 | constexpr Result ERR_NOT_SUPPORTED{ErrorModule::Audio, 513}; | 19 | constexpr Result ResultNotSupported{ErrorModule::Audio, 513}; |
| 20 | constexpr Result ERR_INVALID_PROCESS_HANDLE{ErrorModule::Audio, 1536}; | 20 | constexpr Result ResultInvalidHandle{ErrorModule::Audio, 1536}; |
| 21 | constexpr Result ERR_INVALID_REVISION{ErrorModule::Audio, 1537}; | 21 | constexpr Result ResultInvalidRevision{ErrorModule::Audio, 1537}; |
| 22 | 22 | ||
| 23 | } // namespace Service::Audio | 23 | } // namespace Service::Audio |
diff --git a/src/core/hle/service/friend/errors.h b/src/core/hle/service/friend/errors.h deleted file mode 100644 index ff525d865..000000000 --- a/src/core/hle/service/friend/errors.h +++ /dev/null | |||
| @@ -1,11 +0,0 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later | ||
| 3 | |||
| 4 | #pragma once | ||
| 5 | |||
| 6 | #include "core/hle/result.h" | ||
| 7 | |||
| 8 | namespace Service::Friend { | ||
| 9 | |||
| 10 | constexpr Result ERR_NO_NOTIFICATIONS{ErrorModule::Account, 15}; | ||
| 11 | } | ||
diff --git a/src/core/hle/service/friend/friend.cpp b/src/core/hle/service/friend/friend.cpp index 447deab8b..9d05f9801 100644 --- a/src/core/hle/service/friend/friend.cpp +++ b/src/core/hle/service/friend/friend.cpp | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | #include "common/uuid.h" | 6 | #include "common/uuid.h" |
| 7 | #include "core/core.h" | 7 | #include "core/core.h" |
| 8 | #include "core/hle/kernel/k_event.h" | 8 | #include "core/hle/kernel/k_event.h" |
| 9 | #include "core/hle/service/friend/errors.h" | 9 | #include "core/hle/service/acc/errors.h" |
| 10 | #include "core/hle/service/friend/friend.h" | 10 | #include "core/hle/service/friend/friend.h" |
| 11 | #include "core/hle/service/friend/friend_interface.h" | 11 | #include "core/hle/service/friend/friend_interface.h" |
| 12 | #include "core/hle/service/ipc_helpers.h" | 12 | #include "core/hle/service/ipc_helpers.h" |
| @@ -259,7 +259,7 @@ private: | |||
| 259 | if (notifications.empty()) { | 259 | if (notifications.empty()) { |
| 260 | LOG_ERROR(Service_Friend, "No notifications in queue!"); | 260 | LOG_ERROR(Service_Friend, "No notifications in queue!"); |
| 261 | IPC::ResponseBuilder rb{ctx, 2}; | 261 | IPC::ResponseBuilder rb{ctx, 2}; |
| 262 | rb.Push(ERR_NO_NOTIFICATIONS); | 262 | rb.Push(Account::ResultNoNotifications); |
| 263 | return; | 263 | return; |
| 264 | } | 264 | } |
| 265 | 265 | ||
diff --git a/src/core/hle/service/glue/arp.cpp b/src/core/hle/service/glue/arp.cpp index 9db136bac..929dcca0d 100644 --- a/src/core/hle/service/glue/arp.cpp +++ b/src/core/hle/service/glue/arp.cpp | |||
| @@ -61,7 +61,7 @@ void ARP_R::GetApplicationLaunchProperty(HLERequestContext& ctx) { | |||
| 61 | if (!title_id.has_value()) { | 61 | if (!title_id.has_value()) { |
| 62 | LOG_ERROR(Service_ARP, "Failed to get title ID for process ID!"); | 62 | LOG_ERROR(Service_ARP, "Failed to get title ID for process ID!"); |
| 63 | IPC::ResponseBuilder rb{ctx, 2}; | 63 | IPC::ResponseBuilder rb{ctx, 2}; |
| 64 | rb.Push(ERR_NOT_REGISTERED); | 64 | rb.Push(Glue::ResultProcessIdNotRegistered); |
| 65 | return; | 65 | return; |
| 66 | } | 66 | } |
| 67 | 67 | ||
| @@ -109,7 +109,7 @@ void ARP_R::GetApplicationControlProperty(HLERequestContext& ctx) { | |||
| 109 | if (!title_id.has_value()) { | 109 | if (!title_id.has_value()) { |
| 110 | LOG_ERROR(Service_ARP, "Failed to get title ID for process ID!"); | 110 | LOG_ERROR(Service_ARP, "Failed to get title ID for process ID!"); |
| 111 | IPC::ResponseBuilder rb{ctx, 2}; | 111 | IPC::ResponseBuilder rb{ctx, 2}; |
| 112 | rb.Push(ERR_NOT_REGISTERED); | 112 | rb.Push(Glue::ResultProcessIdNotRegistered); |
| 113 | return; | 113 | return; |
| 114 | } | 114 | } |
| 115 | 115 | ||
| @@ -178,7 +178,7 @@ private: | |||
| 178 | if (process_id == 0) { | 178 | if (process_id == 0) { |
| 179 | LOG_ERROR(Service_ARP, "Must have non-zero process ID!"); | 179 | LOG_ERROR(Service_ARP, "Must have non-zero process ID!"); |
| 180 | IPC::ResponseBuilder rb{ctx, 2}; | 180 | IPC::ResponseBuilder rb{ctx, 2}; |
| 181 | rb.Push(ERR_INVALID_PROCESS_ID); | 181 | rb.Push(Glue::ResultInvalidProcessId); |
| 182 | return; | 182 | return; |
| 183 | } | 183 | } |
| 184 | 184 | ||
| @@ -186,7 +186,7 @@ private: | |||
| 186 | LOG_ERROR(Service_ARP, | 186 | LOG_ERROR(Service_ARP, |
| 187 | "Attempted to issue registrar, but registrar is already issued!"); | 187 | "Attempted to issue registrar, but registrar is already issued!"); |
| 188 | IPC::ResponseBuilder rb{ctx, 2}; | 188 | IPC::ResponseBuilder rb{ctx, 2}; |
| 189 | rb.Push(ERR_INVALID_ACCESS); | 189 | rb.Push(Glue::ResultAlreadyBound); |
| 190 | return; | 190 | return; |
| 191 | } | 191 | } |
| 192 | 192 | ||
| @@ -205,7 +205,7 @@ private: | |||
| 205 | Service_ARP, | 205 | Service_ARP, |
| 206 | "Attempted to set application launch property, but registrar is already issued!"); | 206 | "Attempted to set application launch property, but registrar is already issued!"); |
| 207 | IPC::ResponseBuilder rb{ctx, 2}; | 207 | IPC::ResponseBuilder rb{ctx, 2}; |
| 208 | rb.Push(ERR_INVALID_ACCESS); | 208 | rb.Push(Glue::ResultAlreadyBound); |
| 209 | return; | 209 | return; |
| 210 | } | 210 | } |
| 211 | 211 | ||
| @@ -224,7 +224,7 @@ private: | |||
| 224 | Service_ARP, | 224 | Service_ARP, |
| 225 | "Attempted to set application control property, but registrar is already issued!"); | 225 | "Attempted to set application control property, but registrar is already issued!"); |
| 226 | IPC::ResponseBuilder rb{ctx, 2}; | 226 | IPC::ResponseBuilder rb{ctx, 2}; |
| 227 | rb.Push(ERR_INVALID_ACCESS); | 227 | rb.Push(Glue::ResultAlreadyBound); |
| 228 | return; | 228 | return; |
| 229 | } | 229 | } |
| 230 | 230 | ||
| @@ -263,7 +263,7 @@ void ARP_W::AcquireRegistrar(HLERequestContext& ctx) { | |||
| 263 | system, [this](u64 process_id, ApplicationLaunchProperty launch, std::vector<u8> control) { | 263 | system, [this](u64 process_id, ApplicationLaunchProperty launch, std::vector<u8> control) { |
| 264 | const auto res = GetTitleIDForProcessID(system, process_id); | 264 | const auto res = GetTitleIDForProcessID(system, process_id); |
| 265 | if (!res.has_value()) { | 265 | if (!res.has_value()) { |
| 266 | return ERR_NOT_REGISTERED; | 266 | return Glue::ResultProcessIdNotRegistered; |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | return manager.Register(*res, launch, std::move(control)); | 269 | return manager.Register(*res, launch, std::move(control)); |
| @@ -283,7 +283,7 @@ void ARP_W::UnregisterApplicationInstance(HLERequestContext& ctx) { | |||
| 283 | if (process_id == 0) { | 283 | if (process_id == 0) { |
| 284 | LOG_ERROR(Service_ARP, "Must have non-zero process ID!"); | 284 | LOG_ERROR(Service_ARP, "Must have non-zero process ID!"); |
| 285 | IPC::ResponseBuilder rb{ctx, 2}; | 285 | IPC::ResponseBuilder rb{ctx, 2}; |
| 286 | rb.Push(ERR_INVALID_PROCESS_ID); | 286 | rb.Push(Glue::ResultInvalidProcessId); |
| 287 | return; | 287 | return; |
| 288 | } | 288 | } |
| 289 | 289 | ||
| @@ -292,7 +292,7 @@ void ARP_W::UnregisterApplicationInstance(HLERequestContext& ctx) { | |||
| 292 | if (!title_id.has_value()) { | 292 | if (!title_id.has_value()) { |
| 293 | LOG_ERROR(Service_ARP, "No title ID for process ID!"); | 293 | LOG_ERROR(Service_ARP, "No title ID for process ID!"); |
| 294 | IPC::ResponseBuilder rb{ctx, 2}; | 294 | IPC::ResponseBuilder rb{ctx, 2}; |
| 295 | rb.Push(ERR_NOT_REGISTERED); | 295 | rb.Push(Glue::ResultProcessIdNotRegistered); |
| 296 | return; | 296 | return; |
| 297 | } | 297 | } |
| 298 | 298 | ||
diff --git a/src/core/hle/service/glue/errors.h b/src/core/hle/service/glue/errors.h index d4ce7f44e..30feaa5c0 100644 --- a/src/core/hle/service/glue/errors.h +++ b/src/core/hle/service/glue/errors.h | |||
| @@ -7,9 +7,8 @@ | |||
| 7 | 7 | ||
| 8 | namespace Service::Glue { | 8 | namespace Service::Glue { |
| 9 | 9 | ||
| 10 | constexpr Result ERR_INVALID_RESOURCE{ErrorModule::ARP, 30}; | 10 | constexpr Result ResultInvalidProcessId{ErrorModule::ARP, 31}; |
| 11 | constexpr Result ERR_INVALID_PROCESS_ID{ErrorModule::ARP, 31}; | 11 | constexpr Result ResultAlreadyBound{ErrorModule::ARP, 42}; |
| 12 | constexpr Result ERR_INVALID_ACCESS{ErrorModule::ARP, 42}; | 12 | constexpr Result ResultProcessIdNotRegistered{ErrorModule::ARP, 102}; |
| 13 | constexpr Result ERR_NOT_REGISTERED{ErrorModule::ARP, 102}; | ||
| 14 | 13 | ||
| 15 | } // namespace Service::Glue | 14 | } // namespace Service::Glue |
diff --git a/src/core/hle/service/glue/glue_manager.cpp b/src/core/hle/service/glue/glue_manager.cpp index 8a654cdca..4bf67921b 100644 --- a/src/core/hle/service/glue/glue_manager.cpp +++ b/src/core/hle/service/glue/glue_manager.cpp | |||
| @@ -17,12 +17,12 @@ ARPManager::~ARPManager() = default; | |||
| 17 | 17 | ||
| 18 | ResultVal<ApplicationLaunchProperty> ARPManager::GetLaunchProperty(u64 title_id) const { | 18 | ResultVal<ApplicationLaunchProperty> ARPManager::GetLaunchProperty(u64 title_id) const { |
| 19 | if (title_id == 0) { | 19 | if (title_id == 0) { |
| 20 | return ERR_INVALID_PROCESS_ID; | 20 | return Glue::ResultInvalidProcessId; |
| 21 | } | 21 | } |
| 22 | 22 | ||
| 23 | const auto iter = entries.find(title_id); | 23 | const auto iter = entries.find(title_id); |
| 24 | if (iter == entries.end()) { | 24 | if (iter == entries.end()) { |
| 25 | return ERR_NOT_REGISTERED; | 25 | return Glue::ResultProcessIdNotRegistered; |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | return iter->second.launch; | 28 | return iter->second.launch; |
| @@ -30,12 +30,12 @@ ResultVal<ApplicationLaunchProperty> ARPManager::GetLaunchProperty(u64 title_id) | |||
| 30 | 30 | ||
| 31 | ResultVal<std::vector<u8>> ARPManager::GetControlProperty(u64 title_id) const { | 31 | ResultVal<std::vector<u8>> ARPManager::GetControlProperty(u64 title_id) const { |
| 32 | if (title_id == 0) { | 32 | if (title_id == 0) { |
| 33 | return ERR_INVALID_PROCESS_ID; | 33 | return Glue::ResultInvalidProcessId; |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | const auto iter = entries.find(title_id); | 36 | const auto iter = entries.find(title_id); |
| 37 | if (iter == entries.end()) { | 37 | if (iter == entries.end()) { |
| 38 | return ERR_NOT_REGISTERED; | 38 | return Glue::ResultProcessIdNotRegistered; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | return iter->second.control; | 41 | return iter->second.control; |
| @@ -44,12 +44,12 @@ ResultVal<std::vector<u8>> ARPManager::GetControlProperty(u64 title_id) const { | |||
| 44 | Result ARPManager::Register(u64 title_id, ApplicationLaunchProperty launch, | 44 | Result ARPManager::Register(u64 title_id, ApplicationLaunchProperty launch, |
| 45 | std::vector<u8> control) { | 45 | std::vector<u8> control) { |
| 46 | if (title_id == 0) { | 46 | if (title_id == 0) { |
| 47 | return ERR_INVALID_PROCESS_ID; | 47 | return Glue::ResultInvalidProcessId; |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | const auto iter = entries.find(title_id); | 50 | const auto iter = entries.find(title_id); |
| 51 | if (iter != entries.end()) { | 51 | if (iter != entries.end()) { |
| 52 | return ERR_INVALID_ACCESS; | 52 | return Glue::ResultAlreadyBound; |
| 53 | } | 53 | } |
| 54 | 54 | ||
| 55 | entries.insert_or_assign(title_id, MapEntry{launch, std::move(control)}); | 55 | entries.insert_or_assign(title_id, MapEntry{launch, std::move(control)}); |
| @@ -58,12 +58,12 @@ Result ARPManager::Register(u64 title_id, ApplicationLaunchProperty launch, | |||
| 58 | 58 | ||
| 59 | Result ARPManager::Unregister(u64 title_id) { | 59 | Result ARPManager::Unregister(u64 title_id) { |
| 60 | if (title_id == 0) { | 60 | if (title_id == 0) { |
| 61 | return ERR_INVALID_PROCESS_ID; | 61 | return Glue::ResultInvalidProcessId; |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | const auto iter = entries.find(title_id); | 64 | const auto iter = entries.find(title_id); |
| 65 | if (iter == entries.end()) { | 65 | if (iter == entries.end()) { |
| 66 | return ERR_NOT_REGISTERED; | 66 | return Glue::ResultProcessIdNotRegistered; |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | entries.erase(iter); | 69 | entries.erase(iter); |
diff --git a/src/core/hle/service/glue/glue_manager.h b/src/core/hle/service/glue/glue_manager.h index cd0b092ac..1cf53d9d9 100644 --- a/src/core/hle/service/glue/glue_manager.h +++ b/src/core/hle/service/glue/glue_manager.h | |||
| @@ -30,23 +30,23 @@ public: | |||
| 30 | ~ARPManager(); | 30 | ~ARPManager(); |
| 31 | 31 | ||
| 32 | // Returns the ApplicationLaunchProperty corresponding to the provided title ID if it was | 32 | // Returns the ApplicationLaunchProperty corresponding to the provided title ID if it was |
| 33 | // previously registered, otherwise ERR_NOT_REGISTERED if it was never registered or | 33 | // previously registered, otherwise ResultProcessIdNotRegistered if it was never registered or |
| 34 | // ERR_INVALID_PROCESS_ID if the title ID is 0. | 34 | // ResultInvalidProcessId if the title ID is 0. |
| 35 | ResultVal<ApplicationLaunchProperty> GetLaunchProperty(u64 title_id) const; | 35 | ResultVal<ApplicationLaunchProperty> GetLaunchProperty(u64 title_id) const; |
| 36 | 36 | ||
| 37 | // Returns a vector of the raw bytes of NACP data (necessarily 0x4000 in size) corresponding to | 37 | // Returns a vector of the raw bytes of NACP data (necessarily 0x4000 in size) corresponding to |
| 38 | // the provided title ID if it was previously registered, otherwise ERR_NOT_REGISTERED if it was | 38 | // the provided title ID if it was previously registered, otherwise ResultProcessIdNotRegistered |
| 39 | // never registered or ERR_INVALID_PROCESS_ID if the title ID is 0. | 39 | // if it was never registered or ResultInvalidProcessId if the title ID is 0. |
| 40 | ResultVal<std::vector<u8>> GetControlProperty(u64 title_id) const; | 40 | ResultVal<std::vector<u8>> GetControlProperty(u64 title_id) const; |
| 41 | 41 | ||
| 42 | // Adds a new entry to the internal database with the provided parameters, returning | 42 | // Adds a new entry to the internal database with the provided parameters, returning |
| 43 | // ERR_INVALID_ACCESS if attempting to re-register a title ID without an intermediate Unregister | 43 | // ResultProcessIdNotRegistered if attempting to re-register a title ID without an intermediate |
| 44 | // step, and ERR_INVALID_PROCESS_ID if the title ID is 0. | 44 | // Unregister step, and ResultInvalidProcessId if the title ID is 0. |
| 45 | Result Register(u64 title_id, ApplicationLaunchProperty launch, std::vector<u8> control); | 45 | Result Register(u64 title_id, ApplicationLaunchProperty launch, std::vector<u8> control); |
| 46 | 46 | ||
| 47 | // Removes the registration for the provided title ID from the database, returning | 47 | // Removes the registration for the provided title ID from the database, returning |
| 48 | // ERR_NOT_REGISTERED if it doesn't exist in the database and ERR_INVALID_PROCESS_ID if the | 48 | // ResultProcessIdNotRegistered if it doesn't exist in the database and ResultInvalidProcessId |
| 49 | // title ID is 0. | 49 | // if the title ID is 0. |
| 50 | Result Unregister(u64 title_id); | 50 | Result Unregister(u64 title_id); |
| 51 | 51 | ||
| 52 | // Removes all entries from the database, always succeeds. Should only be used when resetting | 52 | // Removes all entries from the database, always succeeds. Should only be used when resetting |
diff --git a/src/core/hle/service/ipc_helpers.h b/src/core/hle/service/ipc_helpers.h index 3e67123c7..8703b57ca 100644 --- a/src/core/hle/service/ipc_helpers.h +++ b/src/core/hle/service/ipc_helpers.h | |||
| @@ -19,7 +19,7 @@ | |||
| 19 | 19 | ||
| 20 | namespace IPC { | 20 | namespace IPC { |
| 21 | 21 | ||
| 22 | constexpr Result ERR_REMOTE_PROCESS_DEAD{ErrorModule::HIPC, 301}; | 22 | constexpr Result ResultSessionClosed{ErrorModule::HIPC, 301}; |
| 23 | 23 | ||
| 24 | class RequestHelperBase { | 24 | class RequestHelperBase { |
| 25 | protected: | 25 | protected: |
diff --git a/src/core/hle/service/ns/errors.h b/src/core/hle/service/ns/errors.h index 8a7621798..16d2ea6f7 100644 --- a/src/core/hle/service/ns/errors.h +++ b/src/core/hle/service/ns/errors.h | |||
| @@ -7,5 +7,6 @@ | |||
| 7 | 7 | ||
| 8 | namespace Service::NS { | 8 | namespace Service::NS { |
| 9 | 9 | ||
| 10 | constexpr Result ERR_APPLICATION_LANGUAGE_NOT_FOUND{ErrorModule::NS, 300}; | 10 | constexpr Result ResultApplicationLanguageNotFound{ErrorModule::NS, 300}; |
| 11 | } \ No newline at end of file | 11 | |
| 12 | } | ||
diff --git a/src/core/hle/service/ns/ns.cpp b/src/core/hle/service/ns/ns.cpp index d6f0faea2..376067a95 100644 --- a/src/core/hle/service/ns/ns.cpp +++ b/src/core/hle/service/ns/ns.cpp | |||
| @@ -416,14 +416,14 @@ ResultVal<u8> IApplicationManagerInterface::GetApplicationDesiredLanguage( | |||
| 416 | if (application_language == std::nullopt) { | 416 | if (application_language == std::nullopt) { |
| 417 | LOG_ERROR(Service_NS, "Could not convert application language! language_code={}", | 417 | LOG_ERROR(Service_NS, "Could not convert application language! language_code={}", |
| 418 | language_code); | 418 | language_code); |
| 419 | return ERR_APPLICATION_LANGUAGE_NOT_FOUND; | 419 | return Service::NS::ResultApplicationLanguageNotFound; |
| 420 | } | 420 | } |
| 421 | const auto priority_list = GetApplicationLanguagePriorityList(*application_language); | 421 | const auto priority_list = GetApplicationLanguagePriorityList(*application_language); |
| 422 | if (!priority_list) { | 422 | if (!priority_list) { |
| 423 | LOG_ERROR(Service_NS, | 423 | LOG_ERROR(Service_NS, |
| 424 | "Could not find application language priorities! application_language={}", | 424 | "Could not find application language priorities! application_language={}", |
| 425 | *application_language); | 425 | *application_language); |
| 426 | return ERR_APPLICATION_LANGUAGE_NOT_FOUND; | 426 | return Service::NS::ResultApplicationLanguageNotFound; |
| 427 | } | 427 | } |
| 428 | 428 | ||
| 429 | // Try to find a valid language. | 429 | // Try to find a valid language. |
| @@ -436,7 +436,7 @@ ResultVal<u8> IApplicationManagerInterface::GetApplicationDesiredLanguage( | |||
| 436 | 436 | ||
| 437 | LOG_ERROR(Service_NS, "Could not find a valid language! supported_languages={:08X}", | 437 | LOG_ERROR(Service_NS, "Could not find a valid language! supported_languages={:08X}", |
| 438 | supported_languages); | 438 | supported_languages); |
| 439 | return ERR_APPLICATION_LANGUAGE_NOT_FOUND; | 439 | return Service::NS::ResultApplicationLanguageNotFound; |
| 440 | } | 440 | } |
| 441 | 441 | ||
| 442 | void IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode( | 442 | void IApplicationManagerInterface::ConvertApplicationLanguageToLanguageCode( |
| @@ -461,7 +461,7 @@ ResultVal<u64> IApplicationManagerInterface::ConvertApplicationLanguageToLanguag | |||
| 461 | ConvertToLanguageCode(static_cast<ApplicationLanguage>(application_language)); | 461 | ConvertToLanguageCode(static_cast<ApplicationLanguage>(application_language)); |
| 462 | if (language_code == std::nullopt) { | 462 | if (language_code == std::nullopt) { |
| 463 | LOG_ERROR(Service_NS, "Language not found! application_language={}", application_language); | 463 | LOG_ERROR(Service_NS, "Language not found! application_language={}", application_language); |
| 464 | return ERR_APPLICATION_LANGUAGE_NOT_FOUND; | 464 | return Service::NS::ResultApplicationLanguageNotFound; |
| 465 | } | 465 | } |
| 466 | 466 | ||
| 467 | return static_cast<u64>(*language_code); | 467 | return static_cast<u64>(*language_code); |
diff --git a/src/core/hle/service/server_manager.cpp b/src/core/hle/service/server_manager.cpp index c91f6d880..bd04cd023 100644 --- a/src/core/hle/service/server_manager.cpp +++ b/src/core/hle/service/server_manager.cpp | |||
| @@ -404,7 +404,7 @@ Result ServerManager::CompleteSyncRequest(RequestState&& request) { | |||
| 404 | rc = request.session->SendReplyHLE(); | 404 | rc = request.session->SendReplyHLE(); |
| 405 | 405 | ||
| 406 | // If the session has been closed, we're done. | 406 | // If the session has been closed, we're done. |
| 407 | if (rc == Kernel::ResultSessionClosed || service_rc == IPC::ERR_REMOTE_PROCESS_DEAD) { | 407 | if (rc == Kernel::ResultSessionClosed || service_rc == IPC::ResultSessionClosed) { |
| 408 | // Close the session. | 408 | // Close the session. |
| 409 | request.session->Close(); | 409 | request.session->Close(); |
| 410 | 410 | ||
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index eed615377..69cdb5918 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp | |||
| @@ -176,7 +176,7 @@ Result ServiceFrameworkBase::HandleSyncRequest(Kernel::KServerSession& session, | |||
| 176 | case IPC::CommandType::TIPC_Close: { | 176 | case IPC::CommandType::TIPC_Close: { |
| 177 | IPC::ResponseBuilder rb{ctx, 2}; | 177 | IPC::ResponseBuilder rb{ctx, 2}; |
| 178 | rb.Push(ResultSuccess); | 178 | rb.Push(ResultSuccess); |
| 179 | result = IPC::ERR_REMOTE_PROCESS_DEAD; | 179 | result = IPC::ResultSessionClosed; |
| 180 | break; | 180 | break; |
| 181 | } | 181 | } |
| 182 | case IPC::CommandType::ControlWithContext: | 182 | case IPC::CommandType::ControlWithContext: |
diff --git a/src/core/hle/service/set/set.cpp b/src/core/hle/service/set/set.cpp index 88df52331..f5788b481 100644 --- a/src/core/hle/service/set/set.cpp +++ b/src/core/hle/service/set/set.cpp | |||
| @@ -74,7 +74,7 @@ constexpr std::array<std::pair<LanguageCode, KeyboardLayout>, 18> language_to_la | |||
| 74 | constexpr std::size_t PRE_4_0_0_MAX_ENTRIES = 0xF; | 74 | constexpr std::size_t PRE_4_0_0_MAX_ENTRIES = 0xF; |
| 75 | constexpr std::size_t POST_4_0_0_MAX_ENTRIES = 0x40; | 75 | constexpr std::size_t POST_4_0_0_MAX_ENTRIES = 0x40; |
| 76 | 76 | ||
| 77 | constexpr Result ERR_INVALID_LANGUAGE{ErrorModule::Settings, 625}; | 77 | constexpr Result ResultInvalidLanguage{ErrorModule::Settings, 625}; |
| 78 | 78 | ||
| 79 | void PushResponseLanguageCode(HLERequestContext& ctx, std::size_t num_language_codes) { | 79 | void PushResponseLanguageCode(HLERequestContext& ctx, std::size_t num_language_codes) { |
| 80 | IPC::ResponseBuilder rb{ctx, 3}; | 80 | IPC::ResponseBuilder rb{ctx, 3}; |
| @@ -130,7 +130,7 @@ void SET::MakeLanguageCode(HLERequestContext& ctx) { | |||
| 130 | if (index >= available_language_codes.size()) { | 130 | if (index >= available_language_codes.size()) { |
| 131 | LOG_ERROR(Service_SET, "Invalid language code index! index={}", index); | 131 | LOG_ERROR(Service_SET, "Invalid language code index! index={}", index); |
| 132 | IPC::ResponseBuilder rb{ctx, 2}; | 132 | IPC::ResponseBuilder rb{ctx, 2}; |
| 133 | rb.Push(ERR_INVALID_LANGUAGE); | 133 | rb.Push(Set::ResultInvalidLanguage); |
| 134 | return; | 134 | return; |
| 135 | } | 135 | } |
| 136 | 136 | ||
diff --git a/src/core/hle/service/sm/sm.cpp b/src/core/hle/service/sm/sm.cpp index a46f47d3e..b4046d3ce 100644 --- a/src/core/hle/service/sm/sm.cpp +++ b/src/core/hle/service/sm/sm.cpp | |||
| @@ -18,10 +18,10 @@ | |||
| 18 | 18 | ||
| 19 | namespace Service::SM { | 19 | namespace Service::SM { |
| 20 | 20 | ||
| 21 | constexpr Result ERR_NOT_INITIALIZED(ErrorModule::SM, 2); | 21 | constexpr Result ResultInvalidClient(ErrorModule::SM, 2); |
| 22 | constexpr Result ERR_ALREADY_REGISTERED(ErrorModule::SM, 4); | 22 | constexpr Result ResultAlreadyRegistered(ErrorModule::SM, 4); |
| 23 | constexpr Result ERR_INVALID_NAME(ErrorModule::SM, 6); | 23 | constexpr Result ResultInvalidServiceName(ErrorModule::SM, 6); |
| 24 | constexpr Result ERR_SERVICE_NOT_REGISTERED(ErrorModule::SM, 7); | 24 | constexpr Result ResultNotRegistered(ErrorModule::SM, 7); |
| 25 | 25 | ||
| 26 | ServiceManager::ServiceManager(Kernel::KernelCore& kernel_) : kernel{kernel_} { | 26 | ServiceManager::ServiceManager(Kernel::KernelCore& kernel_) : kernel{kernel_} { |
| 27 | controller_interface = std::make_unique<Controller>(kernel.System()); | 27 | controller_interface = std::make_unique<Controller>(kernel.System()); |
| @@ -45,7 +45,7 @@ void ServiceManager::InvokeControlRequest(HLERequestContext& context) { | |||
| 45 | static Result ValidateServiceName(const std::string& name) { | 45 | static Result ValidateServiceName(const std::string& name) { |
| 46 | if (name.empty() || name.size() > 8) { | 46 | if (name.empty() || name.size() > 8) { |
| 47 | LOG_ERROR(Service_SM, "Invalid service name! service={}", name); | 47 | LOG_ERROR(Service_SM, "Invalid service name! service={}", name); |
| 48 | return ERR_INVALID_NAME; | 48 | return Service::SM::ResultInvalidServiceName; |
| 49 | } | 49 | } |
| 50 | return ResultSuccess; | 50 | return ResultSuccess; |
| 51 | } | 51 | } |
| @@ -58,7 +58,7 @@ Result ServiceManager::RegisterService(std::string name, u32 max_sessions, | |||
| 58 | std::scoped_lock lk{lock}; | 58 | std::scoped_lock lk{lock}; |
| 59 | if (registered_services.find(name) != registered_services.end()) { | 59 | if (registered_services.find(name) != registered_services.end()) { |
| 60 | LOG_ERROR(Service_SM, "Service is already registered! service={}", name); | 60 | LOG_ERROR(Service_SM, "Service is already registered! service={}", name); |
| 61 | return ERR_ALREADY_REGISTERED; | 61 | return Service::SM::ResultAlreadyRegistered; |
| 62 | } | 62 | } |
| 63 | 63 | ||
| 64 | auto* port = Kernel::KPort::Create(kernel); | 64 | auto* port = Kernel::KPort::Create(kernel); |
| @@ -80,7 +80,7 @@ Result ServiceManager::UnregisterService(const std::string& name) { | |||
| 80 | const auto iter = registered_services.find(name); | 80 | const auto iter = registered_services.find(name); |
| 81 | if (iter == registered_services.end()) { | 81 | if (iter == registered_services.end()) { |
| 82 | LOG_ERROR(Service_SM, "Server is not registered! service={}", name); | 82 | LOG_ERROR(Service_SM, "Server is not registered! service={}", name); |
| 83 | return ERR_SERVICE_NOT_REGISTERED; | 83 | return Service::SM::ResultNotRegistered; |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | registered_services.erase(iter); | 86 | registered_services.erase(iter); |
| @@ -96,7 +96,7 @@ ResultVal<Kernel::KPort*> ServiceManager::GetServicePort(const std::string& name | |||
| 96 | auto it = service_ports.find(name); | 96 | auto it = service_ports.find(name); |
| 97 | if (it == service_ports.end()) { | 97 | if (it == service_ports.end()) { |
| 98 | LOG_WARNING(Service_SM, "Server is not registered! service={}", name); | 98 | LOG_WARNING(Service_SM, "Server is not registered! service={}", name); |
| 99 | return ERR_SERVICE_NOT_REGISTERED; | 99 | return Service::SM::ResultNotRegistered; |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | return it->second; | 102 | return it->second; |
| @@ -160,7 +160,7 @@ static std::string PopServiceName(IPC::RequestParser& rp) { | |||
| 160 | 160 | ||
| 161 | ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(HLERequestContext& ctx) { | 161 | ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(HLERequestContext& ctx) { |
| 162 | if (!ctx.GetManager()->GetIsInitializedForSm()) { | 162 | if (!ctx.GetManager()->GetIsInitializedForSm()) { |
| 163 | return ERR_NOT_INITIALIZED; | 163 | return Service::SM::ResultInvalidClient; |
| 164 | } | 164 | } |
| 165 | 165 | ||
| 166 | IPC::RequestParser rp{ctx}; | 166 | IPC::RequestParser rp{ctx}; |
| @@ -168,15 +168,15 @@ ResultVal<Kernel::KClientSession*> SM::GetServiceImpl(HLERequestContext& ctx) { | |||
| 168 | 168 | ||
| 169 | // Find the named port. | 169 | // Find the named port. |
| 170 | auto port_result = service_manager.GetServicePort(name); | 170 | auto port_result = service_manager.GetServicePort(name); |
| 171 | if (port_result.Code() == ERR_INVALID_NAME) { | 171 | if (port_result.Code() == Service::SM::ResultInvalidServiceName) { |
| 172 | LOG_ERROR(Service_SM, "Invalid service name '{}'", name); | 172 | LOG_ERROR(Service_SM, "Invalid service name '{}'", name); |
| 173 | return ERR_INVALID_NAME; | 173 | return Service::SM::ResultInvalidServiceName; |
| 174 | } | 174 | } |
| 175 | 175 | ||
| 176 | if (port_result.Failed()) { | 176 | if (port_result.Failed()) { |
| 177 | LOG_INFO(Service_SM, "Waiting for service {} to become available", name); | 177 | LOG_INFO(Service_SM, "Waiting for service {} to become available", name); |
| 178 | ctx.SetIsDeferred(); | 178 | ctx.SetIsDeferred(); |
| 179 | return ERR_SERVICE_NOT_REGISTERED; | 179 | return Service::SM::ResultNotRegistered; |
| 180 | } | 180 | } |
| 181 | auto& port = port_result.Unwrap(); | 181 | auto& port = port_result.Unwrap(); |
| 182 | 182 | ||