From e7ac03c9412bcc977bf1828d5cf2823e6b46ae68 Mon Sep 17 00:00:00 2001 From: Valentin Vanelslande Date: Tue, 27 Mar 2018 14:03:00 -0600 Subject: [PATCH 1/6] Service/APT: Migrate logging macros Macro of line 528 not changed --- src/core/hle/service/apt/apt.cpp | 124 +++++++++++++++---------------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 28f358b4b..6fe71b46a 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -32,8 +32,8 @@ void Module::Interface::Initialize(Kernel::HLERequestContext& ctx) { AppletId app_id = rp.PopEnum(); u32 attributes = rp.Pop(); - LOG_DEBUG(Service_APT, "called app_id=0x%08X, attributes=0x%08X", static_cast(app_id), - attributes); + NGLOG_DEBUG(Service_APT, "called app_id={:#010X}, attributes={:#010X}", static_cast(app_id), + attributes); auto result = apt->applet_manager->Initialize(app_id, attributes); if (result.Failed()) { @@ -197,7 +197,7 @@ void Module::Interface::GetSharedFont(Kernel::HLERequestContext& ctx) { if (apt->LoadSharedFont()) { apt->shared_font_loaded = true; } else if (apt->LoadLegacySharedFont()) { - LOG_WARNING(Service_APT, "Loaded shared font by legacy method"); + NGLOG_WARNING(Service_APT, "Loaded shared font by legacy method"); apt->shared_font_loaded = true; } else { LOG_ERROR(Service_APT, "shared font file missing - go dump it from your 3ds"); @@ -231,7 +231,7 @@ void Module::Interface::NotifyToWait(Kernel::HLERequestContext& ctx) { u32 app_id = rp.Pop(); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - LOG_WARNING(Service_APT, "(STUBBED) app_id=%u", app_id); + NGLOG_WARNING(Service_APT, "(STUBBED) app_id={}", app_id); } void Module::Interface::GetLockHandle(Kernel::HLERequestContext& ctx) { @@ -252,14 +252,14 @@ void Module::Interface::GetLockHandle(Kernel::HLERequestContext& ctx) { rb.Push(0); // Least significant bit = power button state rb.PushCopyObjects(apt->lock); - LOG_WARNING(Service_APT, "(STUBBED) called applet_attributes=0x%08X", applet_attributes); + NGLOG_WARNING(Service_APT, "(STUBBED) called applet_attributes={:#010X}", applet_attributes); } void Module::Interface::Enable(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x3, 1, 0); // 0x30040 u32 attributes = rp.Pop(); - LOG_DEBUG(Service_APT, "called attributes=0x%08X", attributes); + NGLOG_DEBUG(Service_APT, "called attributes={:#010X}", attributes); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(apt->applet_manager->Enable(attributes)); @@ -275,7 +275,7 @@ void Module::Interface::GetAppletManInfo(Kernel::HLERequestContext& ctx) { rb.Push(static_cast(AppletId::HomeMenu)); // Home menu AppID rb.Push(static_cast(AppletId::Application)); // TODO(purpasmart96): Do this correctly - LOG_WARNING(Service_APT, "(STUBBED) called unk=0x%08X", unk); + NGLOG_WARNING(Service_APT, "(STUBBED) called unk={:#010X}", unk); } void Module::Interface::IsRegistered(Kernel::HLERequestContext& ctx) { @@ -285,7 +285,7 @@ void Module::Interface::IsRegistered(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); // No error rb.Push(apt->applet_manager->IsRegistered(app_id)); - LOG_DEBUG(Service_APT, "called app_id=0x%08X", static_cast(app_id)); + NGLOG_DEBUG(Service_APT, "called app_id={:#010X}", static_cast(app_id)); } void Module::Interface::InquireNotification(Kernel::HLERequestContext& ctx) { @@ -294,7 +294,7 @@ void Module::Interface::InquireNotification(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); // No error rb.Push(static_cast(SignalType::None)); // Signal type - LOG_WARNING(Service_APT, "(STUBBED) called app_id=0x%08X", app_id); + NGLOG_WARNING(Service_APT, "(STUBBED) called app_id={:#010X}", app_id); } void Module::Interface::SendParameter(Kernel::HLERequestContext& ctx) { @@ -306,11 +306,11 @@ void Module::Interface::SendParameter(Kernel::HLERequestContext& ctx) { Kernel::SharedPtr object = rp.PopGenericObject(); std::vector buffer = rp.PopStaticBuffer(); - LOG_DEBUG(Service_APT, - "called src_app_id=0x%08X, dst_app_id=0x%08X, signal_type=0x%08X," - "buffer_size=0x%08X", - static_cast(src_app_id), static_cast(dst_app_id), - static_cast(signal_type), buffer_size); + NGLOG_DEBUG(Service_APT, + "called src_app_id={:#010X}, dst_app_id={:#010X}, signal_type={:#010X}," + "buffer_size={:#010X}", + static_cast(src_app_id), static_cast(dst_app_id), + static_cast(signal_type), buffer_size); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); @@ -329,7 +329,7 @@ void Module::Interface::ReceiveParameter(Kernel::HLERequestContext& ctx) { AppletId app_id = rp.PopEnum(); u32 buffer_size = rp.Pop(); - LOG_DEBUG(Service_APT, "called app_id=0x%08X, buffer_size=0x%08X", static_cast(app_id), + NGLOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", static_cast(app_id), buffer_size); auto next_parameter = apt->applet_manager->ReceiveParameter(app_id); @@ -345,7 +345,7 @@ void Module::Interface::ReceiveParameter(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); // No error rb.PushEnum(next_parameter->sender_id); rb.PushEnum(next_parameter->signal); // Signal type - ASSERT_MSG(next_parameter->buffer.size() <= buffer_size, "Input static buffer is too small !"); + ASSERT_MSG(next_parameter->buffer.size() <= buffer_size, "Input static buffer is too small!"); rb.Push(static_cast(next_parameter->buffer.size())); // Parameter buffer size rb.PushMoveObjects(next_parameter->object); next_parameter->buffer.resize(buffer_size, 0); // APT always push a buffer with the maximum size @@ -357,8 +357,8 @@ void Module::Interface::GlanceParameter(Kernel::HLERequestContext& ctx) { AppletId app_id = rp.PopEnum(); u32 buffer_size = rp.Pop(); - LOG_DEBUG(Service_APT, "called app_id=0x%08X, buffer_size=0x%08X", static_cast(app_id), - buffer_size); + NGLOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", static_cast(app_id), + buffer_size); auto next_parameter = apt->applet_manager->GlanceParameter(app_id); @@ -372,7 +372,7 @@ void Module::Interface::GlanceParameter(Kernel::HLERequestContext& ctx) { rb.Push(RESULT_SUCCESS); // No error rb.PushEnum(next_parameter->sender_id); rb.PushEnum(next_parameter->signal); // Signal type - ASSERT_MSG(next_parameter->buffer.size() <= buffer_size, "Input static buffer is too small !"); + ASSERT_MSG(next_parameter->buffer.size() <= buffer_size, "Input static buffer is too small!"); rb.Push(static_cast(next_parameter->buffer.size())); // Parameter buffer size rb.PushMoveObjects(next_parameter->object); next_parameter->buffer.resize(buffer_size, 0); // APT always push a buffer with the maximum size @@ -393,11 +393,11 @@ void Module::Interface::CancelParameter(Kernel::HLERequestContext& ctx) { rb.Push(apt->applet_manager->CancelParameter(check_sender, sender_appid, check_receiver, receiver_appid)); - LOG_DEBUG(Service_APT, - "called check_sender=%u, sender_appid=0x%08X, " - "check_receiver=%u, receiver_appid=0x%08X", - check_sender, static_cast(sender_appid), check_receiver, - static_cast(receiver_appid)); + NGLOG_DEBUG(Service_APT, + "called check_sender={}, sender_appid={:#010X}, " + "check_receiver={}, receiver_appid={:#010X}", + check_sender, static_cast(sender_appid), check_receiver, + static_cast(receiver_appid)); } void Module::Interface::PrepareToStartApplication(Kernel::HLERequestContext& ctx) { @@ -415,10 +415,10 @@ void Module::Interface::PrepareToStartApplication(Kernel::HLERequestContext& ctx IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - LOG_WARNING(Service_APT, - "(STUBBED) called title_info1=0x%08X, title_info2=0x%08X, title_info3=0x%08X," - "title_info4=0x%08X, flags=0x%08X", - title_info1, title_info2, title_info3, title_info4, flags); + NGLOG_WARNING(Service_APT, + "(STUBBED) called title_info1={:#010X}, title_info2={:#010X}, title_info3={:#010X}," + "title_info4={:#010X}, flags={:#010X}, + title_info1, title_info2, title_info3, title_info4, flags); } void Module::Interface::StartApplication(Kernel::HLERequestContext& ctx) { @@ -432,9 +432,9 @@ void Module::Interface::StartApplication(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - LOG_WARNING(Service_APT, - "(STUBBED) called buffer1_size=0x%08X, buffer2_size=0x%08X, flag=0x%08X", - buffer1_size, buffer2_size, flag); + NGLOG_WARNING(Service_APT, + "(STUBBED) called buffer1_size={:#010X}, buffer2_size={:#010X}, flag={:#010X}", + buffer1_size, buffer2_size, flag); } void Module::Interface::AppletUtility(Kernel::HLERequestContext& ctx) { @@ -449,9 +449,9 @@ void Module::Interface::AppletUtility(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - LOG_WARNING(Service_APT, - "(STUBBED) called command=0x%08X, input_size=0x%08X, output_size=0x%08X", - utility_command, input_size, output_size); + NGLOG_WARNING(Service_APT, + "(STUBBED) called command={:#010X}, input_size={:#010X}, output_size={:#010X}", + utility_command, input_size, output_size); } void Module::Interface::SetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { @@ -460,13 +460,13 @@ void Module::Interface::SetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { apt->cpu_percent = rp.Pop(); if (value != 1) { - LOG_ERROR(Service_APT, "This value should be one, but is actually %u!", value); + NGLOG_ERROR(Service_APT, "This value should be one, but is actually {}!", value); } IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - LOG_WARNING(Service_APT, "(STUBBED) called cpu_percent=%u, value=%u", apt->cpu_percent, value); + NGLOG_WARNING(Service_APT, "(STUBBED) called, cpu_percent={}, value={}", apt->cpu_percent, value); } void Module::Interface::GetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { @@ -474,21 +474,21 @@ void Module::Interface::GetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { u32 value = rp.Pop(); if (value != 1) { - LOG_ERROR(Service_APT, "This value should be one, but is actually %u!", value); + NGLOG_ERROR(Service_APT, "This value should be one, but is actually {}!", value); } IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); // No error rb.Push(apt->cpu_percent); - LOG_WARNING(Service_APT, "(STUBBED) called value=%u", value); + NGLOG_WARNING(Service_APT, "(STUBBED) called, value={}", value); } void Module::Interface::PrepareToStartLibraryApplet(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x18, 1, 0); // 0x180040 AppletId applet_id = rp.PopEnum(); - LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast(applet_id)); + NGLOG_DEBUG(Service_APT, "called, applet_id={:#010X}", static_cast(applet_id)); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(apt->applet_manager->PrepareToStartLibraryApplet(applet_id)); @@ -505,14 +505,14 @@ void Module::Interface::PrepareToStartNewestHomeMenu(Kernel::HLERequestContext& rb.Push(ResultCode(ErrorDescription::AlreadyExists, ErrorModule::Applet, ErrorSummary::InvalidState, ErrorLevel::Status)); - LOG_DEBUG(Service_APT, "called"); + NGLOG_DEBUG(Service_APT, "called"); } void Module::Interface::PreloadLibraryApplet(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x16, 1, 0); // 0x160040 AppletId applet_id = rp.PopEnum(); - LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast(applet_id)); + NGLOG_DEBUG(Service_APT, "called, applet_id={:#010X}", static_cast(applet_id)); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(apt->applet_manager->PreloadLibraryApplet(applet_id)); @@ -525,7 +525,7 @@ void Module::Interface::FinishPreloadingLibraryApplet(Kernel::HLERequestContext& IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(apt->applet_manager->FinishPreloadingLibraryApplet(applet_id)); - LOG_WARNING(Service_APT, "(STUBBED) called applet_id=%03X", static_cast(applet_id)); + LOG_WARNING(Service_APT, "(STUBBED) called, applet_id=%03X", static_cast(applet_id)); } void Module::Interface::StartLibraryApplet(Kernel::HLERequestContext& ctx) { @@ -536,7 +536,7 @@ void Module::Interface::StartLibraryApplet(Kernel::HLERequestContext& ctx) { Kernel::SharedPtr object = rp.PopGenericObject(); std::vector buffer = rp.PopStaticBuffer(); - LOG_DEBUG(Service_APT, "called applet_id=%08X", static_cast(applet_id)); + NGLOG_DEBUG(Service_APT, "called applet_id={:#010X}", static_cast(applet_id)); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(apt->applet_manager->StartLibraryApplet(applet_id, object, buffer)); @@ -549,7 +549,7 @@ void Module::Interface::CancelLibraryApplet(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(1); // TODO: Find the return code meaning - LOG_WARNING(Service_APT, "(STUBBED) called exiting=%d", exiting); + NGLOG_WARNING(Service_APT, "(STUBBED) called exiting={}", exiting); } void Module::Interface::SendCaptureBufferInfo(Kernel::HLERequestContext& ctx) { @@ -580,8 +580,8 @@ void Module::Interface::SetScreenCapPostPermission(Kernel::HLERequestContext& ct IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u", - static_cast(apt->screen_capture_post_permission)); + NGLOG_WARNING(Service_APT, "(STUBBED) called, screen_capture_post_permission={}", + static_cast(apt->screen_capture_post_permission)); } void Module::Interface::GetScreenCapPostPermission(Kernel::HLERequestContext& ctx) { @@ -590,15 +590,15 @@ void Module::Interface::GetScreenCapPostPermission(Kernel::HLERequestContext& ct IPC::RequestBuilder rb = rp.MakeBuilder(2, 0); rb.Push(RESULT_SUCCESS); // No error rb.Push(static_cast(apt->screen_capture_post_permission)); - LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u", - static_cast(apt->screen_capture_post_permission)); + NGLOG_WARNING(Service_APT, "(STUBBED) called, screen_capture_post_permission={}", + static_cast(apt->screen_capture_post_permission)); } void Module::Interface::GetAppletInfo(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x6, 1, 0); // 0x60040 auto app_id = rp.PopEnum(); - LOG_DEBUG(Service_APT, "called appid=%u", static_cast(app_id)); + NGLOG_DEBUG(Service_APT, "called, app_id={}", static_cast(app_id)); auto info = apt->applet_manager->GetAppletInfo(app_id); if (info.Failed()) { @@ -621,17 +621,17 @@ void Module::Interface::GetStartupArgument(Kernel::HLERequestContext& ctx) { StartupArgumentType startup_argument_type = static_cast(rp.Pop()); if (parameter_size >= 0x300) { - LOG_ERROR( - Service_APT, - "Parameter size is outside the valid range (capped to 0x300): parameter_size=0x%08x", - parameter_size); + NGLOG_ERROR( + Service_APT, + "Parameter size is outside the valid range (capped to 0x300): parameter_size={:#010X}", + parameter_size); return; } std::vector parameter(parameter_size, 0); - LOG_WARNING(Service_APT, "(stubbed) called startup_argument_type=%u , parameter_size=0x%08x", - static_cast(startup_argument_type), parameter_size); + NGLOG_WARNING(Service_APT, "(STUBBED) called, startup_argument_type={}, parameter_size={:#010X}", + static_cast(startup_argument_type), parameter_size); IPC::RequestBuilder rb = rp.MakeBuilder(2, 2); rb.Push(RESULT_SUCCESS); @@ -655,8 +655,8 @@ void Module::Interface::Wrap(Kernel::HLERequestContext& ctx) { ASSERT_MSG(output_size == input_size + HW::AES::CCM_MAC_SIZE, "input_size (%d) doesn't match to output_size (%d)", input_size, output_size); - LOG_DEBUG(Service_APT, "called, output_size=%u, input_size=%u, nonce_offset=%u, nonce_size=%u", - output_size, input_size, nonce_offset, nonce_size); + NGLOG_DEBUG(Service_APT, "called, output_size={}, input_size={}, nonce_offset={}, nonce_size={}", + output_size, input_size, nonce_offset, nonce_size); // Note: This weird nonce size modification is verified against real 3DS nonce_size = std::min(nonce_size & ~3, HW::AES::CCM_NONCE_SIZE); @@ -700,8 +700,8 @@ void Module::Interface::Unwrap(Kernel::HLERequestContext& ctx) { ASSERT_MSG(output_size == input_size - HW::AES::CCM_MAC_SIZE, "input_size (%d) doesn't match to output_size (%d)", input_size, output_size); - LOG_DEBUG(Service_APT, "called, output_size=%u, input_size=%u, nonce_offset=%u, nonce_size=%u", - output_size, input_size, nonce_offset, nonce_size); + NGLOG_DEBUG(Service_APT, "called, output_size={}, input_size={}, nonce_offset={}, nonce_size={}", + output_size, input_size, nonce_offset, nonce_size); // Note: This weird nonce size modification is verified against real 3DS nonce_size = std::min(nonce_size & ~3, HW::AES::CCM_NONCE_SIZE); @@ -725,7 +725,7 @@ void Module::Interface::Unwrap(Kernel::HLERequestContext& ctx) { pdata.size() - nonce_offset); rb.Push(RESULT_SUCCESS); } else { - LOG_ERROR(Service_APT, "Failed to decrypt data"); + NGLOG_ERROR(Service_APT, "Failed to decrypt data"); rb.Push(ResultCode(static_cast(1), ErrorModule::PS, ErrorSummary::WrongArgument, ErrorLevel::Status)); } @@ -746,7 +746,7 @@ void Module::Interface::CheckNew3DSApp(Kernel::HLERequestContext& ctx) { PTM::CheckNew3DS(rb); } - LOG_WARNING(Service_APT, "(STUBBED) called"); + NGLOG_WARNING(Service_APT, "(STUBBED) called"); } void Module::Interface::CheckNew3DS(Kernel::HLERequestContext& ctx) { @@ -755,7 +755,7 @@ void Module::Interface::CheckNew3DS(Kernel::HLERequestContext& ctx) { PTM::CheckNew3DS(rb); - LOG_WARNING(Service_APT, "(STUBBED) called"); + NGLOG_WARNING(Service_APT, "(STUBBED) called"); } Module::Interface::Interface(std::shared_ptr apt, const char* name, u32 max_session) From 4a37d91bc6e52a8ad454d6b6ab3ca50530a9caec Mon Sep 17 00:00:00 2001 From: Valentin Vanelslande Date: Tue, 27 Mar 2018 14:23:31 -0600 Subject: [PATCH 2/6] change line 528 --- src/core/hle/service/apt/apt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 6fe71b46a..2d245289d 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -525,7 +525,7 @@ void Module::Interface::FinishPreloadingLibraryApplet(Kernel::HLERequestContext& IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(apt->applet_manager->FinishPreloadingLibraryApplet(applet_id)); - LOG_WARNING(Service_APT, "(STUBBED) called, applet_id=%03X", static_cast(applet_id)); + NGLOG_WARNING(Service_APT, "(STUBBED) called, applet_id={:#05X}", static_cast(applet_id)); } void Module::Interface::StartLibraryApplet(Kernel::HLERequestContext& ctx) { From f1e26fad7f385256751a9272b3617e688fe41591 Mon Sep 17 00:00:00 2001 From: Valentin Vanelslande Date: Tue, 27 Mar 2018 15:25:57 -0600 Subject: [PATCH 3/6] Fix build --- src/core/hle/service/apt/apt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 2d245289d..a35964a78 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -417,7 +417,7 @@ void Module::Interface::PrepareToStartApplication(Kernel::HLERequestContext& ctx NGLOG_WARNING(Service_APT, "(STUBBED) called title_info1={:#010X}, title_info2={:#010X}, title_info3={:#010X}," - "title_info4={:#010X}, flags={:#010X}, + "title_info4={:#010X}, flags={:#010X}", title_info1, title_info2, title_info3, title_info4, flags); } From a53365d69e864a60d7b427f759acd2a3af628b52 Mon Sep 17 00:00:00 2001 From: Valentin Vanelslande Date: Tue, 27 Mar 2018 18:17:04 -0600 Subject: [PATCH 4/6] Fix clang --- src/core/hle/service/apt/apt.cpp | 39 ++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index a35964a78..0ce694e3d 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -32,8 +32,8 @@ void Module::Interface::Initialize(Kernel::HLERequestContext& ctx) { AppletId app_id = rp.PopEnum(); u32 attributes = rp.Pop(); - NGLOG_DEBUG(Service_APT, "called app_id={:#010X}, attributes={:#010X}", static_cast(app_id), - attributes); + NGLOG_DEBUG(Service_APT, "called app_id={:#010X}, attributes={:#010X}", + static_cast(app_id), attributes); auto result = apt->applet_manager->Initialize(app_id, attributes); if (result.Failed()) { @@ -329,8 +329,8 @@ void Module::Interface::ReceiveParameter(Kernel::HLERequestContext& ctx) { AppletId app_id = rp.PopEnum(); u32 buffer_size = rp.Pop(); - NGLOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", static_cast(app_id), - buffer_size); + NGLOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", + static_cast(app_id), buffer_size); auto next_parameter = apt->applet_manager->ReceiveParameter(app_id); @@ -357,8 +357,8 @@ void Module::Interface::GlanceParameter(Kernel::HLERequestContext& ctx) { AppletId app_id = rp.PopEnum(); u32 buffer_size = rp.Pop(); - NGLOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", static_cast(app_id), - buffer_size); + NGLOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", + static_cast(app_id), buffer_size); auto next_parameter = apt->applet_manager->GlanceParameter(app_id); @@ -415,10 +415,11 @@ void Module::Interface::PrepareToStartApplication(Kernel::HLERequestContext& ctx IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - NGLOG_WARNING(Service_APT, - "(STUBBED) called title_info1={:#010X}, title_info2={:#010X}, title_info3={:#010X}," - "title_info4={:#010X}, flags={:#010X}", - title_info1, title_info2, title_info3, title_info4, flags); + NGLOG_WARNING( + Service_APT, + "(STUBBED) called title_info1={:#010X}, title_info2={:#010X}, title_info3={:#010X}," + "title_info4={:#010X}, flags={:#010X}", + title_info1, title_info2, title_info3, title_info4, flags); } void Module::Interface::StartApplication(Kernel::HLERequestContext& ctx) { @@ -466,7 +467,8 @@ void Module::Interface::SetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(RESULT_SUCCESS); // No error - NGLOG_WARNING(Service_APT, "(STUBBED) called, cpu_percent={}, value={}", apt->cpu_percent, value); + NGLOG_WARNING(Service_APT, "(STUBBED) called, cpu_percent={}, value={}", apt->cpu_percent, + value); } void Module::Interface::GetAppCpuTimeLimit(Kernel::HLERequestContext& ctx) { @@ -622,15 +624,16 @@ void Module::Interface::GetStartupArgument(Kernel::HLERequestContext& ctx) { if (parameter_size >= 0x300) { NGLOG_ERROR( - Service_APT, - "Parameter size is outside the valid range (capped to 0x300): parameter_size={:#010X}", - parameter_size); + Service_APT, + "Parameter size is outside the valid range (capped to 0x300): parameter_size={:#010X}", + parameter_size); return; } std::vector parameter(parameter_size, 0); - NGLOG_WARNING(Service_APT, "(STUBBED) called, startup_argument_type={}, parameter_size={:#010X}", + NGLOG_WARNING(Service_APT, + "(STUBBED) called, startup_argument_type={}, parameter_size={:#010X}", static_cast(startup_argument_type), parameter_size); IPC::RequestBuilder rb = rp.MakeBuilder(2, 2); @@ -655,7 +658,8 @@ void Module::Interface::Wrap(Kernel::HLERequestContext& ctx) { ASSERT_MSG(output_size == input_size + HW::AES::CCM_MAC_SIZE, "input_size (%d) doesn't match to output_size (%d)", input_size, output_size); - NGLOG_DEBUG(Service_APT, "called, output_size={}, input_size={}, nonce_offset={}, nonce_size={}", + NGLOG_DEBUG(Service_APT, + "called, output_size={}, input_size={}, nonce_offset={}, nonce_size={}", output_size, input_size, nonce_offset, nonce_size); // Note: This weird nonce size modification is verified against real 3DS @@ -700,7 +704,8 @@ void Module::Interface::Unwrap(Kernel::HLERequestContext& ctx) { ASSERT_MSG(output_size == input_size - HW::AES::CCM_MAC_SIZE, "input_size (%d) doesn't match to output_size (%d)", input_size, output_size); - NGLOG_DEBUG(Service_APT, "called, output_size={}, input_size={}, nonce_offset={}, nonce_size={}", + NGLOG_DEBUG(Service_APT, + "called, output_size={}, input_size={}, nonce_offset={}, nonce_size={}", output_size, input_size, nonce_offset, nonce_size); // Note: This weird nonce size modification is verified against real 3DS From ca6642aa2a4c01052f9bef2a3b3a674ebc471026 Mon Sep 17 00:00:00 2001 From: Valentin Vanelslande Date: Wed, 28 Mar 2018 08:45:39 -0600 Subject: [PATCH 5/6] [skip ci] --- src/core/hle/service/apt/apt.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 0ce694e3d..d099e1af4 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -490,7 +490,7 @@ void Module::Interface::PrepareToStartLibraryApplet(Kernel::HLERequestContext& c IPC::RequestParser rp(ctx, 0x18, 1, 0); // 0x180040 AppletId applet_id = rp.PopEnum(); - NGLOG_DEBUG(Service_APT, "called, applet_id={:#010X}", static_cast(applet_id)); + NGLOG_DEBUG(Service_APT, "called, applet_id={:08X}", static_cast(applet_id)); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(apt->applet_manager->PrepareToStartLibraryApplet(applet_id)); @@ -514,7 +514,7 @@ void Module::Interface::PreloadLibraryApplet(Kernel::HLERequestContext& ctx) { IPC::RequestParser rp(ctx, 0x16, 1, 0); // 0x160040 AppletId applet_id = rp.PopEnum(); - NGLOG_DEBUG(Service_APT, "called, applet_id={:#010X}", static_cast(applet_id)); + NGLOG_DEBUG(Service_APT, "called, applet_id={:08X}", static_cast(applet_id)); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(apt->applet_manager->PreloadLibraryApplet(applet_id)); @@ -538,7 +538,7 @@ void Module::Interface::StartLibraryApplet(Kernel::HLERequestContext& ctx) { Kernel::SharedPtr object = rp.PopGenericObject(); std::vector buffer = rp.PopStaticBuffer(); - NGLOG_DEBUG(Service_APT, "called applet_id={:#010X}", static_cast(applet_id)); + NGLOG_DEBUG(Service_APT, "called, applet_id={:08X}", static_cast(applet_id)); IPC::RequestBuilder rb = rp.MakeBuilder(1, 0); rb.Push(apt->applet_manager->StartLibraryApplet(applet_id, object, buffer)); From 542b11ccdc76dcec73c6a436908214118f0bfa95 Mon Sep 17 00:00:00 2001 From: Valentin Vanelslande Date: Wed, 28 Mar 2018 19:05:54 -0600 Subject: [PATCH 6/6] Change line 203 --- src/core/hle/service/apt/apt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index d099e1af4..63f27cc57 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -200,7 +200,7 @@ void Module::Interface::GetSharedFont(Kernel::HLERequestContext& ctx) { NGLOG_WARNING(Service_APT, "Loaded shared font by legacy method"); apt->shared_font_loaded = true; } else { - LOG_ERROR(Service_APT, "shared font file missing - go dump it from your 3ds"); + NGLOG_ERROR(Service_APT, "shared font file missing - go dump it from your 3ds"); rb.Push(-1); // TODO: Find the right error code rb.Push(0); rb.PushCopyObjects(nullptr);