Compare commits
47 Commits
__refs_pul
...
__refs_pul
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e090a1c6bd | ||
|
|
e8af3f29d2 | ||
|
|
4562f7af9a | ||
|
|
f3f57f90fe | ||
|
|
b5d61f214d | ||
|
|
3cf88a4d6c | ||
|
|
d72d753b1a | ||
|
|
a3ffea6a64 | ||
|
|
b014fdacdb | ||
|
|
757aafa582 | ||
|
|
9a9e5844d3 | ||
|
|
64dcb40db1 | ||
|
|
ba4213d956 | ||
|
|
d45ac00d48 | ||
|
|
a7792e5ff8 | ||
|
|
1d0fe75e7c | ||
|
|
6d61430311 | ||
|
|
b210174087 | ||
|
|
e6349fcd3b | ||
|
|
f7e6bda5cd | ||
|
|
31f0fa1065 | ||
|
|
3bd29fb66b | ||
|
|
859fb469b8 | ||
|
|
c161e3f433 | ||
|
|
8a501ff30b | ||
|
|
97704b8da9 | ||
|
|
1f57ae6949 | ||
|
|
f01540da6c | ||
|
|
54711df739 | ||
|
|
644ee0043e | ||
|
|
fdae95efaa | ||
|
|
8a3411b417 | ||
|
|
376a414f5b | ||
|
|
026eaddbee | ||
|
|
3453beb1e0 | ||
|
|
194cf0b497 | ||
|
|
bff1453282 | ||
|
|
7e353082ac | ||
|
|
7fffdf83b7 | ||
|
|
1ed49f92dd | ||
|
|
bd09c82521 | ||
|
|
ce8f4da638 | ||
|
|
a7fb80e612 | ||
|
|
104cb6aa0a | ||
|
|
809148e1a5 | ||
|
|
65be230fdd | ||
|
|
4a1aa98598 |
@@ -477,8 +477,8 @@ if (APPLE)
|
||||
find_library(COCOA_LIBRARY Cocoa)
|
||||
set(PLATFORM_LIBRARIES ${COCOA_LIBRARY} ${IOKIT_LIBRARY} ${COREVIDEO_LIBRARY})
|
||||
elseif (WIN32)
|
||||
# WSAPoll and SHGetKnownFolderPath (AppData/Roaming) didn't exist before WinNT 6.x (Vista)
|
||||
add_definitions(-D_WIN32_WINNT=0x0600 -DWINVER=0x0600)
|
||||
# Target Windows 10
|
||||
add_definitions(-D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00)
|
||||
set(PLATFORM_LIBRARIES winmm ws2_32 iphlpapi)
|
||||
if (MINGW)
|
||||
# PSAPI is the Process Status API
|
||||
|
||||
6
dist/yuzu.manifest
vendored
6
dist/yuzu.manifest
vendored
@@ -36,12 +36,6 @@ SPDX-License-Identifier: GPL-2.0-or-later
|
||||
<application>
|
||||
<!-- Windows 10 -->
|
||||
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
|
||||
<!-- Windows 8.1 -->
|
||||
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
|
||||
<!-- Windows 8 -->
|
||||
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
|
||||
<!-- Windows 7 -->
|
||||
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
|
||||
</application>
|
||||
</compatibility>
|
||||
<trustInfo
|
||||
|
||||
@@ -20,7 +20,7 @@ Manager::Manager(Core::System& system_) : system{system_} {
|
||||
Result Manager::AcquireSessionId(size_t& session_id) {
|
||||
if (num_free_sessions == 0) {
|
||||
LOG_ERROR(Service_Audio, "All 4 AudioIn sessions are in use, cannot create any more");
|
||||
return Service::Audio::ERR_MAXIMUM_SESSIONS_REACHED;
|
||||
return Service::Audio::ResultOutOfSessions;
|
||||
}
|
||||
session_id = session_ids[next_session_id];
|
||||
next_session_id = (next_session_id + 1) % MaxInSessions;
|
||||
|
||||
@@ -19,7 +19,7 @@ void AudioManager::Shutdown() {
|
||||
|
||||
Result AudioManager::SetOutManager(BufferEventFunc buffer_func) {
|
||||
if (!running) {
|
||||
return Service::Audio::ERR_OPERATION_FAILED;
|
||||
return Service::Audio::ResultOperationFailed;
|
||||
}
|
||||
|
||||
std::scoped_lock l{lock};
|
||||
@@ -35,7 +35,7 @@ Result AudioManager::SetOutManager(BufferEventFunc buffer_func) {
|
||||
|
||||
Result AudioManager::SetInManager(BufferEventFunc buffer_func) {
|
||||
if (!running) {
|
||||
return Service::Audio::ERR_OPERATION_FAILED;
|
||||
return Service::Audio::ResultOperationFailed;
|
||||
}
|
||||
|
||||
std::scoped_lock l{lock};
|
||||
|
||||
@@ -19,7 +19,7 @@ Manager::Manager(Core::System& system_) : system{system_} {
|
||||
Result Manager::AcquireSessionId(size_t& session_id) {
|
||||
if (num_free_sessions == 0) {
|
||||
LOG_ERROR(Service_Audio, "All 12 Audio Out sessions are in use, cannot create any more");
|
||||
return Service::Audio::ERR_MAXIMUM_SESSIONS_REACHED;
|
||||
return Service::Audio::ResultOutOfSessions;
|
||||
}
|
||||
session_id = session_ids[next_session_id];
|
||||
next_session_id = (next_session_id + 1) % MaxOutSessions;
|
||||
|
||||
@@ -28,7 +28,7 @@ SystemManager& Manager::GetSystemManager() {
|
||||
Result Manager::GetWorkBufferSize(const AudioRendererParameterInternal& params,
|
||||
u64& out_count) const {
|
||||
if (!CheckValidRevision(params.revision)) {
|
||||
return Service::Audio::ERR_INVALID_REVISION;
|
||||
return Service::Audio::ResultInvalidRevision;
|
||||
}
|
||||
|
||||
out_count = System::GetWorkBufferSize(params);
|
||||
|
||||
@@ -46,7 +46,7 @@ Result In::AppendBuffer(const AudioInBuffer& buffer, u64 tag) {
|
||||
if (system.AppendBuffer(buffer, tag)) {
|
||||
return ResultSuccess;
|
||||
}
|
||||
return Service::Audio::ERR_BUFFER_COUNT_EXCEEDED;
|
||||
return Service::Audio::ResultBufferCountReached;
|
||||
}
|
||||
|
||||
void In::ReleaseAndRegisterBuffers() {
|
||||
|
||||
@@ -45,11 +45,11 @@ Result System::IsConfigValid(const std::string_view device_name,
|
||||
const AudioInParameter& in_params) const {
|
||||
if ((device_name.size() > 0) &&
|
||||
(device_name != GetDefaultDeviceName() && device_name != GetDefaultUacDeviceName())) {
|
||||
return Service::Audio::ERR_INVALID_DEVICE_NAME;
|
||||
return Service::Audio::ResultNotFound;
|
||||
}
|
||||
|
||||
if (in_params.sample_rate != TargetSampleRate && in_params.sample_rate > 0) {
|
||||
return Service::Audio::ERR_INVALID_SAMPLE_RATE;
|
||||
return Service::Audio::ResultInvalidSampleRate;
|
||||
}
|
||||
|
||||
return ResultSuccess;
|
||||
@@ -80,7 +80,7 @@ Result System::Initialize(std::string device_name, const AudioInParameter& in_pa
|
||||
|
||||
Result System::Start() {
|
||||
if (state != State::Stopped) {
|
||||
return Service::Audio::ERR_OPERATION_FAILED;
|
||||
return Service::Audio::ResultOperationFailed;
|
||||
}
|
||||
|
||||
session->Initialize(name, sample_format, channel_count, session_id, handle,
|
||||
|
||||
@@ -46,7 +46,7 @@ Result Out::AppendBuffer(const AudioOutBuffer& buffer, const u64 tag) {
|
||||
if (system.AppendBuffer(buffer, tag)) {
|
||||
return ResultSuccess;
|
||||
}
|
||||
return Service::Audio::ERR_BUFFER_COUNT_EXCEEDED;
|
||||
return Service::Audio::ResultBufferCountReached;
|
||||
}
|
||||
|
||||
void Out::ReleaseAndRegisterBuffers() {
|
||||
|
||||
@@ -33,11 +33,11 @@ std::string_view System::GetDefaultOutputDeviceName() const {
|
||||
Result System::IsConfigValid(std::string_view device_name,
|
||||
const AudioOutParameter& in_params) const {
|
||||
if ((device_name.size() > 0) && (device_name != GetDefaultOutputDeviceName())) {
|
||||
return Service::Audio::ERR_INVALID_DEVICE_NAME;
|
||||
return Service::Audio::ResultNotFound;
|
||||
}
|
||||
|
||||
if (in_params.sample_rate != TargetSampleRate && in_params.sample_rate > 0) {
|
||||
return Service::Audio::ERR_INVALID_SAMPLE_RATE;
|
||||
return Service::Audio::ResultInvalidSampleRate;
|
||||
}
|
||||
|
||||
if (in_params.channel_count == 0 || in_params.channel_count == 2 ||
|
||||
@@ -45,7 +45,7 @@ Result System::IsConfigValid(std::string_view device_name,
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
return Service::Audio::ERR_INVALID_CHANNEL_COUNT;
|
||||
return Service::Audio::ResultInvalidChannelCount;
|
||||
}
|
||||
|
||||
Result System::Initialize(std::string device_name, const AudioOutParameter& in_params, u32 handle_,
|
||||
@@ -80,7 +80,7 @@ size_t System::GetSessionId() const {
|
||||
|
||||
Result System::Start() {
|
||||
if (state != State::Stopped) {
|
||||
return Service::Audio::ERR_OPERATION_FAILED;
|
||||
return Service::Audio::ResultOperationFailed;
|
||||
}
|
||||
|
||||
session->Initialize(name, sample_format, channel_count, session_id, handle,
|
||||
|
||||
@@ -22,7 +22,7 @@ Result Renderer::Initialize(const AudioRendererParameterInternal& params,
|
||||
if (!manager.AddSystem(system)) {
|
||||
LOG_ERROR(Service_Audio,
|
||||
"Both Audio Render sessions are in use, cannot create any more");
|
||||
return Service::Audio::ERR_MAXIMUM_SESSIONS_REACHED;
|
||||
return Service::Audio::ResultOutOfSessions;
|
||||
}
|
||||
system_registered = true;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ Result InfoUpdater::UpdateVoiceChannelResources(VoiceContext& voice_context) {
|
||||
LOG_ERROR(Service_Audio,
|
||||
"Consumed an incorrect voice resource size, header size={}, consumed={}",
|
||||
in_header->voice_resources_size, consumed_input_size);
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
|
||||
input += consumed_input_size;
|
||||
@@ -123,7 +123,7 @@ Result InfoUpdater::UpdateVoices(VoiceContext& voice_context,
|
||||
if (consumed_input_size != in_header->voices_size) {
|
||||
LOG_ERROR(Service_Audio, "Consumed an incorrect voices size, header size={}, consumed={}",
|
||||
in_header->voices_size, consumed_input_size);
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
|
||||
out_header->voices_size = consumed_output_size;
|
||||
@@ -184,7 +184,7 @@ Result InfoUpdater::UpdateEffectsVersion1(EffectContext& effect_context, const b
|
||||
if (consumed_input_size != in_header->effects_size) {
|
||||
LOG_ERROR(Service_Audio, "Consumed an incorrect effects size, header size={}, consumed={}",
|
||||
in_header->effects_size, consumed_input_size);
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
|
||||
out_header->effects_size = consumed_output_size;
|
||||
@@ -239,7 +239,7 @@ Result InfoUpdater::UpdateEffectsVersion2(EffectContext& effect_context, const b
|
||||
if (consumed_input_size != in_header->effects_size) {
|
||||
LOG_ERROR(Service_Audio, "Consumed an incorrect effects size, header size={}, consumed={}",
|
||||
in_header->effects_size, consumed_input_size);
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
|
||||
out_header->effects_size = consumed_output_size;
|
||||
@@ -267,7 +267,7 @@ Result InfoUpdater::UpdateMixes(MixContext& mix_context, const u32 mix_buffer_co
|
||||
}
|
||||
|
||||
if (mix_buffer_count == 0) {
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
|
||||
std::span<const MixInfo::InParameter> in_params{
|
||||
@@ -281,13 +281,13 @@ Result InfoUpdater::UpdateMixes(MixContext& mix_context, const u32 mix_buffer_co
|
||||
total_buffer_count += params.buffer_count;
|
||||
if (params.dest_mix_id > static_cast<s32>(mix_context.GetCount()) &&
|
||||
params.dest_mix_id != UnusedMixId && params.mix_id != FinalMixId) {
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (total_buffer_count > mix_buffer_count) {
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
|
||||
bool mix_dirty{false};
|
||||
@@ -317,7 +317,7 @@ Result InfoUpdater::UpdateMixes(MixContext& mix_context, const u32 mix_buffer_co
|
||||
if (mix_dirty) {
|
||||
if (behaviour.IsSplitterSupported() && splitter_context.UsingSplitter()) {
|
||||
if (!mix_context.TSortInfo(splitter_context)) {
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
} else {
|
||||
mix_context.SortInfo();
|
||||
@@ -327,7 +327,7 @@ Result InfoUpdater::UpdateMixes(MixContext& mix_context, const u32 mix_buffer_co
|
||||
if (consumed_input_size != in_header->mix_size) {
|
||||
LOG_ERROR(Service_Audio, "Consumed an incorrect mixes size, header size={}, consumed={}",
|
||||
in_header->mix_size, consumed_input_size);
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
|
||||
input += mix_count * sizeof(MixInfo::InParameter);
|
||||
@@ -384,7 +384,7 @@ Result InfoUpdater::UpdateSinks(SinkContext& sink_context, std::span<MemoryPoolI
|
||||
if (consumed_input_size != in_header->sinks_size) {
|
||||
LOG_ERROR(Service_Audio, "Consumed an incorrect sinks size, header size={}, consumed={}",
|
||||
in_header->sinks_size, consumed_input_size);
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
|
||||
input += consumed_input_size;
|
||||
@@ -411,7 +411,7 @@ Result InfoUpdater::UpdateMemoryPools(std::span<MemoryPoolInfo> memory_pools,
|
||||
state != MemoryPoolInfo::ResultState::MapFailed &&
|
||||
state != MemoryPoolInfo::ResultState::InUse) {
|
||||
LOG_WARNING(Service_Audio, "Invalid ResultState from updating memory pools");
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,7 +423,7 @@ Result InfoUpdater::UpdateMemoryPools(std::span<MemoryPoolInfo> memory_pools,
|
||||
LOG_ERROR(Service_Audio,
|
||||
"Consumed an incorrect memory pool size, header size={}, consumed={}",
|
||||
in_header->memory_pool_size, consumed_input_size);
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
|
||||
input += consumed_input_size;
|
||||
@@ -453,7 +453,7 @@ Result InfoUpdater::UpdatePerformanceBuffer(std::span<u8> performance_output,
|
||||
LOG_ERROR(Service_Audio,
|
||||
"Consumed an incorrect performance size, header size={}, consumed={}",
|
||||
in_header->performance_buffer_size, consumed_input_size);
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
|
||||
input += consumed_input_size;
|
||||
@@ -467,18 +467,18 @@ Result InfoUpdater::UpdateBehaviorInfo(BehaviorInfo& behaviour_) {
|
||||
const auto in_params{reinterpret_cast<const BehaviorInfo::InParameter*>(input)};
|
||||
|
||||
if (!CheckValidRevision(in_params->revision)) {
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
|
||||
if (in_params->revision != behaviour_.GetUserRevision()) {
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
|
||||
behaviour_.ClearError();
|
||||
behaviour_.UpdateFlags(in_params->flags);
|
||||
|
||||
if (in_header->behaviour_size != sizeof(BehaviorInfo::InParameter)) {
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
|
||||
input += sizeof(BehaviorInfo::InParameter);
|
||||
@@ -500,7 +500,7 @@ Result InfoUpdater::UpdateErrorInfo(const BehaviorInfo& behaviour_) {
|
||||
Result InfoUpdater::UpdateSplitterInfo(SplitterContext& splitter_context) {
|
||||
u32 consumed_size{0};
|
||||
if (!splitter_context.Update(input, consumed_size)) {
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
|
||||
input += consumed_size;
|
||||
@@ -529,9 +529,9 @@ Result InfoUpdater::UpdateRendererInfo(const u64 elapsed_frames) {
|
||||
|
||||
Result InfoUpdater::CheckConsumedSize() {
|
||||
if (CpuAddr(input) - CpuAddr(input_origin.data()) != expected_input_size) {
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
} else if (CpuAddr(output) - CpuAddr(output_origin.data()) != expected_output_size) {
|
||||
return Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
return Service::Audio::ResultInvalidUpdateInfo;
|
||||
}
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
@@ -308,7 +308,8 @@ static void ApplyReverbEffect(const ReverbInfo::ParameterVersion2& params, Rever
|
||||
}
|
||||
|
||||
Common::FixedPoint<50, 14> pre_delay_sample{
|
||||
state.pre_delay_line.Read() * Common::FixedPoint<50, 14>::from_base(params.late_gain)};
|
||||
state.pre_delay_line.TapOut(state.pre_delay_time) *
|
||||
Common::FixedPoint<50, 14>::from_base(params.late_gain)};
|
||||
|
||||
std::array<Common::FixedPoint<50, 14>, ReverbInfo::MaxDelayLines> mix_matrix{
|
||||
state.prev_feedback_output[2] + state.prev_feedback_output[1] + pre_delay_sample,
|
||||
|
||||
@@ -104,7 +104,8 @@ public:
|
||||
}
|
||||
|
||||
void Write(const Common::FixedPoint<50, 14> sample) {
|
||||
*(input++) = sample;
|
||||
*input = sample;
|
||||
input++;
|
||||
if (input >= buffer_end) {
|
||||
input = buffer.data();
|
||||
}
|
||||
|
||||
@@ -79,12 +79,10 @@ public:
|
||||
return;
|
||||
}
|
||||
sample_count = delay_time;
|
||||
input = &buffer[(output - buffer.data() + sample_count) % (sample_count_max + 1)];
|
||||
input = &buffer[0];
|
||||
}
|
||||
|
||||
Common::FixedPoint<50, 14> Tick(const Common::FixedPoint<50, 14> sample) {
|
||||
Write(sample);
|
||||
|
||||
auto out_sample{Read()};
|
||||
|
||||
output++;
|
||||
@@ -92,6 +90,7 @@ public:
|
||||
output = buffer.data();
|
||||
}
|
||||
|
||||
Write(sample);
|
||||
return out_sample;
|
||||
}
|
||||
|
||||
@@ -100,7 +99,8 @@ public:
|
||||
}
|
||||
|
||||
void Write(const Common::FixedPoint<50, 14> sample) {
|
||||
*(input++) = sample;
|
||||
*input = sample;
|
||||
input++;
|
||||
if (input >= buffer_end) {
|
||||
input = buffer.data();
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ bool PoolMapper::TryAttachBuffer(BehaviorInfo::ErrorInfo& error_info, AddressInf
|
||||
address_info.Setup(address, size);
|
||||
|
||||
if (!FillDspAddr(address_info)) {
|
||||
error_info.error_code = Service::Audio::ERR_POOL_MAPPING_FAILED;
|
||||
error_info.error_code = Service::Audio::ResultInvalidAddressInfo;
|
||||
error_info.address = address;
|
||||
return force_map;
|
||||
}
|
||||
|
||||
@@ -101,15 +101,15 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
Kernel::KTransferMemory* transfer_memory, u64 transfer_memory_size,
|
||||
u32 process_handle_, u64 applet_resource_user_id_, s32 session_id_) {
|
||||
if (!CheckValidRevision(params.revision)) {
|
||||
return Service::Audio::ERR_INVALID_REVISION;
|
||||
return Service::Audio::ResultInvalidRevision;
|
||||
}
|
||||
|
||||
if (GetWorkBufferSize(params) > transfer_memory_size) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
if (process_handle_ == 0) {
|
||||
return Service::Audio::ERR_INVALID_PROCESS_HANDLE;
|
||||
return Service::Audio::ResultInvalidHandle;
|
||||
}
|
||||
|
||||
behavior.SetUserLibRevision(params.revision);
|
||||
@@ -143,19 +143,19 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
samples_workbuffer =
|
||||
allocator.Allocate<s32>((voice_channels + mix_buffer_count) * sample_count, 0x10);
|
||||
if (samples_workbuffer.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
auto upsampler_workbuffer{allocator.Allocate<s32>(
|
||||
(voice_channels + mix_buffer_count) * TargetSampleCount * upsampler_count, 0x10)};
|
||||
if (upsampler_workbuffer.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
depop_buffer =
|
||||
allocator.Allocate<s32>(Common::AlignUp(static_cast<u32>(mix_buffer_count), 0x40), 0x40);
|
||||
if (depop_buffer.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
// invalidate samples_workbuffer DSP cache
|
||||
@@ -166,12 +166,12 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
}
|
||||
|
||||
if (voice_infos.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
auto sorted_voice_infos{allocator.Allocate<VoiceInfo*>(params.voices, 0x10)};
|
||||
if (sorted_voice_infos.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
std::memset(sorted_voice_infos.data(), 0, sorted_voice_infos.size_bytes());
|
||||
@@ -183,12 +183,12 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
}
|
||||
|
||||
if (voice_channel_resources.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
auto voice_cpu_states{allocator.Allocate<VoiceState>(params.voices, 0x10)};
|
||||
if (voice_cpu_states.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
for (auto& voice_state : voice_cpu_states) {
|
||||
@@ -198,7 +198,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
auto mix_infos{allocator.Allocate<MixInfo>(params.sub_mixes + 1, 0x10)};
|
||||
|
||||
if (mix_infos.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
u32 effect_process_order_count{0};
|
||||
@@ -208,7 +208,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
effect_process_order_count = params.effects * (params.sub_mixes + 1);
|
||||
effect_process_order_buffer = allocator.Allocate<s32>(effect_process_order_count, 0x10);
|
||||
if (effect_process_order_buffer.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,7 +222,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
|
||||
auto sorted_mix_infos{allocator.Allocate<MixInfo*>(params.sub_mixes + 1, 0x10)};
|
||||
if (sorted_mix_infos.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
std::memset(sorted_mix_infos.data(), 0, sorted_mix_infos.size_bytes());
|
||||
@@ -235,7 +235,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
auto edge_matrix_workbuffer{allocator.Allocate<u8>(edge_matrix_size, 1)};
|
||||
|
||||
if (node_states_workbuffer.empty() || edge_matrix_workbuffer.size() == 0) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
mix_context.Initialize(sorted_mix_infos, mix_infos, params.sub_mixes + 1,
|
||||
@@ -250,7 +250,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
|
||||
upsampler_manager = allocator.Allocate<UpsamplerManager>(1, 0x10).data();
|
||||
if (upsampler_manager == nullptr) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
memory_pool_workbuffer = allocator.Allocate<MemoryPoolInfo>(memory_pool_count, 0x10);
|
||||
@@ -259,18 +259,18 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
}
|
||||
|
||||
if (memory_pool_workbuffer.empty() && memory_pool_count > 0) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
if (!splitter_context.Initialize(behavior, params, allocator)) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
std::span<EffectResultState> effect_result_states_cpu{};
|
||||
if (behavior.IsEffectInfoVersion2Supported() && params.effects > 0) {
|
||||
effect_result_states_cpu = allocator.Allocate<EffectResultState>(params.effects, 0x10);
|
||||
if (effect_result_states_cpu.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
std::memset(effect_result_states_cpu.data(), 0, effect_result_states_cpu.size_bytes());
|
||||
}
|
||||
@@ -289,7 +289,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
upsampler_workbuffer);
|
||||
|
||||
if (upsampler_infos.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
auto effect_infos{allocator.Allocate<EffectInfoBase>(params.effects, 0x40)};
|
||||
@@ -298,14 +298,14 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
}
|
||||
|
||||
if (effect_infos.empty() && params.effects > 0) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
std::span<EffectResultState> effect_result_states_dsp{};
|
||||
if (behavior.IsEffectInfoVersion2Supported() && params.effects > 0) {
|
||||
effect_result_states_dsp = allocator.Allocate<EffectResultState>(params.effects, 0x40);
|
||||
if (effect_result_states_dsp.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
std::memset(effect_result_states_dsp.data(), 0, effect_result_states_dsp.size_bytes());
|
||||
}
|
||||
@@ -319,14 +319,14 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
}
|
||||
|
||||
if (sinks.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
sink_context.Initialize(sinks, params.sinks);
|
||||
|
||||
auto voice_dsp_states{allocator.Allocate<VoiceState>(params.voices, 0x40)};
|
||||
if (voice_dsp_states.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
for (auto& voice_state : voice_dsp_states) {
|
||||
@@ -344,7 +344,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
0xC};
|
||||
performance_workbuffer = allocator.Allocate<u8>(perf_workbuffer_size, 0x40);
|
||||
if (performance_workbuffer.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
std::memset(performance_workbuffer.data(), 0, performance_workbuffer.size_bytes());
|
||||
performance_manager.Initialize(performance_workbuffer, performance_workbuffer.size_bytes(),
|
||||
@@ -360,7 +360,7 @@ Result System::Initialize(const AudioRendererParameterInternal& params,
|
||||
command_workbuffer_size = allocator.GetRemainingSize();
|
||||
command_workbuffer = allocator.Allocate<u8>(command_workbuffer_size, 0x40);
|
||||
if (command_workbuffer.empty()) {
|
||||
return Service::Audio::ERR_INSUFFICIENT_BUFFER_SIZE;
|
||||
return Service::Audio::ResultInsufficientBuffer;
|
||||
}
|
||||
|
||||
command_buffer_size = 0;
|
||||
|
||||
@@ -181,7 +181,7 @@ void VoiceInfo::UpdateWaveBuffer(std::span<BehaviorInfo::ErrorInfo> error_info,
|
||||
if (wave_buffer_internal.start_offset * byte_size > wave_buffer_internal.size ||
|
||||
wave_buffer_internal.end_offset * byte_size > wave_buffer_internal.size) {
|
||||
LOG_ERROR(Service_Audio, "Invalid PCM16 start/end wavebuffer sizes!");
|
||||
error_info[0].error_code = Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
error_info[0].error_code = Service::Audio::ResultInvalidUpdateInfo;
|
||||
error_info[0].address = wave_buffer_internal.address;
|
||||
return;
|
||||
}
|
||||
@@ -192,7 +192,7 @@ void VoiceInfo::UpdateWaveBuffer(std::span<BehaviorInfo::ErrorInfo> error_info,
|
||||
if (wave_buffer_internal.start_offset * byte_size > wave_buffer_internal.size ||
|
||||
wave_buffer_internal.end_offset * byte_size > wave_buffer_internal.size) {
|
||||
LOG_ERROR(Service_Audio, "Invalid PCMFloat start/end wavebuffer sizes!");
|
||||
error_info[0].error_code = Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
error_info[0].error_code = Service::Audio::ResultInvalidUpdateInfo;
|
||||
error_info[0].address = wave_buffer_internal.address;
|
||||
return;
|
||||
}
|
||||
@@ -216,7 +216,7 @@ void VoiceInfo::UpdateWaveBuffer(std::span<BehaviorInfo::ErrorInfo> error_info,
|
||||
if (start > static_cast<s64>(wave_buffer_internal.size) ||
|
||||
end > static_cast<s64>(wave_buffer_internal.size)) {
|
||||
LOG_ERROR(Service_Audio, "Invalid ADPCM start/end wavebuffer sizes!");
|
||||
error_info[0].error_code = Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
error_info[0].error_code = Service::Audio::ResultInvalidUpdateInfo;
|
||||
error_info[0].address = wave_buffer_internal.address;
|
||||
return;
|
||||
}
|
||||
@@ -228,7 +228,7 @@ void VoiceInfo::UpdateWaveBuffer(std::span<BehaviorInfo::ErrorInfo> error_info,
|
||||
|
||||
if (wave_buffer_internal.start_offset < 0 || wave_buffer_internal.end_offset < 0) {
|
||||
LOG_ERROR(Service_Audio, "Invalid input start/end wavebuffer sizes!");
|
||||
error_info[0].error_code = Service::Audio::ERR_INVALID_UPDATE_DATA;
|
||||
error_info[0].error_code = Service::Audio::ResultInvalidUpdateInfo;
|
||||
error_info[0].address = wave_buffer_internal.address;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -91,6 +91,7 @@ add_library(common STATIC
|
||||
multi_level_page_table.h
|
||||
nvidia_flags.cpp
|
||||
nvidia_flags.h
|
||||
overflow.h
|
||||
page_table.cpp
|
||||
page_table.h
|
||||
param_package.cpp
|
||||
@@ -113,6 +114,8 @@ add_library(common STATIC
|
||||
socket_types.h
|
||||
spin_lock.cpp
|
||||
spin_lock.h
|
||||
steady_clock.cpp
|
||||
steady_clock.h
|
||||
stream.cpp
|
||||
stream.h
|
||||
string_util.cpp
|
||||
@@ -142,6 +145,14 @@ add_library(common STATIC
|
||||
zstd_compression.h
|
||||
)
|
||||
|
||||
if (WIN32)
|
||||
target_sources(common PRIVATE
|
||||
windows/timer_resolution.cpp
|
||||
windows/timer_resolution.h
|
||||
)
|
||||
target_link_libraries(common PRIVATE ntdll)
|
||||
endif()
|
||||
|
||||
if(ARCHITECTURE_x86_64)
|
||||
target_sources(common
|
||||
PRIVATE
|
||||
|
||||
@@ -3,19 +3,21 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstring>
|
||||
#include <type_traits>
|
||||
#include <version>
|
||||
|
||||
#ifdef __cpp_lib_bit_cast
|
||||
#include <bit>
|
||||
#endif
|
||||
|
||||
namespace Common {
|
||||
|
||||
template <typename To, typename From>
|
||||
[[nodiscard]] std::enable_if_t<sizeof(To) == sizeof(From) && std::is_trivially_copyable_v<From> &&
|
||||
std::is_trivially_copyable_v<To>,
|
||||
To>
|
||||
BitCast(const From& src) noexcept {
|
||||
To dst;
|
||||
std::memcpy(&dst, &src, sizeof(To));
|
||||
return dst;
|
||||
constexpr inline To BitCast(const From& from) {
|
||||
#ifdef __cpp_lib_bit_cast
|
||||
return std::bit_cast<To>(from);
|
||||
#else
|
||||
return __builtin_bit_cast(To, from);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace Common
|
||||
|
||||
@@ -46,7 +46,7 @@ enum class PollingMode {
|
||||
// Constant polling of buttons, analogs and motion data
|
||||
Active,
|
||||
// Only update on button change, digital analogs
|
||||
Pasive,
|
||||
Passive,
|
||||
// Enable near field communication polling
|
||||
NFC,
|
||||
// Enable infrared camera polling
|
||||
|
||||
@@ -119,7 +119,7 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) {
|
||||
SUB(Service, NPNS) \
|
||||
SUB(Service, NS) \
|
||||
SUB(Service, NVDRV) \
|
||||
SUB(Service, NVFlinger) \
|
||||
SUB(Service, Nvnflinger) \
|
||||
SUB(Service, OLSC) \
|
||||
SUB(Service, PCIE) \
|
||||
SUB(Service, PCTL) \
|
||||
|
||||
@@ -29,107 +29,107 @@ enum class Level : u8 {
|
||||
* filter.cpp.
|
||||
*/
|
||||
enum class Class : u8 {
|
||||
Log, ///< Messages about the log system itself
|
||||
Common, ///< Library routines
|
||||
Common_Filesystem, ///< Filesystem interface library
|
||||
Common_Memory, ///< Memory mapping and management functions
|
||||
Core, ///< LLE emulation core
|
||||
Core_ARM, ///< ARM CPU core
|
||||
Core_Timing, ///< CoreTiming functions
|
||||
Config, ///< Emulator configuration (including commandline)
|
||||
Debug, ///< Debugging tools
|
||||
Debug_Emulated, ///< Debug messages from the emulated programs
|
||||
Debug_GPU, ///< GPU debugging tools
|
||||
Debug_Breakpoint, ///< Logging breakpoints and watchpoints
|
||||
Debug_GDBStub, ///< GDB Stub
|
||||
Kernel, ///< The HLE implementation of the CTR kernel
|
||||
Kernel_SVC, ///< Kernel system calls
|
||||
Service, ///< HLE implementation of system services. Each major service
|
||||
///< should have its own subclass.
|
||||
Service_ACC, ///< The ACC (Accounts) service
|
||||
Service_AM, ///< The AM (Applet manager) service
|
||||
Service_AOC, ///< The AOC (AddOn Content) service
|
||||
Service_APM, ///< The APM (Performance) service
|
||||
Service_ARP, ///< The ARP service
|
||||
Service_Audio, ///< The Audio (Audio control) service
|
||||
Service_BCAT, ///< The BCAT service
|
||||
Service_BGTC, ///< The BGTC (Background Task Controller) service
|
||||
Service_BPC, ///< The BPC service
|
||||
Service_BTDRV, ///< The Bluetooth driver service
|
||||
Service_BTM, ///< The BTM service
|
||||
Service_Capture, ///< The capture service
|
||||
Service_ERPT, ///< The error reporting service
|
||||
Service_ETicket, ///< The ETicket service
|
||||
Service_EUPLD, ///< The error upload service
|
||||
Service_Fatal, ///< The Fatal service
|
||||
Service_FGM, ///< The FGM service
|
||||
Service_Friend, ///< The friend service
|
||||
Service_FS, ///< The FS (Filesystem) service
|
||||
Service_GRC, ///< The game recording service
|
||||
Service_HID, ///< The HID (Human interface device) service
|
||||
Service_IRS, ///< The IRS service
|
||||
Service_JIT, ///< The JIT service
|
||||
Service_LBL, ///< The LBL (LCD backlight) service
|
||||
Service_LDN, ///< The LDN (Local domain network) service
|
||||
Service_LDR, ///< The loader service
|
||||
Service_LM, ///< The LM (Logger) service
|
||||
Service_Migration, ///< The migration service
|
||||
Service_Mii, ///< The Mii service
|
||||
Service_MM, ///< The MM (Multimedia) service
|
||||
Service_MNPP, ///< The MNPP service
|
||||
Service_NCM, ///< The NCM service
|
||||
Service_NFC, ///< The NFC (Near-field communication) service
|
||||
Service_NFP, ///< The NFP service
|
||||
Service_NGCT, ///< The NGCT (No Good Content for Terra) service
|
||||
Service_NIFM, ///< The NIFM (Network interface) service
|
||||
Service_NIM, ///< The NIM service
|
||||
Service_NOTIF, ///< The NOTIF (Notification) service
|
||||
Service_NPNS, ///< The NPNS service
|
||||
Service_NS, ///< The NS services
|
||||
Service_NVDRV, ///< The NVDRV (Nvidia driver) service
|
||||
Service_NVFlinger, ///< The NVFlinger service
|
||||
Service_OLSC, ///< The OLSC service
|
||||
Service_PCIE, ///< The PCIe service
|
||||
Service_PCTL, ///< The PCTL (Parental control) service
|
||||
Service_PCV, ///< The PCV service
|
||||
Service_PM, ///< The PM service
|
||||
Service_PREPO, ///< The PREPO (Play report) service
|
||||
Service_PSC, ///< The PSC service
|
||||
Service_PTM, ///< The PTM service
|
||||
Service_SET, ///< The SET (Settings) service
|
||||
Service_SM, ///< The SM (Service manager) service
|
||||
Service_SPL, ///< The SPL service
|
||||
Service_SSL, ///< The SSL service
|
||||
Service_TCAP, ///< The TCAP service.
|
||||
Service_Time, ///< The time service
|
||||
Service_USB, ///< The USB (Universal Serial Bus) service
|
||||
Service_VI, ///< The VI (Video interface) service
|
||||
Service_WLAN, ///< The WLAN (Wireless local area network) service
|
||||
HW, ///< Low-level hardware emulation
|
||||
HW_Memory, ///< Memory-map and address translation
|
||||
HW_LCD, ///< LCD register emulation
|
||||
HW_GPU, ///< GPU control emulation
|
||||
HW_AES, ///< AES engine emulation
|
||||
IPC, ///< IPC interface
|
||||
Frontend, ///< Emulator UI
|
||||
Render, ///< Emulator video output and hardware acceleration
|
||||
Render_Software, ///< Software renderer backend
|
||||
Render_OpenGL, ///< OpenGL backend
|
||||
Render_Vulkan, ///< Vulkan backend
|
||||
Shader, ///< Shader recompiler
|
||||
Shader_SPIRV, ///< Shader SPIR-V code generation
|
||||
Shader_GLASM, ///< Shader GLASM code generation
|
||||
Shader_GLSL, ///< Shader GLSL code generation
|
||||
Audio, ///< Audio emulation
|
||||
Audio_DSP, ///< The HLE implementation of the DSP
|
||||
Audio_Sink, ///< Emulator audio output backend
|
||||
Loader, ///< ROM loader
|
||||
CheatEngine, ///< Memory manipulation and engine VM functions
|
||||
Crypto, ///< Cryptographic engine/functions
|
||||
Input, ///< Input emulation
|
||||
Network, ///< Network emulation
|
||||
WebService, ///< Interface to yuzu Web Services
|
||||
Count ///< Total number of logging classes
|
||||
Log, ///< Messages about the log system itself
|
||||
Common, ///< Library routines
|
||||
Common_Filesystem, ///< Filesystem interface library
|
||||
Common_Memory, ///< Memory mapping and management functions
|
||||
Core, ///< LLE emulation core
|
||||
Core_ARM, ///< ARM CPU core
|
||||
Core_Timing, ///< CoreTiming functions
|
||||
Config, ///< Emulator configuration (including commandline)
|
||||
Debug, ///< Debugging tools
|
||||
Debug_Emulated, ///< Debug messages from the emulated programs
|
||||
Debug_GPU, ///< GPU debugging tools
|
||||
Debug_Breakpoint, ///< Logging breakpoints and watchpoints
|
||||
Debug_GDBStub, ///< GDB Stub
|
||||
Kernel, ///< The HLE implementation of the CTR kernel
|
||||
Kernel_SVC, ///< Kernel system calls
|
||||
Service, ///< HLE implementation of system services. Each major service
|
||||
///< should have its own subclass.
|
||||
Service_ACC, ///< The ACC (Accounts) service
|
||||
Service_AM, ///< The AM (Applet manager) service
|
||||
Service_AOC, ///< The AOC (AddOn Content) service
|
||||
Service_APM, ///< The APM (Performance) service
|
||||
Service_ARP, ///< The ARP service
|
||||
Service_Audio, ///< The Audio (Audio control) service
|
||||
Service_BCAT, ///< The BCAT service
|
||||
Service_BGTC, ///< The BGTC (Background Task Controller) service
|
||||
Service_BPC, ///< The BPC service
|
||||
Service_BTDRV, ///< The Bluetooth driver service
|
||||
Service_BTM, ///< The BTM service
|
||||
Service_Capture, ///< The capture service
|
||||
Service_ERPT, ///< The error reporting service
|
||||
Service_ETicket, ///< The ETicket service
|
||||
Service_EUPLD, ///< The error upload service
|
||||
Service_Fatal, ///< The Fatal service
|
||||
Service_FGM, ///< The FGM service
|
||||
Service_Friend, ///< The friend service
|
||||
Service_FS, ///< The FS (Filesystem) service
|
||||
Service_GRC, ///< The game recording service
|
||||
Service_HID, ///< The HID (Human interface device) service
|
||||
Service_IRS, ///< The IRS service
|
||||
Service_JIT, ///< The JIT service
|
||||
Service_LBL, ///< The LBL (LCD backlight) service
|
||||
Service_LDN, ///< The LDN (Local domain network) service
|
||||
Service_LDR, ///< The loader service
|
||||
Service_LM, ///< The LM (Logger) service
|
||||
Service_Migration, ///< The migration service
|
||||
Service_Mii, ///< The Mii service
|
||||
Service_MM, ///< The MM (Multimedia) service
|
||||
Service_MNPP, ///< The MNPP service
|
||||
Service_NCM, ///< The NCM service
|
||||
Service_NFC, ///< The NFC (Near-field communication) service
|
||||
Service_NFP, ///< The NFP service
|
||||
Service_NGCT, ///< The NGCT (No Good Content for Terra) service
|
||||
Service_NIFM, ///< The NIFM (Network interface) service
|
||||
Service_NIM, ///< The NIM service
|
||||
Service_NOTIF, ///< The NOTIF (Notification) service
|
||||
Service_NPNS, ///< The NPNS service
|
||||
Service_NS, ///< The NS services
|
||||
Service_NVDRV, ///< The NVDRV (Nvidia driver) service
|
||||
Service_Nvnflinger, ///< The Nvnflinger service
|
||||
Service_OLSC, ///< The OLSC service
|
||||
Service_PCIE, ///< The PCIe service
|
||||
Service_PCTL, ///< The PCTL (Parental control) service
|
||||
Service_PCV, ///< The PCV service
|
||||
Service_PM, ///< The PM service
|
||||
Service_PREPO, ///< The PREPO (Play report) service
|
||||
Service_PSC, ///< The PSC service
|
||||
Service_PTM, ///< The PTM service
|
||||
Service_SET, ///< The SET (Settings) service
|
||||
Service_SM, ///< The SM (Service manager) service
|
||||
Service_SPL, ///< The SPL service
|
||||
Service_SSL, ///< The SSL service
|
||||
Service_TCAP, ///< The TCAP service.
|
||||
Service_Time, ///< The time service
|
||||
Service_USB, ///< The USB (Universal Serial Bus) service
|
||||
Service_VI, ///< The VI (Video interface) service
|
||||
Service_WLAN, ///< The WLAN (Wireless local area network) service
|
||||
HW, ///< Low-level hardware emulation
|
||||
HW_Memory, ///< Memory-map and address translation
|
||||
HW_LCD, ///< LCD register emulation
|
||||
HW_GPU, ///< GPU control emulation
|
||||
HW_AES, ///< AES engine emulation
|
||||
IPC, ///< IPC interface
|
||||
Frontend, ///< Emulator UI
|
||||
Render, ///< Emulator video output and hardware acceleration
|
||||
Render_Software, ///< Software renderer backend
|
||||
Render_OpenGL, ///< OpenGL backend
|
||||
Render_Vulkan, ///< Vulkan backend
|
||||
Shader, ///< Shader recompiler
|
||||
Shader_SPIRV, ///< Shader SPIR-V code generation
|
||||
Shader_GLASM, ///< Shader GLASM code generation
|
||||
Shader_GLSL, ///< Shader GLSL code generation
|
||||
Audio, ///< Audio emulation
|
||||
Audio_DSP, ///< The HLE implementation of the DSP
|
||||
Audio_Sink, ///< Emulator audio output backend
|
||||
Loader, ///< ROM loader
|
||||
CheatEngine, ///< Memory manipulation and engine VM functions
|
||||
Crypto, ///< Cryptographic engine/functions
|
||||
Input, ///< Input emulation
|
||||
Network, ///< Network emulation
|
||||
WebService, ///< Interface to yuzu Web Services
|
||||
Count ///< Total number of logging classes
|
||||
};
|
||||
|
||||
} // namespace Common::Log
|
||||
|
||||
22
src/common/overflow.h
Normal file
22
src/common/overflow.h
Normal file
@@ -0,0 +1,22 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
#include "bit_cast.h"
|
||||
|
||||
namespace Common {
|
||||
|
||||
template <typename T>
|
||||
requires(std::is_integral_v<T> && std::is_signed_v<T>)
|
||||
inline T WrappingAdd(T lhs, T rhs) {
|
||||
using U = std::make_unsigned_t<T>;
|
||||
|
||||
U lhs_u = BitCast<U>(lhs);
|
||||
U rhs_u = BitCast<U>(rhs);
|
||||
|
||||
return BitCast<T>(lhs_u + rhs_u);
|
||||
}
|
||||
|
||||
} // namespace Common
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
/**
|
||||
* Sets a default value, label, and setting value.
|
||||
*
|
||||
* @param default_val Intial value of the setting, and default value of the setting
|
||||
* @param default_val Initial value of the setting, and default value of the setting
|
||||
* @param name Label for the setting
|
||||
*/
|
||||
explicit Setting(const Type& default_val, const std::string& name)
|
||||
@@ -139,7 +139,7 @@ public:
|
||||
/**
|
||||
* Sets a default value, minimum value, maximum value, and label.
|
||||
*
|
||||
* @param default_val Intial value of the setting, and default value of the setting
|
||||
* @param default_val Initial value of the setting, and default value of the setting
|
||||
* @param min_val Sets the minimum allowed value of the setting
|
||||
* @param max_val Sets the maximum allowed value of the setting
|
||||
* @param name Label for the setting
|
||||
@@ -231,7 +231,7 @@ public:
|
||||
/**
|
||||
* Sets a default value, label, and setting value.
|
||||
*
|
||||
* @param default_val Intial value of the setting, and default value of the setting
|
||||
* @param default_val Initial value of the setting, and default value of the setting
|
||||
* @param name Label for the setting
|
||||
*/
|
||||
explicit SwitchableSetting(const Type& default_val, const std::string& name)
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
/**
|
||||
* Sets a default value, minimum value, maximum value, and label.
|
||||
*
|
||||
* @param default_val Intial value of the setting, and default value of the setting
|
||||
* @param default_val Initial value of the setting, and default value of the setting
|
||||
* @param min_val Sets the minimum allowed value of the setting
|
||||
* @param max_val Sets the maximum allowed value of the setting
|
||||
* @param name Label for the setting
|
||||
@@ -503,7 +503,7 @@ struct Values {
|
||||
Setting<bool> tas_loop{false, "tas_loop"};
|
||||
|
||||
Setting<bool> mouse_panning{false, "mouse_panning"};
|
||||
Setting<u8, true> mouse_panning_sensitivity{10, 1, 100, "mouse_panning_sensitivity"};
|
||||
Setting<u8, true> mouse_panning_sensitivity{50, 1, 100, "mouse_panning_sensitivity"};
|
||||
Setting<bool> mouse_enabled{false, "mouse_enabled"};
|
||||
|
||||
Setting<bool> emulate_analog_keyboard{false, "emulate_analog_keyboard"};
|
||||
|
||||
56
src/common/steady_clock.cpp
Normal file
56
src/common/steady_clock.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#include "common/steady_clock.h"
|
||||
|
||||
namespace Common {
|
||||
|
||||
#ifdef _WIN32
|
||||
static s64 WindowsQueryPerformanceFrequency() {
|
||||
LARGE_INTEGER frequency;
|
||||
QueryPerformanceFrequency(&frequency);
|
||||
return frequency.QuadPart;
|
||||
}
|
||||
|
||||
static s64 WindowsQueryPerformanceCounter() {
|
||||
LARGE_INTEGER counter;
|
||||
QueryPerformanceCounter(&counter);
|
||||
return counter.QuadPart;
|
||||
}
|
||||
#endif
|
||||
|
||||
SteadyClock::time_point SteadyClock::Now() noexcept {
|
||||
#if defined(_WIN32)
|
||||
static const auto freq = WindowsQueryPerformanceFrequency();
|
||||
const auto counter = WindowsQueryPerformanceCounter();
|
||||
|
||||
// 10 MHz is a very common QPC frequency on modern PCs.
|
||||
// Optimizing for this specific frequency can double the performance of
|
||||
// this function by avoiding the expensive frequency conversion path.
|
||||
static constexpr s64 TenMHz = 10'000'000;
|
||||
|
||||
if (freq == TenMHz) [[likely]] {
|
||||
static_assert(period::den % TenMHz == 0);
|
||||
static constexpr s64 Multiplier = period::den / TenMHz;
|
||||
return time_point{duration{counter * Multiplier}};
|
||||
}
|
||||
|
||||
const auto whole = (counter / freq) * period::den;
|
||||
const auto part = (counter % freq) * period::den / freq;
|
||||
return time_point{duration{whole + part}};
|
||||
#elif defined(__APPLE__)
|
||||
return time_point{duration{clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW)}};
|
||||
#else
|
||||
timespec ts;
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
return time_point{std::chrono::seconds{ts.tv_sec} + std::chrono::nanoseconds{ts.tv_nsec}};
|
||||
#endif
|
||||
}
|
||||
|
||||
}; // namespace Common
|
||||
23
src/common/steady_clock.h
Normal file
23
src/common/steady_clock.h
Normal file
@@ -0,0 +1,23 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
namespace Common {
|
||||
|
||||
struct SteadyClock {
|
||||
using rep = s64;
|
||||
using period = std::nano;
|
||||
using duration = std::chrono::nanoseconds;
|
||||
using time_point = std::chrono::time_point<SteadyClock>;
|
||||
|
||||
static constexpr bool is_steady = true;
|
||||
|
||||
[[nodiscard]] static time_point Now() noexcept;
|
||||
};
|
||||
|
||||
} // namespace Common
|
||||
@@ -1,6 +1,7 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/steady_clock.h"
|
||||
#include "common/uint128.h"
|
||||
#include "common/wall_clock.h"
|
||||
|
||||
@@ -11,45 +12,32 @@
|
||||
|
||||
namespace Common {
|
||||
|
||||
using base_timer = std::chrono::steady_clock;
|
||||
using base_time_point = std::chrono::time_point<base_timer>;
|
||||
|
||||
class StandardWallClock final : public WallClock {
|
||||
public:
|
||||
explicit StandardWallClock(u64 emulated_cpu_frequency_, u64 emulated_clock_frequency_)
|
||||
: WallClock(emulated_cpu_frequency_, emulated_clock_frequency_, false) {
|
||||
start_time = base_timer::now();
|
||||
}
|
||||
: WallClock{emulated_cpu_frequency_, emulated_clock_frequency_, false},
|
||||
start_time{SteadyClock::Now()} {}
|
||||
|
||||
std::chrono::nanoseconds GetTimeNS() override {
|
||||
base_time_point current = base_timer::now();
|
||||
auto elapsed = current - start_time;
|
||||
return std::chrono::duration_cast<std::chrono::nanoseconds>(elapsed);
|
||||
return SteadyClock::Now() - start_time;
|
||||
}
|
||||
|
||||
std::chrono::microseconds GetTimeUS() override {
|
||||
base_time_point current = base_timer::now();
|
||||
auto elapsed = current - start_time;
|
||||
return std::chrono::duration_cast<std::chrono::microseconds>(elapsed);
|
||||
return std::chrono::duration_cast<std::chrono::microseconds>(GetTimeNS());
|
||||
}
|
||||
|
||||
std::chrono::milliseconds GetTimeMS() override {
|
||||
base_time_point current = base_timer::now();
|
||||
auto elapsed = current - start_time;
|
||||
return std::chrono::duration_cast<std::chrono::milliseconds>(elapsed);
|
||||
return std::chrono::duration_cast<std::chrono::milliseconds>(GetTimeNS());
|
||||
}
|
||||
|
||||
u64 GetClockCycles() override {
|
||||
std::chrono::nanoseconds time_now = GetTimeNS();
|
||||
const u128 temporary =
|
||||
Common::Multiply64Into128(time_now.count(), emulated_clock_frequency);
|
||||
return Common::Divide128On32(temporary, 1000000000).first;
|
||||
const u128 temp = Common::Multiply64Into128(GetTimeNS().count(), emulated_clock_frequency);
|
||||
return Common::Divide128On32(temp, NS_RATIO).first;
|
||||
}
|
||||
|
||||
u64 GetCPUCycles() override {
|
||||
std::chrono::nanoseconds time_now = GetTimeNS();
|
||||
const u128 temporary = Common::Multiply64Into128(time_now.count(), emulated_cpu_frequency);
|
||||
return Common::Divide128On32(temporary, 1000000000).first;
|
||||
const u128 temp = Common::Multiply64Into128(GetTimeNS().count(), emulated_cpu_frequency);
|
||||
return Common::Divide128On32(temp, NS_RATIO).first;
|
||||
}
|
||||
|
||||
void Pause([[maybe_unused]] bool is_paused) override {
|
||||
@@ -57,7 +45,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
base_time_point start_time;
|
||||
SteadyClock::time_point start_time;
|
||||
};
|
||||
|
||||
#ifdef ARCHITECTURE_x86_64
|
||||
@@ -93,4 +81,9 @@ std::unique_ptr<WallClock> CreateBestMatchingClock(u64 emulated_cpu_frequency,
|
||||
|
||||
#endif
|
||||
|
||||
std::unique_ptr<WallClock> CreateStandardWallClock(u64 emulated_cpu_frequency,
|
||||
u64 emulated_clock_frequency) {
|
||||
return std::make_unique<StandardWallClock>(emulated_cpu_frequency, emulated_clock_frequency);
|
||||
}
|
||||
|
||||
} // namespace Common
|
||||
|
||||
@@ -55,4 +55,7 @@ private:
|
||||
[[nodiscard]] std::unique_ptr<WallClock> CreateBestMatchingClock(u64 emulated_cpu_frequency,
|
||||
u64 emulated_clock_frequency);
|
||||
|
||||
[[nodiscard]] std::unique_ptr<WallClock> CreateStandardWallClock(u64 emulated_cpu_frequency,
|
||||
u64 emulated_clock_frequency);
|
||||
|
||||
} // namespace Common
|
||||
|
||||
109
src/common/windows/timer_resolution.cpp
Normal file
109
src/common/windows/timer_resolution.cpp
Normal file
@@ -0,0 +1,109 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include "common/windows/timer_resolution.h"
|
||||
|
||||
extern "C" {
|
||||
// http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FTime%2FNtQueryTimerResolution.html
|
||||
NTSYSAPI LONG NTAPI NtQueryTimerResolution(PULONG MinimumResolution, PULONG MaximumResolution,
|
||||
PULONG CurrentResolution);
|
||||
|
||||
// http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FTime%2FNtSetTimerResolution.html
|
||||
NTSYSAPI LONG NTAPI NtSetTimerResolution(ULONG DesiredResolution, BOOLEAN SetResolution,
|
||||
PULONG CurrentResolution);
|
||||
|
||||
// http://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FThread%2FNtDelayExecution.html
|
||||
NTSYSAPI LONG NTAPI NtDelayExecution(BOOLEAN Alertable, PLARGE_INTEGER DelayInterval);
|
||||
}
|
||||
|
||||
// Defines for compatibility with older Windows 10 SDKs.
|
||||
|
||||
#ifndef PROCESS_POWER_THROTTLING_EXECUTION_SPEED
|
||||
#define PROCESS_POWER_THROTTLING_EXECUTION_SPEED 0x1
|
||||
#endif
|
||||
#ifndef PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION
|
||||
#define PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION 0x4
|
||||
#endif
|
||||
|
||||
namespace Common::Windows {
|
||||
|
||||
namespace {
|
||||
|
||||
using namespace std::chrono;
|
||||
|
||||
constexpr nanoseconds ToNS(ULONG hundred_ns) {
|
||||
return nanoseconds{hundred_ns * 100};
|
||||
}
|
||||
|
||||
constexpr ULONG ToHundredNS(nanoseconds ns) {
|
||||
return static_cast<ULONG>(ns.count()) / 100;
|
||||
}
|
||||
|
||||
struct TimerResolution {
|
||||
std::chrono::nanoseconds minimum;
|
||||
std::chrono::nanoseconds maximum;
|
||||
std::chrono::nanoseconds current;
|
||||
};
|
||||
|
||||
TimerResolution GetTimerResolution() {
|
||||
ULONG MinimumTimerResolution;
|
||||
ULONG MaximumTimerResolution;
|
||||
ULONG CurrentTimerResolution;
|
||||
NtQueryTimerResolution(&MinimumTimerResolution, &MaximumTimerResolution,
|
||||
&CurrentTimerResolution);
|
||||
return {
|
||||
.minimum{ToNS(MinimumTimerResolution)},
|
||||
.maximum{ToNS(MaximumTimerResolution)},
|
||||
.current{ToNS(CurrentTimerResolution)},
|
||||
};
|
||||
}
|
||||
|
||||
void SetHighQoS() {
|
||||
// https://learn.microsoft.com/en-us/windows/win32/procthread/quality-of-service
|
||||
PROCESS_POWER_THROTTLING_STATE PowerThrottling{
|
||||
.Version{PROCESS_POWER_THROTTLING_CURRENT_VERSION},
|
||||
.ControlMask{PROCESS_POWER_THROTTLING_EXECUTION_SPEED |
|
||||
PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION},
|
||||
.StateMask{},
|
||||
};
|
||||
SetProcessInformation(GetCurrentProcess(), ProcessPowerThrottling, &PowerThrottling,
|
||||
sizeof(PROCESS_POWER_THROTTLING_STATE));
|
||||
}
|
||||
|
||||
} // Anonymous namespace
|
||||
|
||||
nanoseconds GetMinimumTimerResolution() {
|
||||
return GetTimerResolution().minimum;
|
||||
}
|
||||
|
||||
nanoseconds GetMaximumTimerResolution() {
|
||||
return GetTimerResolution().maximum;
|
||||
}
|
||||
|
||||
nanoseconds GetCurrentTimerResolution() {
|
||||
return GetTimerResolution().current;
|
||||
}
|
||||
|
||||
nanoseconds SetCurrentTimerResolution(nanoseconds timer_resolution) {
|
||||
// Set the timer resolution, and return the current timer resolution.
|
||||
const auto DesiredTimerResolution = ToHundredNS(timer_resolution);
|
||||
ULONG CurrentTimerResolution;
|
||||
NtSetTimerResolution(DesiredTimerResolution, TRUE, &CurrentTimerResolution);
|
||||
return ToNS(CurrentTimerResolution);
|
||||
}
|
||||
|
||||
nanoseconds SetCurrentTimerResolutionToMaximum() {
|
||||
SetHighQoS();
|
||||
return SetCurrentTimerResolution(GetMaximumTimerResolution());
|
||||
}
|
||||
|
||||
void SleepForOneTick() {
|
||||
LARGE_INTEGER DelayInterval{
|
||||
.QuadPart{-1},
|
||||
};
|
||||
NtDelayExecution(FALSE, &DelayInterval);
|
||||
}
|
||||
|
||||
} // namespace Common::Windows
|
||||
38
src/common/windows/timer_resolution.h
Normal file
38
src/common/windows/timer_resolution.h
Normal file
@@ -0,0 +1,38 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
|
||||
namespace Common::Windows {
|
||||
|
||||
/// Returns the minimum (least precise) supported timer resolution in nanoseconds.
|
||||
std::chrono::nanoseconds GetMinimumTimerResolution();
|
||||
|
||||
/// Returns the maximum (most precise) supported timer resolution in nanoseconds.
|
||||
std::chrono::nanoseconds GetMaximumTimerResolution();
|
||||
|
||||
/// Returns the current timer resolution in nanoseconds.
|
||||
std::chrono::nanoseconds GetCurrentTimerResolution();
|
||||
|
||||
/**
|
||||
* Sets the current timer resolution.
|
||||
*
|
||||
* @param timer_resolution Timer resolution in nanoseconds.
|
||||
*
|
||||
* @returns The current timer resolution.
|
||||
*/
|
||||
std::chrono::nanoseconds SetCurrentTimerResolution(std::chrono::nanoseconds timer_resolution);
|
||||
|
||||
/**
|
||||
* Sets the current timer resolution to the maximum supported timer resolution.
|
||||
*
|
||||
* @returns The current timer resolution.
|
||||
*/
|
||||
std::chrono::nanoseconds SetCurrentTimerResolutionToMaximum();
|
||||
|
||||
/// Sleep for one tick of the current timer resolution.
|
||||
void SleepForOneTick();
|
||||
|
||||
} // namespace Common::Windows
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <thread>
|
||||
|
||||
#include "common/atomic_ops.h"
|
||||
#include "common/steady_clock.h"
|
||||
#include "common/uint128.h"
|
||||
#include "common/x64/native_clock.h"
|
||||
|
||||
@@ -39,6 +40,12 @@ static u64 FencedRDTSC() {
|
||||
}
|
||||
#endif
|
||||
|
||||
template <u64 Nearest>
|
||||
static u64 RoundToNearest(u64 value) {
|
||||
const auto mod = value % Nearest;
|
||||
return mod >= (Nearest / 2) ? (value - mod + Nearest) : (value - mod);
|
||||
}
|
||||
|
||||
u64 EstimateRDTSCFrequency() {
|
||||
// Discard the first result measuring the rdtsc.
|
||||
FencedRDTSC();
|
||||
@@ -46,18 +53,18 @@ u64 EstimateRDTSCFrequency() {
|
||||
FencedRDTSC();
|
||||
|
||||
// Get the current time.
|
||||
const auto start_time = std::chrono::steady_clock::now();
|
||||
const auto start_time = Common::SteadyClock::Now();
|
||||
const u64 tsc_start = FencedRDTSC();
|
||||
// Wait for 200 milliseconds.
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds{200});
|
||||
const auto end_time = std::chrono::steady_clock::now();
|
||||
// Wait for 250 milliseconds.
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds{250});
|
||||
const auto end_time = Common::SteadyClock::Now();
|
||||
const u64 tsc_end = FencedRDTSC();
|
||||
// Calculate differences.
|
||||
const u64 timer_diff = static_cast<u64>(
|
||||
std::chrono::duration_cast<std::chrono::nanoseconds>(end_time - start_time).count());
|
||||
const u64 tsc_diff = tsc_end - tsc_start;
|
||||
const u64 tsc_freq = MultiplyAndDivide64(tsc_diff, 1000000000ULL, timer_diff);
|
||||
return tsc_freq;
|
||||
return RoundToNearest<1000>(tsc_freq);
|
||||
}
|
||||
|
||||
namespace X64 {
|
||||
|
||||
@@ -158,7 +158,6 @@ add_library(core STATIC
|
||||
hid/motion_input.h
|
||||
hle/api_version.h
|
||||
hle/ipc.h
|
||||
hle/ipc_helpers.h
|
||||
hle/kernel/board/nintendo/nx/k_memory_layout.h
|
||||
hle/kernel/board/nintendo/nx/k_system_control.cpp
|
||||
hle/kernel/board/nintendo/nx/k_system_control.h
|
||||
@@ -168,8 +167,6 @@ add_library(core STATIC
|
||||
hle/kernel/svc_results.h
|
||||
hle/kernel/global_scheduler_context.cpp
|
||||
hle/kernel/global_scheduler_context.h
|
||||
hle/kernel/hle_ipc.cpp
|
||||
hle/kernel/hle_ipc.h
|
||||
hle/kernel/init/init_slab_setup.cpp
|
||||
hle/kernel/init/init_slab_setup.h
|
||||
hle/kernel/initial_process.h
|
||||
@@ -457,7 +454,6 @@ add_library(core STATIC
|
||||
hle/service/filesystem/fsp_srv.h
|
||||
hle/service/fgm/fgm.cpp
|
||||
hle/service/fgm/fgm.h
|
||||
hle/service/friend/errors.h
|
||||
hle/service/friend/friend.cpp
|
||||
hle/service/friend/friend.h
|
||||
hle/service/friend/friend_interface.cpp
|
||||
@@ -629,35 +625,35 @@ add_library(core STATIC
|
||||
hle/service/nvdrv/nvdrv_interface.h
|
||||
hle/service/nvdrv/nvmemp.cpp
|
||||
hle/service/nvdrv/nvmemp.h
|
||||
hle/service/nvflinger/binder.h
|
||||
hle/service/nvflinger/buffer_item.h
|
||||
hle/service/nvflinger/buffer_item_consumer.cpp
|
||||
hle/service/nvflinger/buffer_item_consumer.h
|
||||
hle/service/nvflinger/buffer_queue_consumer.cpp
|
||||
hle/service/nvflinger/buffer_queue_consumer.h
|
||||
hle/service/nvflinger/buffer_queue_core.cpp
|
||||
hle/service/nvflinger/buffer_queue_core.h
|
||||
hle/service/nvflinger/buffer_queue_defs.h
|
||||
hle/service/nvflinger/buffer_queue_producer.cpp
|
||||
hle/service/nvflinger/buffer_queue_producer.h
|
||||
hle/service/nvflinger/buffer_slot.h
|
||||
hle/service/nvflinger/buffer_transform_flags.h
|
||||
hle/service/nvflinger/consumer_base.cpp
|
||||
hle/service/nvflinger/consumer_base.h
|
||||
hle/service/nvflinger/consumer_listener.h
|
||||
hle/service/nvflinger/graphic_buffer_producer.cpp
|
||||
hle/service/nvflinger/graphic_buffer_producer.h
|
||||
hle/service/nvflinger/hos_binder_driver_server.cpp
|
||||
hle/service/nvflinger/hos_binder_driver_server.h
|
||||
hle/service/nvflinger/nvflinger.cpp
|
||||
hle/service/nvflinger/nvflinger.h
|
||||
hle/service/nvflinger/parcel.h
|
||||
hle/service/nvflinger/pixel_format.h
|
||||
hle/service/nvflinger/producer_listener.h
|
||||
hle/service/nvflinger/status.h
|
||||
hle/service/nvflinger/ui/fence.h
|
||||
hle/service/nvflinger/ui/graphic_buffer.h
|
||||
hle/service/nvflinger/window.h
|
||||
hle/service/nvnflinger/binder.h
|
||||
hle/service/nvnflinger/buffer_item.h
|
||||
hle/service/nvnflinger/buffer_item_consumer.cpp
|
||||
hle/service/nvnflinger/buffer_item_consumer.h
|
||||
hle/service/nvnflinger/buffer_queue_consumer.cpp
|
||||
hle/service/nvnflinger/buffer_queue_consumer.h
|
||||
hle/service/nvnflinger/buffer_queue_core.cpp
|
||||
hle/service/nvnflinger/buffer_queue_core.h
|
||||
hle/service/nvnflinger/buffer_queue_defs.h
|
||||
hle/service/nvnflinger/buffer_queue_producer.cpp
|
||||
hle/service/nvnflinger/buffer_queue_producer.h
|
||||
hle/service/nvnflinger/buffer_slot.h
|
||||
hle/service/nvnflinger/buffer_transform_flags.h
|
||||
hle/service/nvnflinger/consumer_base.cpp
|
||||
hle/service/nvnflinger/consumer_base.h
|
||||
hle/service/nvnflinger/consumer_listener.h
|
||||
hle/service/nvnflinger/graphic_buffer_producer.cpp
|
||||
hle/service/nvnflinger/graphic_buffer_producer.h
|
||||
hle/service/nvnflinger/hos_binder_driver_server.cpp
|
||||
hle/service/nvnflinger/hos_binder_driver_server.h
|
||||
hle/service/nvnflinger/nvnflinger.cpp
|
||||
hle/service/nvnflinger/nvnflinger.h
|
||||
hle/service/nvnflinger/parcel.h
|
||||
hle/service/nvnflinger/pixel_format.h
|
||||
hle/service/nvnflinger/producer_listener.h
|
||||
hle/service/nvnflinger/status.h
|
||||
hle/service/nvnflinger/ui/fence.h
|
||||
hle/service/nvnflinger/ui/graphic_buffer.h
|
||||
hle/service/nvnflinger/window.h
|
||||
hle/service/olsc/olsc.cpp
|
||||
hle/service/olsc/olsc.h
|
||||
hle/service/pcie/pcie.cpp
|
||||
@@ -680,6 +676,9 @@ add_library(core STATIC
|
||||
hle/service/ptm/ptm.h
|
||||
hle/service/ptm/ts.cpp
|
||||
hle/service/ptm/ts.h
|
||||
hle/service/hle_ipc.cpp
|
||||
hle/service/hle_ipc.h
|
||||
hle/service/ipc_helpers.h
|
||||
hle/service/kernel_helpers.cpp
|
||||
hle/service/kernel_helpers.h
|
||||
hle/service/mutex.cpp
|
||||
|
||||
@@ -4,13 +4,24 @@
|
||||
#include "core/constants.h"
|
||||
|
||||
namespace Core::Constants {
|
||||
const std::array<u8, 107> ACCOUNT_BACKUP_JPEG{{
|
||||
0xff, 0xd8, 0xff, 0xdb, 0x00, 0x43, 0x00, 0x03, 0x02, 0x02, 0x02, 0x02, 0x02, 0x03, 0x02, 0x02,
|
||||
0x02, 0x03, 0x03, 0x03, 0x03, 0x04, 0x06, 0x04, 0x04, 0x04, 0x04, 0x04, 0x08, 0x06, 0x06, 0x05,
|
||||
0x06, 0x09, 0x08, 0x0a, 0x0a, 0x09, 0x08, 0x09, 0x09, 0x0a, 0x0c, 0x0f, 0x0c, 0x0a, 0x0b, 0x0e,
|
||||
0x0b, 0x09, 0x09, 0x0d, 0x11, 0x0d, 0x0e, 0x0f, 0x10, 0x10, 0x11, 0x10, 0x0a, 0x0c, 0x12, 0x13,
|
||||
0x12, 0x10, 0x13, 0x0f, 0x10, 0x10, 0x10, 0xff, 0xc9, 0x00, 0x0b, 0x08, 0x00, 0x01, 0x00, 0x01,
|
||||
0x01, 0x01, 0x11, 0x00, 0xff, 0xcc, 0x00, 0x06, 0x00, 0x10, 0x10, 0x05, 0xff, 0xda, 0x00, 0x08,
|
||||
0x01, 0x01, 0x00, 0x00, 0x3f, 0x00, 0xd2, 0xcf, 0x20, 0xff, 0xd9,
|
||||
const std::array<u8, 287> ACCOUNT_BACKUP_JPEG{{
|
||||
0xff, 0xd8, 0xff, 0xe0, 0x00, 0x10, 0x4a, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x01, 0x00, 0x48,
|
||||
0x00, 0x48, 0x00, 0x00, 0xff, 0xdb, 0x00, 0x43, 0x00, 0x06, 0x04, 0x04, 0x04, 0x05, 0x04, 0x06,
|
||||
0x05, 0x05, 0x06, 0x09, 0x06, 0x05, 0x06, 0x09, 0x0b, 0x08, 0x06, 0x06, 0x08, 0x0b, 0x0c, 0x0a,
|
||||
0x0a, 0x0b, 0x0a, 0x0a, 0x0c, 0x10, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x10, 0x0c, 0x0e, 0x0f,
|
||||
0x10, 0x0f, 0x0e, 0x0c, 0x13, 0x13, 0x14, 0x14, 0x13, 0x13, 0x1c, 0x1b, 0x1b, 0x1b, 0x1c, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xff, 0xdb, 0x00, 0x43, 0x01, 0x07, 0x07,
|
||||
0x07, 0x0d, 0x0c, 0x0d, 0x18, 0x10, 0x10, 0x18, 0x1a, 0x15, 0x11, 0x15, 0x1a, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
|
||||
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0xff, 0xc0,
|
||||
0x00, 0x11, 0x08, 0x00, 0x20, 0x00, 0x20, 0x03, 0x01, 0x22, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11,
|
||||
0x01, 0xff, 0xc4, 0x00, 0x14, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc4, 0x00, 0x14, 0x10, 0x01, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xc4, 0x00,
|
||||
0x14, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0xff, 0xc4, 0x00, 0x14, 0x11, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xda, 0x00, 0x0c, 0x03, 0x01, 0x00,
|
||||
0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xd9,
|
||||
}};
|
||||
}
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
namespace Core::Constants {
|
||||
|
||||
// ACC Service - Blank JPEG used as user icon in absentia of real one.
|
||||
extern const std::array<u8, 107> ACCOUNT_BACKUP_JPEG;
|
||||
extern const std::array<u8, 287> ACCOUNT_BACKUP_JPEG;
|
||||
|
||||
} // namespace Core::Constants
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "common/windows/timer_resolution.h"
|
||||
#endif
|
||||
|
||||
#include "common/microprofile.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/core_timing_util.h"
|
||||
@@ -38,7 +42,8 @@ struct CoreTiming::Event {
|
||||
};
|
||||
|
||||
CoreTiming::CoreTiming()
|
||||
: clock{Common::CreateBestMatchingClock(Hardware::BASE_CLOCK_RATE, Hardware::CNTFREQ)} {}
|
||||
: cpu_clock{Common::CreateBestMatchingClock(Hardware::BASE_CLOCK_RATE, Hardware::CNTFREQ)},
|
||||
event_clock{Common::CreateStandardWallClock(Hardware::BASE_CLOCK_RATE, Hardware::CNTFREQ)} {}
|
||||
|
||||
CoreTiming::~CoreTiming() {
|
||||
Reset();
|
||||
@@ -185,15 +190,15 @@ void CoreTiming::ResetTicks() {
|
||||
}
|
||||
|
||||
u64 CoreTiming::GetCPUTicks() const {
|
||||
if (is_multicore) {
|
||||
return clock->GetCPUCycles();
|
||||
if (is_multicore) [[likely]] {
|
||||
return cpu_clock->GetCPUCycles();
|
||||
}
|
||||
return ticks;
|
||||
}
|
||||
|
||||
u64 CoreTiming::GetClockTicks() const {
|
||||
if (is_multicore) {
|
||||
return clock->GetClockCycles();
|
||||
if (is_multicore) [[likely]] {
|
||||
return cpu_clock->GetClockCycles();
|
||||
}
|
||||
return CpuCyclesToClockCycles(ticks);
|
||||
}
|
||||
@@ -252,21 +257,20 @@ void CoreTiming::ThreadLoop() {
|
||||
const auto next_time = Advance();
|
||||
if (next_time) {
|
||||
// There are more events left in the queue, wait until the next event.
|
||||
const auto wait_time = *next_time - GetGlobalTimeNs().count();
|
||||
auto wait_time = *next_time - GetGlobalTimeNs().count();
|
||||
if (wait_time > 0) {
|
||||
#ifdef _WIN32
|
||||
// Assume a timer resolution of 1ms.
|
||||
static constexpr s64 TimerResolutionNS = 1000000;
|
||||
const auto timer_resolution_ns =
|
||||
Common::Windows::GetCurrentTimerResolution().count();
|
||||
|
||||
// Sleep in discrete intervals of the timer resolution, and spin the rest.
|
||||
const auto sleep_time = wait_time - (wait_time % TimerResolutionNS);
|
||||
if (sleep_time > 0) {
|
||||
event.WaitFor(std::chrono::nanoseconds(sleep_time));
|
||||
}
|
||||
while (!paused && !event.IsSet() && wait_time > 0) {
|
||||
wait_time = *next_time - GetGlobalTimeNs().count();
|
||||
|
||||
while (!paused && !event.IsSet() && GetGlobalTimeNs().count() < *next_time) {
|
||||
// Yield to reduce thread starvation.
|
||||
std::this_thread::yield();
|
||||
if (wait_time >= timer_resolution_ns) {
|
||||
Common::Windows::SleepForOneTick();
|
||||
} else {
|
||||
std::this_thread::yield();
|
||||
}
|
||||
}
|
||||
|
||||
if (event.IsSet()) {
|
||||
@@ -285,9 +289,9 @@ void CoreTiming::ThreadLoop() {
|
||||
}
|
||||
|
||||
paused_set = true;
|
||||
clock->Pause(true);
|
||||
event_clock->Pause(true);
|
||||
pause_event.Wait();
|
||||
clock->Pause(false);
|
||||
event_clock->Pause(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,16 +307,23 @@ void CoreTiming::Reset() {
|
||||
has_started = false;
|
||||
}
|
||||
|
||||
std::chrono::nanoseconds CoreTiming::GetCPUTimeNs() const {
|
||||
if (is_multicore) [[likely]] {
|
||||
return cpu_clock->GetTimeNS();
|
||||
}
|
||||
return CyclesToNs(ticks);
|
||||
}
|
||||
|
||||
std::chrono::nanoseconds CoreTiming::GetGlobalTimeNs() const {
|
||||
if (is_multicore) {
|
||||
return clock->GetTimeNS();
|
||||
if (is_multicore) [[likely]] {
|
||||
return event_clock->GetTimeNS();
|
||||
}
|
||||
return CyclesToNs(ticks);
|
||||
}
|
||||
|
||||
std::chrono::microseconds CoreTiming::GetGlobalTimeUs() const {
|
||||
if (is_multicore) {
|
||||
return clock->GetTimeUS();
|
||||
if (is_multicore) [[likely]] {
|
||||
return event_clock->GetTimeUS();
|
||||
}
|
||||
return CyclesToUs(ticks);
|
||||
}
|
||||
|
||||
@@ -122,6 +122,9 @@ public:
|
||||
/// Returns current time in emulated in Clock cycles
|
||||
u64 GetClockTicks() const;
|
||||
|
||||
/// Returns current time in nanoseconds.
|
||||
std::chrono::nanoseconds GetCPUTimeNs() const;
|
||||
|
||||
/// Returns current time in microseconds.
|
||||
std::chrono::microseconds GetGlobalTimeUs() const;
|
||||
|
||||
@@ -139,7 +142,8 @@ private:
|
||||
|
||||
void Reset();
|
||||
|
||||
std::unique_ptr<Common::WallClock> clock;
|
||||
std::unique_ptr<Common::WallClock> cpu_clock;
|
||||
std::unique_ptr<Common::WallClock> event_clock;
|
||||
|
||||
s64 global_timer = 0;
|
||||
|
||||
|
||||
@@ -13,11 +13,9 @@ namespace Core {
|
||||
|
||||
namespace Hardware {
|
||||
|
||||
// The below clock rate is based on Switch's clockspeed being widely known as 1.020GHz
|
||||
// The exact value used is of course unverified.
|
||||
constexpr u64 BASE_CLOCK_RATE = 1019215872; // Switch cpu frequency is 1020MHz un/docked
|
||||
constexpr u64 CNTFREQ = 19200000; // Switch's hardware clock speed
|
||||
constexpr u32 NUM_CPU_CORES = 4; // Number of CPU Cores
|
||||
constexpr u64 BASE_CLOCK_RATE = 1'020'000'000; // Default CPU Frequency = 1020 MHz
|
||||
constexpr u64 CNTFREQ = 19'200'000; // CNTPCT_EL0 Frequency = 19.2 MHz
|
||||
constexpr u32 NUM_CPU_CORES = 4; // Number of CPU Cores
|
||||
|
||||
// Virtual to Physical core map.
|
||||
constexpr std::array<s32, Common::BitSize<u64>()> VirtualToPhysicalCoreMap{
|
||||
|
||||
@@ -44,11 +44,11 @@ const KAddressSpaceInfo& GetAddressSpaceInfo(size_t width, KAddressSpaceInfo::Ty
|
||||
|
||||
} // namespace
|
||||
|
||||
uintptr_t KAddressSpaceInfo::GetAddressSpaceStart(size_t width, KAddressSpaceInfo::Type type) {
|
||||
std::size_t KAddressSpaceInfo::GetAddressSpaceStart(size_t width, KAddressSpaceInfo::Type type) {
|
||||
return GetAddressSpaceInfo(width, type).address;
|
||||
}
|
||||
|
||||
size_t KAddressSpaceInfo::GetAddressSpaceSize(size_t width, KAddressSpaceInfo::Type type) {
|
||||
std::size_t KAddressSpaceInfo::GetAddressSpaceSize(size_t width, KAddressSpaceInfo::Type type) {
|
||||
return GetAddressSpaceInfo(width, type).size;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ struct KAddressSpaceInfo final {
|
||||
Count,
|
||||
};
|
||||
|
||||
static u64 GetAddressSpaceStart(std::size_t width, Type type);
|
||||
static std::size_t GetAddressSpaceStart(std::size_t width, Type type);
|
||||
static std::size_t GetAddressSpaceSize(std::size_t width, Type type);
|
||||
|
||||
const std::size_t bit_width{};
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/scope_exit.h"
|
||||
#include "core/hle/kernel/hle_ipc.h"
|
||||
#include "core/hle/kernel/k_client_port.h"
|
||||
#include "core/hle/kernel/k_port.h"
|
||||
#include "core/hle/kernel/k_scheduler.h"
|
||||
|
||||
@@ -15,7 +15,6 @@ namespace Kernel {
|
||||
class KClientSession;
|
||||
class KernelCore;
|
||||
class KPort;
|
||||
class SessionRequestManager;
|
||||
|
||||
class KClientPort final : public KSynchronizationObject {
|
||||
KERNEL_AUTOOBJECT_TRAITS(KClientPort, KSynchronizationObject);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/scope_exit.h"
|
||||
#include "core/hle/kernel/hle_ipc.h"
|
||||
#include "core/hle/kernel/k_client_session.h"
|
||||
#include "core/hle/kernel/k_server_session.h"
|
||||
#include "core/hle/kernel/k_session.h"
|
||||
|
||||
@@ -21,9 +21,9 @@ public:
|
||||
~KDeviceAddressSpace();
|
||||
|
||||
Result Initialize(u64 address, u64 size);
|
||||
void Finalize();
|
||||
void Finalize() override;
|
||||
|
||||
bool IsInitialized() const {
|
||||
bool IsInitialized() const override {
|
||||
return m_is_initialized;
|
||||
}
|
||||
static void PostDestroy(uintptr_t arg) {}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2021 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/hle/kernel/hle_ipc.h"
|
||||
#include "core/hle/kernel/k_port.h"
|
||||
#include "core/hle/kernel/k_scheduler.h"
|
||||
#include "core/hle/kernel/svc_results.h"
|
||||
|
||||
@@ -310,10 +310,10 @@ public:
|
||||
/// Clears the signaled state of the process if and only if it's signaled.
|
||||
///
|
||||
/// @pre The process must not be already terminated. If this is called on a
|
||||
/// terminated process, then ERR_INVALID_STATE will be returned.
|
||||
/// terminated process, then ResultInvalidState will be returned.
|
||||
///
|
||||
/// @pre The process must be in a signaled state. If this is called on a
|
||||
/// process instance that is not signaled, ERR_INVALID_STATE will be
|
||||
/// process instance that is not signaled, ResultInvalidState will be
|
||||
/// returned.
|
||||
Result Reset();
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/overflow.h"
|
||||
#include "core/core.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/hle/kernel/k_resource_limit.h"
|
||||
@@ -104,7 +105,7 @@ bool KResourceLimit::Reserve(LimitableResource which, s64 value, s64 timeout) {
|
||||
ASSERT(current_hints[index] <= current_values[index]);
|
||||
|
||||
// If we would overflow, don't allow to succeed.
|
||||
if (current_values[index] + value <= current_values[index]) {
|
||||
if (Common::WrappingAdd(current_values[index], value) <= current_values[index]) {
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <concepts>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
#include "common/scope_exit.h"
|
||||
#include "core/core.h"
|
||||
#include "core/core_timing.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/hle_ipc.h"
|
||||
#include "core/hle/kernel/k_client_port.h"
|
||||
#include "core/hle/kernel/k_handle_table.h"
|
||||
#include "core/hle/kernel/k_process.h"
|
||||
@@ -22,6 +20,8 @@
|
||||
#include "core/hle/kernel/k_thread.h"
|
||||
#include "core/hle/kernel/k_thread_queue.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/service/hle_ipc.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
namespace Kernel {
|
||||
@@ -281,8 +281,8 @@ Result KServerSession::SendReply(bool is_hle) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Result KServerSession::ReceiveRequest(std::shared_ptr<HLERequestContext>* out_context,
|
||||
std::weak_ptr<SessionRequestManager> manager) {
|
||||
Result KServerSession::ReceiveRequest(std::shared_ptr<Service::HLERequestContext>* out_context,
|
||||
std::weak_ptr<Service::SessionRequestManager> manager) {
|
||||
// Lock the session.
|
||||
KScopedLightLock lk{m_lock};
|
||||
|
||||
@@ -329,7 +329,8 @@ Result KServerSession::ReceiveRequest(std::shared_ptr<HLERequestContext>* out_co
|
||||
if (out_context != nullptr) {
|
||||
// HLE request.
|
||||
u32* cmd_buf{reinterpret_cast<u32*>(memory.GetPointer(client_message))};
|
||||
*out_context = std::make_shared<HLERequestContext>(kernel, memory, this, client_thread);
|
||||
*out_context =
|
||||
std::make_shared<Service::HLERequestContext>(kernel, memory, this, client_thread);
|
||||
(*out_context)->SetSessionRequestManager(manager);
|
||||
(*out_context)
|
||||
->PopulateFromIncomingCommandBuffer(client_thread->GetOwnerProcess()->GetHandleTable(),
|
||||
|
||||
@@ -10,18 +10,20 @@
|
||||
|
||||
#include <boost/intrusive/list.hpp>
|
||||
|
||||
#include "core/hle/kernel/hle_ipc.h"
|
||||
#include "core/hle/kernel/k_light_lock.h"
|
||||
#include "core/hle/kernel/k_session_request.h"
|
||||
#include "core/hle/kernel/k_synchronization_object.h"
|
||||
#include "core/hle/result.h"
|
||||
|
||||
namespace Service {
|
||||
class HLERequestContext;
|
||||
class SessionRequestManager;
|
||||
} // namespace Service
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
class HLERequestContext;
|
||||
class KernelCore;
|
||||
class KSession;
|
||||
class SessionRequestManager;
|
||||
class KThread;
|
||||
|
||||
class KServerSession final : public KSynchronizationObject,
|
||||
@@ -52,8 +54,8 @@ public:
|
||||
/// TODO: flesh these out to match the real kernel
|
||||
Result OnRequest(KSessionRequest* request);
|
||||
Result SendReply(bool is_hle = false);
|
||||
Result ReceiveRequest(std::shared_ptr<HLERequestContext>* out_context = nullptr,
|
||||
std::weak_ptr<SessionRequestManager> manager = {});
|
||||
Result ReceiveRequest(std::shared_ptr<Service::HLERequestContext>* out_context = nullptr,
|
||||
std::weak_ptr<Service::SessionRequestManager> manager = {});
|
||||
|
||||
Result SendReplyHLE() {
|
||||
return SendReply(true);
|
||||
|
||||
@@ -48,19 +48,15 @@ Result ResetSignal(Core::System& system, Handle handle) {
|
||||
return ResultInvalidHandle;
|
||||
}
|
||||
|
||||
/// Wait for the given handles to synchronize, timeout after the specified nanoseconds
|
||||
Result WaitSynchronization(Core::System& system, s32* index, VAddr handles_address, s32 num_handles,
|
||||
s64 nano_seconds) {
|
||||
LOG_TRACE(Kernel_SVC, "called handles_address=0x{:X}, num_handles={}, nano_seconds={}",
|
||||
handles_address, num_handles, nano_seconds);
|
||||
|
||||
static Result WaitSynchronization(Core::System& system, int32_t* out_index, const Handle* handles,
|
||||
int32_t num_handles, int64_t timeout_ns) {
|
||||
// Ensure number of handles is valid.
|
||||
R_UNLESS(0 <= num_handles && num_handles <= ArgumentHandleCountMax, ResultOutOfRange);
|
||||
R_UNLESS(0 <= num_handles && num_handles <= Svc::ArgumentHandleCountMax, ResultOutOfRange);
|
||||
|
||||
// Get the synchronization context.
|
||||
auto& kernel = system.Kernel();
|
||||
auto& handle_table = GetCurrentProcess(kernel).GetHandleTable();
|
||||
std::vector<KSynchronizationObject*> objs(num_handles);
|
||||
const auto& handle_table = GetCurrentProcess(kernel).GetHandleTable();
|
||||
Handle* handles = system.Memory().GetPointer<Handle>(handles_address);
|
||||
|
||||
// Copy user handles.
|
||||
if (num_handles > 0) {
|
||||
@@ -68,21 +64,38 @@ Result WaitSynchronization(Core::System& system, s32* index, VAddr handles_addre
|
||||
R_UNLESS(handle_table.GetMultipleObjects<KSynchronizationObject>(objs.data(), handles,
|
||||
num_handles),
|
||||
ResultInvalidHandle);
|
||||
for (const auto& obj : objs) {
|
||||
kernel.RegisterInUseObject(obj);
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure handles are closed when we're done.
|
||||
SCOPE_EXIT({
|
||||
for (s32 i = 0; i < num_handles; ++i) {
|
||||
kernel.UnregisterInUseObject(objs[i]);
|
||||
for (auto i = 0; i < num_handles; ++i) {
|
||||
objs[i]->Close();
|
||||
}
|
||||
});
|
||||
|
||||
return KSynchronizationObject::Wait(kernel, index, objs.data(), static_cast<s32>(objs.size()),
|
||||
nano_seconds);
|
||||
// Wait on the objects.
|
||||
Result res = KSynchronizationObject::Wait(kernel, out_index, objs.data(),
|
||||
static_cast<s32>(objs.size()), timeout_ns);
|
||||
|
||||
R_SUCCEED_IF(res == ResultSessionClosed);
|
||||
R_RETURN(res);
|
||||
}
|
||||
|
||||
/// Wait for the given handles to synchronize, timeout after the specified nanoseconds
|
||||
Result WaitSynchronization(Core::System& system, int32_t* out_index, VAddr user_handles,
|
||||
int32_t num_handles, int64_t timeout_ns) {
|
||||
LOG_TRACE(Kernel_SVC, "called user_handles={:#x}, num_handles={}, timeout_ns={}", user_handles,
|
||||
num_handles, timeout_ns);
|
||||
|
||||
// Ensure number of handles is valid.
|
||||
R_UNLESS(0 <= num_handles && num_handles <= Svc::ArgumentHandleCountMax, ResultOutOfRange);
|
||||
|
||||
std::vector<Handle> handles(num_handles);
|
||||
if (num_handles > 0) {
|
||||
system.Memory().ReadBlock(user_handles, handles.data(), num_handles * sizeof(Handle));
|
||||
}
|
||||
|
||||
R_RETURN(WaitSynchronization(system, out_index, handles.data(), num_handles, timeout_ns));
|
||||
}
|
||||
|
||||
/// Resumes a thread waiting on WaitSynchronization
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#include "core/core_timing.h"
|
||||
#include "core/file_sys/control_metadata.h"
|
||||
#include "core/file_sys/patch_manager.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/acc/acc.h"
|
||||
#include "core/hle/service/acc/acc_aa.h"
|
||||
#include "core/hle/service/acc/acc_su.h"
|
||||
@@ -25,17 +24,12 @@
|
||||
#include "core/hle/service/acc/errors.h"
|
||||
#include "core/hle/service/acc/profile_manager.h"
|
||||
#include "core/hle/service/glue/glue_manager.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/server_manager.h"
|
||||
#include "core/loader/loader.h"
|
||||
|
||||
namespace Service::Account {
|
||||
|
||||
constexpr Result ERR_INVALID_USER_ID{ErrorModule::Account, 20};
|
||||
constexpr Result ERR_INVALID_APPLICATION_ID{ErrorModule::Account, 22};
|
||||
constexpr Result ERR_INVALID_BUFFER{ErrorModule::Account, 30};
|
||||
constexpr Result ERR_INVALID_BUFFER_SIZE{ErrorModule::Account, 31};
|
||||
constexpr Result ERR_FAILED_SAVE_DATA{ErrorModule::Account, 100};
|
||||
|
||||
// Thumbnails are hard coded to be at least this size
|
||||
constexpr std::size_t THUMBNAIL_SIZE = 0x24000;
|
||||
|
||||
@@ -295,7 +289,7 @@ public:
|
||||
}
|
||||
|
||||
protected:
|
||||
void Get(Kernel::HLERequestContext& ctx) {
|
||||
void Get(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString());
|
||||
ProfileBase profile_base{};
|
||||
UserData data{};
|
||||
@@ -312,7 +306,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void GetBase(Kernel::HLERequestContext& ctx) {
|
||||
void GetBase(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString());
|
||||
ProfileBase profile_base{};
|
||||
if (profile_manager.GetProfileBase(user_id, profile_base)) {
|
||||
@@ -326,7 +320,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void LoadImage(Kernel::HLERequestContext& ctx) {
|
||||
void LoadImage(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -353,7 +347,7 @@ protected:
|
||||
rb.Push<u32>(size);
|
||||
}
|
||||
|
||||
void GetImageSize(Kernel::HLERequestContext& ctx) {
|
||||
void GetImageSize(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
@@ -370,7 +364,7 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
void Store(Kernel::HLERequestContext& ctx) {
|
||||
void Store(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto base = rp.PopRaw<ProfileBase>();
|
||||
|
||||
@@ -384,7 +378,7 @@ protected:
|
||||
if (user_data.size() < sizeof(UserData)) {
|
||||
LOG_ERROR(Service_ACC, "UserData buffer too small!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_INVALID_BUFFER);
|
||||
rb.Push(Account::ResultInvalidArrayLength);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -394,7 +388,7 @@ protected:
|
||||
if (!profile_manager.SetProfileBaseAndData(user_id, base, data)) {
|
||||
LOG_ERROR(Service_ACC, "Failed to update user data and base!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_FAILED_SAVE_DATA);
|
||||
rb.Push(Account::ResultAccountUpdateFailed);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -402,7 +396,7 @@ protected:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void StoreWithImage(Kernel::HLERequestContext& ctx) {
|
||||
void StoreWithImage(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto base = rp.PopRaw<ProfileBase>();
|
||||
|
||||
@@ -417,7 +411,7 @@ protected:
|
||||
if (user_data.size() < sizeof(UserData)) {
|
||||
LOG_ERROR(Service_ACC, "UserData buffer too small!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_INVALID_BUFFER);
|
||||
rb.Push(Account::ResultInvalidArrayLength);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -432,7 +426,7 @@ protected:
|
||||
!profile_manager.SetProfileBaseAndData(user_id, base, data)) {
|
||||
LOG_ERROR(Service_ACC, "Failed to update profile data, base, and image!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_FAILED_SAVE_DATA);
|
||||
rb.Push(Account::ResultAccountUpdateFailed);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -499,7 +493,7 @@ public:
|
||||
}
|
||||
~EnsureTokenIdCacheAsyncInterface() = default;
|
||||
|
||||
void LoadIdTokenCache(Kernel::HLERequestContext& ctx) {
|
||||
void LoadIdTokenCache(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
@@ -542,14 +536,14 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void CheckAvailability(Kernel::HLERequestContext& ctx) {
|
||||
void CheckAvailability(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "(STUBBED) called");
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(false); // TODO: Check when this is supposed to return true and when not
|
||||
}
|
||||
|
||||
void GetAccountId(Kernel::HLERequestContext& ctx) {
|
||||
void GetAccountId(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
@@ -557,7 +551,7 @@ private:
|
||||
rb.PushRaw<u64>(profile_manager->GetLastOpenedUser().Hash());
|
||||
}
|
||||
|
||||
void EnsureIdTokenCacheAsync(Kernel::HLERequestContext& ctx) {
|
||||
void EnsureIdTokenCacheAsync(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -565,13 +559,13 @@ private:
|
||||
rb.PushIpcInterface(ensure_token_id);
|
||||
}
|
||||
|
||||
void LoadIdTokenCache(Kernel::HLERequestContext& ctx) {
|
||||
void LoadIdTokenCache(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
||||
|
||||
ensure_token_id->LoadIdTokenCache(ctx);
|
||||
}
|
||||
|
||||
void GetNintendoAccountUserResourceCacheForApplication(Kernel::HLERequestContext& ctx) {
|
||||
void GetNintendoAccountUserResourceCacheForApplication(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
||||
|
||||
std::vector<u8> nas_user_base_for_application(0x68);
|
||||
@@ -587,7 +581,7 @@ private:
|
||||
rb.PushRaw<u64>(profile_manager->GetLastOpenedUser().Hash());
|
||||
}
|
||||
|
||||
void StoreOpenContext(Kernel::HLERequestContext& ctx) {
|
||||
void StoreOpenContext(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
|
||||
profile_manager->StoreOpenedUsers();
|
||||
@@ -689,14 +683,14 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
void Module::Interface::GetUserCount(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::GetUserCount(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push<u32>(static_cast<u32>(profile_manager->GetUserCount()));
|
||||
}
|
||||
|
||||
void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::GetUserExistence(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
Common::UUID user_id = rp.PopRaw<Common::UUID>();
|
||||
LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString());
|
||||
@@ -706,28 +700,28 @@ void Module::Interface::GetUserExistence(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(profile_manager->UserExists(user_id));
|
||||
}
|
||||
|
||||
void Module::Interface::ListAllUsers(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::ListAllUsers(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
ctx.WriteBuffer(profile_manager->GetAllUsers());
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Module::Interface::ListOpenUsers(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::ListOpenUsers(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
ctx.WriteBuffer(profile_manager->GetOpenUsers());
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Module::Interface::GetLastOpenedUser(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::GetLastOpenedUser(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
IPC::ResponseBuilder rb{ctx, 6};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushRaw<Common::UUID>(profile_manager->GetLastOpenedUser());
|
||||
}
|
||||
|
||||
void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::GetProfile(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
Common::UUID user_id = rp.PopRaw<Common::UUID>();
|
||||
LOG_DEBUG(Service_ACC, "called user_id=0x{}", user_id.RawString());
|
||||
@@ -737,20 +731,20 @@ void Module::Interface::GetProfile(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface<IProfile>(system, user_id, *profile_manager);
|
||||
}
|
||||
|
||||
void Module::Interface::IsUserRegistrationRequestPermitted(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::IsUserRegistrationRequestPermitted(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(profile_manager->CanSystemRegisterUser());
|
||||
}
|
||||
|
||||
void Module::Interface::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::InitializeApplicationInfo(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(InitializeApplicationInfoBase());
|
||||
}
|
||||
|
||||
void Module::Interface::InitializeApplicationInfoRestricted(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::InitializeApplicationInfoRestricted(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_ACC, "(Partial implementation) called");
|
||||
|
||||
// TODO(ogniK): We require checking if the user actually owns the title and what not. As of
|
||||
@@ -764,7 +758,7 @@ void Module::Interface::InitializeApplicationInfoRestricted(Kernel::HLERequestCo
|
||||
Result Module::Interface::InitializeApplicationInfoBase() {
|
||||
if (application_info) {
|
||||
LOG_ERROR(Service_ACC, "Application already initialized");
|
||||
return ERR_ACCOUNTINFO_ALREADY_INITIALIZED;
|
||||
return Account::ResultApplicationInfoAlreadyInitialized;
|
||||
}
|
||||
|
||||
// TODO(ogniK): This should be changed to reflect the target process for when we have multiple
|
||||
@@ -775,7 +769,7 @@ Result Module::Interface::InitializeApplicationInfoBase() {
|
||||
|
||||
if (launch_property.Failed()) {
|
||||
LOG_ERROR(Service_ACC, "Failed to get launch property");
|
||||
return ERR_ACCOUNTINFO_BAD_APPLICATION;
|
||||
return Account::ResultInvalidApplication;
|
||||
}
|
||||
|
||||
switch (launch_property->base_game_storage_id) {
|
||||
@@ -791,7 +785,7 @@ Result Module::Interface::InitializeApplicationInfoBase() {
|
||||
default:
|
||||
LOG_ERROR(Service_ACC, "Invalid game storage ID! storage_id={}",
|
||||
launch_property->base_game_storage_id);
|
||||
return ERR_ACCOUNTINFO_BAD_APPLICATION;
|
||||
return Account::ResultInvalidApplication;
|
||||
}
|
||||
|
||||
LOG_WARNING(Service_ACC, "ApplicationInfo init required");
|
||||
@@ -800,14 +794,14 @@ Result Module::Interface::InitializeApplicationInfoBase() {
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
void Module::Interface::GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::GetBaasAccountManagerForApplication(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushIpcInterface<IManagerForApplication>(system, profile_manager);
|
||||
}
|
||||
|
||||
void Module::Interface::IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::IsUserAccountSwitchLocked(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
FileSys::NACP nacp;
|
||||
const auto res = system.GetAppLoader().ReadControlData(nacp);
|
||||
@@ -834,14 +828,14 @@ void Module::Interface::IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx
|
||||
rb.Push(is_locked);
|
||||
}
|
||||
|
||||
void Module::Interface::InitializeApplicationInfoV2(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::InitializeApplicationInfoV2(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_ACC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Module::Interface::GetProfileEditor(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::GetProfileEditor(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
Common::UUID user_id = rp.PopRaw<Common::UUID>();
|
||||
|
||||
@@ -852,7 +846,7 @@ void Module::Interface::GetProfileEditor(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface<IProfileEditor>(system, user_id, *profile_manager);
|
||||
}
|
||||
|
||||
void Module::Interface::ListQualifiedUsers(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::ListQualifiedUsers(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
|
||||
// All users should be qualified. We don't actually have parental control or anything to do with
|
||||
@@ -863,7 +857,7 @@ void Module::Interface::ListQualifiedUsers(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Module::Interface::ListOpenContextStoredUsers(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::ListOpenContextStoredUsers(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
|
||||
ctx.WriteBuffer(profile_manager->GetStoredOpenedUsers());
|
||||
@@ -871,7 +865,7 @@ void Module::Interface::ListOpenContextStoredUsers(Kernel::HLERequestContext& ct
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::StoreSaveDataThumbnailApplication(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto uuid = rp.PopRaw<Common::UUID>();
|
||||
|
||||
@@ -884,7 +878,7 @@ void Module::Interface::StoreSaveDataThumbnailApplication(Kernel::HLERequestCont
|
||||
StoreSaveDataThumbnail(ctx, uuid, tid);
|
||||
}
|
||||
|
||||
void Module::Interface::StoreSaveDataThumbnailSystem(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::StoreSaveDataThumbnailSystem(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto uuid = rp.PopRaw<Common::UUID>();
|
||||
const auto tid = rp.Pop<u64_le>();
|
||||
@@ -893,26 +887,26 @@ void Module::Interface::StoreSaveDataThumbnailSystem(Kernel::HLERequestContext&
|
||||
StoreSaveDataThumbnail(ctx, uuid, tid);
|
||||
}
|
||||
|
||||
void Module::Interface::StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx,
|
||||
const Common::UUID& uuid, const u64 tid) {
|
||||
void Module::Interface::StoreSaveDataThumbnail(HLERequestContext& ctx, const Common::UUID& uuid,
|
||||
const u64 tid) {
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
|
||||
if (tid == 0) {
|
||||
LOG_ERROR(Service_ACC, "TitleID is not valid!");
|
||||
rb.Push(ERR_INVALID_APPLICATION_ID);
|
||||
rb.Push(Account::ResultInvalidApplication);
|
||||
return;
|
||||
}
|
||||
|
||||
if (uuid.IsInvalid()) {
|
||||
LOG_ERROR(Service_ACC, "User ID is not valid!");
|
||||
rb.Push(ERR_INVALID_USER_ID);
|
||||
rb.Push(Account::ResultInvalidUserId);
|
||||
return;
|
||||
}
|
||||
const auto thumbnail_size = ctx.GetReadBufferSize();
|
||||
if (thumbnail_size != THUMBNAIL_SIZE) {
|
||||
LOG_ERROR(Service_ACC, "Buffer size is empty! size={:X} expecting {:X}", thumbnail_size,
|
||||
THUMBNAIL_SIZE);
|
||||
rb.Push(ERR_INVALID_BUFFER_SIZE);
|
||||
rb.Push(Account::ResultInvalidArrayLength);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -920,7 +914,7 @@ void Module::Interface::StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx,
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Module::Interface::TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::TrySelectUserWithoutInteraction(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
// A u8 is passed into this function which we can safely ignore. It's to determine if we have
|
||||
// access to use the network or not by the looks of it
|
||||
|
||||
@@ -20,28 +20,28 @@ public:
|
||||
const char* name);
|
||||
~Interface() override;
|
||||
|
||||
void GetUserCount(Kernel::HLERequestContext& ctx);
|
||||
void GetUserExistence(Kernel::HLERequestContext& ctx);
|
||||
void ListAllUsers(Kernel::HLERequestContext& ctx);
|
||||
void ListOpenUsers(Kernel::HLERequestContext& ctx);
|
||||
void GetLastOpenedUser(Kernel::HLERequestContext& ctx);
|
||||
void GetProfile(Kernel::HLERequestContext& ctx);
|
||||
void InitializeApplicationInfo(Kernel::HLERequestContext& ctx);
|
||||
void InitializeApplicationInfoRestricted(Kernel::HLERequestContext& ctx);
|
||||
void GetBaasAccountManagerForApplication(Kernel::HLERequestContext& ctx);
|
||||
void IsUserRegistrationRequestPermitted(Kernel::HLERequestContext& ctx);
|
||||
void TrySelectUserWithoutInteraction(Kernel::HLERequestContext& ctx);
|
||||
void IsUserAccountSwitchLocked(Kernel::HLERequestContext& ctx);
|
||||
void InitializeApplicationInfoV2(Kernel::HLERequestContext& ctx);
|
||||
void GetProfileEditor(Kernel::HLERequestContext& ctx);
|
||||
void ListQualifiedUsers(Kernel::HLERequestContext& ctx);
|
||||
void ListOpenContextStoredUsers(Kernel::HLERequestContext& ctx);
|
||||
void StoreSaveDataThumbnailApplication(Kernel::HLERequestContext& ctx);
|
||||
void StoreSaveDataThumbnailSystem(Kernel::HLERequestContext& ctx);
|
||||
void GetUserCount(HLERequestContext& ctx);
|
||||
void GetUserExistence(HLERequestContext& ctx);
|
||||
void ListAllUsers(HLERequestContext& ctx);
|
||||
void ListOpenUsers(HLERequestContext& ctx);
|
||||
void GetLastOpenedUser(HLERequestContext& ctx);
|
||||
void GetProfile(HLERequestContext& ctx);
|
||||
void InitializeApplicationInfo(HLERequestContext& ctx);
|
||||
void InitializeApplicationInfoRestricted(HLERequestContext& ctx);
|
||||
void GetBaasAccountManagerForApplication(HLERequestContext& ctx);
|
||||
void IsUserRegistrationRequestPermitted(HLERequestContext& ctx);
|
||||
void TrySelectUserWithoutInteraction(HLERequestContext& ctx);
|
||||
void IsUserAccountSwitchLocked(HLERequestContext& ctx);
|
||||
void InitializeApplicationInfoV2(HLERequestContext& ctx);
|
||||
void GetProfileEditor(HLERequestContext& ctx);
|
||||
void ListQualifiedUsers(HLERequestContext& ctx);
|
||||
void ListOpenContextStoredUsers(HLERequestContext& ctx);
|
||||
void StoreSaveDataThumbnailApplication(HLERequestContext& ctx);
|
||||
void StoreSaveDataThumbnailSystem(HLERequestContext& ctx);
|
||||
|
||||
private:
|
||||
Result InitializeApplicationInfoBase();
|
||||
void StoreSaveDataThumbnail(Kernel::HLERequestContext& ctx, const Common::UUID& uuid,
|
||||
void StoreSaveDataThumbnail(HLERequestContext& ctx, const Common::UUID& uuid,
|
||||
const u64 tid);
|
||||
|
||||
enum class ApplicationType : u32_le {
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/service/acc/async_context.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
|
||||
namespace Service::Account {
|
||||
IAsyncContext::IAsyncContext(Core::System& system_)
|
||||
@@ -27,7 +27,7 @@ IAsyncContext::~IAsyncContext() {
|
||||
service_context.CloseEvent(completion_event);
|
||||
}
|
||||
|
||||
void IAsyncContext::GetSystemEvent(Kernel::HLERequestContext& ctx) {
|
||||
void IAsyncContext::GetSystemEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -35,7 +35,7 @@ void IAsyncContext::GetSystemEvent(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushCopyObjects(completion_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void IAsyncContext::Cancel(Kernel::HLERequestContext& ctx) {
|
||||
void IAsyncContext::Cancel(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
|
||||
Cancel();
|
||||
@@ -45,7 +45,7 @@ void IAsyncContext::Cancel(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IAsyncContext::HasDone(Kernel::HLERequestContext& ctx) {
|
||||
void IAsyncContext::HasDone(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
|
||||
is_complete.store(IsComplete());
|
||||
@@ -55,7 +55,7 @@ void IAsyncContext::HasDone(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(is_complete.load());
|
||||
}
|
||||
|
||||
void IAsyncContext::GetResult(Kernel::HLERequestContext& ctx) {
|
||||
void IAsyncContext::GetResult(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ACC, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
|
||||
@@ -18,10 +18,10 @@ public:
|
||||
explicit IAsyncContext(Core::System& system_);
|
||||
~IAsyncContext() override;
|
||||
|
||||
void GetSystemEvent(Kernel::HLERequestContext& ctx);
|
||||
void Cancel(Kernel::HLERequestContext& ctx);
|
||||
void HasDone(Kernel::HLERequestContext& ctx);
|
||||
void GetResult(Kernel::HLERequestContext& ctx);
|
||||
void GetSystemEvent(HLERequestContext& ctx);
|
||||
void Cancel(HLERequestContext& ctx);
|
||||
void HasDone(HLERequestContext& ctx);
|
||||
void GetResult(HLERequestContext& ctx);
|
||||
|
||||
protected:
|
||||
virtual bool IsComplete() const = 0;
|
||||
|
||||
@@ -7,7 +7,13 @@
|
||||
|
||||
namespace Service::Account {
|
||||
|
||||
constexpr Result ERR_ACCOUNTINFO_BAD_APPLICATION{ErrorModule::Account, 22};
|
||||
constexpr Result ERR_ACCOUNTINFO_ALREADY_INITIALIZED{ErrorModule::Account, 41};
|
||||
constexpr Result ResultCancelledByUser{ErrorModule::Account, 1};
|
||||
constexpr Result ResultNoNotifications{ErrorModule::Account, 15};
|
||||
constexpr Result ResultInvalidUserId{ErrorModule::Account, 20};
|
||||
constexpr Result ResultInvalidApplication{ErrorModule::Account, 22};
|
||||
constexpr Result ResultNullptr{ErrorModule::Account, 30};
|
||||
constexpr Result ResultInvalidArrayLength{ErrorModule::Account, 32};
|
||||
constexpr Result ResultApplicationInfoAlreadyInitialized{ErrorModule::Account, 41};
|
||||
constexpr Result ResultAccountUpdateFailed{ErrorModule::Account, 100};
|
||||
|
||||
} // namespace Service::Account
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "core/file_sys/patch_manager.h"
|
||||
#include "core/file_sys/registered_cache.h"
|
||||
#include "core/file_sys/savedata_factory.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/k_transfer_memory.h"
|
||||
#include "core/hle/service/acc/profile_manager.h"
|
||||
@@ -29,8 +28,9 @@
|
||||
#include "core/hle/service/bcat/backend/backend.h"
|
||||
#include "core/hle/service/caps/caps.h"
|
||||
#include "core/hle/service/filesystem/filesystem.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/ns/ns.h"
|
||||
#include "core/hle/service/nvflinger/nvflinger.h"
|
||||
#include "core/hle/service/nvnflinger/nvnflinger.h"
|
||||
#include "core/hle/service/pm/pm.h"
|
||||
#include "core/hle/service/server_manager.h"
|
||||
#include "core/hle/service/sm/sm.h"
|
||||
@@ -39,9 +39,9 @@
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
constexpr Result ERR_NO_DATA_IN_CHANNEL{ErrorModule::AM, 2};
|
||||
constexpr Result ERR_NO_MESSAGES{ErrorModule::AM, 3};
|
||||
constexpr Result ERR_SIZE_OUT_OF_BOUNDS{ErrorModule::AM, 503};
|
||||
constexpr Result ResultNoDataInChannel{ErrorModule::AM, 2};
|
||||
constexpr Result ResultNoMessages{ErrorModule::AM, 3};
|
||||
constexpr Result ResultInvalidOffset{ErrorModule::AM, 503};
|
||||
|
||||
enum class LaunchParameterKind : u32 {
|
||||
ApplicationSpecific = 1,
|
||||
@@ -78,7 +78,7 @@ IWindowController::IWindowController(Core::System& system_)
|
||||
|
||||
IWindowController::~IWindowController() = default;
|
||||
|
||||
void IWindowController::GetAppletResourceUserId(Kernel::HLERequestContext& ctx) {
|
||||
void IWindowController::GetAppletResourceUserId(HLERequestContext& ctx) {
|
||||
const u64 process_id = system.ApplicationProcess()->GetProcessID();
|
||||
|
||||
LOG_DEBUG(Service_AM, "called. Process ID=0x{:016X}", process_id);
|
||||
@@ -88,7 +88,7 @@ void IWindowController::GetAppletResourceUserId(Kernel::HLERequestContext& ctx)
|
||||
rb.Push<u64>(process_id);
|
||||
}
|
||||
|
||||
void IWindowController::AcquireForegroundRights(Kernel::HLERequestContext& ctx) {
|
||||
void IWindowController::AcquireForegroundRights(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
@@ -111,7 +111,7 @@ IAudioController::IAudioController(Core::System& system_)
|
||||
|
||||
IAudioController::~IAudioController() = default;
|
||||
|
||||
void IAudioController::SetExpectedMasterVolume(Kernel::HLERequestContext& ctx) {
|
||||
void IAudioController::SetExpectedMasterVolume(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const float main_applet_volume_tmp = rp.Pop<float>();
|
||||
const float library_applet_volume_tmp = rp.Pop<float>();
|
||||
@@ -128,21 +128,21 @@ void IAudioController::SetExpectedMasterVolume(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IAudioController::GetMainAppletExpectedMasterVolume(Kernel::HLERequestContext& ctx) {
|
||||
void IAudioController::GetMainAppletExpectedMasterVolume(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called. main_applet_volume={}", main_applet_volume);
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(main_applet_volume);
|
||||
}
|
||||
|
||||
void IAudioController::GetLibraryAppletExpectedMasterVolume(Kernel::HLERequestContext& ctx) {
|
||||
void IAudioController::GetLibraryAppletExpectedMasterVolume(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called. library_applet_volume={}", library_applet_volume);
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(library_applet_volume);
|
||||
}
|
||||
|
||||
void IAudioController::ChangeMainAppletMasterVolume(Kernel::HLERequestContext& ctx) {
|
||||
void IAudioController::ChangeMainAppletMasterVolume(HLERequestContext& ctx) {
|
||||
struct Parameters {
|
||||
float volume;
|
||||
s64 fade_time_ns;
|
||||
@@ -162,7 +162,7 @@ void IAudioController::ChangeMainAppletMasterVolume(Kernel::HLERequestContext& c
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IAudioController::SetTransparentAudioRate(Kernel::HLERequestContext& ctx) {
|
||||
void IAudioController::SetTransparentAudioRate(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const float transparent_volume_rate_tmp = rp.Pop<float>();
|
||||
|
||||
@@ -251,10 +251,9 @@ IDebugFunctions::IDebugFunctions(Core::System& system_)
|
||||
|
||||
IDebugFunctions::~IDebugFunctions() = default;
|
||||
|
||||
ISelfController::ISelfController(Core::System& system_, NVFlinger::NVFlinger& nvflinger_)
|
||||
: ServiceFramework{system_, "ISelfController"}, nvflinger{nvflinger_}, service_context{
|
||||
system,
|
||||
"ISelfController"} {
|
||||
ISelfController::ISelfController(Core::System& system_, Nvnflinger::Nvnflinger& nvnflinger_)
|
||||
: ServiceFramework{system_, "ISelfController"}, nvnflinger{nvnflinger_},
|
||||
service_context{system, "ISelfController"} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ISelfController::Exit, "Exit"},
|
||||
@@ -328,7 +327,7 @@ ISelfController::~ISelfController() {
|
||||
service_context.CloseEvent(accumulated_suspended_tick_changed_event);
|
||||
}
|
||||
|
||||
void ISelfController::Exit(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::Exit(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
@@ -337,7 +336,7 @@ void ISelfController::Exit(Kernel::HLERequestContext& ctx) {
|
||||
system.Exit();
|
||||
}
|
||||
|
||||
void ISelfController::LockExit(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::LockExit(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
system.SetExitLock(true);
|
||||
@@ -346,7 +345,7 @@ void ISelfController::LockExit(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::UnlockExit(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::UnlockExit(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
system.SetExitLock(false);
|
||||
@@ -355,7 +354,7 @@ void ISelfController::UnlockExit(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::EnterFatalSection(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::EnterFatalSection(HLERequestContext& ctx) {
|
||||
++num_fatal_sections_entered;
|
||||
LOG_DEBUG(Service_AM, "called. Num fatal sections entered: {}", num_fatal_sections_entered);
|
||||
|
||||
@@ -363,7 +362,7 @@ void ISelfController::EnterFatalSection(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::LeaveFatalSection(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::LeaveFatalSection(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called.");
|
||||
|
||||
// Entry and exit of fatal sections must be balanced.
|
||||
@@ -379,7 +378,7 @@ void ISelfController::LeaveFatalSection(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::GetLibraryAppletLaunchableEvent(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
launchable_event->Signal();
|
||||
@@ -389,7 +388,7 @@ void ISelfController::GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext&
|
||||
rb.PushCopyObjects(launchable_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void ISelfController::SetScreenShotPermission(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::SetScreenShotPermission(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto permission = rp.PopEnum<ScreenshotPermission>();
|
||||
LOG_DEBUG(Service_AM, "called, permission={}", permission);
|
||||
@@ -400,7 +399,7 @@ void ISelfController::SetScreenShotPermission(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::SetOperationModeChangedNotification(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::SetOperationModeChangedNotification(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
bool flag = rp.Pop<bool>();
|
||||
@@ -410,7 +409,7 @@ void ISelfController::SetOperationModeChangedNotification(Kernel::HLERequestCont
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::SetPerformanceModeChangedNotification(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::SetPerformanceModeChangedNotification(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
bool flag = rp.Pop<bool>();
|
||||
@@ -420,7 +419,7 @@ void ISelfController::SetPerformanceModeChangedNotification(Kernel::HLERequestCo
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::SetFocusHandlingMode(HLERequestContext& ctx) {
|
||||
// Takes 3 input u8s with each field located immediately after the previous
|
||||
// u8, these are bool flags. No output.
|
||||
IPC::RequestParser rp{ctx};
|
||||
@@ -439,14 +438,14 @@ void ISelfController::SetFocusHandlingMode(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::SetRestartMessageEnabled(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::SetRestartMessageEnabled(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::SetOutOfFocusSuspendingEnabled(HLERequestContext& ctx) {
|
||||
// Takes 3 input u8s with each field located immediately after the previous
|
||||
// u8, these are bool flags. No output.
|
||||
IPC::RequestParser rp{ctx};
|
||||
@@ -458,27 +457,27 @@ void ISelfController::SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext&
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::SetAlbumImageOrientation(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::SetAlbumImageOrientation(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::CreateManagedDisplayLayer(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
// TODO(Subv): Find out how AM determines the display to use, for now just
|
||||
// create the layer in the Default display.
|
||||
const auto display_id = nvflinger.OpenDisplay("Default");
|
||||
const auto layer_id = nvflinger.CreateLayer(*display_id);
|
||||
const auto display_id = nvnflinger.OpenDisplay("Default");
|
||||
const auto layer_id = nvnflinger.CreateLayer(*display_id);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(*layer_id);
|
||||
}
|
||||
|
||||
void ISelfController::CreateManagedDisplaySeparableLayer(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::CreateManagedDisplaySeparableLayer(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
// TODO(Subv): Find out how AM determines the display to use, for now just
|
||||
@@ -488,22 +487,22 @@ void ISelfController::CreateManagedDisplaySeparableLayer(Kernel::HLERequestConte
|
||||
// Outputting 1 layer id instead of the expected 2 has not been observed to cause any adverse
|
||||
// side effects.
|
||||
// TODO: Support multiple layers
|
||||
const auto display_id = nvflinger.OpenDisplay("Default");
|
||||
const auto layer_id = nvflinger.CreateLayer(*display_id);
|
||||
const auto display_id = nvnflinger.OpenDisplay("Default");
|
||||
const auto layer_id = nvnflinger.CreateLayer(*display_id);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.Push(*layer_id);
|
||||
}
|
||||
|
||||
void ISelfController::SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::SetHandlesRequestToDisplay(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::SetIdleTimeDetectionExtension(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
idle_time_detection_extension = rp.Pop<u32>();
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called idle_time_detection_extension={}",
|
||||
@@ -513,7 +512,7 @@ void ISelfController::SetIdleTimeDetectionExtension(Kernel::HLERequestContext& c
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::GetIdleTimeDetectionExtension(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -521,14 +520,14 @@ void ISelfController::GetIdleTimeDetectionExtension(Kernel::HLERequestContext& c
|
||||
rb.Push<u32>(idle_time_detection_extension);
|
||||
}
|
||||
|
||||
void ISelfController::ReportUserIsActive(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::ReportUserIsActive(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::SetAutoSleepDisabled(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::SetAutoSleepDisabled(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
is_auto_sleep_disabled = rp.Pop<bool>();
|
||||
|
||||
@@ -548,7 +547,7 @@ void ISelfController::SetAutoSleepDisabled(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::IsAutoSleepDisabled(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::IsAutoSleepDisabled(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called.");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -556,7 +555,7 @@ void ISelfController::IsAutoSleepDisabled(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(is_auto_sleep_disabled);
|
||||
}
|
||||
|
||||
void ISelfController::GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::GetAccumulatedSuspendedTickValue(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called.");
|
||||
|
||||
// This command returns the total number of system ticks since ISelfController creation
|
||||
@@ -567,7 +566,7 @@ void ISelfController::GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext
|
||||
rb.Push<u64>(0);
|
||||
}
|
||||
|
||||
void ISelfController::GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::GetAccumulatedSuspendedTickChangedEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called.");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -575,7 +574,7 @@ void ISelfController::GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequest
|
||||
rb.PushCopyObjects(accumulated_suspended_tick_changed_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void ISelfController::SetAlbumImageTakenNotificationEnabled(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::SetAlbumImageTakenNotificationEnabled(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
// This service call sets an internal flag whether a notification is shown when an image is
|
||||
@@ -590,7 +589,7 @@ void ISelfController::SetAlbumImageTakenNotificationEnabled(Kernel::HLERequestCo
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::SaveCurrentScreenshot(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::SaveCurrentScreenshot(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto album_report_option = rp.PopEnum<Capture::AlbumReportOption>();
|
||||
@@ -601,7 +600,7 @@ void ISelfController::SaveCurrentScreenshot(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ISelfController::SetRecordVolumeMuted(Kernel::HLERequestContext& ctx) {
|
||||
void ISelfController::SetRecordVolumeMuted(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto is_record_volume_muted = rp.Pop<bool>();
|
||||
@@ -735,7 +734,7 @@ ICommonStateGetter::ICommonStateGetter(Core::System& system_,
|
||||
|
||||
ICommonStateGetter::~ICommonStateGetter() = default;
|
||||
|
||||
void ICommonStateGetter::GetBootMode(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::GetBootMode(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -743,7 +742,7 @@ void ICommonStateGetter::GetBootMode(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u8>(static_cast<u8>(Service::PM::SystemBootMode::Normal)); // Normal boot mode
|
||||
}
|
||||
|
||||
void ICommonStateGetter::GetEventHandle(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::GetEventHandle(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -751,7 +750,7 @@ void ICommonStateGetter::GetEventHandle(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushCopyObjects(msg_queue->GetMessageReceiveEvent());
|
||||
}
|
||||
|
||||
void ICommonStateGetter::ReceiveMessage(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::ReceiveMessage(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
const auto message = msg_queue->PopMessage();
|
||||
@@ -759,7 +758,7 @@ void ICommonStateGetter::ReceiveMessage(Kernel::HLERequestContext& ctx) {
|
||||
|
||||
if (message == AppletMessageQueue::AppletMessage::None) {
|
||||
LOG_ERROR(Service_AM, "Message queue is empty");
|
||||
rb.Push(ERR_NO_MESSAGES);
|
||||
rb.Push(AM::ResultNoMessages);
|
||||
rb.PushEnum<AppletMessageQueue::AppletMessage>(message);
|
||||
return;
|
||||
}
|
||||
@@ -768,7 +767,7 @@ void ICommonStateGetter::ReceiveMessage(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushEnum<AppletMessageQueue::AppletMessage>(message);
|
||||
}
|
||||
|
||||
void ICommonStateGetter::GetCurrentFocusState(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::GetCurrentFocusState(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -776,7 +775,7 @@ void ICommonStateGetter::GetCurrentFocusState(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(static_cast<u8>(FocusState::InFocus));
|
||||
}
|
||||
|
||||
void ICommonStateGetter::IsVrModeEnabled(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::IsVrModeEnabled(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -784,7 +783,7 @@ void ICommonStateGetter::IsVrModeEnabled(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(vr_mode_state);
|
||||
}
|
||||
|
||||
void ICommonStateGetter::SetVrModeEnabled(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::SetVrModeEnabled(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
vr_mode_state = rp.Pop<bool>();
|
||||
|
||||
@@ -794,7 +793,7 @@ void ICommonStateGetter::SetVrModeEnabled(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ICommonStateGetter::SetLcdBacklighOffEnabled(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::SetLcdBacklighOffEnabled(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto is_lcd_backlight_off_enabled = rp.Pop<bool>();
|
||||
|
||||
@@ -805,21 +804,21 @@ void ICommonStateGetter::SetLcdBacklighOffEnabled(Kernel::HLERequestContext& ctx
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ICommonStateGetter::BeginVrModeEx(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::BeginVrModeEx(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ICommonStateGetter::EndVrModeEx(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::EndVrModeEx(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -827,7 +826,7 @@ void ICommonStateGetter::GetDefaultDisplayResolutionChangeEvent(Kernel::HLEReque
|
||||
rb.PushCopyObjects(msg_queue->GetOperationModeChangedEvent());
|
||||
}
|
||||
|
||||
void ICommonStateGetter::GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::GetDefaultDisplayResolution(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
@@ -842,7 +841,7 @@ void ICommonStateGetter::GetDefaultDisplayResolution(Kernel::HLERequestContext&
|
||||
}
|
||||
}
|
||||
|
||||
void ICommonStateGetter::SetCpuBoostMode(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::SetCpuBoostMode(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called, forwarding to APM:SYS");
|
||||
|
||||
const auto& sm = system.ServiceManager();
|
||||
@@ -852,7 +851,7 @@ void ICommonStateGetter::SetCpuBoostMode(Kernel::HLERequestContext& ctx) {
|
||||
apm_sys->SetCpuBoostMode(ctx);
|
||||
}
|
||||
|
||||
void ICommonStateGetter::PerformSystemButtonPressingIfInFocus(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::PerformSystemButtonPressingIfInFocus(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto system_button{rp.PopEnum<SystemButtonType>()};
|
||||
|
||||
@@ -863,7 +862,7 @@ void ICommonStateGetter::PerformSystemButtonPressingIfInFocus(Kernel::HLERequest
|
||||
}
|
||||
|
||||
void ICommonStateGetter::SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled(
|
||||
Kernel::HLERequestContext& ctx) {
|
||||
HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
@@ -911,7 +910,7 @@ void IStorage::Register() {
|
||||
|
||||
IStorage::~IStorage() = default;
|
||||
|
||||
void IStorage::Open(Kernel::HLERequestContext& ctx) {
|
||||
void IStorage::Open(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -920,7 +919,7 @@ void IStorage::Open(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface<IStorageAccessor>(system, *this);
|
||||
}
|
||||
|
||||
void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::GetOperationMode(HLERequestContext& ctx) {
|
||||
const bool use_docked_mode{Settings::values.use_docked_mode.GetValue()};
|
||||
LOG_DEBUG(Service_AM, "called, use_docked_mode={}", use_docked_mode);
|
||||
|
||||
@@ -929,7 +928,7 @@ void ICommonStateGetter::GetOperationMode(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(static_cast<u8>(use_docked_mode ? OperationMode::Docked : OperationMode::Handheld));
|
||||
}
|
||||
|
||||
void ICommonStateGetter::GetPerformanceMode(Kernel::HLERequestContext& ctx) {
|
||||
void ICommonStateGetter::GetPerformanceMode(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -969,7 +968,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void GetAppletStateChangedEvent(Kernel::HLERequestContext& ctx) {
|
||||
void GetAppletStateChangedEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -977,7 +976,7 @@ private:
|
||||
rb.PushCopyObjects(applet->GetBroker().GetStateChangedEvent());
|
||||
}
|
||||
|
||||
void IsCompleted(Kernel::HLERequestContext& ctx) {
|
||||
void IsCompleted(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -985,21 +984,21 @@ private:
|
||||
rb.Push<u32>(applet->TransactionComplete());
|
||||
}
|
||||
|
||||
void GetResult(Kernel::HLERequestContext& ctx) {
|
||||
void GetResult(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(applet->GetStatus());
|
||||
}
|
||||
|
||||
void PresetLibraryAppletGpuTimeSliceZero(Kernel::HLERequestContext& ctx) {
|
||||
void PresetLibraryAppletGpuTimeSliceZero(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Start(Kernel::HLERequestContext& ctx) {
|
||||
void Start(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
ASSERT(applet != nullptr);
|
||||
@@ -1011,7 +1010,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void PushInData(Kernel::HLERequestContext& ctx) {
|
||||
void PushInData(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::RequestParser rp{ctx};
|
||||
@@ -1021,7 +1020,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void PopOutData(Kernel::HLERequestContext& ctx) {
|
||||
void PopOutData(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
auto storage = applet->GetBroker().PopNormalDataToGame();
|
||||
@@ -1029,7 +1028,7 @@ private:
|
||||
LOG_DEBUG(Service_AM,
|
||||
"storage is a nullptr. There is no data in the current normal channel");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_NO_DATA_IN_CHANNEL);
|
||||
rb.Push(AM::ResultNoDataInChannel);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1038,7 +1037,7 @@ private:
|
||||
rb.PushIpcInterface<IStorage>(std::move(storage));
|
||||
}
|
||||
|
||||
void PushInteractiveInData(Kernel::HLERequestContext& ctx) {
|
||||
void PushInteractiveInData(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::RequestParser rp{ctx};
|
||||
@@ -1052,7 +1051,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void PopInteractiveOutData(Kernel::HLERequestContext& ctx) {
|
||||
void PopInteractiveOutData(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
auto storage = applet->GetBroker().PopInteractiveDataToGame();
|
||||
@@ -1060,7 +1059,7 @@ private:
|
||||
LOG_DEBUG(Service_AM,
|
||||
"storage is a nullptr. There is no data in the current interactive channel");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_NO_DATA_IN_CHANNEL);
|
||||
rb.Push(AM::ResultNoDataInChannel);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1069,7 +1068,7 @@ private:
|
||||
rb.PushIpcInterface<IStorage>(std::move(storage));
|
||||
}
|
||||
|
||||
void GetPopOutDataEvent(Kernel::HLERequestContext& ctx) {
|
||||
void GetPopOutDataEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -1077,7 +1076,7 @@ private:
|
||||
rb.PushCopyObjects(applet->GetBroker().GetNormalDataEvent());
|
||||
}
|
||||
|
||||
void GetPopInteractiveOutDataEvent(Kernel::HLERequestContext& ctx) {
|
||||
void GetPopInteractiveOutDataEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -1085,7 +1084,7 @@ private:
|
||||
rb.PushCopyObjects(applet->GetBroker().GetInteractiveDataEvent());
|
||||
}
|
||||
|
||||
void GetIndirectLayerConsumerHandle(Kernel::HLERequestContext& ctx) {
|
||||
void GetIndirectLayerConsumerHandle(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
// We require a non-zero handle to be valid. Using 0xdeadbeef allows us to trace if this is
|
||||
@@ -1115,7 +1114,7 @@ IStorageAccessor::IStorageAccessor(Core::System& system_, IStorage& backing_)
|
||||
|
||||
IStorageAccessor::~IStorageAccessor() = default;
|
||||
|
||||
void IStorageAccessor::GetSize(Kernel::HLERequestContext& ctx) {
|
||||
void IStorageAccessor::GetSize(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
@@ -1124,7 +1123,7 @@ void IStorageAccessor::GetSize(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(static_cast<u64>(backing.GetSize()));
|
||||
}
|
||||
|
||||
void IStorageAccessor::Write(Kernel::HLERequestContext& ctx) {
|
||||
void IStorageAccessor::Write(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const u64 offset{rp.Pop<u64>()};
|
||||
@@ -1139,7 +1138,7 @@ void IStorageAccessor::Write(Kernel::HLERequestContext& ctx) {
|
||||
backing.GetSize(), size, offset);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_SIZE_OUT_OF_BOUNDS);
|
||||
rb.Push(AM::ResultInvalidOffset);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1149,7 +1148,7 @@ void IStorageAccessor::Write(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) {
|
||||
void IStorageAccessor::Read(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const u64 offset{rp.Pop<u64>()};
|
||||
@@ -1162,7 +1161,7 @@ void IStorageAccessor::Read(Kernel::HLERequestContext& ctx) {
|
||||
backing.GetSize(), size, offset);
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_SIZE_OUT_OF_BOUNDS);
|
||||
rb.Push(AM::ResultInvalidOffset);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1187,7 +1186,7 @@ ILibraryAppletCreator::ILibraryAppletCreator(Core::System& system_)
|
||||
|
||||
ILibraryAppletCreator::~ILibraryAppletCreator() = default;
|
||||
|
||||
void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx) {
|
||||
void ILibraryAppletCreator::CreateLibraryApplet(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto applet_id = rp.PopRaw<Applets::AppletId>();
|
||||
@@ -1213,7 +1212,7 @@ void ILibraryAppletCreator::CreateLibraryApplet(Kernel::HLERequestContext& ctx)
|
||||
rb.PushIpcInterface<ILibraryAppletAccessor>(system, applet);
|
||||
}
|
||||
|
||||
void ILibraryAppletCreator::CreateStorage(Kernel::HLERequestContext& ctx) {
|
||||
void ILibraryAppletCreator::CreateStorage(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const s64 size{rp.Pop<s64>()};
|
||||
@@ -1234,7 +1233,7 @@ void ILibraryAppletCreator::CreateStorage(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface<IStorage>(system, std::move(buffer));
|
||||
}
|
||||
|
||||
void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContext& ctx) {
|
||||
void ILibraryAppletCreator::CreateTransferMemoryStorage(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
struct Parameters {
|
||||
@@ -1273,7 +1272,7 @@ void ILibraryAppletCreator::CreateTransferMemoryStorage(Kernel::HLERequestContex
|
||||
rb.PushIpcInterface<IStorage>(system, std::move(memory));
|
||||
}
|
||||
|
||||
void ILibraryAppletCreator::CreateHandleStorage(Kernel::HLERequestContext& ctx) {
|
||||
void ILibraryAppletCreator::CreateHandleStorage(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const s64 size{rp.Pop<s64>()};
|
||||
@@ -1395,29 +1394,28 @@ IApplicationFunctions::~IApplicationFunctions() {
|
||||
service_context.CloseEvent(health_warning_disappeared_system_event);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::EnableApplicationCrashReport(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::EnableApplicationCrashReport(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::InitializeApplicationCopyrightFrameBuffer(
|
||||
Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::InitializeApplicationCopyrightFrameBuffer(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::SetApplicationCopyrightImage(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::SetApplicationCopyrightImage(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::SetApplicationCopyrightVisibility(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::SetApplicationCopyrightVisibility(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto is_visible = rp.Pop<bool>();
|
||||
|
||||
@@ -1427,37 +1425,35 @@ void IApplicationFunctions::SetApplicationCopyrightVisibility(Kernel::HLERequest
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed(
|
||||
Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::BeginBlockingHomeButtonShortAndLongPressed(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed(
|
||||
Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::EndBlockingHomeButtonShortAndLongPressed(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::BeginBlockingHomeButton(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::BeginBlockingHomeButton(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::EndBlockingHomeButton(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::EndBlockingHomeButton(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::PopLaunchParameter(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto kind = rp.PopEnum<LaunchParameterKind>();
|
||||
|
||||
@@ -1506,18 +1502,17 @@ void IApplicationFunctions::PopLaunchParameter(Kernel::HLERequestContext& ctx) {
|
||||
|
||||
LOG_ERROR(Service_AM, "Attempted to load launch parameter but none was found!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_NO_DATA_IN_CHANNEL);
|
||||
rb.Push(AM::ResultNoDataInChannel);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::CreateApplicationAndRequestToStartForQuest(
|
||||
Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::CreateApplicationAndRequestToStartForQuest(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::EnsureSaveData(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
u128 user_id = rp.PopRaw<u128>();
|
||||
|
||||
@@ -1535,7 +1530,7 @@ void IApplicationFunctions::EnsureSaveData(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u64>(0);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::SetTerminateResult(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::SetTerminateResult(HLERequestContext& ctx) {
|
||||
// Takes an input u32 Result, no output.
|
||||
// For example, in some cases official apps use this with error 0x2A2 then
|
||||
// uses svcBreak.
|
||||
@@ -1548,7 +1543,7 @@ void IApplicationFunctions::SetTerminateResult(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::GetDisplayVersion(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
std::array<u8, 0x10> version_string{};
|
||||
@@ -1582,7 +1577,7 @@ void IApplicationFunctions::GetDisplayVersion(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushRaw(version_string);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::GetDesiredLanguage(HLERequestContext& ctx) {
|
||||
// TODO(bunnei): This should be configurable
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
@@ -1638,7 +1633,7 @@ void IApplicationFunctions::GetDesiredLanguage(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(*res_code);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::IsGamePlayRecordingSupported(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::IsGamePlayRecordingSupported(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
constexpr bool gameplay_recording_supported = false;
|
||||
@@ -1648,21 +1643,21 @@ void IApplicationFunctions::IsGamePlayRecordingSupported(Kernel::HLERequestConte
|
||||
rb.Push(gameplay_recording_supported);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::InitializeGamePlayRecording(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::InitializeGamePlayRecording(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::SetGamePlayRecordingState(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::SetGamePlayRecordingState(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::NotifyRunning(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::NotifyRunning(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -1670,7 +1665,7 @@ void IApplicationFunctions::NotifyRunning(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u8>(0); // Unknown, seems to be ignored by official processes
|
||||
}
|
||||
|
||||
void IApplicationFunctions::GetPseudoDeviceId(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::GetPseudoDeviceId(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 6};
|
||||
@@ -1681,7 +1676,7 @@ void IApplicationFunctions::GetPseudoDeviceId(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u64>(0);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::ExtendSaveData(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::ExtendSaveData(HLERequestContext& ctx) {
|
||||
struct Parameters {
|
||||
FileSys::SaveDataType type;
|
||||
u128 user_id;
|
||||
@@ -1710,7 +1705,7 @@ void IApplicationFunctions::ExtendSaveData(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u64>(0);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::GetSaveDataSize(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::GetSaveDataSize(HLERequestContext& ctx) {
|
||||
struct Parameters {
|
||||
FileSys::SaveDataType type;
|
||||
u128 user_id;
|
||||
@@ -1732,7 +1727,7 @@ void IApplicationFunctions::GetSaveDataSize(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(size.journal);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::QueryApplicationPlayStatistics(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::QueryApplicationPlayStatistics(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -1740,7 +1735,7 @@ void IApplicationFunctions::QueryApplicationPlayStatistics(Kernel::HLERequestCon
|
||||
rb.Push<u32>(0);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::QueryApplicationPlayStatisticsByUid(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::QueryApplicationPlayStatisticsByUid(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -1748,7 +1743,7 @@ void IApplicationFunctions::QueryApplicationPlayStatisticsByUid(Kernel::HLEReque
|
||||
rb.Push<u32>(0);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::ExecuteProgram(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::ExecuteProgram(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::RequestParser rp{ctx};
|
||||
@@ -1762,21 +1757,21 @@ void IApplicationFunctions::ExecuteProgram(Kernel::HLERequestContext& ctx) {
|
||||
system.ExecuteProgram(program_index);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::ClearUserChannel(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::ClearUserChannel(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::UnpopToUserChannel(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::UnpopToUserChannel(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::GetPreviousProgramIndex(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::GetPreviousProgramIndex(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -1784,7 +1779,7 @@ void IApplicationFunctions::GetPreviousProgramIndex(Kernel::HLERequestContext& c
|
||||
rb.Push<s32>(previous_program_index);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::GetGpuErrorDetectedSystemEvent(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::GetGpuErrorDetectedSystemEvent(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -1792,7 +1787,7 @@ void IApplicationFunctions::GetGpuErrorDetectedSystemEvent(Kernel::HLERequestCon
|
||||
rb.PushCopyObjects(gpu_error_detected_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void IApplicationFunctions::GetFriendInvitationStorageChannelEvent(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::GetFriendInvitationStorageChannelEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -1800,15 +1795,14 @@ void IApplicationFunctions::GetFriendInvitationStorageChannelEvent(Kernel::HLERe
|
||||
rb.PushCopyObjects(friend_invitation_storage_channel_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void IApplicationFunctions::TryPopFromFriendInvitationStorageChannel(
|
||||
Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::TryPopFromFriendInvitationStorageChannel(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_NO_DATA_IN_CHANNEL);
|
||||
rb.Push(AM::ResultNoDataInChannel);
|
||||
}
|
||||
|
||||
void IApplicationFunctions::GetNotificationStorageChannelEvent(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::GetNotificationStorageChannelEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -1816,7 +1810,7 @@ void IApplicationFunctions::GetNotificationStorageChannelEvent(Kernel::HLEReques
|
||||
rb.PushCopyObjects(notification_storage_channel_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void IApplicationFunctions::GetHealthWarningDisappearedSystemEvent(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::GetHealthWarningDisappearedSystemEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -1824,14 +1818,14 @@ void IApplicationFunctions::GetHealthWarningDisappearedSystemEvent(Kernel::HLERe
|
||||
rb.PushCopyObjects(health_warning_disappeared_system_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void IApplicationFunctions::PrepareForJit(Kernel::HLERequestContext& ctx) {
|
||||
void IApplicationFunctions::PrepareForJit(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void LoopProcess(NVFlinger::NVFlinger& nvflinger, Core::System& system) {
|
||||
void LoopProcess(Nvnflinger::Nvnflinger& nvnflinger, Core::System& system) {
|
||||
auto message_queue = std::make_shared<AppletMessageQueue>(system);
|
||||
// Needed on game boot
|
||||
message_queue->PushMessage(AppletMessageQueue::AppletMessage::FocusStateChanged);
|
||||
@@ -1839,9 +1833,9 @@ void LoopProcess(NVFlinger::NVFlinger& nvflinger, Core::System& system) {
|
||||
auto server_manager = std::make_unique<ServerManager>(system);
|
||||
|
||||
server_manager->RegisterNamedService(
|
||||
"appletAE", std::make_shared<AppletAE>(nvflinger, message_queue, system));
|
||||
"appletAE", std::make_shared<AppletAE>(nvnflinger, message_queue, system));
|
||||
server_manager->RegisterNamedService(
|
||||
"appletOE", std::make_shared<AppletOE>(nvflinger, message_queue, system));
|
||||
"appletOE", std::make_shared<AppletOE>(nvnflinger, message_queue, system));
|
||||
server_manager->RegisterNamedService("idle:sys", std::make_shared<IdleSys>(system));
|
||||
server_manager->RegisterNamedService("omm", std::make_shared<OMM>(system));
|
||||
server_manager->RegisterNamedService("spsm", std::make_shared<SPSM>(system));
|
||||
@@ -1881,14 +1875,14 @@ IHomeMenuFunctions::~IHomeMenuFunctions() {
|
||||
service_context.CloseEvent(pop_from_general_channel_event);
|
||||
}
|
||||
|
||||
void IHomeMenuFunctions::RequestToGetForeground(Kernel::HLERequestContext& ctx) {
|
||||
void IHomeMenuFunctions::RequestToGetForeground(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void IHomeMenuFunctions::GetPopFromGeneralChannelEvent(Kernel::HLERequestContext& ctx) {
|
||||
void IHomeMenuFunctions::GetPopFromGeneralChannelEvent(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
|
||||
@@ -12,11 +12,12 @@
|
||||
|
||||
namespace Kernel {
|
||||
class KernelCore;
|
||||
class KReadableEvent;
|
||||
class KTransferMemory;
|
||||
} // namespace Kernel
|
||||
|
||||
namespace Service::NVFlinger {
|
||||
class NVFlinger;
|
||||
namespace Service::Nvnflinger {
|
||||
class Nvnflinger;
|
||||
}
|
||||
|
||||
namespace Service::AM {
|
||||
@@ -109,8 +110,8 @@ public:
|
||||
~IWindowController() override;
|
||||
|
||||
private:
|
||||
void GetAppletResourceUserId(Kernel::HLERequestContext& ctx);
|
||||
void AcquireForegroundRights(Kernel::HLERequestContext& ctx);
|
||||
void GetAppletResourceUserId(HLERequestContext& ctx);
|
||||
void AcquireForegroundRights(HLERequestContext& ctx);
|
||||
};
|
||||
|
||||
class IAudioController final : public ServiceFramework<IAudioController> {
|
||||
@@ -119,11 +120,11 @@ public:
|
||||
~IAudioController() override;
|
||||
|
||||
private:
|
||||
void SetExpectedMasterVolume(Kernel::HLERequestContext& ctx);
|
||||
void GetMainAppletExpectedMasterVolume(Kernel::HLERequestContext& ctx);
|
||||
void GetLibraryAppletExpectedMasterVolume(Kernel::HLERequestContext& ctx);
|
||||
void ChangeMainAppletMasterVolume(Kernel::HLERequestContext& ctx);
|
||||
void SetTransparentAudioRate(Kernel::HLERequestContext& ctx);
|
||||
void SetExpectedMasterVolume(HLERequestContext& ctx);
|
||||
void GetMainAppletExpectedMasterVolume(HLERequestContext& ctx);
|
||||
void GetLibraryAppletExpectedMasterVolume(HLERequestContext& ctx);
|
||||
void ChangeMainAppletMasterVolume(HLERequestContext& ctx);
|
||||
void SetTransparentAudioRate(HLERequestContext& ctx);
|
||||
|
||||
static constexpr float min_allowed_volume = 0.0f;
|
||||
static constexpr float max_allowed_volume = 1.0f;
|
||||
@@ -153,36 +154,36 @@ public:
|
||||
|
||||
class ISelfController final : public ServiceFramework<ISelfController> {
|
||||
public:
|
||||
explicit ISelfController(Core::System& system_, NVFlinger::NVFlinger& nvflinger_);
|
||||
explicit ISelfController(Core::System& system_, Nvnflinger::Nvnflinger& nvnflinger_);
|
||||
~ISelfController() override;
|
||||
|
||||
private:
|
||||
void Exit(Kernel::HLERequestContext& ctx);
|
||||
void LockExit(Kernel::HLERequestContext& ctx);
|
||||
void UnlockExit(Kernel::HLERequestContext& ctx);
|
||||
void EnterFatalSection(Kernel::HLERequestContext& ctx);
|
||||
void LeaveFatalSection(Kernel::HLERequestContext& ctx);
|
||||
void GetLibraryAppletLaunchableEvent(Kernel::HLERequestContext& ctx);
|
||||
void SetScreenShotPermission(Kernel::HLERequestContext& ctx);
|
||||
void SetOperationModeChangedNotification(Kernel::HLERequestContext& ctx);
|
||||
void SetPerformanceModeChangedNotification(Kernel::HLERequestContext& ctx);
|
||||
void SetFocusHandlingMode(Kernel::HLERequestContext& ctx);
|
||||
void SetRestartMessageEnabled(Kernel::HLERequestContext& ctx);
|
||||
void SetOutOfFocusSuspendingEnabled(Kernel::HLERequestContext& ctx);
|
||||
void SetAlbumImageOrientation(Kernel::HLERequestContext& ctx);
|
||||
void CreateManagedDisplayLayer(Kernel::HLERequestContext& ctx);
|
||||
void CreateManagedDisplaySeparableLayer(Kernel::HLERequestContext& ctx);
|
||||
void SetHandlesRequestToDisplay(Kernel::HLERequestContext& ctx);
|
||||
void SetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx);
|
||||
void GetIdleTimeDetectionExtension(Kernel::HLERequestContext& ctx);
|
||||
void ReportUserIsActive(Kernel::HLERequestContext& ctx);
|
||||
void SetAutoSleepDisabled(Kernel::HLERequestContext& ctx);
|
||||
void IsAutoSleepDisabled(Kernel::HLERequestContext& ctx);
|
||||
void GetAccumulatedSuspendedTickValue(Kernel::HLERequestContext& ctx);
|
||||
void GetAccumulatedSuspendedTickChangedEvent(Kernel::HLERequestContext& ctx);
|
||||
void SetAlbumImageTakenNotificationEnabled(Kernel::HLERequestContext& ctx);
|
||||
void SaveCurrentScreenshot(Kernel::HLERequestContext& ctx);
|
||||
void SetRecordVolumeMuted(Kernel::HLERequestContext& ctx);
|
||||
void Exit(HLERequestContext& ctx);
|
||||
void LockExit(HLERequestContext& ctx);
|
||||
void UnlockExit(HLERequestContext& ctx);
|
||||
void EnterFatalSection(HLERequestContext& ctx);
|
||||
void LeaveFatalSection(HLERequestContext& ctx);
|
||||
void GetLibraryAppletLaunchableEvent(HLERequestContext& ctx);
|
||||
void SetScreenShotPermission(HLERequestContext& ctx);
|
||||
void SetOperationModeChangedNotification(HLERequestContext& ctx);
|
||||
void SetPerformanceModeChangedNotification(HLERequestContext& ctx);
|
||||
void SetFocusHandlingMode(HLERequestContext& ctx);
|
||||
void SetRestartMessageEnabled(HLERequestContext& ctx);
|
||||
void SetOutOfFocusSuspendingEnabled(HLERequestContext& ctx);
|
||||
void SetAlbumImageOrientation(HLERequestContext& ctx);
|
||||
void CreateManagedDisplayLayer(HLERequestContext& ctx);
|
||||
void CreateManagedDisplaySeparableLayer(HLERequestContext& ctx);
|
||||
void SetHandlesRequestToDisplay(HLERequestContext& ctx);
|
||||
void SetIdleTimeDetectionExtension(HLERequestContext& ctx);
|
||||
void GetIdleTimeDetectionExtension(HLERequestContext& ctx);
|
||||
void ReportUserIsActive(HLERequestContext& ctx);
|
||||
void SetAutoSleepDisabled(HLERequestContext& ctx);
|
||||
void IsAutoSleepDisabled(HLERequestContext& ctx);
|
||||
void GetAccumulatedSuspendedTickValue(HLERequestContext& ctx);
|
||||
void GetAccumulatedSuspendedTickChangedEvent(HLERequestContext& ctx);
|
||||
void SetAlbumImageTakenNotificationEnabled(HLERequestContext& ctx);
|
||||
void SaveCurrentScreenshot(HLERequestContext& ctx);
|
||||
void SetRecordVolumeMuted(HLERequestContext& ctx);
|
||||
|
||||
enum class ScreenshotPermission : u32 {
|
||||
Inherit = 0,
|
||||
@@ -190,7 +191,7 @@ private:
|
||||
Disable = 2,
|
||||
};
|
||||
|
||||
NVFlinger::NVFlinger& nvflinger;
|
||||
Nvnflinger::Nvnflinger& nvnflinger;
|
||||
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
|
||||
@@ -235,22 +236,22 @@ private:
|
||||
CaptureButtonLongPressing,
|
||||
};
|
||||
|
||||
void GetEventHandle(Kernel::HLERequestContext& ctx);
|
||||
void ReceiveMessage(Kernel::HLERequestContext& ctx);
|
||||
void GetCurrentFocusState(Kernel::HLERequestContext& ctx);
|
||||
void GetDefaultDisplayResolutionChangeEvent(Kernel::HLERequestContext& ctx);
|
||||
void GetOperationMode(Kernel::HLERequestContext& ctx);
|
||||
void GetPerformanceMode(Kernel::HLERequestContext& ctx);
|
||||
void GetBootMode(Kernel::HLERequestContext& ctx);
|
||||
void IsVrModeEnabled(Kernel::HLERequestContext& ctx);
|
||||
void SetVrModeEnabled(Kernel::HLERequestContext& ctx);
|
||||
void SetLcdBacklighOffEnabled(Kernel::HLERequestContext& ctx);
|
||||
void BeginVrModeEx(Kernel::HLERequestContext& ctx);
|
||||
void EndVrModeEx(Kernel::HLERequestContext& ctx);
|
||||
void GetDefaultDisplayResolution(Kernel::HLERequestContext& ctx);
|
||||
void SetCpuBoostMode(Kernel::HLERequestContext& ctx);
|
||||
void PerformSystemButtonPressingIfInFocus(Kernel::HLERequestContext& ctx);
|
||||
void SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled(Kernel::HLERequestContext& ctx);
|
||||
void GetEventHandle(HLERequestContext& ctx);
|
||||
void ReceiveMessage(HLERequestContext& ctx);
|
||||
void GetCurrentFocusState(HLERequestContext& ctx);
|
||||
void GetDefaultDisplayResolutionChangeEvent(HLERequestContext& ctx);
|
||||
void GetOperationMode(HLERequestContext& ctx);
|
||||
void GetPerformanceMode(HLERequestContext& ctx);
|
||||
void GetBootMode(HLERequestContext& ctx);
|
||||
void IsVrModeEnabled(HLERequestContext& ctx);
|
||||
void SetVrModeEnabled(HLERequestContext& ctx);
|
||||
void SetLcdBacklighOffEnabled(HLERequestContext& ctx);
|
||||
void BeginVrModeEx(HLERequestContext& ctx);
|
||||
void EndVrModeEx(HLERequestContext& ctx);
|
||||
void GetDefaultDisplayResolution(HLERequestContext& ctx);
|
||||
void SetCpuBoostMode(HLERequestContext& ctx);
|
||||
void PerformSystemButtonPressingIfInFocus(HLERequestContext& ctx);
|
||||
void SetRequestExitToLibraryAppletAtExecuteNextProgramEnabled(HLERequestContext& ctx);
|
||||
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue;
|
||||
bool vr_mode_state{};
|
||||
@@ -283,7 +284,7 @@ public:
|
||||
|
||||
private:
|
||||
void Register();
|
||||
void Open(Kernel::HLERequestContext& ctx);
|
||||
void Open(HLERequestContext& ctx);
|
||||
|
||||
std::shared_ptr<IStorageImpl> impl;
|
||||
};
|
||||
@@ -294,9 +295,9 @@ public:
|
||||
~IStorageAccessor() override;
|
||||
|
||||
private:
|
||||
void GetSize(Kernel::HLERequestContext& ctx);
|
||||
void Write(Kernel::HLERequestContext& ctx);
|
||||
void Read(Kernel::HLERequestContext& ctx);
|
||||
void GetSize(HLERequestContext& ctx);
|
||||
void Write(HLERequestContext& ctx);
|
||||
void Read(HLERequestContext& ctx);
|
||||
|
||||
IStorage& backing;
|
||||
};
|
||||
@@ -307,10 +308,10 @@ public:
|
||||
~ILibraryAppletCreator() override;
|
||||
|
||||
private:
|
||||
void CreateLibraryApplet(Kernel::HLERequestContext& ctx);
|
||||
void CreateStorage(Kernel::HLERequestContext& ctx);
|
||||
void CreateTransferMemoryStorage(Kernel::HLERequestContext& ctx);
|
||||
void CreateHandleStorage(Kernel::HLERequestContext& ctx);
|
||||
void CreateLibraryApplet(HLERequestContext& ctx);
|
||||
void CreateStorage(HLERequestContext& ctx);
|
||||
void CreateTransferMemoryStorage(HLERequestContext& ctx);
|
||||
void CreateHandleStorage(HLERequestContext& ctx);
|
||||
};
|
||||
|
||||
class IApplicationFunctions final : public ServiceFramework<IApplicationFunctions> {
|
||||
@@ -319,39 +320,39 @@ public:
|
||||
~IApplicationFunctions() override;
|
||||
|
||||
private:
|
||||
void PopLaunchParameter(Kernel::HLERequestContext& ctx);
|
||||
void CreateApplicationAndRequestToStartForQuest(Kernel::HLERequestContext& ctx);
|
||||
void EnsureSaveData(Kernel::HLERequestContext& ctx);
|
||||
void SetTerminateResult(Kernel::HLERequestContext& ctx);
|
||||
void GetDisplayVersion(Kernel::HLERequestContext& ctx);
|
||||
void GetDesiredLanguage(Kernel::HLERequestContext& ctx);
|
||||
void IsGamePlayRecordingSupported(Kernel::HLERequestContext& ctx);
|
||||
void InitializeGamePlayRecording(Kernel::HLERequestContext& ctx);
|
||||
void SetGamePlayRecordingState(Kernel::HLERequestContext& ctx);
|
||||
void NotifyRunning(Kernel::HLERequestContext& ctx);
|
||||
void GetPseudoDeviceId(Kernel::HLERequestContext& ctx);
|
||||
void ExtendSaveData(Kernel::HLERequestContext& ctx);
|
||||
void GetSaveDataSize(Kernel::HLERequestContext& ctx);
|
||||
void BeginBlockingHomeButtonShortAndLongPressed(Kernel::HLERequestContext& ctx);
|
||||
void EndBlockingHomeButtonShortAndLongPressed(Kernel::HLERequestContext& ctx);
|
||||
void BeginBlockingHomeButton(Kernel::HLERequestContext& ctx);
|
||||
void EndBlockingHomeButton(Kernel::HLERequestContext& ctx);
|
||||
void EnableApplicationCrashReport(Kernel::HLERequestContext& ctx);
|
||||
void InitializeApplicationCopyrightFrameBuffer(Kernel::HLERequestContext& ctx);
|
||||
void SetApplicationCopyrightImage(Kernel::HLERequestContext& ctx);
|
||||
void SetApplicationCopyrightVisibility(Kernel::HLERequestContext& ctx);
|
||||
void QueryApplicationPlayStatistics(Kernel::HLERequestContext& ctx);
|
||||
void QueryApplicationPlayStatisticsByUid(Kernel::HLERequestContext& ctx);
|
||||
void ExecuteProgram(Kernel::HLERequestContext& ctx);
|
||||
void ClearUserChannel(Kernel::HLERequestContext& ctx);
|
||||
void UnpopToUserChannel(Kernel::HLERequestContext& ctx);
|
||||
void GetPreviousProgramIndex(Kernel::HLERequestContext& ctx);
|
||||
void GetGpuErrorDetectedSystemEvent(Kernel::HLERequestContext& ctx);
|
||||
void GetFriendInvitationStorageChannelEvent(Kernel::HLERequestContext& ctx);
|
||||
void TryPopFromFriendInvitationStorageChannel(Kernel::HLERequestContext& ctx);
|
||||
void GetNotificationStorageChannelEvent(Kernel::HLERequestContext& ctx);
|
||||
void GetHealthWarningDisappearedSystemEvent(Kernel::HLERequestContext& ctx);
|
||||
void PrepareForJit(Kernel::HLERequestContext& ctx);
|
||||
void PopLaunchParameter(HLERequestContext& ctx);
|
||||
void CreateApplicationAndRequestToStartForQuest(HLERequestContext& ctx);
|
||||
void EnsureSaveData(HLERequestContext& ctx);
|
||||
void SetTerminateResult(HLERequestContext& ctx);
|
||||
void GetDisplayVersion(HLERequestContext& ctx);
|
||||
void GetDesiredLanguage(HLERequestContext& ctx);
|
||||
void IsGamePlayRecordingSupported(HLERequestContext& ctx);
|
||||
void InitializeGamePlayRecording(HLERequestContext& ctx);
|
||||
void SetGamePlayRecordingState(HLERequestContext& ctx);
|
||||
void NotifyRunning(HLERequestContext& ctx);
|
||||
void GetPseudoDeviceId(HLERequestContext& ctx);
|
||||
void ExtendSaveData(HLERequestContext& ctx);
|
||||
void GetSaveDataSize(HLERequestContext& ctx);
|
||||
void BeginBlockingHomeButtonShortAndLongPressed(HLERequestContext& ctx);
|
||||
void EndBlockingHomeButtonShortAndLongPressed(HLERequestContext& ctx);
|
||||
void BeginBlockingHomeButton(HLERequestContext& ctx);
|
||||
void EndBlockingHomeButton(HLERequestContext& ctx);
|
||||
void EnableApplicationCrashReport(HLERequestContext& ctx);
|
||||
void InitializeApplicationCopyrightFrameBuffer(HLERequestContext& ctx);
|
||||
void SetApplicationCopyrightImage(HLERequestContext& ctx);
|
||||
void SetApplicationCopyrightVisibility(HLERequestContext& ctx);
|
||||
void QueryApplicationPlayStatistics(HLERequestContext& ctx);
|
||||
void QueryApplicationPlayStatisticsByUid(HLERequestContext& ctx);
|
||||
void ExecuteProgram(HLERequestContext& ctx);
|
||||
void ClearUserChannel(HLERequestContext& ctx);
|
||||
void UnpopToUserChannel(HLERequestContext& ctx);
|
||||
void GetPreviousProgramIndex(HLERequestContext& ctx);
|
||||
void GetGpuErrorDetectedSystemEvent(HLERequestContext& ctx);
|
||||
void GetFriendInvitationStorageChannelEvent(HLERequestContext& ctx);
|
||||
void TryPopFromFriendInvitationStorageChannel(HLERequestContext& ctx);
|
||||
void GetNotificationStorageChannelEvent(HLERequestContext& ctx);
|
||||
void GetHealthWarningDisappearedSystemEvent(HLERequestContext& ctx);
|
||||
void PrepareForJit(HLERequestContext& ctx);
|
||||
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
|
||||
@@ -370,8 +371,8 @@ public:
|
||||
~IHomeMenuFunctions() override;
|
||||
|
||||
private:
|
||||
void RequestToGetForeground(Kernel::HLERequestContext& ctx);
|
||||
void GetPopFromGeneralChannelEvent(Kernel::HLERequestContext& ctx);
|
||||
void RequestToGetForeground(HLERequestContext& ctx);
|
||||
void GetPopFromGeneralChannelEvent(HLERequestContext& ctx);
|
||||
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
|
||||
@@ -396,6 +397,6 @@ public:
|
||||
~IProcessWindingController() override;
|
||||
};
|
||||
|
||||
void LoopProcess(NVFlinger::NVFlinger& nvflinger, Core::System& system);
|
||||
void LoopProcess(Nvnflinger::Nvnflinger& nvnflinger, Core::System& system);
|
||||
|
||||
} // namespace Service::AM
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/am/am.h"
|
||||
#include "core/hle/service/am/applet_ae.h"
|
||||
#include "core/hle/service/nvflinger/nvflinger.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/nvnflinger/nvnflinger.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
class ILibraryAppletProxy final : public ServiceFramework<ILibraryAppletProxy> {
|
||||
public:
|
||||
explicit ILibraryAppletProxy(NVFlinger::NVFlinger& nvflinger_,
|
||||
explicit ILibraryAppletProxy(Nvnflinger::Nvnflinger& nvnflinger_,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue_,
|
||||
Core::System& system_)
|
||||
: ServiceFramework{system_, "ILibraryAppletProxy"}, nvflinger{nvflinger_},
|
||||
msg_queue{std::move(msg_queue_)} {
|
||||
: ServiceFramework{system_, "ILibraryAppletProxy"},
|
||||
nvnflinger{nvnflinger_}, msg_queue{std::move(msg_queue_)} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ILibraryAppletProxy::GetCommonStateGetter, "GetCommonStateGetter"},
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void GetCommonStateGetter(Kernel::HLERequestContext& ctx) {
|
||||
void GetCommonStateGetter(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -44,15 +44,15 @@ private:
|
||||
rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue);
|
||||
}
|
||||
|
||||
void GetSelfController(Kernel::HLERequestContext& ctx) {
|
||||
void GetSelfController(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushIpcInterface<ISelfController>(system, nvflinger);
|
||||
rb.PushIpcInterface<ISelfController>(system, nvnflinger);
|
||||
}
|
||||
|
||||
void GetWindowController(Kernel::HLERequestContext& ctx) {
|
||||
void GetWindowController(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -60,7 +60,7 @@ private:
|
||||
rb.PushIpcInterface<IWindowController>(system);
|
||||
}
|
||||
|
||||
void GetAudioController(Kernel::HLERequestContext& ctx) {
|
||||
void GetAudioController(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -68,7 +68,7 @@ private:
|
||||
rb.PushIpcInterface<IAudioController>(system);
|
||||
}
|
||||
|
||||
void GetDisplayController(Kernel::HLERequestContext& ctx) {
|
||||
void GetDisplayController(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -76,7 +76,7 @@ private:
|
||||
rb.PushIpcInterface<IDisplayController>(system);
|
||||
}
|
||||
|
||||
void GetProcessWindingController(Kernel::HLERequestContext& ctx) {
|
||||
void GetProcessWindingController(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -84,7 +84,7 @@ private:
|
||||
rb.PushIpcInterface<IProcessWindingController>(system);
|
||||
}
|
||||
|
||||
void GetDebugFunctions(Kernel::HLERequestContext& ctx) {
|
||||
void GetDebugFunctions(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -92,7 +92,7 @@ private:
|
||||
rb.PushIpcInterface<IDebugFunctions>(system);
|
||||
}
|
||||
|
||||
void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
|
||||
void GetLibraryAppletCreator(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -100,7 +100,7 @@ private:
|
||||
rb.PushIpcInterface<ILibraryAppletCreator>(system);
|
||||
}
|
||||
|
||||
void GetApplicationFunctions(Kernel::HLERequestContext& ctx) {
|
||||
void GetApplicationFunctions(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -108,17 +108,17 @@ private:
|
||||
rb.PushIpcInterface<IApplicationFunctions>(system);
|
||||
}
|
||||
|
||||
NVFlinger::NVFlinger& nvflinger;
|
||||
Nvnflinger::Nvnflinger& nvnflinger;
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue;
|
||||
};
|
||||
|
||||
class ISystemAppletProxy final : public ServiceFramework<ISystemAppletProxy> {
|
||||
public:
|
||||
explicit ISystemAppletProxy(NVFlinger::NVFlinger& nvflinger_,
|
||||
explicit ISystemAppletProxy(Nvnflinger::Nvnflinger& nvnflinger_,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue_,
|
||||
Core::System& system_)
|
||||
: ServiceFramework{system_, "ISystemAppletProxy"}, nvflinger{nvflinger_},
|
||||
msg_queue{std::move(msg_queue_)} {
|
||||
: ServiceFramework{system_, "ISystemAppletProxy"},
|
||||
nvnflinger{nvnflinger_}, msg_queue{std::move(msg_queue_)} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &ISystemAppletProxy::GetCommonStateGetter, "GetCommonStateGetter"},
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void GetCommonStateGetter(Kernel::HLERequestContext& ctx) {
|
||||
void GetCommonStateGetter(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -148,15 +148,15 @@ private:
|
||||
rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue);
|
||||
}
|
||||
|
||||
void GetSelfController(Kernel::HLERequestContext& ctx) {
|
||||
void GetSelfController(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushIpcInterface<ISelfController>(system, nvflinger);
|
||||
rb.PushIpcInterface<ISelfController>(system, nvnflinger);
|
||||
}
|
||||
|
||||
void GetWindowController(Kernel::HLERequestContext& ctx) {
|
||||
void GetWindowController(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -164,7 +164,7 @@ private:
|
||||
rb.PushIpcInterface<IWindowController>(system);
|
||||
}
|
||||
|
||||
void GetAudioController(Kernel::HLERequestContext& ctx) {
|
||||
void GetAudioController(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -172,7 +172,7 @@ private:
|
||||
rb.PushIpcInterface<IAudioController>(system);
|
||||
}
|
||||
|
||||
void GetDisplayController(Kernel::HLERequestContext& ctx) {
|
||||
void GetDisplayController(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -180,7 +180,7 @@ private:
|
||||
rb.PushIpcInterface<IDisplayController>(system);
|
||||
}
|
||||
|
||||
void GetDebugFunctions(Kernel::HLERequestContext& ctx) {
|
||||
void GetDebugFunctions(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -188,7 +188,7 @@ private:
|
||||
rb.PushIpcInterface<IDebugFunctions>(system);
|
||||
}
|
||||
|
||||
void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
|
||||
void GetLibraryAppletCreator(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -196,7 +196,7 @@ private:
|
||||
rb.PushIpcInterface<ILibraryAppletCreator>(system);
|
||||
}
|
||||
|
||||
void GetHomeMenuFunctions(Kernel::HLERequestContext& ctx) {
|
||||
void GetHomeMenuFunctions(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -204,7 +204,7 @@ private:
|
||||
rb.PushIpcInterface<IHomeMenuFunctions>(system);
|
||||
}
|
||||
|
||||
void GetGlobalStateController(Kernel::HLERequestContext& ctx) {
|
||||
void GetGlobalStateController(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -212,7 +212,7 @@ private:
|
||||
rb.PushIpcInterface<IGlobalStateController>(system);
|
||||
}
|
||||
|
||||
void GetApplicationCreator(Kernel::HLERequestContext& ctx) {
|
||||
void GetApplicationCreator(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -220,38 +220,38 @@ private:
|
||||
rb.PushIpcInterface<IApplicationCreator>(system);
|
||||
}
|
||||
|
||||
NVFlinger::NVFlinger& nvflinger;
|
||||
Nvnflinger::Nvnflinger& nvnflinger;
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue;
|
||||
};
|
||||
|
||||
void AppletAE::OpenSystemAppletProxy(Kernel::HLERequestContext& ctx) {
|
||||
void AppletAE::OpenSystemAppletProxy(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushIpcInterface<ISystemAppletProxy>(nvflinger, msg_queue, system);
|
||||
rb.PushIpcInterface<ISystemAppletProxy>(nvnflinger, msg_queue, system);
|
||||
}
|
||||
|
||||
void AppletAE::OpenLibraryAppletProxy(Kernel::HLERequestContext& ctx) {
|
||||
void AppletAE::OpenLibraryAppletProxy(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue, system);
|
||||
rb.PushIpcInterface<ILibraryAppletProxy>(nvnflinger, msg_queue, system);
|
||||
}
|
||||
|
||||
void AppletAE::OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx) {
|
||||
void AppletAE::OpenLibraryAppletProxyOld(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushIpcInterface<ILibraryAppletProxy>(nvflinger, msg_queue, system);
|
||||
rb.PushIpcInterface<ILibraryAppletProxy>(nvnflinger, msg_queue, system);
|
||||
}
|
||||
|
||||
AppletAE::AppletAE(NVFlinger::NVFlinger& nvflinger_, std::shared_ptr<AppletMessageQueue> msg_queue_,
|
||||
Core::System& system_)
|
||||
: ServiceFramework{system_, "appletAE"}, nvflinger{nvflinger_}, msg_queue{
|
||||
std::move(msg_queue_)} {
|
||||
AppletAE::AppletAE(Nvnflinger::Nvnflinger& nvnflinger_,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue_, Core::System& system_)
|
||||
: ServiceFramework{system_, "appletAE"}, nvnflinger{nvnflinger_}, msg_queue{
|
||||
std::move(msg_queue_)} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{100, &AppletAE::OpenSystemAppletProxy, "OpenSystemAppletProxy"},
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace FileSystem {
|
||||
class FileSystemController;
|
||||
}
|
||||
|
||||
namespace NVFlinger {
|
||||
class NVFlinger;
|
||||
namespace Nvnflinger {
|
||||
class Nvnflinger;
|
||||
}
|
||||
|
||||
namespace AM {
|
||||
@@ -22,18 +22,18 @@ class AppletMessageQueue;
|
||||
|
||||
class AppletAE final : public ServiceFramework<AppletAE> {
|
||||
public:
|
||||
explicit AppletAE(NVFlinger::NVFlinger& nvflinger_,
|
||||
explicit AppletAE(Nvnflinger::Nvnflinger& nvnflinger_,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue_, Core::System& system_);
|
||||
~AppletAE() override;
|
||||
|
||||
const std::shared_ptr<AppletMessageQueue>& GetMessageQueue() const;
|
||||
|
||||
private:
|
||||
void OpenSystemAppletProxy(Kernel::HLERequestContext& ctx);
|
||||
void OpenLibraryAppletProxy(Kernel::HLERequestContext& ctx);
|
||||
void OpenLibraryAppletProxyOld(Kernel::HLERequestContext& ctx);
|
||||
void OpenSystemAppletProxy(HLERequestContext& ctx);
|
||||
void OpenLibraryAppletProxy(HLERequestContext& ctx);
|
||||
void OpenLibraryAppletProxyOld(HLERequestContext& ctx);
|
||||
|
||||
NVFlinger::NVFlinger& nvflinger;
|
||||
Nvnflinger::Nvnflinger& nvnflinger;
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue;
|
||||
};
|
||||
|
||||
|
||||
@@ -2,20 +2,20 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/am/am.h"
|
||||
#include "core/hle/service/am/applet_oe.h"
|
||||
#include "core/hle/service/nvflinger/nvflinger.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/nvnflinger/nvnflinger.h"
|
||||
|
||||
namespace Service::AM {
|
||||
|
||||
class IApplicationProxy final : public ServiceFramework<IApplicationProxy> {
|
||||
public:
|
||||
explicit IApplicationProxy(NVFlinger::NVFlinger& nvflinger_,
|
||||
explicit IApplicationProxy(Nvnflinger::Nvnflinger& nvnflinger_,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue_,
|
||||
Core::System& system_)
|
||||
: ServiceFramework{system_, "IApplicationProxy"}, nvflinger{nvflinger_},
|
||||
msg_queue{std::move(msg_queue_)} {
|
||||
: ServiceFramework{system_, "IApplicationProxy"},
|
||||
nvnflinger{nvnflinger_}, msg_queue{std::move(msg_queue_)} {
|
||||
// clang-format off
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &IApplicationProxy::GetCommonStateGetter, "GetCommonStateGetter"},
|
||||
@@ -34,7 +34,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void GetAudioController(Kernel::HLERequestContext& ctx) {
|
||||
void GetAudioController(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -42,7 +42,7 @@ private:
|
||||
rb.PushIpcInterface<IAudioController>(system);
|
||||
}
|
||||
|
||||
void GetDisplayController(Kernel::HLERequestContext& ctx) {
|
||||
void GetDisplayController(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -50,7 +50,7 @@ private:
|
||||
rb.PushIpcInterface<IDisplayController>(system);
|
||||
}
|
||||
|
||||
void GetDebugFunctions(Kernel::HLERequestContext& ctx) {
|
||||
void GetDebugFunctions(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -58,7 +58,7 @@ private:
|
||||
rb.PushIpcInterface<IDebugFunctions>(system);
|
||||
}
|
||||
|
||||
void GetWindowController(Kernel::HLERequestContext& ctx) {
|
||||
void GetWindowController(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -66,15 +66,15 @@ private:
|
||||
rb.PushIpcInterface<IWindowController>(system);
|
||||
}
|
||||
|
||||
void GetSelfController(Kernel::HLERequestContext& ctx) {
|
||||
void GetSelfController(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushIpcInterface<ISelfController>(system, nvflinger);
|
||||
rb.PushIpcInterface<ISelfController>(system, nvnflinger);
|
||||
}
|
||||
|
||||
void GetCommonStateGetter(Kernel::HLERequestContext& ctx) {
|
||||
void GetCommonStateGetter(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -82,7 +82,7 @@ private:
|
||||
rb.PushIpcInterface<ICommonStateGetter>(system, msg_queue);
|
||||
}
|
||||
|
||||
void GetLibraryAppletCreator(Kernel::HLERequestContext& ctx) {
|
||||
void GetLibraryAppletCreator(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -90,7 +90,7 @@ private:
|
||||
rb.PushIpcInterface<ILibraryAppletCreator>(system);
|
||||
}
|
||||
|
||||
void GetApplicationFunctions(Kernel::HLERequestContext& ctx) {
|
||||
void GetApplicationFunctions(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -98,22 +98,22 @@ private:
|
||||
rb.PushIpcInterface<IApplicationFunctions>(system);
|
||||
}
|
||||
|
||||
NVFlinger::NVFlinger& nvflinger;
|
||||
Nvnflinger::Nvnflinger& nvnflinger;
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue;
|
||||
};
|
||||
|
||||
void AppletOE::OpenApplicationProxy(Kernel::HLERequestContext& ctx) {
|
||||
void AppletOE::OpenApplicationProxy(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_AM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushIpcInterface<IApplicationProxy>(nvflinger, msg_queue, system);
|
||||
rb.PushIpcInterface<IApplicationProxy>(nvnflinger, msg_queue, system);
|
||||
}
|
||||
|
||||
AppletOE::AppletOE(NVFlinger::NVFlinger& nvflinger_, std::shared_ptr<AppletMessageQueue> msg_queue_,
|
||||
Core::System& system_)
|
||||
: ServiceFramework{system_, "appletOE"}, nvflinger{nvflinger_}, msg_queue{
|
||||
std::move(msg_queue_)} {
|
||||
AppletOE::AppletOE(Nvnflinger::Nvnflinger& nvnflinger_,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue_, Core::System& system_)
|
||||
: ServiceFramework{system_, "appletOE"}, nvnflinger{nvnflinger_}, msg_queue{
|
||||
std::move(msg_queue_)} {
|
||||
static const FunctionInfo functions[] = {
|
||||
{0, &AppletOE::OpenApplicationProxy, "OpenApplicationProxy"},
|
||||
};
|
||||
|
||||
@@ -12,8 +12,8 @@ namespace FileSystem {
|
||||
class FileSystemController;
|
||||
}
|
||||
|
||||
namespace NVFlinger {
|
||||
class NVFlinger;
|
||||
namespace Nvnflinger {
|
||||
class Nvnflinger;
|
||||
}
|
||||
|
||||
namespace AM {
|
||||
@@ -22,16 +22,16 @@ class AppletMessageQueue;
|
||||
|
||||
class AppletOE final : public ServiceFramework<AppletOE> {
|
||||
public:
|
||||
explicit AppletOE(NVFlinger::NVFlinger& nvflinger_,
|
||||
explicit AppletOE(Nvnflinger::Nvnflinger& nvnflinger_,
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue_, Core::System& system_);
|
||||
~AppletOE() override;
|
||||
|
||||
const std::shared_ptr<AppletMessageQueue>& GetMessageQueue() const;
|
||||
|
||||
private:
|
||||
void OpenApplicationProxy(Kernel::HLERequestContext& ctx);
|
||||
void OpenApplicationProxy(HLERequestContext& ctx);
|
||||
|
||||
NVFlinger::NVFlinger& nvflinger;
|
||||
Nvnflinger::Nvnflinger& nvnflinger;
|
||||
std::shared_ptr<AppletMessageQueue> msg_queue;
|
||||
};
|
||||
|
||||
|
||||
@@ -19,10 +19,9 @@
|
||||
|
||||
namespace Service::AM::Applets {
|
||||
|
||||
// This error code (0x183ACA) is thrown when the applet fails to initialize.
|
||||
[[maybe_unused]] constexpr Result ERR_CONTROLLER_APPLET_3101{ErrorModule::HID, 3101};
|
||||
// This error code (0x183CCA) is thrown when the u32 result in ControllerSupportResultInfo is 2.
|
||||
[[maybe_unused]] constexpr Result ERR_CONTROLLER_APPLET_3102{ErrorModule::HID, 3102};
|
||||
[[maybe_unused]] constexpr Result ResultControllerSupportCanceled{ErrorModule::HID, 3101};
|
||||
[[maybe_unused]] constexpr Result ResultControllerSupportNotSupportedNpadStyle{ErrorModule::HID,
|
||||
3102};
|
||||
|
||||
static Core::Frontend::ControllerParameters ConvertToFrontendParameters(
|
||||
ControllerSupportArgPrivate private_arg, ControllerSupportArgHeader header, bool enable_text,
|
||||
|
||||
@@ -7,13 +7,12 @@
|
||||
#include "common/string_util.h"
|
||||
#include "core/core.h"
|
||||
#include "core/frontend/applets/profile_select.h"
|
||||
#include "core/hle/service/acc/errors.h"
|
||||
#include "core/hle/service/am/am.h"
|
||||
#include "core/hle/service/am/applets/applet_profile_select.h"
|
||||
|
||||
namespace Service::AM::Applets {
|
||||
|
||||
constexpr Result ERR_USER_CANCELLED_SELECTION{ErrorModule::Account, 1};
|
||||
|
||||
ProfileSelect::ProfileSelect(Core::System& system_, LibraryAppletMode applet_mode_,
|
||||
const Core::Frontend::ProfileSelectApplet& frontend_)
|
||||
: Applet{system_, applet_mode_}, frontend{frontend_}, system{system_} {}
|
||||
@@ -63,8 +62,8 @@ void ProfileSelect::SelectionComplete(std::optional<Common::UUID> uuid) {
|
||||
output.result = 0;
|
||||
output.uuid_selected = *uuid;
|
||||
} else {
|
||||
status = ERR_USER_CANCELLED_SELECTION;
|
||||
output.result = ERR_USER_CANCELLED_SELECTION.raw;
|
||||
status = Account::ResultCancelledByUser;
|
||||
output.result = Account::ResultCancelledByUser.raw;
|
||||
output.uuid_selected = Common::InvalidUUID;
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
#include "core/file_sys/nca_metadata.h"
|
||||
#include "core/file_sys/patch_manager.h"
|
||||
#include "core/file_sys/registered_cache.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/service/aoc/aoc_u.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/server_manager.h"
|
||||
#include "core/loader/loader.h"
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void SetDefaultDeliveryTarget(Kernel::HLERequestContext& ctx) {
|
||||
void SetDefaultDeliveryTarget(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto unknown_1 = rp.Pop<u64>();
|
||||
@@ -81,7 +81,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void SetDeliveryTarget(Kernel::HLERequestContext& ctx) {
|
||||
void SetDeliveryTarget(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto unknown_1 = rp.Pop<u64>();
|
||||
@@ -93,7 +93,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void GetPurchasedEventReadableHandle(Kernel::HLERequestContext& ctx) {
|
||||
void GetPurchasedEventReadableHandle(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AOC, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -145,7 +145,7 @@ AOC_U::~AOC_U() {
|
||||
service_context.CloseEvent(aoc_change_event);
|
||||
}
|
||||
|
||||
void AOC_U::CountAddOnContent(Kernel::HLERequestContext& ctx) {
|
||||
void AOC_U::CountAddOnContent(HLERequestContext& ctx) {
|
||||
struct Parameters {
|
||||
u64 process_id;
|
||||
};
|
||||
@@ -172,7 +172,7 @@ void AOC_U::CountAddOnContent(Kernel::HLERequestContext& ctx) {
|
||||
[current](u64 tid) { return CheckAOCTitleIDMatchesBase(tid, current); })));
|
||||
}
|
||||
|
||||
void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) {
|
||||
void AOC_U::ListAddOnContent(HLERequestContext& ctx) {
|
||||
struct Parameters {
|
||||
u32 offset;
|
||||
u32 count;
|
||||
@@ -218,7 +218,7 @@ void AOC_U::ListAddOnContent(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(out_count);
|
||||
}
|
||||
|
||||
void AOC_U::GetAddOnContentBaseId(Kernel::HLERequestContext& ctx) {
|
||||
void AOC_U::GetAddOnContentBaseId(HLERequestContext& ctx) {
|
||||
struct Parameters {
|
||||
u64 process_id;
|
||||
};
|
||||
@@ -245,7 +245,7 @@ void AOC_U::GetAddOnContentBaseId(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(res.first->GetDLCBaseTitleId());
|
||||
}
|
||||
|
||||
void AOC_U::PrepareAddOnContent(Kernel::HLERequestContext& ctx) {
|
||||
void AOC_U::PrepareAddOnContent(HLERequestContext& ctx) {
|
||||
struct Parameters {
|
||||
s32 addon_index;
|
||||
u64 process_id;
|
||||
@@ -262,7 +262,7 @@ void AOC_U::PrepareAddOnContent(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void AOC_U::GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx) {
|
||||
void AOC_U::GetAddOnContentListChangedEvent(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AOC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -270,7 +270,7 @@ void AOC_U::GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushCopyObjects(aoc_change_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void AOC_U::GetAddOnContentListChangedEventWithProcessId(Kernel::HLERequestContext& ctx) {
|
||||
void AOC_U::GetAddOnContentListChangedEventWithProcessId(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AOC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -278,28 +278,28 @@ void AOC_U::GetAddOnContentListChangedEventWithProcessId(Kernel::HLERequestConte
|
||||
rb.PushCopyObjects(aoc_change_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void AOC_U::NotifyMountAddOnContent(Kernel::HLERequestContext& ctx) {
|
||||
void AOC_U::NotifyMountAddOnContent(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AOC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void AOC_U::NotifyUnmountAddOnContent(Kernel::HLERequestContext& ctx) {
|
||||
void AOC_U::NotifyUnmountAddOnContent(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AOC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void AOC_U::CheckAddOnContentMountStatus(Kernel::HLERequestContext& ctx) {
|
||||
void AOC_U::CheckAddOnContentMountStatus(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AOC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void AOC_U::CreateEcPurchasedEventManager(Kernel::HLERequestContext& ctx) {
|
||||
void AOC_U::CreateEcPurchasedEventManager(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AOC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -307,7 +307,7 @@ void AOC_U::CreateEcPurchasedEventManager(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface<IPurchaseEventManager>(system);
|
||||
}
|
||||
|
||||
void AOC_U::CreatePermanentEcPurchasedEventManager(Kernel::HLERequestContext& ctx) {
|
||||
void AOC_U::CreatePermanentEcPurchasedEventManager(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_AOC, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
|
||||
@@ -22,17 +22,17 @@ public:
|
||||
~AOC_U() override;
|
||||
|
||||
private:
|
||||
void CountAddOnContent(Kernel::HLERequestContext& ctx);
|
||||
void ListAddOnContent(Kernel::HLERequestContext& ctx);
|
||||
void GetAddOnContentBaseId(Kernel::HLERequestContext& ctx);
|
||||
void PrepareAddOnContent(Kernel::HLERequestContext& ctx);
|
||||
void GetAddOnContentListChangedEvent(Kernel::HLERequestContext& ctx);
|
||||
void GetAddOnContentListChangedEventWithProcessId(Kernel::HLERequestContext& ctx);
|
||||
void NotifyMountAddOnContent(Kernel::HLERequestContext& ctx);
|
||||
void NotifyUnmountAddOnContent(Kernel::HLERequestContext& ctx);
|
||||
void CheckAddOnContentMountStatus(Kernel::HLERequestContext& ctx);
|
||||
void CreateEcPurchasedEventManager(Kernel::HLERequestContext& ctx);
|
||||
void CreatePermanentEcPurchasedEventManager(Kernel::HLERequestContext& ctx);
|
||||
void CountAddOnContent(HLERequestContext& ctx);
|
||||
void ListAddOnContent(HLERequestContext& ctx);
|
||||
void GetAddOnContentBaseId(HLERequestContext& ctx);
|
||||
void PrepareAddOnContent(HLERequestContext& ctx);
|
||||
void GetAddOnContentListChangedEvent(HLERequestContext& ctx);
|
||||
void GetAddOnContentListChangedEventWithProcessId(HLERequestContext& ctx);
|
||||
void NotifyMountAddOnContent(HLERequestContext& ctx);
|
||||
void NotifyUnmountAddOnContent(HLERequestContext& ctx);
|
||||
void CheckAddOnContentMountStatus(HLERequestContext& ctx);
|
||||
void CreateEcPurchasedEventManager(HLERequestContext& ctx);
|
||||
void CreatePermanentEcPurchasedEventManager(HLERequestContext& ctx);
|
||||
|
||||
std::vector<u64> add_on_content;
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/apm/apm.h"
|
||||
#include "core/hle/service/apm/apm_controller.h"
|
||||
#include "core/hle/service/apm/apm_interface.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
|
||||
namespace Service::APM {
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void SetPerformanceConfiguration(Kernel::HLERequestContext& ctx) {
|
||||
void SetPerformanceConfiguration(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto mode = rp.PopEnum<PerformanceMode>();
|
||||
@@ -35,7 +35,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void GetPerformanceConfiguration(Kernel::HLERequestContext& ctx) {
|
||||
void GetPerformanceConfiguration(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto mode = rp.PopEnum<PerformanceMode>();
|
||||
@@ -46,7 +46,7 @@ private:
|
||||
rb.PushEnum(controller.GetCurrentPerformanceConfiguration(mode));
|
||||
}
|
||||
|
||||
void SetCpuOverclockEnabled(Kernel::HLERequestContext& ctx) {
|
||||
void SetCpuOverclockEnabled(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto cpu_overclock_enabled = rp.Pop<bool>();
|
||||
@@ -74,7 +74,7 @@ APM::APM(Core::System& system_, std::shared_ptr<Module> apm_, Controller& contro
|
||||
|
||||
APM::~APM() = default;
|
||||
|
||||
void APM::OpenSession(Kernel::HLERequestContext& ctx) {
|
||||
void APM::OpenSession(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_APM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -82,14 +82,14 @@ void APM::OpenSession(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface<ISession>(system, controller);
|
||||
}
|
||||
|
||||
void APM::GetPerformanceMode(Kernel::HLERequestContext& ctx) {
|
||||
void APM::GetPerformanceMode(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_APM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.PushEnum(controller.GetCurrentPerformanceMode());
|
||||
}
|
||||
|
||||
void APM::IsCpuOverclockEnabled(Kernel::HLERequestContext& ctx) {
|
||||
void APM::IsCpuOverclockEnabled(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_APM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -117,7 +117,7 @@ APM_Sys::APM_Sys(Core::System& system_, Controller& controller_)
|
||||
|
||||
APM_Sys::~APM_Sys() = default;
|
||||
|
||||
void APM_Sys::GetPerformanceEvent(Kernel::HLERequestContext& ctx) {
|
||||
void APM_Sys::GetPerformanceEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_APM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -125,7 +125,7 @@ void APM_Sys::GetPerformanceEvent(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface<ISession>(system, controller);
|
||||
}
|
||||
|
||||
void APM_Sys::SetCpuBoostMode(Kernel::HLERequestContext& ctx) {
|
||||
void APM_Sys::SetCpuBoostMode(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto mode = rp.PopEnum<CpuBoostMode>();
|
||||
|
||||
@@ -137,7 +137,7 @@ void APM_Sys::SetCpuBoostMode(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void APM_Sys::GetCurrentPerformanceConfiguration(Kernel::HLERequestContext& ctx) {
|
||||
void APM_Sys::GetCurrentPerformanceConfiguration(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_APM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
|
||||
@@ -17,9 +17,9 @@ public:
|
||||
~APM() override;
|
||||
|
||||
private:
|
||||
void OpenSession(Kernel::HLERequestContext& ctx);
|
||||
void GetPerformanceMode(Kernel::HLERequestContext& ctx);
|
||||
void IsCpuOverclockEnabled(Kernel::HLERequestContext& ctx);
|
||||
void OpenSession(HLERequestContext& ctx);
|
||||
void GetPerformanceMode(HLERequestContext& ctx);
|
||||
void IsCpuOverclockEnabled(HLERequestContext& ctx);
|
||||
|
||||
std::shared_ptr<Module> apm;
|
||||
Controller& controller;
|
||||
@@ -30,11 +30,11 @@ public:
|
||||
explicit APM_Sys(Core::System& system_, Controller& controller);
|
||||
~APM_Sys() override;
|
||||
|
||||
void SetCpuBoostMode(Kernel::HLERequestContext& ctx);
|
||||
void SetCpuBoostMode(HLERequestContext& ctx);
|
||||
|
||||
private:
|
||||
void GetPerformanceEvent(Kernel::HLERequestContext& ctx);
|
||||
void GetCurrentPerformanceConfiguration(Kernel::HLERequestContext& ctx);
|
||||
void GetPerformanceEvent(HLERequestContext& ctx);
|
||||
void GetCurrentPerformanceConfiguration(HLERequestContext& ctx);
|
||||
|
||||
Controller& controller;
|
||||
};
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/audio/audctl.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
|
||||
@@ -72,7 +72,7 @@ AudCtl::AudCtl(Core::System& system_) : ServiceFramework{system_, "audctl"} {
|
||||
|
||||
AudCtl::~AudCtl() = default;
|
||||
|
||||
void AudCtl::GetTargetVolumeMin(Kernel::HLERequestContext& ctx) {
|
||||
void AudCtl::GetTargetVolumeMin(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Audio, "called.");
|
||||
|
||||
// This service function is currently hardcoded on the
|
||||
@@ -84,7 +84,7 @@ void AudCtl::GetTargetVolumeMin(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(target_min_volume);
|
||||
}
|
||||
|
||||
void AudCtl::GetTargetVolumeMax(Kernel::HLERequestContext& ctx) {
|
||||
void AudCtl::GetTargetVolumeMax(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Audio, "called.");
|
||||
|
||||
// This service function is currently hardcoded on the
|
||||
|
||||
@@ -17,8 +17,8 @@ public:
|
||||
~AudCtl() override;
|
||||
|
||||
private:
|
||||
void GetTargetVolumeMin(Kernel::HLERequestContext& ctx);
|
||||
void GetTargetVolumeMax(Kernel::HLERequestContext& ctx);
|
||||
void GetTargetVolumeMin(HLERequestContext& ctx);
|
||||
void GetTargetVolumeMax(HLERequestContext& ctx);
|
||||
};
|
||||
|
||||
} // namespace Service::Audio
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#include "common/logging/log.h"
|
||||
#include "common/string_util.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/service/audio/audin_u.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
using namespace AudioCore::AudioIn;
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void GetAudioInState(Kernel::HLERequestContext& ctx) {
|
||||
void GetAudioInState(HLERequestContext& ctx) {
|
||||
const auto state = static_cast<u32>(impl->GetState());
|
||||
|
||||
LOG_DEBUG(Service_Audio, "called. State={}", state);
|
||||
@@ -71,7 +71,7 @@ private:
|
||||
rb.Push(state);
|
||||
}
|
||||
|
||||
void Start(Kernel::HLERequestContext& ctx) {
|
||||
void Start(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
auto result = impl->StartSystem();
|
||||
@@ -80,7 +80,7 @@ private:
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void Stop(Kernel::HLERequestContext& ctx) {
|
||||
void Stop(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
auto result = impl->StopSystem();
|
||||
@@ -89,7 +89,7 @@ private:
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void AppendAudioInBuffer(Kernel::HLERequestContext& ctx) {
|
||||
void AppendAudioInBuffer(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
u64 tag = rp.PopRaw<u64>();
|
||||
|
||||
@@ -111,7 +111,7 @@ private:
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void RegisterBufferEvent(Kernel::HLERequestContext& ctx) {
|
||||
void RegisterBufferEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
auto& buffer_event = impl->GetBufferEvent();
|
||||
@@ -121,7 +121,7 @@ private:
|
||||
rb.PushCopyObjects(buffer_event);
|
||||
}
|
||||
|
||||
void GetReleasedAudioInBuffer(Kernel::HLERequestContext& ctx) {
|
||||
void GetReleasedAudioInBuffer(HLERequestContext& ctx) {
|
||||
const auto write_buffer_size = ctx.GetWriteBufferNumElements<u64>();
|
||||
std::vector<u64> released_buffers(write_buffer_size);
|
||||
|
||||
@@ -141,7 +141,7 @@ private:
|
||||
rb.Push(count);
|
||||
}
|
||||
|
||||
void ContainsAudioInBuffer(Kernel::HLERequestContext& ctx) {
|
||||
void ContainsAudioInBuffer(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const u64 tag{rp.Pop<u64>()};
|
||||
@@ -154,7 +154,7 @@ private:
|
||||
rb.Push(buffer_queued);
|
||||
}
|
||||
|
||||
void GetAudioInBufferCount(Kernel::HLERequestContext& ctx) {
|
||||
void GetAudioInBufferCount(HLERequestContext& ctx) {
|
||||
const auto buffer_count = impl->GetBufferCount();
|
||||
|
||||
LOG_DEBUG(Service_Audio, "called. Buffer count={}", buffer_count);
|
||||
@@ -165,7 +165,7 @@ private:
|
||||
rb.Push(buffer_count);
|
||||
}
|
||||
|
||||
void SetDeviceGain(Kernel::HLERequestContext& ctx) {
|
||||
void SetDeviceGain(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto volume{rp.Pop<f32>()};
|
||||
@@ -177,7 +177,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void GetDeviceGain(Kernel::HLERequestContext& ctx) {
|
||||
void GetDeviceGain(HLERequestContext& ctx) {
|
||||
auto volume{impl->GetVolume()};
|
||||
|
||||
LOG_DEBUG(Service_Audio, "called. Gain {}", volume);
|
||||
@@ -187,7 +187,7 @@ private:
|
||||
rb.Push(volume);
|
||||
}
|
||||
|
||||
void FlushAudioInBuffers(Kernel::HLERequestContext& ctx) {
|
||||
void FlushAudioInBuffers(HLERequestContext& ctx) {
|
||||
bool flushed{impl->FlushAudioInBuffers()};
|
||||
|
||||
LOG_DEBUG(Service_Audio, "called. Were any buffers flushed? {}", flushed);
|
||||
@@ -221,7 +221,7 @@ AudInU::AudInU(Core::System& system_)
|
||||
|
||||
AudInU::~AudInU() = default;
|
||||
|
||||
void AudInU::ListAudioIns(Kernel::HLERequestContext& ctx) {
|
||||
void AudInU::ListAudioIns(HLERequestContext& ctx) {
|
||||
using namespace AudioCore::AudioRenderer;
|
||||
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
@@ -241,7 +241,7 @@ void AudInU::ListAudioIns(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(out_count);
|
||||
}
|
||||
|
||||
void AudInU::ListAudioInsAutoFiltered(Kernel::HLERequestContext& ctx) {
|
||||
void AudInU::ListAudioInsAutoFiltered(HLERequestContext& ctx) {
|
||||
using namespace AudioCore::AudioRenderer;
|
||||
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
@@ -261,7 +261,7 @@ void AudInU::ListAudioInsAutoFiltered(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(out_count);
|
||||
}
|
||||
|
||||
void AudInU::OpenAudioIn(Kernel::HLERequestContext& ctx) {
|
||||
void AudInU::OpenAudioIn(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
auto in_params{rp.PopRaw<AudioInParameter>()};
|
||||
auto applet_resource_user_id{rp.PopRaw<u64>()};
|
||||
@@ -311,7 +311,7 @@ void AudInU::OpenAudioIn(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface<IAudioIn>(audio_in);
|
||||
}
|
||||
|
||||
void AudInU::OpenAudioInProtocolSpecified(Kernel::HLERequestContext& ctx) {
|
||||
void AudInU::OpenAudioInProtocolSpecified(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
auto protocol_specified{rp.PopRaw<u64>()};
|
||||
auto in_params{rp.PopRaw<AudioInParameter>()};
|
||||
|
||||
@@ -12,10 +12,6 @@ namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace AudioCore::AudioOut {
|
||||
class Manager;
|
||||
class In;
|
||||
@@ -29,11 +25,11 @@ public:
|
||||
~AudInU() override;
|
||||
|
||||
private:
|
||||
void ListAudioIns(Kernel::HLERequestContext& ctx);
|
||||
void ListAudioInsAutoFiltered(Kernel::HLERequestContext& ctx);
|
||||
void OpenInOutImpl(Kernel::HLERequestContext& ctx);
|
||||
void OpenAudioIn(Kernel::HLERequestContext& ctx);
|
||||
void OpenAudioInProtocolSpecified(Kernel::HLERequestContext& ctx);
|
||||
void ListAudioIns(HLERequestContext& ctx);
|
||||
void ListAudioInsAutoFiltered(HLERequestContext& ctx);
|
||||
void OpenInOutImpl(HLERequestContext& ctx);
|
||||
void OpenAudioIn(HLERequestContext& ctx);
|
||||
void OpenAudioInProtocolSpecified(HLERequestContext& ctx);
|
||||
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
std::unique_ptr<AudioCore::AudioIn::Manager> impl;
|
||||
|
||||
@@ -12,10 +12,10 @@
|
||||
#include "common/string_util.h"
|
||||
#include "common/swap.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/service/audio/audout_u.h"
|
||||
#include "core/hle/service/audio/errors.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void GetAudioOutState(Kernel::HLERequestContext& ctx) {
|
||||
void GetAudioOutState(HLERequestContext& ctx) {
|
||||
const auto state = static_cast<u32>(impl->GetState());
|
||||
|
||||
LOG_DEBUG(Service_Audio, "called. State={}", state);
|
||||
@@ -77,7 +77,7 @@ private:
|
||||
rb.Push(state);
|
||||
}
|
||||
|
||||
void Start(Kernel::HLERequestContext& ctx) {
|
||||
void Start(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
auto result = impl->StartSystem();
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void Stop(Kernel::HLERequestContext& ctx) {
|
||||
void Stop(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
auto result = impl->StopSystem();
|
||||
@@ -95,7 +95,7 @@ private:
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void AppendAudioOutBuffer(Kernel::HLERequestContext& ctx) {
|
||||
void AppendAudioOutBuffer(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
u64 tag = rp.PopRaw<u64>();
|
||||
|
||||
@@ -117,7 +117,7 @@ private:
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void RegisterBufferEvent(Kernel::HLERequestContext& ctx) {
|
||||
void RegisterBufferEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
auto& buffer_event = impl->GetBufferEvent();
|
||||
@@ -127,7 +127,7 @@ private:
|
||||
rb.PushCopyObjects(buffer_event);
|
||||
}
|
||||
|
||||
void GetReleasedAudioOutBuffers(Kernel::HLERequestContext& ctx) {
|
||||
void GetReleasedAudioOutBuffers(HLERequestContext& ctx) {
|
||||
const auto write_buffer_size = ctx.GetWriteBufferNumElements<u64>();
|
||||
std::vector<u64> released_buffers(write_buffer_size);
|
||||
|
||||
@@ -147,7 +147,7 @@ private:
|
||||
rb.Push(count);
|
||||
}
|
||||
|
||||
void ContainsAudioOutBuffer(Kernel::HLERequestContext& ctx) {
|
||||
void ContainsAudioOutBuffer(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const u64 tag{rp.Pop<u64>()};
|
||||
@@ -160,7 +160,7 @@ private:
|
||||
rb.Push(buffer_queued);
|
||||
}
|
||||
|
||||
void GetAudioOutBufferCount(Kernel::HLERequestContext& ctx) {
|
||||
void GetAudioOutBufferCount(HLERequestContext& ctx) {
|
||||
const auto buffer_count = impl->GetBufferCount();
|
||||
|
||||
LOG_DEBUG(Service_Audio, "called. Buffer count={}", buffer_count);
|
||||
@@ -171,7 +171,7 @@ private:
|
||||
rb.Push(buffer_count);
|
||||
}
|
||||
|
||||
void GetAudioOutPlayedSampleCount(Kernel::HLERequestContext& ctx) {
|
||||
void GetAudioOutPlayedSampleCount(HLERequestContext& ctx) {
|
||||
const auto samples_played = impl->GetPlayedSampleCount();
|
||||
|
||||
LOG_DEBUG(Service_Audio, "called. Played samples={}", samples_played);
|
||||
@@ -182,7 +182,7 @@ private:
|
||||
rb.Push(samples_played);
|
||||
}
|
||||
|
||||
void FlushAudioOutBuffers(Kernel::HLERequestContext& ctx) {
|
||||
void FlushAudioOutBuffers(HLERequestContext& ctx) {
|
||||
bool flushed{impl->FlushAudioOutBuffers()};
|
||||
|
||||
LOG_DEBUG(Service_Audio, "called. Were any buffers flushed? {}", flushed);
|
||||
@@ -192,7 +192,7 @@ private:
|
||||
rb.Push(flushed);
|
||||
}
|
||||
|
||||
void SetAudioOutVolume(Kernel::HLERequestContext& ctx) {
|
||||
void SetAudioOutVolume(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto volume = rp.Pop<f32>();
|
||||
|
||||
@@ -204,7 +204,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void GetAudioOutVolume(Kernel::HLERequestContext& ctx) {
|
||||
void GetAudioOutVolume(HLERequestContext& ctx) {
|
||||
const auto volume = impl->GetVolume();
|
||||
|
||||
LOG_DEBUG(Service_Audio, "called. Volume={}", volume);
|
||||
@@ -236,7 +236,7 @@ AudOutU::AudOutU(Core::System& system_)
|
||||
|
||||
AudOutU::~AudOutU() = default;
|
||||
|
||||
void AudOutU::ListAudioOuts(Kernel::HLERequestContext& ctx) {
|
||||
void AudOutU::ListAudioOuts(HLERequestContext& ctx) {
|
||||
using namespace AudioCore::AudioRenderer;
|
||||
|
||||
std::scoped_lock l{impl->mutex};
|
||||
@@ -258,7 +258,7 @@ void AudOutU::ListAudioOuts(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u32>(static_cast<u32>(device_names.size()));
|
||||
}
|
||||
|
||||
void AudOutU::OpenAudioOut(Kernel::HLERequestContext& ctx) {
|
||||
void AudOutU::OpenAudioOut(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
auto in_params{rp.PopRaw<AudioOutParameter>()};
|
||||
auto applet_resource_user_id{rp.PopRaw<u64>()};
|
||||
|
||||
@@ -12,10 +12,6 @@ namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace AudioCore::AudioOut {
|
||||
class Manager;
|
||||
class Out;
|
||||
@@ -31,8 +27,8 @@ public:
|
||||
~AudOutU() override;
|
||||
|
||||
private:
|
||||
void ListAudioOuts(Kernel::HLERequestContext& ctx);
|
||||
void OpenAudioOut(Kernel::HLERequestContext& ctx);
|
||||
void ListAudioOuts(HLERequestContext& ctx);
|
||||
void OpenAudioOut(HLERequestContext& ctx);
|
||||
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
std::unique_ptr<AudioCore::AudioOut::Manager> impl;
|
||||
|
||||
@@ -17,12 +17,12 @@
|
||||
#include "common/polyfill_ranges.h"
|
||||
#include "common/string_util.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/kernel/k_process.h"
|
||||
#include "core/hle/kernel/k_transfer_memory.h"
|
||||
#include "core/hle/service/audio/audren_u.h"
|
||||
#include "core/hle/service/audio/errors.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/memory.h"
|
||||
|
||||
using namespace AudioCore::AudioRenderer;
|
||||
@@ -68,7 +68,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void GetSampleRate(Kernel::HLERequestContext& ctx) {
|
||||
void GetSampleRate(HLERequestContext& ctx) {
|
||||
const auto sample_rate{impl->GetSystem().GetSampleRate()};
|
||||
|
||||
LOG_DEBUG(Service_Audio, "called. Sample rate {}", sample_rate);
|
||||
@@ -78,7 +78,7 @@ private:
|
||||
rb.Push(sample_rate);
|
||||
}
|
||||
|
||||
void GetSampleCount(Kernel::HLERequestContext& ctx) {
|
||||
void GetSampleCount(HLERequestContext& ctx) {
|
||||
const auto sample_count{impl->GetSystem().GetSampleCount()};
|
||||
|
||||
LOG_DEBUG(Service_Audio, "called. Sample count {}", sample_count);
|
||||
@@ -88,7 +88,7 @@ private:
|
||||
rb.Push(sample_count);
|
||||
}
|
||||
|
||||
void GetState(Kernel::HLERequestContext& ctx) {
|
||||
void GetState(HLERequestContext& ctx) {
|
||||
const u32 state{!impl->GetSystem().IsActive()};
|
||||
|
||||
LOG_DEBUG(Service_Audio, "called, state {}", state);
|
||||
@@ -98,7 +98,7 @@ private:
|
||||
rb.Push(state);
|
||||
}
|
||||
|
||||
void GetMixBufferCount(Kernel::HLERequestContext& ctx) {
|
||||
void GetMixBufferCount(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
const auto buffer_count{impl->GetSystem().GetMixBufferCount()};
|
||||
@@ -108,7 +108,7 @@ private:
|
||||
rb.Push(buffer_count);
|
||||
}
|
||||
|
||||
void RequestUpdate(Kernel::HLERequestContext& ctx) {
|
||||
void RequestUpdate(HLERequestContext& ctx) {
|
||||
LOG_TRACE(Service_Audio, "called");
|
||||
|
||||
const auto input{ctx.ReadBuffer(0)};
|
||||
@@ -147,7 +147,7 @@ private:
|
||||
rb.Push(result);
|
||||
}
|
||||
|
||||
void Start(Kernel::HLERequestContext& ctx) {
|
||||
void Start(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
impl->Start();
|
||||
@@ -156,7 +156,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Stop(Kernel::HLERequestContext& ctx) {
|
||||
void Stop(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
impl->Stop();
|
||||
@@ -165,12 +165,12 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void QuerySystemEvent(Kernel::HLERequestContext& ctx) {
|
||||
void QuerySystemEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
if (impl->GetSystem().GetExecutionMode() == AudioCore::ExecutionMode::Manual) {
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_NOT_SUPPORTED);
|
||||
rb.Push(Audio::ResultNotSupported);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ private:
|
||||
rb.PushCopyObjects(rendered_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void SetRenderingTimeLimit(Kernel::HLERequestContext& ctx) {
|
||||
void SetRenderingTimeLimit(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
IPC::RequestParser rp{ctx};
|
||||
@@ -192,7 +192,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void GetRenderingTimeLimit(Kernel::HLERequestContext& ctx) {
|
||||
void GetRenderingTimeLimit(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
auto& system_ = impl->GetSystem();
|
||||
@@ -203,11 +203,11 @@ private:
|
||||
rb.Push(time);
|
||||
}
|
||||
|
||||
void ExecuteAudioRendererRendering(Kernel::HLERequestContext& ctx) {
|
||||
void ExecuteAudioRendererRendering(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
}
|
||||
|
||||
void SetVoiceDropParameter(Kernel::HLERequestContext& ctx) {
|
||||
void SetVoiceDropParameter(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
IPC::RequestParser rp{ctx};
|
||||
@@ -220,7 +220,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void GetVoiceDropParameter(Kernel::HLERequestContext& ctx) {
|
||||
void GetVoiceDropParameter(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
auto& system_ = impl->GetSystem();
|
||||
@@ -271,7 +271,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void ListAudioDeviceName(Kernel::HLERequestContext& ctx) {
|
||||
void ListAudioDeviceName(HLERequestContext& ctx) {
|
||||
const size_t in_count = ctx.GetWriteBufferNumElements<AudioDevice::AudioDeviceName>();
|
||||
|
||||
std::vector<AudioDevice::AudioDeviceName> out_names{};
|
||||
@@ -299,7 +299,7 @@ private:
|
||||
rb.Push(out_count);
|
||||
}
|
||||
|
||||
void SetAudioDeviceOutputVolume(Kernel::HLERequestContext& ctx) {
|
||||
void SetAudioDeviceOutputVolume(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const f32 volume = rp.Pop<f32>();
|
||||
|
||||
@@ -316,7 +316,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void GetAudioDeviceOutputVolume(Kernel::HLERequestContext& ctx) {
|
||||
void GetAudioDeviceOutputVolume(HLERequestContext& ctx) {
|
||||
const auto device_name_buffer = ctx.ReadBuffer();
|
||||
const std::string name = Common::StringFromBuffer(device_name_buffer);
|
||||
|
||||
@@ -332,7 +332,7 @@ private:
|
||||
rb.Push(volume);
|
||||
}
|
||||
|
||||
void GetActiveAudioDeviceName(Kernel::HLERequestContext& ctx) {
|
||||
void GetActiveAudioDeviceName(HLERequestContext& ctx) {
|
||||
const auto write_size = ctx.GetWriteBufferSize();
|
||||
std::string out_name{"AudioTvOutput"};
|
||||
|
||||
@@ -346,7 +346,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void QueryAudioDeviceSystemEvent(Kernel::HLERequestContext& ctx) {
|
||||
void QueryAudioDeviceSystemEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "(STUBBED) called");
|
||||
|
||||
event->Signal();
|
||||
@@ -356,7 +356,7 @@ private:
|
||||
rb.PushCopyObjects(event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void GetActiveChannelCount(Kernel::HLERequestContext& ctx) {
|
||||
void GetActiveChannelCount(HLERequestContext& ctx) {
|
||||
const auto& sink{system.AudioCore().GetOutputSink()};
|
||||
u32 channel_count{sink.GetDeviceChannels()};
|
||||
|
||||
@@ -368,7 +368,7 @@ private:
|
||||
rb.Push<u32>(channel_count);
|
||||
}
|
||||
|
||||
void QueryAudioDeviceInputEvent(Kernel::HLERequestContext& ctx) {
|
||||
void QueryAudioDeviceInputEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -376,7 +376,7 @@ private:
|
||||
rb.PushCopyObjects(event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void QueryAudioDeviceOutputEvent(Kernel::HLERequestContext& ctx) {
|
||||
void QueryAudioDeviceOutputEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -384,7 +384,7 @@ private:
|
||||
rb.PushCopyObjects(event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void ListAudioOutputDeviceName(Kernel::HLERequestContext& ctx) {
|
||||
void ListAudioOutputDeviceName(HLERequestContext& ctx) {
|
||||
const size_t in_count = ctx.GetWriteBufferNumElements<AudioDevice::AudioDeviceName>();
|
||||
|
||||
std::vector<AudioDevice::AudioDeviceName> out_names{};
|
||||
@@ -435,7 +435,7 @@ AudRenU::AudRenU(Core::System& system_)
|
||||
|
||||
AudRenU::~AudRenU() = default;
|
||||
|
||||
void AudRenU::OpenAudioRenderer(Kernel::HLERequestContext& ctx) {
|
||||
void AudRenU::OpenAudioRenderer(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
AudioCore::AudioRendererParameterInternal params;
|
||||
@@ -448,7 +448,7 @@ void AudRenU::OpenAudioRenderer(Kernel::HLERequestContext& ctx) {
|
||||
if (impl->GetSessionCount() + 1 > AudioCore::MaxRendererSessions) {
|
||||
LOG_ERROR(Service_Audio, "Too many AudioRenderer sessions open!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_MAXIMUM_SESSIONS_REACHED);
|
||||
rb.Push(Audio::ResultOutOfSessions);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -461,7 +461,7 @@ void AudRenU::OpenAudioRenderer(Kernel::HLERequestContext& ctx) {
|
||||
if (session_id == -1) {
|
||||
LOG_ERROR(Service_Audio, "Tried to open a session that's already in use!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_MAXIMUM_SESSIONS_REACHED);
|
||||
rb.Push(Audio::ResultOutOfSessions);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@ void AudRenU::OpenAudioRenderer(Kernel::HLERequestContext& ctx) {
|
||||
applet_resource_user_id, session_id);
|
||||
}
|
||||
|
||||
void AudRenU::GetWorkBufferSize(Kernel::HLERequestContext& ctx) {
|
||||
void AudRenU::GetWorkBufferSize(HLERequestContext& ctx) {
|
||||
AudioCore::AudioRendererParameterInternal params;
|
||||
|
||||
IPC::RequestParser rp{ctx};
|
||||
@@ -506,7 +506,7 @@ void AudRenU::GetWorkBufferSize(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u64>(size);
|
||||
}
|
||||
|
||||
void AudRenU::GetAudioDeviceService(Kernel::HLERequestContext& ctx) {
|
||||
void AudRenU::GetAudioDeviceService(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto applet_resource_user_id = rp.Pop<u64>();
|
||||
@@ -520,11 +520,11 @@ void AudRenU::GetAudioDeviceService(Kernel::HLERequestContext& ctx) {
|
||||
::Common::MakeMagic('R', 'E', 'V', '1'), num_audio_devices++);
|
||||
}
|
||||
|
||||
void AudRenU::OpenAudioRendererForManualExecution(Kernel::HLERequestContext& ctx) {
|
||||
void AudRenU::OpenAudioRendererForManualExecution(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Audio, "called");
|
||||
}
|
||||
|
||||
void AudRenU::GetAudioDeviceServiceWithRevisionInfo(Kernel::HLERequestContext& ctx) {
|
||||
void AudRenU::GetAudioDeviceServiceWithRevisionInfo(HLERequestContext& ctx) {
|
||||
struct Parameters {
|
||||
u32 revision;
|
||||
u64 applet_resource_user_id;
|
||||
|
||||
@@ -11,10 +11,6 @@ namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace Service::Audio {
|
||||
class IAudioRenderer;
|
||||
|
||||
@@ -24,11 +20,11 @@ public:
|
||||
~AudRenU() override;
|
||||
|
||||
private:
|
||||
void OpenAudioRenderer(Kernel::HLERequestContext& ctx);
|
||||
void GetWorkBufferSize(Kernel::HLERequestContext& ctx);
|
||||
void GetAudioDeviceService(Kernel::HLERequestContext& ctx);
|
||||
void OpenAudioRendererForManualExecution(Kernel::HLERequestContext& ctx);
|
||||
void GetAudioDeviceServiceWithRevisionInfo(Kernel::HLERequestContext& ctx);
|
||||
void OpenAudioRenderer(HLERequestContext& ctx);
|
||||
void GetWorkBufferSize(HLERequestContext& ctx);
|
||||
void GetAudioDeviceService(HLERequestContext& ctx);
|
||||
void OpenAudioRendererForManualExecution(HLERequestContext& ctx);
|
||||
void GetAudioDeviceServiceWithRevisionInfo(HLERequestContext& ctx);
|
||||
|
||||
KernelHelpers::ServiceContext service_context;
|
||||
std::unique_ptr<AudioCore::AudioRenderer::Manager> impl;
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
|
||||
namespace Service::Audio {
|
||||
|
||||
constexpr Result ERR_INVALID_DEVICE_NAME{ErrorModule::Audio, 1};
|
||||
constexpr Result ERR_OPERATION_FAILED{ErrorModule::Audio, 2};
|
||||
constexpr Result ERR_INVALID_SAMPLE_RATE{ErrorModule::Audio, 3};
|
||||
constexpr Result ERR_INSUFFICIENT_BUFFER_SIZE{ErrorModule::Audio, 4};
|
||||
constexpr Result ERR_MAXIMUM_SESSIONS_REACHED{ErrorModule::Audio, 5};
|
||||
constexpr Result ERR_BUFFER_COUNT_EXCEEDED{ErrorModule::Audio, 8};
|
||||
constexpr Result ERR_INVALID_CHANNEL_COUNT{ErrorModule::Audio, 10};
|
||||
constexpr Result ERR_INVALID_UPDATE_DATA{ErrorModule::Audio, 41};
|
||||
constexpr Result ERR_POOL_MAPPING_FAILED{ErrorModule::Audio, 42};
|
||||
constexpr Result ERR_NOT_SUPPORTED{ErrorModule::Audio, 513};
|
||||
constexpr Result ERR_INVALID_PROCESS_HANDLE{ErrorModule::Audio, 1536};
|
||||
constexpr Result ERR_INVALID_REVISION{ErrorModule::Audio, 1537};
|
||||
constexpr Result ResultNotFound{ErrorModule::Audio, 1};
|
||||
constexpr Result ResultOperationFailed{ErrorModule::Audio, 2};
|
||||
constexpr Result ResultInvalidSampleRate{ErrorModule::Audio, 3};
|
||||
constexpr Result ResultInsufficientBuffer{ErrorModule::Audio, 4};
|
||||
constexpr Result ResultOutOfSessions{ErrorModule::Audio, 5};
|
||||
constexpr Result ResultBufferCountReached{ErrorModule::Audio, 8};
|
||||
constexpr Result ResultInvalidChannelCount{ErrorModule::Audio, 10};
|
||||
constexpr Result ResultInvalidUpdateInfo{ErrorModule::Audio, 41};
|
||||
constexpr Result ResultInvalidAddressInfo{ErrorModule::Audio, 42};
|
||||
constexpr Result ResultNotSupported{ErrorModule::Audio, 513};
|
||||
constexpr Result ResultInvalidHandle{ErrorModule::Audio, 1536};
|
||||
constexpr Result ResultInvalidRevision{ErrorModule::Audio, 1537};
|
||||
|
||||
} // namespace Service::Audio
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
#include "common/assert.h"
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/audio/hwopus.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
|
||||
namespace Service::Audio {
|
||||
namespace {
|
||||
@@ -53,7 +53,7 @@ public:
|
||||
|
||||
// Decodes interleaved Opus packets. Optionally allows reporting time taken to
|
||||
// perform the decoding, as well as any relevant extra behavior.
|
||||
void DecodeInterleaved(Kernel::HLERequestContext& ctx, PerfTime perf_time,
|
||||
void DecodeInterleaved(HLERequestContext& ctx, PerfTime perf_time,
|
||||
ExtraBehavior extra_behavior) {
|
||||
if (perf_time == PerfTime::Disabled) {
|
||||
DecodeInterleavedHelper(ctx, nullptr, extra_behavior);
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void DecodeInterleavedHelper(Kernel::HLERequestContext& ctx, u64* performance,
|
||||
void DecodeInterleavedHelper(HLERequestContext& ctx, u64* performance,
|
||||
ExtraBehavior extra_behavior) {
|
||||
u32 consumed = 0;
|
||||
u32 sample_count = 0;
|
||||
@@ -180,21 +180,21 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void DecodeInterleavedOld(Kernel::HLERequestContext& ctx) {
|
||||
void DecodeInterleavedOld(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Audio, "called");
|
||||
|
||||
decoder_state.DecodeInterleaved(ctx, OpusDecoderState::PerfTime::Disabled,
|
||||
OpusDecoderState::ExtraBehavior::None);
|
||||
}
|
||||
|
||||
void DecodeInterleavedWithPerfOld(Kernel::HLERequestContext& ctx) {
|
||||
void DecodeInterleavedWithPerfOld(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Audio, "called");
|
||||
|
||||
decoder_state.DecodeInterleaved(ctx, OpusDecoderState::PerfTime::Enabled,
|
||||
OpusDecoderState::ExtraBehavior::None);
|
||||
}
|
||||
|
||||
void DecodeInterleaved(Kernel::HLERequestContext& ctx) {
|
||||
void DecodeInterleaved(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Audio, "called");
|
||||
|
||||
IPC::RequestParser rp{ctx};
|
||||
@@ -231,7 +231,7 @@ std::array<u8, 2> CreateMappingTable(u32 channel_count) {
|
||||
}
|
||||
} // Anonymous namespace
|
||||
|
||||
void HwOpus::GetWorkBufferSize(Kernel::HLERequestContext& ctx) {
|
||||
void HwOpus::GetWorkBufferSize(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto sample_rate = rp.Pop<u32>();
|
||||
const auto channel_count = rp.Pop<u32>();
|
||||
@@ -251,11 +251,11 @@ void HwOpus::GetWorkBufferSize(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u32>(worker_buffer_sz);
|
||||
}
|
||||
|
||||
void HwOpus::GetWorkBufferSizeEx(Kernel::HLERequestContext& ctx) {
|
||||
void HwOpus::GetWorkBufferSizeEx(HLERequestContext& ctx) {
|
||||
GetWorkBufferSize(ctx);
|
||||
}
|
||||
|
||||
void HwOpus::GetWorkBufferSizeForMultiStreamEx(Kernel::HLERequestContext& ctx) {
|
||||
void HwOpus::GetWorkBufferSizeForMultiStreamEx(HLERequestContext& ctx) {
|
||||
OpusMultiStreamParametersEx param;
|
||||
std::memcpy(¶m, ctx.ReadBuffer().data(), ctx.GetReadBufferSize());
|
||||
|
||||
@@ -281,7 +281,7 @@ void HwOpus::GetWorkBufferSizeForMultiStreamEx(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push<u32>(worker_buffer_sz);
|
||||
}
|
||||
|
||||
void HwOpus::OpenHardwareOpusDecoder(Kernel::HLERequestContext& ctx) {
|
||||
void HwOpus::OpenHardwareOpusDecoder(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto sample_rate = rp.Pop<u32>();
|
||||
const auto channel_count = rp.Pop<u32>();
|
||||
@@ -319,7 +319,7 @@ void HwOpus::OpenHardwareOpusDecoder(Kernel::HLERequestContext& ctx) {
|
||||
system, OpusDecoderState{std::move(decoder), sample_rate, channel_count});
|
||||
}
|
||||
|
||||
void HwOpus::OpenHardwareOpusDecoderEx(Kernel::HLERequestContext& ctx) {
|
||||
void HwOpus::OpenHardwareOpusDecoderEx(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto sample_rate = rp.Pop<u32>();
|
||||
const auto channel_count = rp.Pop<u32>();
|
||||
|
||||
@@ -27,11 +27,11 @@ public:
|
||||
~HwOpus() override;
|
||||
|
||||
private:
|
||||
void OpenHardwareOpusDecoder(Kernel::HLERequestContext& ctx);
|
||||
void OpenHardwareOpusDecoderEx(Kernel::HLERequestContext& ctx);
|
||||
void GetWorkBufferSize(Kernel::HLERequestContext& ctx);
|
||||
void GetWorkBufferSizeEx(Kernel::HLERequestContext& ctx);
|
||||
void GetWorkBufferSizeForMultiStreamEx(Kernel::HLERequestContext& ctx);
|
||||
void OpenHardwareOpusDecoder(HLERequestContext& ctx);
|
||||
void OpenHardwareOpusDecoderEx(HLERequestContext& ctx);
|
||||
void GetWorkBufferSize(HLERequestContext& ctx);
|
||||
void GetWorkBufferSizeEx(HLERequestContext& ctx);
|
||||
void GetWorkBufferSizeForMultiStreamEx(HLERequestContext& ctx);
|
||||
};
|
||||
|
||||
} // namespace Service::Audio
|
||||
|
||||
@@ -9,12 +9,12 @@
|
||||
#include "common/string_util.h"
|
||||
#include "core/core.h"
|
||||
#include "core/file_sys/vfs.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_readable_event.h"
|
||||
#include "core/hle/service/bcat/backend/backend.h"
|
||||
#include "core/hle/service/bcat/bcat.h"
|
||||
#include "core/hle/service/bcat/bcat_module.h"
|
||||
#include "core/hle/service/filesystem/filesystem.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/server_manager.h"
|
||||
|
||||
namespace Service::BCAT {
|
||||
@@ -51,8 +51,7 @@ BCATDigest DigestFile(const FileSys::VirtualFile& file) {
|
||||
// For a name to be valid it must be non-empty, must have a null terminating character as the final
|
||||
// char, can only contain numbers, letters, underscores and a hyphen if directory and a period if
|
||||
// file.
|
||||
bool VerifyNameValidInternal(Kernel::HLERequestContext& ctx, std::array<char, 0x20> name,
|
||||
char match_char) {
|
||||
bool VerifyNameValidInternal(HLERequestContext& ctx, std::array<char, 0x20> name, char match_char) {
|
||||
const auto null_chars = std::count(name.begin(), name.end(), 0);
|
||||
const auto bad_chars = std::count_if(name.begin(), name.end(), [match_char](char c) {
|
||||
return !std::isalnum(static_cast<u8>(c)) && c != '_' && c != match_char && c != '\0';
|
||||
@@ -67,11 +66,11 @@ bool VerifyNameValidInternal(Kernel::HLERequestContext& ctx, std::array<char, 0x
|
||||
return true;
|
||||
}
|
||||
|
||||
bool VerifyNameValidDir(Kernel::HLERequestContext& ctx, DirectoryName name) {
|
||||
bool VerifyNameValidDir(HLERequestContext& ctx, DirectoryName name) {
|
||||
return VerifyNameValidInternal(ctx, name, '-');
|
||||
}
|
||||
|
||||
bool VerifyNameValidFile(Kernel::HLERequestContext& ctx, FileName name) {
|
||||
bool VerifyNameValidFile(HLERequestContext& ctx, FileName name) {
|
||||
return VerifyNameValidInternal(ctx, name, '.');
|
||||
}
|
||||
|
||||
@@ -99,7 +98,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void GetEvent(Kernel::HLERequestContext& ctx) {
|
||||
void GetEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_BCAT, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -107,7 +106,7 @@ private:
|
||||
rb.PushCopyObjects(event);
|
||||
}
|
||||
|
||||
void GetImpl(Kernel::HLERequestContext& ctx) {
|
||||
void GetImpl(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_BCAT, "called");
|
||||
|
||||
ctx.WriteBuffer(impl);
|
||||
@@ -174,7 +173,7 @@ private:
|
||||
progress_backend.GetImpl());
|
||||
}
|
||||
|
||||
void RequestSyncDeliveryCache(Kernel::HLERequestContext& ctx) {
|
||||
void RequestSyncDeliveryCache(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_BCAT, "called");
|
||||
|
||||
backend.Synchronize({system.GetApplicationProcessProgramID(),
|
||||
@@ -186,7 +185,7 @@ private:
|
||||
rb.PushIpcInterface(CreateProgressService(SyncType::Normal));
|
||||
}
|
||||
|
||||
void RequestSyncDeliveryCacheWithDirectoryName(Kernel::HLERequestContext& ctx) {
|
||||
void RequestSyncDeliveryCacheWithDirectoryName(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto name_raw = rp.PopRaw<DirectoryName>();
|
||||
const auto name =
|
||||
@@ -203,7 +202,7 @@ private:
|
||||
rb.PushIpcInterface(CreateProgressService(SyncType::Directory));
|
||||
}
|
||||
|
||||
void SetPassphrase(Kernel::HLERequestContext& ctx) {
|
||||
void SetPassphrase(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto title_id = rp.PopRaw<u64>();
|
||||
|
||||
@@ -235,7 +234,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ClearDeliveryCacheStorage(Kernel::HLERequestContext& ctx) {
|
||||
void ClearDeliveryCacheStorage(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto title_id = rp.PopRaw<u64>();
|
||||
|
||||
@@ -271,7 +270,7 @@ private:
|
||||
std::array<ProgressServiceBackend, static_cast<size_t>(SyncType::Count)> progress;
|
||||
};
|
||||
|
||||
void Module::Interface::CreateBcatService(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::CreateBcatService(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_BCAT, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -296,7 +295,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void Open(Kernel::HLERequestContext& ctx) {
|
||||
void Open(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto dir_name_raw = rp.PopRaw<DirectoryName>();
|
||||
const auto file_name_raw = rp.PopRaw<FileName>();
|
||||
@@ -340,7 +339,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Read(Kernel::HLERequestContext& ctx) {
|
||||
void Read(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto offset{rp.PopRaw<u64>()};
|
||||
|
||||
@@ -363,7 +362,7 @@ private:
|
||||
rb.Push<u64>(buffer.size());
|
||||
}
|
||||
|
||||
void GetSize(Kernel::HLERequestContext& ctx) {
|
||||
void GetSize(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_BCAT, "called");
|
||||
|
||||
if (current_file == nullptr) {
|
||||
@@ -377,7 +376,7 @@ private:
|
||||
rb.Push<u64>(current_file->GetSize());
|
||||
}
|
||||
|
||||
void GetDigest(Kernel::HLERequestContext& ctx) {
|
||||
void GetDigest(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_BCAT, "called");
|
||||
|
||||
if (current_file == nullptr) {
|
||||
@@ -412,7 +411,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void Open(Kernel::HLERequestContext& ctx) {
|
||||
void Open(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto name_raw = rp.PopRaw<DirectoryName>();
|
||||
const auto name =
|
||||
@@ -443,7 +442,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Read(Kernel::HLERequestContext& ctx) {
|
||||
void Read(HLERequestContext& ctx) {
|
||||
auto write_size = ctx.GetWriteBufferNumElements<DeliveryCacheDirectoryEntry>();
|
||||
|
||||
LOG_DEBUG(Service_BCAT, "called, write_size={:016X}", write_size);
|
||||
@@ -473,7 +472,7 @@ private:
|
||||
rb.Push(static_cast<u32>(write_size * sizeof(DeliveryCacheDirectoryEntry)));
|
||||
}
|
||||
|
||||
void GetCount(Kernel::HLERequestContext& ctx) {
|
||||
void GetCount(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_BCAT, "called");
|
||||
|
||||
if (current_dir == nullptr) {
|
||||
@@ -517,7 +516,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void CreateFileService(Kernel::HLERequestContext& ctx) {
|
||||
void CreateFileService(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_BCAT, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -525,7 +524,7 @@ private:
|
||||
rb.PushIpcInterface<IDeliveryCacheFileService>(system, root);
|
||||
}
|
||||
|
||||
void CreateDirectoryService(Kernel::HLERequestContext& ctx) {
|
||||
void CreateDirectoryService(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_BCAT, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -533,7 +532,7 @@ private:
|
||||
rb.PushIpcInterface<IDeliveryCacheDirectoryService>(system, root);
|
||||
}
|
||||
|
||||
void EnumerateDeliveryCacheDirectory(Kernel::HLERequestContext& ctx) {
|
||||
void EnumerateDeliveryCacheDirectory(HLERequestContext& ctx) {
|
||||
auto size = ctx.GetWriteBufferNumElements<DirectoryName>();
|
||||
|
||||
LOG_DEBUG(Service_BCAT, "called, size={:016X}", size);
|
||||
@@ -552,7 +551,7 @@ private:
|
||||
u64 next_read_index = 0;
|
||||
};
|
||||
|
||||
void Module::Interface::CreateDeliveryCacheStorageService(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::CreateDeliveryCacheStorageService(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_BCAT, "called");
|
||||
|
||||
const auto title_id = system.GetApplicationProcessProgramID();
|
||||
@@ -561,8 +560,7 @@ void Module::Interface::CreateDeliveryCacheStorageService(Kernel::HLERequestCont
|
||||
rb.PushIpcInterface<IDeliveryCacheStorageService>(system, fsc.GetBCATDirectory(title_id));
|
||||
}
|
||||
|
||||
void Module::Interface::CreateDeliveryCacheStorageServiceWithApplicationId(
|
||||
Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::CreateDeliveryCacheStorageServiceWithApplicationId(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto title_id = rp.PopRaw<u64>();
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@ public:
|
||||
FileSystem::FileSystemController& fsc_, const char* name);
|
||||
~Interface() override;
|
||||
|
||||
void CreateBcatService(Kernel::HLERequestContext& ctx);
|
||||
void CreateDeliveryCacheStorageService(Kernel::HLERequestContext& ctx);
|
||||
void CreateDeliveryCacheStorageServiceWithApplicationId(Kernel::HLERequestContext& ctx);
|
||||
void CreateBcatService(HLERequestContext& ctx);
|
||||
void CreateDeliveryCacheStorageService(HLERequestContext& ctx);
|
||||
void CreateDeliveryCacheStorageServiceWithApplicationId(HLERequestContext& ctx);
|
||||
|
||||
protected:
|
||||
FileSystem::FileSystemController& fsc;
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/service/btdrv/btdrv.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
#include "core/hle/service/server_manager.h"
|
||||
#include "core/hle/service/service.h"
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void RegisterBleEvent(Kernel::HLERequestContext& ctx) {
|
||||
void RegisterBleEvent(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/service/btm/btm.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
#include "core/hle/service/server_manager.h"
|
||||
#include "core/hle/service/service.h"
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void AcquireBleScanEvent(Kernel::HLERequestContext& ctx) {
|
||||
void AcquireBleScanEvent(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3, 1};
|
||||
@@ -79,7 +79,7 @@ private:
|
||||
rb.PushCopyObjects(scan_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void AcquireBleConnectionEvent(Kernel::HLERequestContext& ctx) {
|
||||
void AcquireBleConnectionEvent(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3, 1};
|
||||
@@ -88,7 +88,7 @@ private:
|
||||
rb.PushCopyObjects(connection_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void AcquireBleServiceDiscoveryEvent(Kernel::HLERequestContext& ctx) {
|
||||
void AcquireBleServiceDiscoveryEvent(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3, 1};
|
||||
@@ -97,7 +97,7 @@ private:
|
||||
rb.PushCopyObjects(service_discovery_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void AcquireBleMtuConfigEvent(Kernel::HLERequestContext& ctx) {
|
||||
void AcquireBleMtuConfigEvent(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_BTM, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3, 1};
|
||||
@@ -126,7 +126,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void GetCore(Kernel::HLERequestContext& ctx) {
|
||||
void GetCore(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_BTM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
@@ -307,7 +307,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void GetCore(Kernel::HLERequestContext& ctx) {
|
||||
void GetCore(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_BTM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
|
||||
@@ -9,10 +9,6 @@ namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace Service::Capture {
|
||||
|
||||
class CAPS_A final : public ServiceFramework<CAPS_A> {
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/caps/caps_c.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
|
||||
namespace Service::Capture {
|
||||
|
||||
@@ -74,7 +74,7 @@ CAPS_C::CAPS_C(Core::System& system_) : ServiceFramework{system_, "caps:c"} {
|
||||
|
||||
CAPS_C::~CAPS_C() = default;
|
||||
|
||||
void CAPS_C::SetShimLibraryVersion(Kernel::HLERequestContext& ctx) {
|
||||
void CAPS_C::SetShimLibraryVersion(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto library_version{rp.Pop<u64>()};
|
||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
||||
|
||||
@@ -9,10 +9,6 @@ namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace Service::Capture {
|
||||
|
||||
class CAPS_C final : public ServiceFramework<CAPS_C> {
|
||||
@@ -21,7 +17,7 @@ public:
|
||||
~CAPS_C() override;
|
||||
|
||||
private:
|
||||
void SetShimLibraryVersion(Kernel::HLERequestContext& ctx);
|
||||
void SetShimLibraryVersion(HLERequestContext& ctx);
|
||||
};
|
||||
|
||||
} // namespace Service::Capture
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/caps/caps_su.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
|
||||
namespace Service::Capture {
|
||||
|
||||
@@ -23,7 +23,7 @@ CAPS_SU::CAPS_SU(Core::System& system_) : ServiceFramework{system_, "caps:su"} {
|
||||
|
||||
CAPS_SU::~CAPS_SU() = default;
|
||||
|
||||
void CAPS_SU::SetShimLibraryVersion(Kernel::HLERequestContext& ctx) {
|
||||
void CAPS_SU::SetShimLibraryVersion(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto library_version{rp.Pop<u64>()};
|
||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
||||
|
||||
@@ -9,10 +9,6 @@ namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace Service::Capture {
|
||||
|
||||
class CAPS_SU final : public ServiceFramework<CAPS_SU> {
|
||||
@@ -21,7 +17,7 @@ public:
|
||||
~CAPS_SU() override;
|
||||
|
||||
private:
|
||||
void SetShimLibraryVersion(Kernel::HLERequestContext& ctx);
|
||||
void SetShimLibraryVersion(HLERequestContext& ctx);
|
||||
};
|
||||
|
||||
} // namespace Service::Capture
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/caps/caps.h"
|
||||
#include "core/hle/service/caps/caps_u.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
|
||||
namespace Service::Capture {
|
||||
|
||||
@@ -52,7 +52,7 @@ CAPS_U::CAPS_U(Core::System& system_) : ServiceFramework{system_, "caps:u"} {
|
||||
|
||||
CAPS_U::~CAPS_U() = default;
|
||||
|
||||
void CAPS_U::SetShimLibraryVersion(Kernel::HLERequestContext& ctx) {
|
||||
void CAPS_U::SetShimLibraryVersion(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto library_version{rp.Pop<u64>()};
|
||||
const auto applet_resource_user_id{rp.Pop<u64>()};
|
||||
@@ -64,7 +64,7 @@ void CAPS_U::SetShimLibraryVersion(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void CAPS_U::GetAlbumContentsFileListForApplication(Kernel::HLERequestContext& ctx) {
|
||||
void CAPS_U::GetAlbumContentsFileListForApplication(HLERequestContext& ctx) {
|
||||
// Takes a type-0x6 output buffer containing an array of ApplicationAlbumFileEntry, a PID, an
|
||||
// u8 ContentType, two s64s, and an u64 AppletResourceUserId. Returns an output u64 for total
|
||||
// output entries (which is copied to a s32 by official SW).
|
||||
@@ -93,7 +93,7 @@ void CAPS_U::GetAlbumContentsFileListForApplication(Kernel::HLERequestContext& c
|
||||
rb.Push(total_entries_2);
|
||||
}
|
||||
|
||||
void CAPS_U::GetAlbumFileList3AaeAruid(Kernel::HLERequestContext& ctx) {
|
||||
void CAPS_U::GetAlbumFileList3AaeAruid(HLERequestContext& ctx) {
|
||||
GetAlbumContentsFileListForApplication(ctx);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,10 +9,6 @@ namespace Core {
|
||||
class System;
|
||||
}
|
||||
|
||||
namespace Kernel {
|
||||
class HLERequestContext;
|
||||
}
|
||||
|
||||
namespace Service::Capture {
|
||||
|
||||
class CAPS_U final : public ServiceFramework<CAPS_U> {
|
||||
@@ -21,9 +17,9 @@ public:
|
||||
~CAPS_U() override;
|
||||
|
||||
private:
|
||||
void SetShimLibraryVersion(Kernel::HLERequestContext& ctx);
|
||||
void GetAlbumContentsFileListForApplication(Kernel::HLERequestContext& ctx);
|
||||
void GetAlbumFileList3AaeAruid(Kernel::HLERequestContext& ctx);
|
||||
void SetShimLibraryVersion(HLERequestContext& ctx);
|
||||
void GetAlbumContentsFileListForApplication(HLERequestContext& ctx);
|
||||
void GetAlbumFileList3AaeAruid(HLERequestContext& ctx);
|
||||
};
|
||||
|
||||
} // namespace Service::Capture
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "core/crypto/key_manager.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/es/es.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/server_manager.h"
|
||||
#include "core/hle/service/service.h"
|
||||
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
bool CheckRightsId(Kernel::HLERequestContext& ctx, const u128& rights_id) {
|
||||
bool CheckRightsId(HLERequestContext& ctx, const u128& rights_id) {
|
||||
if (rights_id == u128{}) {
|
||||
LOG_ERROR(Service_ETicket, "The rights ID was invalid!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
@@ -121,7 +121,7 @@ private:
|
||||
return true;
|
||||
}
|
||||
|
||||
void ImportTicket(Kernel::HLERequestContext& ctx) {
|
||||
void ImportTicket(HLERequestContext& ctx) {
|
||||
const auto ticket = ctx.ReadBuffer();
|
||||
[[maybe_unused]] const auto cert = ctx.ReadBuffer(1);
|
||||
|
||||
@@ -146,7 +146,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void GetTitleKey(Kernel::HLERequestContext& ctx) {
|
||||
void GetTitleKey(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto rights_id = rp.PopRaw<u128>();
|
||||
|
||||
@@ -172,7 +172,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void CountCommonTicket(Kernel::HLERequestContext& ctx) {
|
||||
void CountCommonTicket(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ETicket, "called");
|
||||
|
||||
const u32 count = static_cast<u32>(keys.GetCommonTickets().size());
|
||||
@@ -182,7 +182,7 @@ private:
|
||||
rb.Push<u32>(count);
|
||||
}
|
||||
|
||||
void CountPersonalizedTicket(Kernel::HLERequestContext& ctx) {
|
||||
void CountPersonalizedTicket(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ETicket, "called");
|
||||
|
||||
const u32 count = static_cast<u32>(keys.GetPersonalizedTickets().size());
|
||||
@@ -192,7 +192,7 @@ private:
|
||||
rb.Push<u32>(count);
|
||||
}
|
||||
|
||||
void ListCommonTicketRightsIds(Kernel::HLERequestContext& ctx) {
|
||||
void ListCommonTicketRightsIds(HLERequestContext& ctx) {
|
||||
size_t out_entries = 0;
|
||||
if (!keys.GetCommonTickets().empty()) {
|
||||
out_entries = ctx.GetWriteBufferNumElements<u128>();
|
||||
@@ -213,7 +213,7 @@ private:
|
||||
rb.Push<u32>(static_cast<u32>(out_entries));
|
||||
}
|
||||
|
||||
void ListPersonalizedTicketRightsIds(Kernel::HLERequestContext& ctx) {
|
||||
void ListPersonalizedTicketRightsIds(HLERequestContext& ctx) {
|
||||
size_t out_entries = 0;
|
||||
if (!keys.GetPersonalizedTickets().empty()) {
|
||||
out_entries = ctx.GetWriteBufferNumElements<u128>();
|
||||
@@ -235,7 +235,7 @@ private:
|
||||
rb.Push<u32>(static_cast<u32>(out_entries));
|
||||
}
|
||||
|
||||
void GetCommonTicketSize(Kernel::HLERequestContext& ctx) {
|
||||
void GetCommonTicketSize(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto rights_id = rp.PopRaw<u128>();
|
||||
|
||||
@@ -251,7 +251,7 @@ private:
|
||||
rb.Push<u64>(ticket.GetSize());
|
||||
}
|
||||
|
||||
void GetPersonalizedTicketSize(Kernel::HLERequestContext& ctx) {
|
||||
void GetPersonalizedTicketSize(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto rights_id = rp.PopRaw<u128>();
|
||||
|
||||
@@ -267,7 +267,7 @@ private:
|
||||
rb.Push<u64>(ticket.GetSize());
|
||||
}
|
||||
|
||||
void GetCommonTicketData(Kernel::HLERequestContext& ctx) {
|
||||
void GetCommonTicketData(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto rights_id = rp.PopRaw<u128>();
|
||||
|
||||
@@ -286,7 +286,7 @@ private:
|
||||
rb.Push<u64>(write_size);
|
||||
}
|
||||
|
||||
void GetPersonalizedTicketData(Kernel::HLERequestContext& ctx) {
|
||||
void GetPersonalizedTicketData(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto rights_id = rp.PopRaw<u128>();
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
#include "common/scm_rev.h"
|
||||
#include "common/swap.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/fatal/fatal.h"
|
||||
#include "core/hle/service/fatal/fatal_p.h"
|
||||
#include "core/hle/service/fatal/fatal_u.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/server_manager.h"
|
||||
#include "core/reporter.h"
|
||||
|
||||
@@ -126,7 +126,7 @@ static void ThrowFatalError(Core::System& system, Result error_code, FatalType f
|
||||
}
|
||||
}
|
||||
|
||||
void Module::Interface::ThrowFatal(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::ThrowFatal(HLERequestContext& ctx) {
|
||||
LOG_ERROR(Service_Fatal, "called");
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto error_code = rp.Pop<Result>();
|
||||
@@ -136,7 +136,7 @@ void Module::Interface::ThrowFatal(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Module::Interface::ThrowFatalWithPolicy(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::ThrowFatalWithPolicy(HLERequestContext& ctx) {
|
||||
LOG_ERROR(Service_Fatal, "called");
|
||||
IPC::RequestParser rp(ctx);
|
||||
const auto error_code = rp.Pop<Result>();
|
||||
@@ -148,7 +148,7 @@ void Module::Interface::ThrowFatalWithPolicy(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Module::Interface::ThrowFatalWithCpuContext(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::ThrowFatalWithCpuContext(HLERequestContext& ctx) {
|
||||
LOG_ERROR(Service_Fatal, "called");
|
||||
IPC::RequestParser rp(ctx);
|
||||
const auto error_code = rp.Pop<Result>();
|
||||
|
||||
@@ -19,9 +19,9 @@ public:
|
||||
const char* name);
|
||||
~Interface() override;
|
||||
|
||||
void ThrowFatal(Kernel::HLERequestContext& ctx);
|
||||
void ThrowFatalWithPolicy(Kernel::HLERequestContext& ctx);
|
||||
void ThrowFatalWithCpuContext(Kernel::HLERequestContext& ctx);
|
||||
void ThrowFatal(HLERequestContext& ctx);
|
||||
void ThrowFatalWithPolicy(HLERequestContext& ctx);
|
||||
void ThrowFatalWithCpuContext(HLERequestContext& ctx);
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Module> module;
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/fgm/fgm.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/server_manager.h"
|
||||
#include "core/hle/service/service.h"
|
||||
#include "core/hle/service/sm/sm.h"
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void Initialize(Kernel::HLERequestContext& ctx) {
|
||||
void Initialize(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_FGM, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
|
||||
@@ -24,9 +24,9 @@
|
||||
#include "core/file_sys/savedata_factory.h"
|
||||
#include "core/file_sys/system_archive/system_archive.h"
|
||||
#include "core/file_sys/vfs.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/service/filesystem/filesystem.h"
|
||||
#include "core/hle/service/filesystem/fsp_srv.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/reporter.h"
|
||||
|
||||
namespace Service::FileSystem {
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
private:
|
||||
FileSys::VirtualFile backend;
|
||||
|
||||
void Read(Kernel::HLERequestContext& ctx) {
|
||||
void Read(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const s64 offset = rp.Pop<s64>();
|
||||
const s64 length = rp.Pop<s64>();
|
||||
@@ -102,7 +102,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void GetSize(Kernel::HLERequestContext& ctx) {
|
||||
void GetSize(HLERequestContext& ctx) {
|
||||
const u64 size = backend->GetSize();
|
||||
LOG_DEBUG(Service_FS, "called, size={}", size);
|
||||
|
||||
@@ -131,7 +131,7 @@ public:
|
||||
private:
|
||||
FileSys::VirtualFile backend;
|
||||
|
||||
void Read(Kernel::HLERequestContext& ctx) {
|
||||
void Read(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const u64 option = rp.Pop<u64>();
|
||||
const s64 offset = rp.Pop<s64>();
|
||||
@@ -165,7 +165,7 @@ private:
|
||||
rb.Push(static_cast<u64>(output.size()));
|
||||
}
|
||||
|
||||
void Write(Kernel::HLERequestContext& ctx) {
|
||||
void Write(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const u64 option = rp.Pop<u64>();
|
||||
const s64 offset = rp.Pop<s64>();
|
||||
@@ -208,7 +208,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Flush(Kernel::HLERequestContext& ctx) {
|
||||
void Flush(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_FS, "called");
|
||||
|
||||
// Exists for SDK compatibiltity -- No need to flush file.
|
||||
@@ -217,7 +217,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void SetSize(Kernel::HLERequestContext& ctx) {
|
||||
void SetSize(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const u64 size = rp.Pop<u64>();
|
||||
LOG_DEBUG(Service_FS, "called, size={}", size);
|
||||
@@ -228,7 +228,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void GetSize(Kernel::HLERequestContext& ctx) {
|
||||
void GetSize(HLERequestContext& ctx) {
|
||||
const u64 size = backend->GetSize();
|
||||
LOG_DEBUG(Service_FS, "called, size={}", size);
|
||||
|
||||
@@ -270,7 +270,7 @@ private:
|
||||
std::vector<FileSys::Entry> entries;
|
||||
u64 next_entry_index = 0;
|
||||
|
||||
void Read(Kernel::HLERequestContext& ctx) {
|
||||
void Read(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_FS, "called.");
|
||||
|
||||
// Calculate how many entries we can fit in the output buffer
|
||||
@@ -294,7 +294,7 @@ private:
|
||||
rb.Push(actual_entries);
|
||||
}
|
||||
|
||||
void GetEntryCount(Kernel::HLERequestContext& ctx) {
|
||||
void GetEntryCount(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_FS, "called");
|
||||
|
||||
u64 count = entries.size() - next_entry_index;
|
||||
@@ -331,7 +331,7 @@ public:
|
||||
RegisterHandlers(functions);
|
||||
}
|
||||
|
||||
void CreateFile(Kernel::HLERequestContext& ctx) {
|
||||
void CreateFile(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto file_buffer = ctx.ReadBuffer();
|
||||
@@ -347,7 +347,7 @@ public:
|
||||
rb.Push(backend.CreateFile(name, file_size));
|
||||
}
|
||||
|
||||
void DeleteFile(Kernel::HLERequestContext& ctx) {
|
||||
void DeleteFile(HLERequestContext& ctx) {
|
||||
const auto file_buffer = ctx.ReadBuffer();
|
||||
const std::string name = Common::StringFromBuffer(file_buffer);
|
||||
|
||||
@@ -357,7 +357,7 @@ public:
|
||||
rb.Push(backend.DeleteFile(name));
|
||||
}
|
||||
|
||||
void CreateDirectory(Kernel::HLERequestContext& ctx) {
|
||||
void CreateDirectory(HLERequestContext& ctx) {
|
||||
const auto file_buffer = ctx.ReadBuffer();
|
||||
const std::string name = Common::StringFromBuffer(file_buffer);
|
||||
|
||||
@@ -367,7 +367,7 @@ public:
|
||||
rb.Push(backend.CreateDirectory(name));
|
||||
}
|
||||
|
||||
void DeleteDirectory(Kernel::HLERequestContext& ctx) {
|
||||
void DeleteDirectory(HLERequestContext& ctx) {
|
||||
const auto file_buffer = ctx.ReadBuffer();
|
||||
const std::string name = Common::StringFromBuffer(file_buffer);
|
||||
|
||||
@@ -377,7 +377,7 @@ public:
|
||||
rb.Push(backend.DeleteDirectory(name));
|
||||
}
|
||||
|
||||
void DeleteDirectoryRecursively(Kernel::HLERequestContext& ctx) {
|
||||
void DeleteDirectoryRecursively(HLERequestContext& ctx) {
|
||||
const auto file_buffer = ctx.ReadBuffer();
|
||||
const std::string name = Common::StringFromBuffer(file_buffer);
|
||||
|
||||
@@ -387,7 +387,7 @@ public:
|
||||
rb.Push(backend.DeleteDirectoryRecursively(name));
|
||||
}
|
||||
|
||||
void CleanDirectoryRecursively(Kernel::HLERequestContext& ctx) {
|
||||
void CleanDirectoryRecursively(HLERequestContext& ctx) {
|
||||
const auto file_buffer = ctx.ReadBuffer();
|
||||
const std::string name = Common::StringFromBuffer(file_buffer);
|
||||
|
||||
@@ -397,7 +397,7 @@ public:
|
||||
rb.Push(backend.CleanDirectoryRecursively(name));
|
||||
}
|
||||
|
||||
void RenameFile(Kernel::HLERequestContext& ctx) {
|
||||
void RenameFile(HLERequestContext& ctx) {
|
||||
const std::string src_name = Common::StringFromBuffer(ctx.ReadBuffer(0));
|
||||
const std::string dst_name = Common::StringFromBuffer(ctx.ReadBuffer(1));
|
||||
|
||||
@@ -407,7 +407,7 @@ public:
|
||||
rb.Push(backend.RenameFile(src_name, dst_name));
|
||||
}
|
||||
|
||||
void OpenFile(Kernel::HLERequestContext& ctx) {
|
||||
void OpenFile(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto file_buffer = ctx.ReadBuffer();
|
||||
@@ -431,7 +431,7 @@ public:
|
||||
rb.PushIpcInterface<IFile>(std::move(file));
|
||||
}
|
||||
|
||||
void OpenDirectory(Kernel::HLERequestContext& ctx) {
|
||||
void OpenDirectory(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto file_buffer = ctx.ReadBuffer();
|
||||
@@ -456,7 +456,7 @@ public:
|
||||
rb.PushIpcInterface<IDirectory>(std::move(directory));
|
||||
}
|
||||
|
||||
void GetEntryType(Kernel::HLERequestContext& ctx) {
|
||||
void GetEntryType(HLERequestContext& ctx) {
|
||||
const auto file_buffer = ctx.ReadBuffer();
|
||||
const std::string name = Common::StringFromBuffer(file_buffer);
|
||||
|
||||
@@ -474,14 +474,14 @@ public:
|
||||
rb.Push<u32>(static_cast<u32>(*result));
|
||||
}
|
||||
|
||||
void Commit(Kernel::HLERequestContext& ctx) {
|
||||
void Commit(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_FS, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void GetFreeSpaceSize(Kernel::HLERequestContext& ctx) {
|
||||
void GetFreeSpaceSize(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_FS, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
@@ -489,7 +489,7 @@ public:
|
||||
rb.Push(size.get_free_size());
|
||||
}
|
||||
|
||||
void GetTotalSpaceSize(Kernel::HLERequestContext& ctx) {
|
||||
void GetTotalSpaceSize(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_FS, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
@@ -497,7 +497,7 @@ public:
|
||||
rb.Push(size.get_total_size());
|
||||
}
|
||||
|
||||
void GetFileTimeStampRaw(Kernel::HLERequestContext& ctx) {
|
||||
void GetFileTimeStampRaw(HLERequestContext& ctx) {
|
||||
const auto file_buffer = ctx.ReadBuffer();
|
||||
const std::string name = Common::StringFromBuffer(file_buffer);
|
||||
|
||||
@@ -533,7 +533,7 @@ public:
|
||||
FindAllSaves(space);
|
||||
}
|
||||
|
||||
void ReadSaveDataInfo(Kernel::HLERequestContext& ctx) {
|
||||
void ReadSaveDataInfo(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_FS, "called");
|
||||
|
||||
// Calculate how many entries we can fit in the output buffer
|
||||
@@ -811,7 +811,7 @@ FSP_SRV::FSP_SRV(Core::System& system_)
|
||||
|
||||
FSP_SRV::~FSP_SRV() = default;
|
||||
|
||||
void FSP_SRV::SetCurrentProcess(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::SetCurrentProcess(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
current_process_id = rp.Pop<u64>();
|
||||
|
||||
@@ -821,7 +821,7 @@ void FSP_SRV::SetCurrentProcess(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void FSP_SRV::OpenFileSystemWithPatch(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::OpenFileSystemWithPatch(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto type = rp.PopRaw<FileSystemType>();
|
||||
@@ -832,7 +832,7 @@ void FSP_SRV::OpenFileSystemWithPatch(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultUnknown);
|
||||
}
|
||||
|
||||
void FSP_SRV::OpenSdCardFileSystem(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::OpenSdCardFileSystem(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_FS, "called");
|
||||
|
||||
auto filesystem =
|
||||
@@ -844,7 +844,7 @@ void FSP_SRV::OpenSdCardFileSystem(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface<IFileSystem>(std::move(filesystem));
|
||||
}
|
||||
|
||||
void FSP_SRV::CreateSaveDataFileSystem(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::CreateSaveDataFileSystem(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
auto save_struct = rp.PopRaw<FileSys::SaveDataAttribute>();
|
||||
@@ -860,7 +860,7 @@ void FSP_SRV::CreateSaveDataFileSystem(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::OpenSaveDataFileSystem(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
struct Parameters {
|
||||
@@ -905,12 +905,12 @@ void FSP_SRV::OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface<IFileSystem>(std::move(filesystem));
|
||||
}
|
||||
|
||||
void FSP_SRV::OpenReadOnlySaveDataFileSystem(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::OpenReadOnlySaveDataFileSystem(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_FS, "(STUBBED) called, delegating to 51 OpenSaveDataFilesystem");
|
||||
OpenSaveDataFileSystem(ctx);
|
||||
}
|
||||
|
||||
void FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto space = rp.PopRaw<FileSys::SaveDataSpaceId>();
|
||||
LOG_INFO(Service_FS, "called, space={}", space);
|
||||
@@ -921,15 +921,14 @@ void FSP_SRV::OpenSaveDataInfoReaderBySaveDataSpaceId(Kernel::HLERequestContext&
|
||||
std::make_shared<ISaveDataInfoReader>(system, space, fsc));
|
||||
}
|
||||
|
||||
void FSP_SRV::WriteSaveDataFileSystemExtraDataBySaveDataAttribute(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::WriteSaveDataFileSystemExtraDataBySaveDataAttribute(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_FS, "(STUBBED) called.");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute(
|
||||
Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
struct Parameters {
|
||||
@@ -955,7 +954,7 @@ void FSP_SRV::ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute(
|
||||
rb.Push(flags);
|
||||
}
|
||||
|
||||
void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::OpenDataStorageByCurrentProcess(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_FS, "called");
|
||||
|
||||
auto current_romfs = fsc.OpenRomFSCurrentProcess();
|
||||
@@ -974,7 +973,7 @@ void FSP_SRV::OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface<IStorage>(std::move(storage));
|
||||
}
|
||||
|
||||
void FSP_SRV::OpenDataStorageByDataId(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::OpenDataStorageByDataId(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto storage_id = rp.PopRaw<FileSys::StorageId>();
|
||||
const auto unknown = rp.PopRaw<u32>();
|
||||
@@ -1014,7 +1013,7 @@ void FSP_SRV::OpenDataStorageByDataId(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface<IStorage>(std::move(storage));
|
||||
}
|
||||
|
||||
void FSP_SRV::OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::OpenPatchDataStorageByCurrentProcess(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto storage_id = rp.PopRaw<FileSys::StorageId>();
|
||||
@@ -1026,7 +1025,7 @@ void FSP_SRV::OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ct
|
||||
rb.Push(FileSys::ERROR_ENTITY_NOT_FOUND);
|
||||
}
|
||||
|
||||
void FSP_SRV::OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::OpenDataStorageWithProgramIndex(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
|
||||
const auto program_index = rp.PopRaw<u8>();
|
||||
@@ -1053,7 +1052,7 @@ void FSP_SRV::OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface<IStorage>(std::move(storage));
|
||||
}
|
||||
|
||||
void FSP_SRV::DisableAutoSaveDataCreation(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::DisableAutoSaveDataCreation(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_FS, "called");
|
||||
|
||||
fsc.SetAutoSaveDataCreation(false);
|
||||
@@ -1062,7 +1061,7 @@ void FSP_SRV::DisableAutoSaveDataCreation(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::SetGlobalAccessLogMode(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
access_log_mode = rp.PopEnum<AccessLogMode>();
|
||||
|
||||
@@ -1072,7 +1071,7 @@ void FSP_SRV::SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::GetGlobalAccessLogMode(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_FS, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 3};
|
||||
@@ -1080,7 +1079,7 @@ void FSP_SRV::GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushEnum(access_log_mode);
|
||||
}
|
||||
|
||||
void FSP_SRV::OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::OutputAccessLogToSdCard(HLERequestContext& ctx) {
|
||||
const auto raw = ctx.ReadBufferCopy();
|
||||
auto log = Common::StringFromFixedZeroTerminatedBuffer(
|
||||
reinterpret_cast<const char*>(raw.data()), raw.size());
|
||||
@@ -1093,7 +1092,7 @@ void FSP_SRV::OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void FSP_SRV::GetProgramIndexForAccessLog(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::GetProgramIndexForAccessLog(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_FS, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 4};
|
||||
@@ -1102,7 +1101,7 @@ void FSP_SRV::GetProgramIndexForAccessLog(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(access_log_program_index);
|
||||
}
|
||||
|
||||
void FSP_SRV::GetCacheStorageSize(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::GetCacheStorageSize(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto index{rp.Pop<s32>()};
|
||||
|
||||
@@ -1128,14 +1127,14 @@ public:
|
||||
private:
|
||||
FileSys::VirtualFile backend;
|
||||
|
||||
void Add(Kernel::HLERequestContext& ctx) {
|
||||
void Add(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_FS, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Commit(Kernel::HLERequestContext& ctx) {
|
||||
void Commit(HLERequestContext& ctx) {
|
||||
LOG_WARNING(Service_FS, "(STUBBED) called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
@@ -1143,7 +1142,7 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
void FSP_SRV::OpenMultiCommitManager(Kernel::HLERequestContext& ctx) {
|
||||
void FSP_SRV::OpenMultiCommitManager(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_FS, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
|
||||
@@ -35,26 +35,26 @@ public:
|
||||
~FSP_SRV() override;
|
||||
|
||||
private:
|
||||
void SetCurrentProcess(Kernel::HLERequestContext& ctx);
|
||||
void OpenFileSystemWithPatch(Kernel::HLERequestContext& ctx);
|
||||
void OpenSdCardFileSystem(Kernel::HLERequestContext& ctx);
|
||||
void CreateSaveDataFileSystem(Kernel::HLERequestContext& ctx);
|
||||
void OpenSaveDataFileSystem(Kernel::HLERequestContext& ctx);
|
||||
void OpenReadOnlySaveDataFileSystem(Kernel::HLERequestContext& ctx);
|
||||
void OpenSaveDataInfoReaderBySaveDataSpaceId(Kernel::HLERequestContext& ctx);
|
||||
void WriteSaveDataFileSystemExtraDataBySaveDataAttribute(Kernel::HLERequestContext& ctx);
|
||||
void ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute(Kernel::HLERequestContext& ctx);
|
||||
void OpenDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx);
|
||||
void OpenDataStorageByDataId(Kernel::HLERequestContext& ctx);
|
||||
void OpenPatchDataStorageByCurrentProcess(Kernel::HLERequestContext& ctx);
|
||||
void OpenDataStorageWithProgramIndex(Kernel::HLERequestContext& ctx);
|
||||
void DisableAutoSaveDataCreation(Kernel::HLERequestContext& ctx);
|
||||
void SetGlobalAccessLogMode(Kernel::HLERequestContext& ctx);
|
||||
void GetGlobalAccessLogMode(Kernel::HLERequestContext& ctx);
|
||||
void OutputAccessLogToSdCard(Kernel::HLERequestContext& ctx);
|
||||
void GetProgramIndexForAccessLog(Kernel::HLERequestContext& ctx);
|
||||
void OpenMultiCommitManager(Kernel::HLERequestContext& ctx);
|
||||
void GetCacheStorageSize(Kernel::HLERequestContext& ctx);
|
||||
void SetCurrentProcess(HLERequestContext& ctx);
|
||||
void OpenFileSystemWithPatch(HLERequestContext& ctx);
|
||||
void OpenSdCardFileSystem(HLERequestContext& ctx);
|
||||
void CreateSaveDataFileSystem(HLERequestContext& ctx);
|
||||
void OpenSaveDataFileSystem(HLERequestContext& ctx);
|
||||
void OpenReadOnlySaveDataFileSystem(HLERequestContext& ctx);
|
||||
void OpenSaveDataInfoReaderBySaveDataSpaceId(HLERequestContext& ctx);
|
||||
void WriteSaveDataFileSystemExtraDataBySaveDataAttribute(HLERequestContext& ctx);
|
||||
void ReadSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute(HLERequestContext& ctx);
|
||||
void OpenDataStorageByCurrentProcess(HLERequestContext& ctx);
|
||||
void OpenDataStorageByDataId(HLERequestContext& ctx);
|
||||
void OpenPatchDataStorageByCurrentProcess(HLERequestContext& ctx);
|
||||
void OpenDataStorageWithProgramIndex(HLERequestContext& ctx);
|
||||
void DisableAutoSaveDataCreation(HLERequestContext& ctx);
|
||||
void SetGlobalAccessLogMode(HLERequestContext& ctx);
|
||||
void GetGlobalAccessLogMode(HLERequestContext& ctx);
|
||||
void OutputAccessLogToSdCard(HLERequestContext& ctx);
|
||||
void GetProgramIndexForAccessLog(HLERequestContext& ctx);
|
||||
void OpenMultiCommitManager(HLERequestContext& ctx);
|
||||
void GetCacheStorageSize(HLERequestContext& ctx);
|
||||
|
||||
FileSystemController& fsc;
|
||||
const FileSys::ContentProvider& content_provider;
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "core/hle/result.h"
|
||||
|
||||
namespace Service::Friend {
|
||||
|
||||
constexpr Result ERR_NO_NOTIFICATIONS{ErrorModule::Account, 15};
|
||||
}
|
||||
@@ -5,11 +5,11 @@
|
||||
#include "common/logging/log.h"
|
||||
#include "common/uuid.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_event.h"
|
||||
#include "core/hle/service/friend/errors.h"
|
||||
#include "core/hle/service/acc/errors.h"
|
||||
#include "core/hle/service/friend/friend.h"
|
||||
#include "core/hle/service/friend/friend_interface.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
#include "core/hle/service/kernel_helpers.h"
|
||||
#include "core/hle/service/server_manager.h"
|
||||
|
||||
@@ -136,7 +136,7 @@ private:
|
||||
};
|
||||
static_assert(sizeof(SizedFriendFilter) == 0x10, "SizedFriendFilter is an invalid size");
|
||||
|
||||
void GetCompletionEvent(Kernel::HLERequestContext& ctx) {
|
||||
void GetCompletionEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Friend, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -144,7 +144,7 @@ private:
|
||||
rb.PushCopyObjects(completion_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void GetBlockedUserListIds(Kernel::HLERequestContext& ctx) {
|
||||
void GetBlockedUserListIds(HLERequestContext& ctx) {
|
||||
// This is safe to stub, as there should be no adverse consequences from reporting no
|
||||
// blocked users.
|
||||
LOG_WARNING(Service_Friend, "(STUBBED) called");
|
||||
@@ -153,21 +153,21 @@ private:
|
||||
rb.Push<u32>(0); // Indicates there are no blocked users
|
||||
}
|
||||
|
||||
void DeclareCloseOnlinePlaySession(Kernel::HLERequestContext& ctx) {
|
||||
void DeclareCloseOnlinePlaySession(HLERequestContext& ctx) {
|
||||
// Stub used by Splatoon 2
|
||||
LOG_WARNING(Service_Friend, "(STUBBED) called");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void UpdateUserPresence(Kernel::HLERequestContext& ctx) {
|
||||
void UpdateUserPresence(HLERequestContext& ctx) {
|
||||
// Stub used by Retro City Rampage
|
||||
LOG_WARNING(Service_Friend, "(STUBBED) called");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void GetPlayHistoryRegistrationKey(Kernel::HLERequestContext& ctx) {
|
||||
void GetPlayHistoryRegistrationKey(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto local_play = rp.Pop<bool>();
|
||||
const auto uuid = rp.PopRaw<Common::UUID>();
|
||||
@@ -179,7 +179,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void GetFriendList(Kernel::HLERequestContext& ctx) {
|
||||
void GetFriendList(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto friend_offset = rp.Pop<u32>();
|
||||
const auto uuid = rp.PopRaw<Common::UUID>();
|
||||
@@ -195,7 +195,7 @@ private:
|
||||
// TODO(ogniK): Return a buffer of u64s which are the "NetworkServiceAccountId"
|
||||
}
|
||||
|
||||
void CheckFriendListAvailability(Kernel::HLERequestContext& ctx) {
|
||||
void CheckFriendListAvailability(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto uuid{rp.PopRaw<Common::UUID>()};
|
||||
|
||||
@@ -234,7 +234,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void GetEvent(Kernel::HLERequestContext& ctx) {
|
||||
void GetEvent(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Friend, "called");
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2, 1};
|
||||
@@ -242,7 +242,7 @@ private:
|
||||
rb.PushCopyObjects(notification_event->GetReadableEvent());
|
||||
}
|
||||
|
||||
void Clear(Kernel::HLERequestContext& ctx) {
|
||||
void Clear(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Friend, "called");
|
||||
while (!notifications.empty()) {
|
||||
notifications.pop();
|
||||
@@ -253,13 +253,13 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void Pop(Kernel::HLERequestContext& ctx) {
|
||||
void Pop(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_Friend, "called");
|
||||
|
||||
if (notifications.empty()) {
|
||||
LOG_ERROR(Service_Friend, "No notifications in queue!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_NO_NOTIFICATIONS);
|
||||
rb.Push(Account::ResultNoNotifications);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -312,14 +312,14 @@ private:
|
||||
States states{};
|
||||
};
|
||||
|
||||
void Module::Interface::CreateFriendService(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::CreateFriendService(HLERequestContext& ctx) {
|
||||
IPC::ResponseBuilder rb{ctx, 2, 0, 1};
|
||||
rb.Push(ResultSuccess);
|
||||
rb.PushIpcInterface<IFriendService>(system);
|
||||
LOG_DEBUG(Service_Friend, "called");
|
||||
}
|
||||
|
||||
void Module::Interface::CreateNotificationService(Kernel::HLERequestContext& ctx) {
|
||||
void Module::Interface::CreateNotificationService(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
auto uuid = rp.PopRaw<Common::UUID>();
|
||||
|
||||
|
||||
@@ -19,8 +19,8 @@ public:
|
||||
const char* name);
|
||||
~Interface() override;
|
||||
|
||||
void CreateFriendService(Kernel::HLERequestContext& ctx);
|
||||
void CreateNotificationService(Kernel::HLERequestContext& ctx);
|
||||
void CreateFriendService(HLERequestContext& ctx);
|
||||
void CreateNotificationService(HLERequestContext& ctx);
|
||||
|
||||
protected:
|
||||
std::shared_ptr<Module> module;
|
||||
|
||||
@@ -5,12 +5,12 @@
|
||||
|
||||
#include "common/logging/log.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/ipc_helpers.h"
|
||||
#include "core/hle/kernel/k_process.h"
|
||||
#include "core/hle/kernel/kernel.h"
|
||||
#include "core/hle/service/glue/arp.h"
|
||||
#include "core/hle/service/glue/errors.h"
|
||||
#include "core/hle/service/glue/glue_manager.h"
|
||||
#include "core/hle/service/ipc_helpers.h"
|
||||
|
||||
namespace Service::Glue {
|
||||
|
||||
@@ -51,7 +51,7 @@ ARP_R::ARP_R(Core::System& system_, const ARPManager& manager_)
|
||||
|
||||
ARP_R::~ARP_R() = default;
|
||||
|
||||
void ARP_R::GetApplicationLaunchProperty(Kernel::HLERequestContext& ctx) {
|
||||
void ARP_R::GetApplicationLaunchProperty(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto process_id = rp.PopRaw<u64>();
|
||||
|
||||
@@ -61,7 +61,7 @@ void ARP_R::GetApplicationLaunchProperty(Kernel::HLERequestContext& ctx) {
|
||||
if (!title_id.has_value()) {
|
||||
LOG_ERROR(Service_ARP, "Failed to get title ID for process ID!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_NOT_REGISTERED);
|
||||
rb.Push(Glue::ResultProcessIdNotRegistered);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ void ARP_R::GetApplicationLaunchProperty(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushRaw(*res);
|
||||
}
|
||||
|
||||
void ARP_R::GetApplicationLaunchPropertyWithApplicationId(Kernel::HLERequestContext& ctx) {
|
||||
void ARP_R::GetApplicationLaunchPropertyWithApplicationId(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto title_id = rp.PopRaw<u64>();
|
||||
|
||||
@@ -99,7 +99,7 @@ void ARP_R::GetApplicationLaunchPropertyWithApplicationId(Kernel::HLERequestCont
|
||||
rb.PushRaw(*res);
|
||||
}
|
||||
|
||||
void ARP_R::GetApplicationControlProperty(Kernel::HLERequestContext& ctx) {
|
||||
void ARP_R::GetApplicationControlProperty(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto process_id = rp.PopRaw<u64>();
|
||||
|
||||
@@ -109,7 +109,7 @@ void ARP_R::GetApplicationControlProperty(Kernel::HLERequestContext& ctx) {
|
||||
if (!title_id.has_value()) {
|
||||
LOG_ERROR(Service_ARP, "Failed to get title ID for process ID!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_NOT_REGISTERED);
|
||||
rb.Push(Glue::ResultProcessIdNotRegistered);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ void ARP_R::GetApplicationControlProperty(Kernel::HLERequestContext& ctx) {
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void ARP_R::GetApplicationControlPropertyWithApplicationId(Kernel::HLERequestContext& ctx) {
|
||||
void ARP_R::GetApplicationControlPropertyWithApplicationId(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto title_id = rp.PopRaw<u64>();
|
||||
|
||||
@@ -169,7 +169,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
void Issue(Kernel::HLERequestContext& ctx) {
|
||||
void Issue(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto process_id = rp.PopRaw<u64>();
|
||||
|
||||
@@ -178,7 +178,7 @@ private:
|
||||
if (process_id == 0) {
|
||||
LOG_ERROR(Service_ARP, "Must have non-zero process ID!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_INVALID_PROCESS_ID);
|
||||
rb.Push(Glue::ResultInvalidProcessId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -186,7 +186,7 @@ private:
|
||||
LOG_ERROR(Service_ARP,
|
||||
"Attempted to issue registrar, but registrar is already issued!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_INVALID_ACCESS);
|
||||
rb.Push(Glue::ResultAlreadyBound);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -197,7 +197,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void SetApplicationLaunchProperty(Kernel::HLERequestContext& ctx) {
|
||||
void SetApplicationLaunchProperty(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ARP, "called");
|
||||
|
||||
if (issued) {
|
||||
@@ -205,7 +205,7 @@ private:
|
||||
Service_ARP,
|
||||
"Attempted to set application launch property, but registrar is already issued!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_INVALID_ACCESS);
|
||||
rb.Push(Glue::ResultAlreadyBound);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -216,7 +216,7 @@ private:
|
||||
rb.Push(ResultSuccess);
|
||||
}
|
||||
|
||||
void SetApplicationControlProperty(Kernel::HLERequestContext& ctx) {
|
||||
void SetApplicationControlProperty(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ARP, "called");
|
||||
|
||||
if (issued) {
|
||||
@@ -224,7 +224,7 @@ private:
|
||||
Service_ARP,
|
||||
"Attempted to set application control property, but registrar is already issued!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_INVALID_ACCESS);
|
||||
rb.Push(Glue::ResultAlreadyBound);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -256,14 +256,14 @@ ARP_W::ARP_W(Core::System& system_, ARPManager& manager_)
|
||||
|
||||
ARP_W::~ARP_W() = default;
|
||||
|
||||
void ARP_W::AcquireRegistrar(Kernel::HLERequestContext& ctx) {
|
||||
void ARP_W::AcquireRegistrar(HLERequestContext& ctx) {
|
||||
LOG_DEBUG(Service_ARP, "called");
|
||||
|
||||
registrar = std::make_shared<IRegistrar>(
|
||||
system, [this](u64 process_id, ApplicationLaunchProperty launch, std::vector<u8> control) {
|
||||
const auto res = GetTitleIDForProcessID(system, process_id);
|
||||
if (!res.has_value()) {
|
||||
return ERR_NOT_REGISTERED;
|
||||
return Glue::ResultProcessIdNotRegistered;
|
||||
}
|
||||
|
||||
return manager.Register(*res, launch, std::move(control));
|
||||
@@ -274,7 +274,7 @@ void ARP_W::AcquireRegistrar(Kernel::HLERequestContext& ctx) {
|
||||
rb.PushIpcInterface(registrar);
|
||||
}
|
||||
|
||||
void ARP_W::UnregisterApplicationInstance(Kernel::HLERequestContext& ctx) {
|
||||
void ARP_W::UnregisterApplicationInstance(HLERequestContext& ctx) {
|
||||
IPC::RequestParser rp{ctx};
|
||||
const auto process_id = rp.PopRaw<u64>();
|
||||
|
||||
@@ -283,7 +283,7 @@ void ARP_W::UnregisterApplicationInstance(Kernel::HLERequestContext& ctx) {
|
||||
if (process_id == 0) {
|
||||
LOG_ERROR(Service_ARP, "Must have non-zero process ID!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_INVALID_PROCESS_ID);
|
||||
rb.Push(Glue::ResultInvalidProcessId);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -292,7 +292,7 @@ void ARP_W::UnregisterApplicationInstance(Kernel::HLERequestContext& ctx) {
|
||||
if (!title_id.has_value()) {
|
||||
LOG_ERROR(Service_ARP, "No title ID for process ID!");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ERR_NOT_REGISTERED);
|
||||
rb.Push(Glue::ResultProcessIdNotRegistered);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user