mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-11-03 23:28:48 +00:00 
			
		
		
		
	Merge pull request #5660 from FearlessTobi/port-5166
Port yuzu-emu/yuzu#5166: "core: Remove unnecessary enum casts in log calls"
This commit is contained in:
		
						commit
						2539215f18
					
				
					 36 changed files with 136 additions and 162 deletions
				
			
		| 
						 | 
				
			
			@ -79,7 +79,7 @@ static u64 GetTitleIdForApplet(AppletId id, u32 region_value) {
 | 
			
		|||
                                return data.applet_ids[0] == id || data.applet_ids[1] == id;
 | 
			
		||||
                            });
 | 
			
		||||
 | 
			
		||||
    ASSERT_MSG(itr != applet_titleids.end(), "Unknown applet id 0x{:#05X}", static_cast<u32>(id));
 | 
			
		||||
    ASSERT_MSG(itr != applet_titleids.end(), "Unknown applet id 0x{:#05X}", id);
 | 
			
		||||
 | 
			
		||||
    return itr->title_ids[region_value];
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -173,7 +173,7 @@ void AppletManager::CancelAndSendParameter(const MessageParameter& parameter) {
 | 
			
		|||
    auto* const slot_data = GetAppletSlotData(static_cast<AppletId>(parameter.destination_id));
 | 
			
		||||
    if (slot_data == nullptr) {
 | 
			
		||||
        LOG_DEBUG(Service_APT, "No applet was registered with the id {:03X}",
 | 
			
		||||
                  static_cast<u32>(parameter.destination_id));
 | 
			
		||||
                  parameter.destination_id);
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -338,8 +338,7 @@ ResultCode AppletManager::PrepareToStartLibraryApplet(AppletId applet_id) {
 | 
			
		|||
    // If we weren't able to load the native applet title, try to fallback to an HLE implementation.
 | 
			
		||||
    auto applet = HLE::Applets::Applet::Get(applet_id);
 | 
			
		||||
    if (applet) {
 | 
			
		||||
        LOG_WARNING(Service_APT, "applet has already been started id={:08X}",
 | 
			
		||||
                    static_cast<u32>(applet_id));
 | 
			
		||||
        LOG_WARNING(Service_APT, "applet has already been started id={:08X}", applet_id);
 | 
			
		||||
        return RESULT_SUCCESS;
 | 
			
		||||
    } else {
 | 
			
		||||
        return HLE::Applets::Applet::Create(applet_id, shared_from_this());
 | 
			
		||||
| 
						 | 
				
			
			@ -365,8 +364,7 @@ ResultCode AppletManager::PreloadLibraryApplet(AppletId applet_id) {
 | 
			
		|||
    // If we weren't able to load the native applet title, try to fallback to an HLE implementation.
 | 
			
		||||
    auto applet = HLE::Applets::Applet::Get(applet_id);
 | 
			
		||||
    if (applet) {
 | 
			
		||||
        LOG_WARNING(Service_APT, "applet has already been started id={:08X}",
 | 
			
		||||
                    static_cast<u32>(applet_id));
 | 
			
		||||
        LOG_WARNING(Service_APT, "applet has already been started id={:08X}", applet_id);
 | 
			
		||||
        return RESULT_SUCCESS;
 | 
			
		||||
    } else {
 | 
			
		||||
        return HLE::Applets::Applet::Create(applet_id, shared_from_this());
 | 
			
		||||
| 
						 | 
				
			
			@ -455,8 +453,7 @@ ResultVal<AppletManager::AppletInfo> AppletManager::GetAppletInfo(AppletId app_i
 | 
			
		|||
            return ResultCode(ErrorDescription::NotFound, ErrorModule::Applet,
 | 
			
		||||
                              ErrorSummary::NotFound, ErrorLevel::Status);
 | 
			
		||||
        }
 | 
			
		||||
        LOG_WARNING(Service_APT, "Using HLE applet info for applet {:03X}",
 | 
			
		||||
                    static_cast<u32>(app_id));
 | 
			
		||||
        LOG_WARNING(Service_APT, "Using HLE applet info for applet {:03X}", app_id);
 | 
			
		||||
        // TODO(Subv): Get the title id for the current applet and write it in the response[2-3]
 | 
			
		||||
        return MakeResult<AppletInfo>({0, Service::FS::MediaType::NAND, true, true, 0});
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -79,8 +79,7 @@ void Module::APTInterface::Initialize(Kernel::HLERequestContext& ctx) {
 | 
			
		|||
    AppletId app_id = rp.PopEnum<AppletId>();
 | 
			
		||||
    u32 attributes = rp.Pop<u32>();
 | 
			
		||||
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called app_id={:#010X}, attributes={:#010X}", static_cast<u32>(app_id),
 | 
			
		||||
              attributes);
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called app_id={:#010X}, attributes={:#010X}", app_id, attributes);
 | 
			
		||||
 | 
			
		||||
    auto result = apt->applet_manager->Initialize(app_id, attributes);
 | 
			
		||||
    if (result.Failed()) {
 | 
			
		||||
| 
						 | 
				
			
			@ -348,7 +347,7 @@ void Module::APTInterface::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={:#010X}", static_cast<u32>(app_id));
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called app_id={:#010X}", app_id);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Module::APTInterface::InquireNotification(Kernel::HLERequestContext& ctx) {
 | 
			
		||||
| 
						 | 
				
			
			@ -372,8 +371,7 @@ void Module::APTInterface::SendParameter(Kernel::HLERequestContext& ctx) {
 | 
			
		|||
    LOG_DEBUG(Service_APT,
 | 
			
		||||
              "called src_app_id={:#010X}, dst_app_id={:#010X}, signal_type={:#010X},"
 | 
			
		||||
              "buffer_size={:#010X}",
 | 
			
		||||
              static_cast<u32>(src_app_id), static_cast<u32>(dst_app_id),
 | 
			
		||||
              static_cast<u32>(signal_type), buffer_size);
 | 
			
		||||
              src_app_id, dst_app_id, signal_type, buffer_size);
 | 
			
		||||
 | 
			
		||||
    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -392,8 +390,7 @@ void Module::APTInterface::ReceiveParameter(Kernel::HLERequestContext& ctx) {
 | 
			
		|||
    const auto app_id = rp.PopEnum<AppletId>();
 | 
			
		||||
    const u32 buffer_size = rp.Pop<u32>();
 | 
			
		||||
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", static_cast<u32>(app_id),
 | 
			
		||||
              buffer_size);
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", app_id, buffer_size);
 | 
			
		||||
 | 
			
		||||
    auto next_parameter = apt->applet_manager->ReceiveParameter(app_id);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -420,8 +417,7 @@ void Module::APTInterface::GlanceParameter(Kernel::HLERequestContext& ctx) {
 | 
			
		|||
    const auto app_id = rp.PopEnum<AppletId>();
 | 
			
		||||
    const u32 buffer_size = rp.Pop<u32>();
 | 
			
		||||
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", static_cast<u32>(app_id),
 | 
			
		||||
              buffer_size);
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called app_id={:#010X}, buffer_size={:#010X}", app_id, buffer_size);
 | 
			
		||||
 | 
			
		||||
    auto next_parameter = apt->applet_manager->GlanceParameter(app_id);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -459,8 +455,7 @@ void Module::APTInterface::CancelParameter(Kernel::HLERequestContext& ctx) {
 | 
			
		|||
    LOG_DEBUG(Service_APT,
 | 
			
		||||
              "called check_sender={}, sender_appid={:#010X}, "
 | 
			
		||||
              "check_receiver={}, receiver_appid={:#010X}",
 | 
			
		||||
              check_sender, static_cast<u32>(sender_appid), check_receiver,
 | 
			
		||||
              static_cast<u32>(receiver_appid));
 | 
			
		||||
              check_sender, sender_appid, check_receiver, receiver_appid);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Module::APTInterface::PrepareToDoApplicationJump(Kernel::HLERequestContext& ctx) {
 | 
			
		||||
| 
						 | 
				
			
			@ -470,7 +465,7 @@ void Module::APTInterface::PrepareToDoApplicationJump(Kernel::HLERequestContext&
 | 
			
		|||
    u8 media_type = rp.Pop<u8>();
 | 
			
		||||
 | 
			
		||||
    LOG_WARNING(Service_APT, "(STUBBED) called title_id={:016X}, media_type={:#01X}, flags={:#08X}",
 | 
			
		||||
                title_id, media_type, static_cast<u8>(flags));
 | 
			
		||||
                title_id, media_type, flags);
 | 
			
		||||
 | 
			
		||||
    ResultCode result = apt->applet_manager->PrepareToDoApplicationJump(
 | 
			
		||||
        title_id, static_cast<FS::MediaType>(media_type), flags);
 | 
			
		||||
| 
						 | 
				
			
			@ -631,7 +626,7 @@ void Module::APTInterface::PrepareToStartLibraryApplet(Kernel::HLERequestContext
 | 
			
		|||
    IPC::RequestParser rp(ctx, 0x18, 1, 0); // 0x180040
 | 
			
		||||
    AppletId applet_id = rp.PopEnum<AppletId>();
 | 
			
		||||
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called, applet_id={:08X}", static_cast<u32>(applet_id));
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called, applet_id={:08X}", applet_id);
 | 
			
		||||
 | 
			
		||||
    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
 | 
			
		||||
    rb.Push(apt->applet_manager->PrepareToStartLibraryApplet(applet_id));
 | 
			
		||||
| 
						 | 
				
			
			@ -655,7 +650,7 @@ void Module::APTInterface::PreloadLibraryApplet(Kernel::HLERequestContext& ctx)
 | 
			
		|||
    IPC::RequestParser rp(ctx, 0x16, 1, 0); // 0x160040
 | 
			
		||||
    AppletId applet_id = rp.PopEnum<AppletId>();
 | 
			
		||||
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called, applet_id={:08X}", static_cast<u32>(applet_id));
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called, applet_id={:08X}", applet_id);
 | 
			
		||||
 | 
			
		||||
    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
 | 
			
		||||
    rb.Push(apt->applet_manager->PreloadLibraryApplet(applet_id));
 | 
			
		||||
| 
						 | 
				
			
			@ -668,7 +663,7 @@ void Module::APTInterface::FinishPreloadingLibraryApplet(Kernel::HLERequestConte
 | 
			
		|||
    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
 | 
			
		||||
    rb.Push(apt->applet_manager->FinishPreloadingLibraryApplet(applet_id));
 | 
			
		||||
 | 
			
		||||
    LOG_WARNING(Service_APT, "(STUBBED) called, applet_id={:#05X}", static_cast<u32>(applet_id));
 | 
			
		||||
    LOG_WARNING(Service_APT, "(STUBBED) called, applet_id={:#05X}", applet_id);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Module::APTInterface::StartLibraryApplet(Kernel::HLERequestContext& ctx) {
 | 
			
		||||
| 
						 | 
				
			
			@ -679,7 +674,7 @@ void Module::APTInterface::StartLibraryApplet(Kernel::HLERequestContext& ctx) {
 | 
			
		|||
    std::shared_ptr<Kernel::Object> object = rp.PopGenericObject();
 | 
			
		||||
    const std::vector<u8> buffer = rp.PopStaticBuffer();
 | 
			
		||||
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called, applet_id={:08X}", static_cast<u32>(applet_id));
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called, applet_id={:08X}", applet_id);
 | 
			
		||||
 | 
			
		||||
    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
 | 
			
		||||
    rb.Push(apt->applet_manager->StartLibraryApplet(applet_id, std::move(object), buffer));
 | 
			
		||||
| 
						 | 
				
			
			@ -806,7 +801,7 @@ void Module::APTInterface::SetScreenCapPostPermission(Kernel::HLERequestContext&
 | 
			
		|||
    IPC::RequestBuilder rb = rp.MakeBuilder(1, 0);
 | 
			
		||||
    rb.Push(RESULT_SUCCESS); // No error
 | 
			
		||||
    LOG_WARNING(Service_APT, "(STUBBED) called, screen_capture_post_permission={}",
 | 
			
		||||
                static_cast<u32>(apt->screen_capture_post_permission));
 | 
			
		||||
                apt->screen_capture_post_permission);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Module::APTInterface::GetScreenCapPostPermission(Kernel::HLERequestContext& ctx) {
 | 
			
		||||
| 
						 | 
				
			
			@ -816,14 +811,14 @@ void Module::APTInterface::GetScreenCapPostPermission(Kernel::HLERequestContext&
 | 
			
		|||
    rb.Push(RESULT_SUCCESS); // No error
 | 
			
		||||
    rb.Push(static_cast<u32>(apt->screen_capture_post_permission));
 | 
			
		||||
    LOG_WARNING(Service_APT, "(STUBBED) called, screen_capture_post_permission={}",
 | 
			
		||||
                static_cast<u32>(apt->screen_capture_post_permission));
 | 
			
		||||
                apt->screen_capture_post_permission);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Module::APTInterface::GetAppletInfo(Kernel::HLERequestContext& ctx) {
 | 
			
		||||
    IPC::RequestParser rp(ctx, 0x6, 1, 0); // 0x60040
 | 
			
		||||
    auto app_id = rp.PopEnum<AppletId>();
 | 
			
		||||
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called, app_id={}", static_cast<u32>(app_id));
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called, app_id={}", app_id);
 | 
			
		||||
 | 
			
		||||
    auto info = apt->applet_manager->GetAppletInfo(app_id);
 | 
			
		||||
    if (info.Failed()) {
 | 
			
		||||
| 
						 | 
				
			
			@ -847,7 +842,7 @@ void Module::APTInterface::GetStartupArgument(Kernel::HLERequestContext& ctx) {
 | 
			
		|||
    const auto startup_argument_type = static_cast<StartupArgumentType>(rp.Pop<u8>());
 | 
			
		||||
 | 
			
		||||
    LOG_WARNING(Service_APT, "called, startup_argument_type={}, parameter_size={:#010X}",
 | 
			
		||||
                static_cast<u32>(startup_argument_type), parameter_size);
 | 
			
		||||
                startup_argument_type, parameter_size);
 | 
			
		||||
 | 
			
		||||
    if (parameter_size > max_parameter_size) {
 | 
			
		||||
        LOG_ERROR(Service_APT,
 | 
			
		||||
| 
						 | 
				
			
			@ -1029,8 +1024,7 @@ void Module::APTInterface::IsTitleAllowed(Kernel::HLERequestContext& ctx) {
 | 
			
		|||
    rb.Push(RESULT_SUCCESS);
 | 
			
		||||
    rb.Push(true);
 | 
			
		||||
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called, title_id={:016X} media_type={}", program_id,
 | 
			
		||||
              static_cast<u32>(media_type));
 | 
			
		||||
    LOG_DEBUG(Service_APT, "called, title_id={:016X} media_type={}", program_id, media_type);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Module::APTInterface::APTInterface(std::shared_ptr<Module> apt, const char* name, u32 max_session)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue