From dc8479928c5aee4c6ad6fe4f59006fb604cee701 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Sun, 18 Sep 2016 09:38:01 +0900 Subject: Sources: Run clang-format on everything. --- src/core/hle/service/ac_u.cpp | 38 +- src/core/hle/service/am/am.cpp | 53 +-- src/core/hle/service/am/am_app.cpp | 16 +- src/core/hle/service/am/am_net.cpp | 110 +++--- src/core/hle/service/am/am_sys.cpp | 44 ++- src/core/hle/service/am/am_u.cpp | 70 ++-- src/core/hle/service/apt/apt.cpp | 148 ++++---- src/core/hle/service/apt/apt.h | 95 ++--- src/core/hle/service/apt/apt_a.cpp | 57 ++- src/core/hle/service/apt/apt_s.cpp | 171 +++++---- src/core/hle/service/apt/apt_u.cpp | 177 +++++----- src/core/hle/service/boss/boss.cpp | 2 +- src/core/hle/service/boss/boss_p.cpp | 2 +- src/core/hle/service/boss/boss_u.cpp | 8 +- src/core/hle/service/cam/cam.cpp | 75 ++-- src/core/hle/service/cam/cam.h | 69 +--- src/core/hle/service/cam/cam_c.cpp | 4 +- src/core/hle/service/cam/cam_q.cpp | 4 +- src/core/hle/service/cam/cam_s.cpp | 4 +- src/core/hle/service/cam/cam_u.cpp | 124 +++---- src/core/hle/service/cecd/cecd.cpp | 9 +- src/core/hle/service/cecd/cecd.h | 10 +- src/core/hle/service/cecd/cecd_s.cpp | 4 +- src/core/hle/service/cecd/cecd_u.cpp | 6 +- src/core/hle/service/cfg/cfg.cpp | 191 ++++++---- src/core/hle/service/cfg/cfg.h | 12 +- src/core/hle/service/cfg/cfg_i.cpp | 84 ++--- src/core/hle/service/cfg/cfg_s.cpp | 38 +- src/core/hle/service/cfg/cfg_u.cpp | 20 +- src/core/hle/service/csnd_snd.cpp | 34 +- src/core/hle/service/csnd_snd.h | 2 +- src/core/hle/service/dlp/dlp.cpp | 2 +- src/core/hle/service/dlp/dlp_clnt.cpp | 3 +- src/core/hle/service/dlp/dlp_fkcl.cpp | 3 +- src/core/hle/service/dlp/dlp_srvr.cpp | 10 +- src/core/hle/service/dsp_dsp.cpp | 153 ++++---- src/core/hle/service/err_f.cpp | 129 ++++--- src/core/hle/service/frd/frd.cpp | 20 +- src/core/hle/service/frd/frd_a.cpp | 2 +- src/core/hle/service/frd/frd_u.cpp | 104 +++--- src/core/hle/service/fs/archive.cpp | 389 +++++++++++---------- src/core/hle/service/fs/archive.h | 65 ++-- src/core/hle/service/fs/fs_user.cpp | 386 ++++++++++---------- src/core/hle/service/gsp_gpu.cpp | 247 +++++++------ src/core/hle/service/gsp_gpu.h | 40 +-- src/core/hle/service/gsp_lcd.cpp | 12 +- src/core/hle/service/hid/hid.cpp | 47 +-- src/core/hle/service/hid/hid.h | 69 ++-- src/core/hle/service/hid/hid_spvr.cpp | 18 +- src/core/hle/service/hid/hid_user.cpp | 18 +- src/core/hle/service/http_c.cpp | 100 +++--- src/core/hle/service/ir/ir.cpp | 28 +- src/core/hle/service/ir/ir_rst.cpp | 8 +- src/core/hle/service/ir/ir_u.cpp | 27 +- src/core/hle/service/ir/ir_user.cpp | 50 +-- src/core/hle/service/ldr_ro/cro_helper.cpp | 375 ++++++++++---------- src/core/hle/service/ldr_ro/cro_helper.h | 145 ++++---- src/core/hle/service/ldr_ro/ldr_ro.cpp | 208 ++++++----- .../hle/service/ldr_ro/memory_synchronizer.cpp | 5 +- src/core/hle/service/mic_u.cpp | 32 +- src/core/hle/service/ndm/ndm.cpp | 20 +- src/core/hle/service/ndm/ndm.h | 42 +-- src/core/hle/service/ndm/ndm_u.cpp | 44 +-- src/core/hle/service/news/news.cpp | 2 +- src/core/hle/service/news/news_s.cpp | 26 +- src/core/hle/service/news/news_u.cpp | 2 +- src/core/hle/service/nim/nim.cpp | 2 +- src/core/hle/service/nim/nim_aoc.cpp | 16 +- src/core/hle/service/nim/nim_s.cpp | 9 +- src/core/hle/service/nim/nim_u.cpp | 13 +- src/core/hle/service/ns_s.cpp | 30 +- src/core/hle/service/nwm_uds.cpp | 82 ++--- src/core/hle/service/pm_app.cpp | 24 +- src/core/hle/service/ptm/ptm.cpp | 31 +- src/core/hle/service/ptm/ptm.h | 21 +- src/core/hle/service/ptm/ptm_play.cpp | 8 +- src/core/hle/service/ptm/ptm_play.h | 6 +- src/core/hle/service/ptm/ptm_sysm.cpp | 62 ++-- src/core/hle/service/ptm/ptm_u.cpp | 28 +- src/core/hle/service/service.cpp | 23 +- src/core/hle/service/service.h | 10 +- src/core/hle/service/soc_u.cpp | 378 ++++++++++---------- src/core/hle/service/srv.cpp | 50 +-- src/core/hle/service/ssl_c.cpp | 44 +-- src/core/hle/service/y2r_u.cpp | 155 ++++---- 85 files changed, 2865 insertions(+), 2639 deletions(-) (limited to 'src/core/hle/service') diff --git a/src/core/hle/service/ac_u.cpp b/src/core/hle/service/ac_u.cpp index 5241dd3e7..887b57529 100644 --- a/src/core/hle/service/ac_u.cpp +++ b/src/core/hle/service/ac_u.cpp @@ -47,7 +47,7 @@ static void GetWifiStatus(Service::Interface* self) { // it returns a valid result without implementing full functionality. cmd_buff[1] = RESULT_SUCCESS.raw; // No error - cmd_buff[2] = 0; // Connection type set to none + cmd_buff[2] = 0; // Connection type set to none LOG_WARNING(Service_AC, "(STUBBED) called"); } @@ -62,29 +62,29 @@ static void IsConnected(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - cmd_buff[2] = false; // Not connected to ac:u service + cmd_buff[2] = false; // Not connected to ac:u service LOG_WARNING(Service_AC, "(STUBBED) called"); } const Interface::FunctionInfo FunctionTable[] = { - {0x00010000, nullptr, "CreateDefaultConfig"}, - {0x00040006, nullptr, "ConnectAsync"}, - {0x00050002, nullptr, "GetConnectResult"}, - {0x00080004, CloseAsync, "CloseAsync"}, - {0x00090002, nullptr, "GetCloseResult"}, - {0x000A0000, nullptr, "GetLastErrorCode"}, - {0x000D0000, GetWifiStatus, "GetWifiStatus"}, - {0x000E0042, nullptr, "GetCurrentAPInfo"}, - {0x00100042, nullptr, "GetCurrentNZoneInfo"}, - {0x00110042, nullptr, "GetNZoneApNumService"}, - {0x00240042, nullptr, "AddDenyApType"}, - {0x00270002, nullptr, "GetInfraPriority"}, - {0x002D0082, nullptr, "SetRequestEulaVersion"}, - {0x00300004, nullptr, "RegisterDisconnectEvent"}, - {0x003C0042, nullptr, "GetAPSSIDList"}, - {0x003E0042, IsConnected, "IsConnected"}, - {0x00400042, nullptr, "SetClientVersion"}, + {0x00010000, nullptr, "CreateDefaultConfig"}, + {0x00040006, nullptr, "ConnectAsync"}, + {0x00050002, nullptr, "GetConnectResult"}, + {0x00080004, CloseAsync, "CloseAsync"}, + {0x00090002, nullptr, "GetCloseResult"}, + {0x000A0000, nullptr, "GetLastErrorCode"}, + {0x000D0000, GetWifiStatus, "GetWifiStatus"}, + {0x000E0042, nullptr, "GetCurrentAPInfo"}, + {0x00100042, nullptr, "GetCurrentNZoneInfo"}, + {0x00110042, nullptr, "GetNZoneApNumService"}, + {0x00240042, nullptr, "AddDenyApType"}, + {0x00270002, nullptr, "GetInfraPriority"}, + {0x002D0082, nullptr, "SetRequestEulaVersion"}, + {0x00300004, nullptr, "RegisterDisconnectEvent"}, + {0x003C0042, nullptr, "GetAPSSIDList"}, + {0x003E0042, IsConnected, "IsConnected"}, + {0x00400042, nullptr, "SetClientVersion"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 3f71e7f2b..b653523a4 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -6,19 +6,19 @@ #include "common/logging/log.h" -#include "core/hle/service/service.h" #include "core/hle/service/am/am.h" #include "core/hle/service/am/am_app.h" #include "core/hle/service/am/am_net.h" #include "core/hle/service/am/am_sys.h" #include "core/hle/service/am/am_u.h" +#include "core/hle/service/service.h" namespace Service { namespace AM { -static std::array am_content_count = { 0, 0, 0 }; -static std::array am_titles_count = { 0, 0, 0 }; -static std::array am_titles_list_count = { 0, 0, 0 }; +static std::array am_content_count = {0, 0, 0}; +static std::array am_titles_count = {0, 0, 0}; +static std::array am_titles_list_count = {0, 0, 0}; static u32 am_ticket_count = 0; static u32 am_ticket_list_count = 0; @@ -29,7 +29,8 @@ void GetTitleCount(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = am_titles_count[media_type]; - LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_count=0x%08x", media_type, am_titles_count[media_type]); + LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_count=0x%08x", media_type, + am_titles_count[media_type]); } void FindContentInfos(Service::Interface* self) { @@ -43,8 +44,10 @@ void FindContentInfos(Service::Interface* self) { am_content_count[media_type] = cmd_buff[4]; cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_id=0x%016llx, content_cound=%u, content_ids_pointer=0x%08x, content_info_pointer=0x%08x", - media_type, title_id, am_content_count[media_type], content_ids_pointer, content_info_pointer); + LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_id=0x%016llx, content_cound=%u, " + "content_ids_pointer=0x%08x, content_info_pointer=0x%08x", + media_type, title_id, am_content_count[media_type], content_ids_pointer, + content_info_pointer); } void ListContentInfos(Service::Interface* self) { @@ -59,8 +62,10 @@ void ListContentInfos(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = am_content_count[media_type]; - LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, content_count=%u, title_id=0x%016" PRIx64 ", start_index=0x%08x, content_info_pointer=0x%08X", - media_type, am_content_count[media_type], title_id, start_index, content_info_pointer); + LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, content_count=%u, title_id=0x%016" PRIx64 + ", start_index=0x%08x, content_info_pointer=0x%08X", + media_type, am_content_count[media_type], title_id, start_index, + content_info_pointer); } void DeleteContents(Service::Interface* self) { @@ -73,8 +78,9 @@ void DeleteContents(Service::Interface* self) { am_content_count[media_type] = cmd_buff[4]; cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_id=0x%016" PRIx64 ", content_count=%u, content_ids_pointer=0x%08x", - media_type, title_id, am_content_count[media_type], content_ids_pointer); + LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, title_id=0x%016" PRIx64 + ", content_count=%u, content_ids_pointer=0x%08x", + media_type, title_id, am_content_count[media_type], content_ids_pointer); } void GetTitleList(Service::Interface* self) { @@ -87,8 +93,10 @@ void GetTitleList(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = am_titles_list_count[media_type]; - LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, titles_list_count=0x%08X, title_ids_output_pointer=0x%08X", - media_type, am_titles_list_count[media_type], title_ids_output_pointer); + LOG_WARNING( + Service_AM, + "(STUBBED) media_type=%u, titles_list_count=0x%08X, title_ids_output_pointer=0x%08X", + media_type, am_titles_list_count[media_type], title_ids_output_pointer); } void GetTitleInfo(Service::Interface* self) { @@ -101,7 +109,8 @@ void GetTitleInfo(Service::Interface* self) { am_titles_count[media_type] = cmd_buff[2]; cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, total_titles=0x%08X, title_id_list_pointer=0x%08X, title_list_pointer=0x%08X", + LOG_WARNING(Service_AM, "(STUBBED) media_type=%u, total_titles=0x%08X, " + "title_id_list_pointer=0x%08X, title_list_pointer=0x%08X", media_type, am_titles_count[media_type], title_id_list_pointer, title_list_pointer); } @@ -122,8 +131,9 @@ void ListDataTitleTicketInfos(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = am_ticket_count; - LOG_WARNING(Service_AM, "(STUBBED) ticket_count=0x%08X, title_id=0x%016" PRIx64 ", start_index=0x%08X, ticket_info_pointer=0x%08X", - am_ticket_count, title_id, start_index, ticket_info_pointer); + LOG_WARNING(Service_AM, "(STUBBED) ticket_count=0x%08X, title_id=0x%016" PRIx64 + ", start_index=0x%08X, ticket_info_pointer=0x%08X", + am_ticket_count, title_id, start_index, ticket_info_pointer); } void GetNumContentInfos(Service::Interface* self) { @@ -140,7 +150,7 @@ void DeleteTicket(Service::Interface* self) { u64 title_id = (static_cast(cmd_buff[2]) << 32) | cmd_buff[1]; cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_WARNING(Service_AM, "(STUBBED) called title_id=0x%016" PRIx64 "",title_id); + LOG_WARNING(Service_AM, "(STUBBED) called title_id=0x%016" PRIx64 "", title_id); } void GetTicketCount(Service::Interface* self) { @@ -148,7 +158,7 @@ void GetTicketCount(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = am_ticket_count; - LOG_WARNING(Service_AM, "(STUBBED) called ticket_count=0x%08x",am_ticket_count); + LOG_WARNING(Service_AM, "(STUBBED) called ticket_count=0x%08x", am_ticket_count); } void GetTicketList(Service::Interface* self) { @@ -161,8 +171,10 @@ void GetTicketList(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = am_ticket_list_count; - LOG_WARNING(Service_AM, "(STUBBED) ticket_list_count=0x%08x, num_of_skip=0x%08x, ticket_list_pointer=0x%08x", - am_ticket_list_count, num_of_skip, ticket_list_pointer); + LOG_WARNING( + Service_AM, + "(STUBBED) ticket_list_count=0x%08x, num_of_skip=0x%08x, ticket_list_pointer=0x%08x", + am_ticket_list_count, num_of_skip, ticket_list_pointer); } void Init() { @@ -175,7 +187,6 @@ void Init() { } void Shutdown() { - } } // namespace AM diff --git a/src/core/hle/service/am/am_app.cpp b/src/core/hle/service/am/am_app.cpp index d27b3defd..bfc1ca6bd 100644 --- a/src/core/hle/service/am/am_app.cpp +++ b/src/core/hle/service/am/am_app.cpp @@ -9,14 +9,14 @@ namespace Service { namespace AM { const Interface::FunctionInfo FunctionTable[] = { - {0x100100C0, GetNumContentInfos, "GetNumContentInfos"}, - {0x10020104, FindContentInfos, "FindContentInfos"}, - {0x10030142, ListContentInfos, "ListContentInfos"}, - {0x10040102, DeleteContents, "DeleteContents"}, - {0x10050084, GetDataTitleInfos, "GetDataTitleInfos"}, - {0x10070102, ListDataTitleTicketInfos, "ListDataTitleTicketInfos"}, - {0x100900C0, nullptr, "IsDataTitleInUse"}, - {0x100A0000, nullptr, "IsExternalTitleDatabaseInitialized"}, + {0x100100C0, GetNumContentInfos, "GetNumContentInfos"}, + {0x10020104, FindContentInfos, "FindContentInfos"}, + {0x10030142, ListContentInfos, "ListContentInfos"}, + {0x10040102, DeleteContents, "DeleteContents"}, + {0x10050084, GetDataTitleInfos, "GetDataTitleInfos"}, + {0x10070102, ListDataTitleTicketInfos, "ListDataTitleTicketInfos"}, + {0x100900C0, nullptr, "IsDataTitleInUse"}, + {0x100A0000, nullptr, "IsExternalTitleDatabaseInitialized"}, }; AM_APP_Interface::AM_APP_Interface() { diff --git a/src/core/hle/service/am/am_net.cpp b/src/core/hle/service/am/am_net.cpp index e75755245..3a597a34c 100644 --- a/src/core/hle/service/am/am_net.cpp +++ b/src/core/hle/service/am/am_net.cpp @@ -9,61 +9,61 @@ namespace Service { namespace AM { const Interface::FunctionInfo FunctionTable[] = { - {0x00010040, GetTitleCount, "GetTitleCount"}, - {0x00020082, GetTitleList, "GetTitleList"}, - {0x00030084, GetTitleInfo, "GetTitleInfo"}, - {0x000400C0, nullptr, "DeleteApplicationTitle"}, - {0x000500C0, nullptr, "GetTitleProductCode"}, - {0x000600C0, nullptr, "GetTitleExtDataId"}, - {0x00070080, DeleteTicket, "DeleteTicket"}, - {0x00080000, GetTicketCount, "GetTicketCount"}, - {0x00090082, GetTicketList, "GetTicketList"}, - {0x000A0000, nullptr, "GetDeviceID"}, - {0x000D0084, nullptr, "GetPendingTitleInfo"}, - {0x000E00C0, nullptr, "DeletePendingTitle"}, - {0x00140040, nullptr, "FinalizePendingTitles"}, - {0x00150040, nullptr, "DeleteAllPendingTitles"}, - {0x00180080, nullptr, "InitializeTitleDatabase"}, - {0x00190040, nullptr, "ReloadDBS"}, - {0x001A00C0, nullptr, "GetDSiWareExportSize"}, - {0x001B0144, nullptr, "ExportDSiWare"}, - {0x001C0084, nullptr, "ImportDSiWare"}, - {0x00230080, nullptr, "TitleIDListGetTotal2"}, - {0x002400C2, nullptr, "GetTitleIDList2"}, - {0x04010080, nullptr, "InstallFIRM"}, - {0x04020040, nullptr, "StartInstallCIADB0"}, - {0x04030000, nullptr, "StartInstallCIADB1"}, - {0x04040002, nullptr, "AbortCIAInstall"}, - {0x04050002, nullptr, "CloseCIAFinalizeInstall"}, - {0x04060002, nullptr, "CloseCIA"}, - {0x040700C2, nullptr, "FinalizeTitlesInstall"}, - {0x04080042, nullptr, "GetCiaFileInfo"}, - {0x040E00C2, nullptr, "InstallTitlesFinish"}, - {0x040F0000, nullptr, "InstallNATIVEFIRM"}, - {0x041000C0, nullptr, "DeleteTitle"}, - {0x04120000, nullptr, "Initialize"}, - {0x041700C0, nullptr, "MigrateAGBtoSAV"}, - {0x08010000, nullptr, "OpenTicket"}, - {0x08020002, nullptr, "TicketAbortInstall"}, - {0x08030002, nullptr, "TicketFinalizeInstall"}, - {0x08040100, nullptr, "InstallTitleBegin"}, - {0x08050000, nullptr, "InstallTitleAbort"}, - {0x080600C0, nullptr, "InstallTitleResume"}, - {0x08070000, nullptr, "InstallTitleAbortTMD"}, - {0x08080000, nullptr, "InstallTitleFinish"}, - {0x080A0000, nullptr, "OpenTMD"}, - {0x080B0002, nullptr, "TMDAbortInstall"}, - {0x080C0042, nullptr, "TMDFinalizeInstall"}, - {0x080E0040, nullptr, "OpenContentCreate"}, - {0x080F0002, nullptr, "ContentAbortInstall"}, - {0x08100040, nullptr, "OpenContentResume"}, - {0x08120002, nullptr, "ContentFinalizeInstall"}, - {0x08130000, nullptr, "GetTotalContents"}, - {0x08140042, nullptr, "GetContentIndexes"}, - {0x08150044, nullptr, "GetContentsInfo"}, - {0x08180042, nullptr, "GetCTCert"}, - {0x08190108, nullptr, "SetCertificates"}, - {0x081B00C2, nullptr, "InstallTitlesFinish"}, + {0x00010040, GetTitleCount, "GetTitleCount"}, + {0x00020082, GetTitleList, "GetTitleList"}, + {0x00030084, GetTitleInfo, "GetTitleInfo"}, + {0x000400C0, nullptr, "DeleteApplicationTitle"}, + {0x000500C0, nullptr, "GetTitleProductCode"}, + {0x000600C0, nullptr, "GetTitleExtDataId"}, + {0x00070080, DeleteTicket, "DeleteTicket"}, + {0x00080000, GetTicketCount, "GetTicketCount"}, + {0x00090082, GetTicketList, "GetTicketList"}, + {0x000A0000, nullptr, "GetDeviceID"}, + {0x000D0084, nullptr, "GetPendingTitleInfo"}, + {0x000E00C0, nullptr, "DeletePendingTitle"}, + {0x00140040, nullptr, "FinalizePendingTitles"}, + {0x00150040, nullptr, "DeleteAllPendingTitles"}, + {0x00180080, nullptr, "InitializeTitleDatabase"}, + {0x00190040, nullptr, "ReloadDBS"}, + {0x001A00C0, nullptr, "GetDSiWareExportSize"}, + {0x001B0144, nullptr, "ExportDSiWare"}, + {0x001C0084, nullptr, "ImportDSiWare"}, + {0x00230080, nullptr, "TitleIDListGetTotal2"}, + {0x002400C2, nullptr, "GetTitleIDList2"}, + {0x04010080, nullptr, "InstallFIRM"}, + {0x04020040, nullptr, "StartInstallCIADB0"}, + {0x04030000, nullptr, "StartInstallCIADB1"}, + {0x04040002, nullptr, "AbortCIAInstall"}, + {0x04050002, nullptr, "CloseCIAFinalizeInstall"}, + {0x04060002, nullptr, "CloseCIA"}, + {0x040700C2, nullptr, "FinalizeTitlesInstall"}, + {0x04080042, nullptr, "GetCiaFileInfo"}, + {0x040E00C2, nullptr, "InstallTitlesFinish"}, + {0x040F0000, nullptr, "InstallNATIVEFIRM"}, + {0x041000C0, nullptr, "DeleteTitle"}, + {0x04120000, nullptr, "Initialize"}, + {0x041700C0, nullptr, "MigrateAGBtoSAV"}, + {0x08010000, nullptr, "OpenTicket"}, + {0x08020002, nullptr, "TicketAbortInstall"}, + {0x08030002, nullptr, "TicketFinalizeInstall"}, + {0x08040100, nullptr, "InstallTitleBegin"}, + {0x08050000, nullptr, "InstallTitleAbort"}, + {0x080600C0, nullptr, "InstallTitleResume"}, + {0x08070000, nullptr, "InstallTitleAbortTMD"}, + {0x08080000, nullptr, "InstallTitleFinish"}, + {0x080A0000, nullptr, "OpenTMD"}, + {0x080B0002, nullptr, "TMDAbortInstall"}, + {0x080C0042, nullptr, "TMDFinalizeInstall"}, + {0x080E0040, nullptr, "OpenContentCreate"}, + {0x080F0002, nullptr, "ContentAbortInstall"}, + {0x08100040, nullptr, "OpenContentResume"}, + {0x08120002, nullptr, "ContentFinalizeInstall"}, + {0x08130000, nullptr, "GetTotalContents"}, + {0x08140042, nullptr, "GetContentIndexes"}, + {0x08150044, nullptr, "GetContentsInfo"}, + {0x08180042, nullptr, "GetCTCert"}, + {0x08190108, nullptr, "SetCertificates"}, + {0x081B00C2, nullptr, "InstallTitlesFinish"}, }; AM_NET_Interface::AM_NET_Interface() { diff --git a/src/core/hle/service/am/am_sys.cpp b/src/core/hle/service/am/am_sys.cpp index 8bad5e1c9..8bb58cab7 100644 --- a/src/core/hle/service/am/am_sys.cpp +++ b/src/core/hle/service/am/am_sys.cpp @@ -8,29 +8,27 @@ namespace Service { namespace AM { -const Interface::FunctionInfo FunctionTable[] = { - {0x00010040, GetTitleCount, "GetTitleCount"}, - {0x00020082, GetTitleList, "GetTitleList"}, - {0x00030084, GetTitleInfo, "GetTitleInfo"}, - {0x000400C0, nullptr, "DeleteApplicationTitle"}, - {0x000500C0, nullptr, "GetTitleProductCode"}, - {0x000600C0, nullptr, "GetTitleExtDataId"}, - {0x00070080, DeleteTicket, "DeleteTicket"}, - {0x00080000, GetTicketCount, "GetTicketCount"}, - {0x00090082, GetTicketList, "GetTicketList"}, - {0x000A0000, nullptr, "GetDeviceID"}, - {0x000D0084, nullptr, "GetPendingTitleInfo"}, - {0x000E00C0, nullptr, "DeletePendingTitle"}, - {0x00140040, nullptr, "FinalizePendingTitles"}, - {0x00150040, nullptr, "DeleteAllPendingTitles"}, - {0x00180080, nullptr, "InitializeTitleDatabase"}, - {0x00190040, nullptr, "ReloadDBS"}, - {0x001A00C0, nullptr, "GetDSiWareExportSize"}, - {0x001B0144, nullptr, "ExportDSiWare"}, - {0x001C0084, nullptr, "ImportDSiWare"}, - {0x00230080, nullptr, "GetPendingTitleCount"}, - {0x002400C2, nullptr, "GetPendingTitleList"} -}; +const Interface::FunctionInfo FunctionTable[] = {{0x00010040, GetTitleCount, "GetTitleCount"}, + {0x00020082, GetTitleList, "GetTitleList"}, + {0x00030084, GetTitleInfo, "GetTitleInfo"}, + {0x000400C0, nullptr, "DeleteApplicationTitle"}, + {0x000500C0, nullptr, "GetTitleProductCode"}, + {0x000600C0, nullptr, "GetTitleExtDataId"}, + {0x00070080, DeleteTicket, "DeleteTicket"}, + {0x00080000, GetTicketCount, "GetTicketCount"}, + {0x00090082, GetTicketList, "GetTicketList"}, + {0x000A0000, nullptr, "GetDeviceID"}, + {0x000D0084, nullptr, "GetPendingTitleInfo"}, + {0x000E00C0, nullptr, "DeletePendingTitle"}, + {0x00140040, nullptr, "FinalizePendingTitles"}, + {0x00150040, nullptr, "DeleteAllPendingTitles"}, + {0x00180080, nullptr, "InitializeTitleDatabase"}, + {0x00190040, nullptr, "ReloadDBS"}, + {0x001A00C0, nullptr, "GetDSiWareExportSize"}, + {0x001B0144, nullptr, "ExportDSiWare"}, + {0x001C0084, nullptr, "ImportDSiWare"}, + {0x00230080, nullptr, "GetPendingTitleCount"}, + {0x002400C2, nullptr, "GetPendingTitleList"}}; AM_SYS_Interface::AM_SYS_Interface() { Register(FunctionTable); diff --git a/src/core/hle/service/am/am_u.cpp b/src/core/hle/service/am/am_u.cpp index d583dd9e6..32d47741f 100644 --- a/src/core/hle/service/am/am_u.cpp +++ b/src/core/hle/service/am/am_u.cpp @@ -8,42 +8,40 @@ namespace Service { namespace AM { -const Interface::FunctionInfo FunctionTable[] = { - {0x00010040, GetTitleCount, "GetTitleCount"}, - {0x00020082, GetTitleList, "GetTitleList"}, - {0x00030084, GetTitleInfo, "GetTitleInfo"}, - {0x000400C0, nullptr, "DeleteApplicationTitle"}, - {0x000500C0, nullptr, "GetTitleProductCode"}, - {0x000600C0, nullptr, "GetTitleExtDataId"}, - {0x00070080, DeleteTicket, "DeleteTicket"}, - {0x00080000, GetTicketCount, "GetTicketCount"}, - {0x00090082, GetTicketList, "GetTicketList"}, - {0x000A0000, nullptr, "GetDeviceID"}, - {0x000D0084, nullptr, "GetPendingTitleInfo"}, - {0x000E00C0, nullptr, "DeletePendingTitle"}, - {0x00140040, nullptr, "FinalizePendingTitles"}, - {0x00150040, nullptr, "DeleteAllPendingTitles"}, - {0x00180080, nullptr, "InitializeTitleDatabase"}, - {0x00190040, nullptr, "ReloadDBS"}, - {0x001A00C0, nullptr, "GetDSiWareExportSize"}, - {0x001B0144, nullptr, "ExportDSiWare"}, - {0x001C0084, nullptr, "ImportDSiWare"}, - {0x00230080, nullptr, "TitleIDListGetTotal2"}, - {0x002400C2, nullptr, "GetTitleIDList2"}, - {0x04010080, nullptr, "InstallFIRM"}, - {0x04020040, nullptr, "StartInstallCIADB0"}, - {0x04030000, nullptr, "StartInstallCIADB1"}, - {0x04040002, nullptr, "AbortCIAInstall"}, - {0x04050002, nullptr, "CloseCIAFinalizeInstall"}, - {0x04060002, nullptr, "CloseCIA"}, - {0x040700C2, nullptr, "FinalizeTitlesInstall"}, - {0x04080042, nullptr, "GetCiaFileInfo"}, - {0x040E00C2, nullptr, "InstallTitlesFinish"}, - {0x040F0000, nullptr, "InstallNATIVEFIRM"}, - {0x041000C0, nullptr, "DeleteTitle"}, - {0x04120000, nullptr, "Initialize"}, - {0x041700C0, nullptr, "MigrateAGBtoSAV"} -}; +const Interface::FunctionInfo FunctionTable[] = {{0x00010040, GetTitleCount, "GetTitleCount"}, + {0x00020082, GetTitleList, "GetTitleList"}, + {0x00030084, GetTitleInfo, "GetTitleInfo"}, + {0x000400C0, nullptr, "DeleteApplicationTitle"}, + {0x000500C0, nullptr, "GetTitleProductCode"}, + {0x000600C0, nullptr, "GetTitleExtDataId"}, + {0x00070080, DeleteTicket, "DeleteTicket"}, + {0x00080000, GetTicketCount, "GetTicketCount"}, + {0x00090082, GetTicketList, "GetTicketList"}, + {0x000A0000, nullptr, "GetDeviceID"}, + {0x000D0084, nullptr, "GetPendingTitleInfo"}, + {0x000E00C0, nullptr, "DeletePendingTitle"}, + {0x00140040, nullptr, "FinalizePendingTitles"}, + {0x00150040, nullptr, "DeleteAllPendingTitles"}, + {0x00180080, nullptr, "InitializeTitleDatabase"}, + {0x00190040, nullptr, "ReloadDBS"}, + {0x001A00C0, nullptr, "GetDSiWareExportSize"}, + {0x001B0144, nullptr, "ExportDSiWare"}, + {0x001C0084, nullptr, "ImportDSiWare"}, + {0x00230080, nullptr, "TitleIDListGetTotal2"}, + {0x002400C2, nullptr, "GetTitleIDList2"}, + {0x04010080, nullptr, "InstallFIRM"}, + {0x04020040, nullptr, "StartInstallCIADB0"}, + {0x04030000, nullptr, "StartInstallCIADB1"}, + {0x04040002, nullptr, "AbortCIAInstall"}, + {0x04050002, nullptr, "CloseCIAFinalizeInstall"}, + {0x04060002, nullptr, "CloseCIA"}, + {0x040700C2, nullptr, "FinalizeTitlesInstall"}, + {0x04080042, nullptr, "GetCiaFileInfo"}, + {0x040E00C2, nullptr, "InstallTitlesFinish"}, + {0x040F0000, nullptr, "InstallNATIVEFIRM"}, + {0x041000C0, nullptr, "DeleteTitle"}, + {0x04120000, nullptr, "Initialize"}, + {0x041700C0, nullptr, "MigrateAGBtoSAV"}}; AM_U_Interface::AM_U_Interface() { Register(FunctionTable); diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 4d2956638..c798e8752 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -7,7 +7,6 @@ #include "common/logging/log.h" #include "core/hle/applets/applet.h" -#include "core/hle/service/service.h" #include "core/hle/service/apt/apt.h" #include "core/hle/service/apt/apt_a.h" #include "core/hle/service/apt/apt_s.h" @@ -15,6 +14,7 @@ #include "core/hle/service/apt/bcfnt/bcfnt.h" #include "core/hle/service/fs/archive.h" #include "core/hle/service/ptm/ptm.h" +#include "core/hle/service/service.h" #include "core/hle/kernel/event.h" #include "core/hle/kernel/mutex.h" @@ -30,7 +30,7 @@ static bool shared_font_relocated = false; static Kernel::SharedPtr lock; static Kernel::SharedPtr notification_event; ///< APT notification event -static Kernel::SharedPtr parameter_event; ///< APT parameter event +static Kernel::SharedPtr parameter_event; ///< APT parameter event static u32 cpu_percent; ///< CPU time available to the running application @@ -51,7 +51,7 @@ void SendParameter(const MessageParameter& parameter) { void Initialize(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 app_id = cmd_buff[1]; - u32 flags = cmd_buff[2]; + u32 flags = cmd_buff[2]; cmd_buff[2] = IPC::CopyHandleDesc(2); cmd_buff[3] = Kernel::g_handle_table.Create(notification_event).MoveFrom(); @@ -75,20 +75,24 @@ void GetSharedFont(Service::Interface* self) { if (!shared_font_mem) { LOG_ERROR(Service_APT, "shared font file missing - go dump it from your 3ds"); cmd_buff[0] = IPC::MakeHeader(0x44, 2, 2); - cmd_buff[1] = -1; // TODO: Find the right error code + cmd_buff[1] = -1; // TODO: Find the right error code return; } - // The shared font has to be relocated to the new address before being passed to the application. - VAddr target_address = Memory::PhysicalToVirtualAddress(shared_font_mem->linear_heap_phys_address); + // The shared font has to be relocated to the new address before being passed to the + // application. + VAddr target_address = + Memory::PhysicalToVirtualAddress(shared_font_mem->linear_heap_phys_address); if (!shared_font_relocated) { BCFNT::RelocateSharedFont(shared_font_mem, target_address); shared_font_relocated = true; } cmd_buff[0] = IPC::MakeHeader(0x44, 2, 2); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - // Since the SharedMemory interface doesn't provide the address at which the memory was allocated, - // the real APT service calculates this address by scanning the entire address space (using svcQueryMemory) + // Since the SharedMemory interface doesn't provide the address at which the memory was + // allocated, + // the real APT service calculates this address by scanning the entire address space (using + // svcQueryMemory) // and searches for an allocation of the same size as the Shared Font. cmd_buff[2] = target_address; cmd_buff[3] = IPC::CopyHandleDesc(); @@ -112,18 +116,19 @@ void GetLockHandle(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[2] = applet_attributes; // Applet Attributes, this value is passed to Enable. - cmd_buff[3] = 0; // Least significant bit = power button state + cmd_buff[3] = 0; // Least significant bit = power button state cmd_buff[4] = IPC::CopyHandleDesc(); cmd_buff[5] = Kernel::g_handle_table.Create(lock).MoveFrom(); - LOG_WARNING(Service_APT, "(STUBBED) called handle=0x%08X applet_attributes=0x%08X", cmd_buff[5], applet_attributes); + LOG_WARNING(Service_APT, "(STUBBED) called handle=0x%08X applet_attributes=0x%08X", cmd_buff[5], + applet_attributes); } void Enable(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 attributes = cmd_buff[1]; cmd_buff[1] = RESULT_SUCCESS.raw; // No error - parameter_event->Signal(); // Let the application know that it has been started + parameter_event->Signal(); // Let the application know that it has been started LOG_WARNING(Service_APT, "(STUBBED) called attributes=0x%08X", attributes); } @@ -133,7 +138,7 @@ void GetAppletManInfo(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[2] = 0; cmd_buff[3] = 0; - cmd_buff[4] = static_cast(AppletId::HomeMenu); // Home menu AppID + cmd_buff[4] = static_cast(AppletId::HomeMenu); // Home menu AppID cmd_buff[5] = static_cast(AppletId::Application); // TODO(purpasmart96): Do this correctly LOG_WARNING(Service_APT, "(STUBBED) called unk=0x%08X", unk); @@ -159,23 +164,24 @@ void IsRegistered(Service::Interface* self) { void InquireNotification(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 app_id = cmd_buff[1]; - cmd_buff[1] = RESULT_SUCCESS.raw; // No error + cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[2] = static_cast(SignalType::None); // Signal type LOG_WARNING(Service_APT, "(STUBBED) called app_id=0x%08X", app_id); } void SendParameter(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - u32 src_app_id = cmd_buff[1]; - u32 dst_app_id = cmd_buff[2]; - u32 signal_type = cmd_buff[3]; - u32 buffer_size = cmd_buff[4]; - u32 value = cmd_buff[5]; - u32 handle = cmd_buff[6]; - u32 size = cmd_buff[7]; - u32 buffer = cmd_buff[8]; - - std::shared_ptr dest_applet = HLE::Applets::Applet::Get(static_cast(dst_app_id)); + u32 src_app_id = cmd_buff[1]; + u32 dst_app_id = cmd_buff[2]; + u32 signal_type = cmd_buff[3]; + u32 buffer_size = cmd_buff[4]; + u32 value = cmd_buff[5]; + u32 handle = cmd_buff[6]; + u32 size = cmd_buff[7]; + u32 buffer = cmd_buff[8]; + + std::shared_ptr dest_applet = + HLE::Applets::Applet::Get(static_cast(dst_app_id)); if (dest_applet == nullptr) { LOG_ERROR(Service_APT, "Unknown applet id=0x%08X", dst_app_id); @@ -193,9 +199,11 @@ void SendParameter(Service::Interface* self) { cmd_buff[1] = dest_applet->ReceiveParameter(param).raw; - LOG_WARNING(Service_APT, "(STUBBED) called src_app_id=0x%08X, dst_app_id=0x%08X, signal_type=0x%08X," - "buffer_size=0x%08X, value=0x%08X, handle=0x%08X, size=0x%08X, in_param_buffer_ptr=0x%08X", - src_app_id, dst_app_id, signal_type, buffer_size, value, handle, size, buffer); + LOG_WARNING( + Service_APT, + "(STUBBED) called src_app_id=0x%08X, dst_app_id=0x%08X, signal_type=0x%08X," + "buffer_size=0x%08X, value=0x%08X, handle=0x%08X, size=0x%08X, in_param_buffer_ptr=0x%08X", + src_app_id, dst_app_id, signal_type, buffer_size, value, handle, size, buffer); } void ReceiveParameter(Service::Interface* self) { @@ -206,7 +214,7 @@ void ReceiveParameter(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[2] = next_parameter.sender_id; - cmd_buff[3] = next_parameter.signal; // Signal type + cmd_buff[3] = next_parameter.signal; // Signal type cmd_buff[4] = next_parameter.buffer.size(); // Parameter buffer size cmd_buff[5] = 0x10; cmd_buff[6] = 0; @@ -228,7 +236,7 @@ void GlanceParameter(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[2] = next_parameter.sender_id; - cmd_buff[3] = next_parameter.signal; // Signal type + cmd_buff[3] = next_parameter.signal; // Signal type cmd_buff[4] = next_parameter.buffer.size(); // Parameter buffer size cmd_buff[5] = 0x10; cmd_buff[6] = 0; @@ -237,32 +245,34 @@ void GlanceParameter(Service::Interface* self) { cmd_buff[7] = (next_parameter.buffer.size() << 14) | 2; cmd_buff[8] = buffer; - Memory::WriteBlock(buffer, next_parameter.buffer.data(), std::min(static_cast(buffer_size), next_parameter.buffer.size())); + Memory::WriteBlock(buffer, next_parameter.buffer.data(), + std::min(static_cast(buffer_size), next_parameter.buffer.size())); LOG_WARNING(Service_APT, "called app_id=0x%08X, buffer_size=0x%08X", app_id, buffer_size); } void CancelParameter(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - u32 flag1 = cmd_buff[1]; - u32 unk = cmd_buff[2]; - u32 flag2 = cmd_buff[3]; + u32 flag1 = cmd_buff[1]; + u32 unk = cmd_buff[2]; + u32 flag2 = cmd_buff[3]; u32 app_id = cmd_buff[4]; cmd_buff[1] = RESULT_SUCCESS.raw; // No error - cmd_buff[2] = 1; // Set to Success + cmd_buff[2] = 1; // Set to Success - LOG_WARNING(Service_APT, "(STUBBED) called flag1=0x%08X, unk=0x%08X, flag2=0x%08X, app_id=0x%08X", - flag1, unk, flag2, app_id); + LOG_WARNING(Service_APT, + "(STUBBED) called flag1=0x%08X, unk=0x%08X, flag2=0x%08X, app_id=0x%08X", flag1, + unk, flag2, app_id); } void PrepareToStartApplication(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - u32 title_info1 = cmd_buff[1]; - u32 title_info2 = cmd_buff[2]; - u32 title_info3 = cmd_buff[3]; - u32 title_info4 = cmd_buff[4]; - u32 flags = cmd_buff[5]; + u32 title_info1 = cmd_buff[1]; + u32 title_info2 = cmd_buff[2]; + u32 title_info3 = cmd_buff[3]; + u32 title_info4 = cmd_buff[4]; + u32 flags = cmd_buff[5]; if (flags & 0x00000100) { unknown_ns_state_field = 1; @@ -270,25 +280,28 @@ void PrepareToStartApplication(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; // 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); + 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); } void StartApplication(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 buffer1_size = cmd_buff[1]; u32 buffer2_size = cmd_buff[2]; - u32 flag = cmd_buff[3]; - u32 size1 = cmd_buff[4]; - u32 buffer1_ptr = cmd_buff[5]; - u32 size2 = cmd_buff[6]; - u32 buffer2_ptr = cmd_buff[7]; + u32 flag = cmd_buff[3]; + u32 size1 = cmd_buff[4]; + u32 buffer1_ptr = cmd_buff[5]; + u32 size2 = cmd_buff[6]; + u32 buffer2_ptr = cmd_buff[7]; cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_APT, "(STUBBED) called buffer1_size=0x%08X, buffer2_size=0x%08X, flag=0x%08X," - "size1=0x%08X, buffer1_ptr=0x%08X, size2=0x%08X, buffer2_ptr=0x%08X", - buffer1_size, buffer2_size, flag, size1, buffer1_ptr, size2, buffer2_ptr); + LOG_WARNING(Service_APT, + "(STUBBED) called buffer1_size=0x%08X, buffer2_size=0x%08X, flag=0x%08X," + "size1=0x%08X, buffer1_ptr=0x%08X, size2=0x%08X, buffer2_ptr=0x%08X", + buffer1_size, buffer2_size, flag, size1, buffer1_ptr, size2, buffer2_ptr); } void AppletUtility(Service::Interface* self) { @@ -303,14 +316,15 @@ void AppletUtility(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_APT, "(STUBBED) called command=0x%08X, buffer1_size=0x%08X, buffer2_size=0x%08X, " - "buffer1_addr=0x%08X, buffer2_addr=0x%08X", command, buffer1_size, buffer2_size, - buffer1_addr, buffer2_addr); + LOG_WARNING(Service_APT, + "(STUBBED) called command=0x%08X, buffer1_size=0x%08X, buffer2_size=0x%08X, " + "buffer1_addr=0x%08X, buffer2_addr=0x%08X", + command, buffer1_size, buffer2_size, buffer1_addr, buffer2_addr); } void SetAppCpuTimeLimit(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - u32 value = cmd_buff[1]; + u32 value = cmd_buff[1]; cpu_percent = cmd_buff[2]; if (value != 1) { @@ -393,7 +407,8 @@ void SetScreenCapPostPermission(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x55, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u", screen_capture_post_permission); + LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u", + screen_capture_post_permission); } void GetScreenCapPostPermission(Service::Interface* self) { @@ -402,7 +417,8 @@ void GetScreenCapPostPermission(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x56, 2, 0); cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = static_cast(screen_capture_post_permission); - LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u", screen_capture_post_permission); + LOG_WARNING(Service_APT, "(STUBBED) screen_capture_post_permission=%u", + screen_capture_post_permission); } void GetAppletInfo(Service::Interface* self) { @@ -418,7 +434,8 @@ void GetAppletInfo(Service::Interface* self) { cmd_buff[7] = 0; // Applet Attributes } else { cmd_buff[1] = ResultCode(ErrorDescription::NotFound, ErrorModule::Applet, - ErrorSummary::NotFound, ErrorLevel::Status).raw; + ErrorSummary::NotFound, ErrorLevel::Status) + .raw; } LOG_WARNING(Service_APT, "(stubbed) called appid=%u", app_id); } @@ -429,11 +446,15 @@ void GetStartupArgument(Service::Interface* self) { StartupArgumentType startup_argument_type = static_cast(cmd_buff[2]); if (parameter_size >= 0x300) { - LOG_ERROR(Service_APT, "Parameter size is outside the valid range (capped to 0x300): parameter_size=0x%08x", parameter_size); + LOG_ERROR( + Service_APT, + "Parameter size is outside the valid range (capped to 0x300): parameter_size=0x%08x", + parameter_size); return; } - LOG_WARNING(Service_APT,"(stubbed) called startup_argument_type=%u , parameter_size=0x%08x , parameter_value=0x%08x", + LOG_WARNING(Service_APT, "(stubbed) called startup_argument_type=%u , parameter_size=0x%08x , " + "parameter_value=0x%08x", startup_argument_type, parameter_size, Memory::Read32(cmd_buff[41])); cmd_buff[1] = RESULT_SUCCESS.raw; @@ -484,8 +505,10 @@ void Init() { if (file.IsOpen()) { // Create shared font memory object using Kernel::MemoryPermission; - shared_font_mem = Kernel::SharedMemory::Create(nullptr, 0x332000, // 3272 KB - MemoryPermission::ReadWrite, MemoryPermission::Read, 0, Kernel::MemoryRegion::SYSTEM, "APT:SharedFont"); + shared_font_mem = + Kernel::SharedMemory::Create(nullptr, 0x332000, // 3272 KB + MemoryPermission::ReadWrite, MemoryPermission::Read, 0, + Kernel::MemoryRegion::SYSTEM, "APT:SharedFont"); // Read shared font data file.ReadBytes(shared_font_mem->GetPointer(), file.GetSize()); } else { @@ -497,7 +520,8 @@ void Init() { cpu_percent = 0; unknown_ns_state_field = 0; - screen_capture_post_permission = ScreencapPostPermission::CleanThePermission; // TODO(JamePeng): verify the initial value + screen_capture_post_permission = + ScreencapPostPermission::CleanThePermission; // TODO(JamePeng): verify the initial value // TODO(bunnei): Check if these are created in Initialize or on APT process startup. notification_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "APT_U:Notification"); diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h index 077a6a316..fe8b8a7b8 100644 --- a/src/core/hle/service/apt/apt.h +++ b/src/core/hle/service/apt/apt.h @@ -46,58 +46,58 @@ static_assert(sizeof(CaptureBufferInfo) == 0x20, "CaptureBufferInfo struct has i /// Signals used by APT functions enum class SignalType : u32 { - None = 0x0, - AppJustStarted = 0x1, + None = 0x0, + AppJustStarted = 0x1, LibAppJustStarted = 0x2, - LibAppFinished = 0x3, - LibAppClosed = 0xA, - ReturningToApp = 0xB, - ExitingApp = 0xC, + LibAppFinished = 0x3, + LibAppClosed = 0xA, + ReturningToApp = 0xB, + ExitingApp = 0xC, }; /// App Id's used by APT functions enum class AppletId : u32 { - HomeMenu = 0x101, - AlternateMenu = 0x103, - Camera = 0x110, - FriendsList = 0x112, - GameNotes = 0x113, - InternetBrowser = 0x114, - InstructionManual = 0x115, - Notifications = 0x116, - Miiverse = 0x117, - MiiversePost = 0x118, - AmiiboSettings = 0x119, - SoftwareKeyboard1 = 0x201, - Ed1 = 0x202, - PnoteApp = 0x204, - SnoteApp = 0x205, - Error = 0x206, - Mint = 0x207, - Extrapad = 0x208, - Memolib = 0x209, - Application = 0x300, - AnyLibraryApplet = 0x400, - SoftwareKeyboard2 = 0x401, - Ed2 = 0x402, - PnoteApp2 = 0x404, - SnoteApp2 = 0x405, - Error2 = 0x406, - Mint2 = 0x407, - Extrapad2 = 0x408, - Memolib2 = 0x409, + HomeMenu = 0x101, + AlternateMenu = 0x103, + Camera = 0x110, + FriendsList = 0x112, + GameNotes = 0x113, + InternetBrowser = 0x114, + InstructionManual = 0x115, + Notifications = 0x116, + Miiverse = 0x117, + MiiversePost = 0x118, + AmiiboSettings = 0x119, + SoftwareKeyboard1 = 0x201, + Ed1 = 0x202, + PnoteApp = 0x204, + SnoteApp = 0x205, + Error = 0x206, + Mint = 0x207, + Extrapad = 0x208, + Memolib = 0x209, + Application = 0x300, + AnyLibraryApplet = 0x400, + SoftwareKeyboard2 = 0x401, + Ed2 = 0x402, + PnoteApp2 = 0x404, + SnoteApp2 = 0x405, + Error2 = 0x406, + Mint2 = 0x407, + Extrapad2 = 0x408, + Memolib2 = 0x409, }; enum class StartupArgumentType : u32 { - OtherApp = 0, - Restart = 1, + OtherApp = 0, + Restart = 1, OtherMedia = 2, }; enum class ScreencapPostPermission : u32 { - CleanThePermission = 0, //TODO(JamePeng): verify what "zero" means - NoExplicitSetting = 1, - EnableScreenshotPostingToMiiverse = 2, + CleanThePermission = 0, // TODO(JamePeng): verify what "zero" means + NoExplicitSetting = 1, + EnableScreenshotPostingToMiiverse = 2, DisableScreenshotPostingToMiiverse = 3 }; @@ -182,9 +182,12 @@ void GetAppletManInfo(Service::Interface* self); void GetAppletInfo(Service::Interface* self); /** - * APT::IsRegistered service function. This returns whether the specified AppID is registered with NS yet. - * An AppID is "registered" once the process associated with the AppID uses APT:Enable. Home Menu uses this - * command to determine when the launched process is running and to determine when to stop using GSP etc, + * APT::IsRegistered service function. This returns whether the specified AppID is registered with + * NS yet. + * An AppID is "registered" once the process associated with the AppID uses APT:Enable. Home Menu + * uses this + * command to determine when the launched process is running and to determine when to stop using GSP + * etc, * while displaying the "Nintendo 3DS" loading screen. * Inputs: * 1 : AppID @@ -260,9 +263,11 @@ void GlanceParameter(Service::Interface* self); * clears the flag which indicates that parameter data is available * (same flag cleared by APT:ReceiveParameter). * Inputs: - * 1 : Flag, when non-zero NS will compare the word after this one with a field in the NS state. + * 1 : Flag, when non-zero NS will compare the word after this one with a field in the NS + * state. * 2 : Unknown, this is the same as the first unknown field returned by APT:ReceiveParameter. - * 3 : Flag, when non-zero NS will compare the word after this one with a field in the NS state. + * 3 : Flag, when non-zero NS will compare the word after this one with a field in the NS + * state. * 4 : AppID * Outputs: * 0 : Return header diff --git a/src/core/hle/service/apt/apt_a.cpp b/src/core/hle/service/apt/apt_a.cpp index 6c44c491c..7d47d7675 100644 --- a/src/core/hle/service/apt/apt_a.cpp +++ b/src/core/hle/service/apt/apt_a.cpp @@ -9,35 +9,34 @@ namespace Service { namespace APT { const Interface::FunctionInfo FunctionTable[] = { - {0x00010040, GetLockHandle, "GetLockHandle?"}, - {0x00020080, Initialize, "Initialize?"}, - {0x00030040, Enable, "Enable?"}, - {0x00040040, nullptr, "Finalize?"}, - {0x00050040, GetAppletManInfo, "GetAppletManInfo"}, - {0x00060040, GetAppletInfo, "GetAppletInfo"}, - {0x00090040, IsRegistered, "IsRegistered"}, - {0x000B0040, InquireNotification, "InquireNotification"}, - {0x000C0104, SendParameter, "SendParameter"}, - {0x000D0080, ReceiveParameter, "ReceiveParameter"}, - {0x000E0080, GlanceParameter, "GlanceParameter"}, - {0x000F0100, CancelParameter, "CancelParameter"}, - {0x00150140, PrepareToStartApplication, "PrepareToStartApplication"}, - {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, - {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, - {0x001E0084, StartLibraryApplet, "StartLibraryApplet"}, - {0x003B0040, nullptr, "CancelLibraryApplet?"}, - {0x003E0080, nullptr, "ReplySleepQuery"}, - {0x00430040, NotifyToWait, "NotifyToWait?"}, - {0x00440000, GetSharedFont, "GetSharedFont?"}, - {0x004B00C2, AppletUtility, "AppletUtility?"}, - {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, - {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, - {0x00510080, GetStartupArgument, "GetStartupArgument"}, - {0x00550040, SetScreenCapPostPermission, "SetScreenCapPostPermission"}, - {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"}, - {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, - {0x01020000, CheckNew3DS, "CheckNew3DS"} -}; + {0x00010040, GetLockHandle, "GetLockHandle?"}, + {0x00020080, Initialize, "Initialize?"}, + {0x00030040, Enable, "Enable?"}, + {0x00040040, nullptr, "Finalize?"}, + {0x00050040, GetAppletManInfo, "GetAppletManInfo"}, + {0x00060040, GetAppletInfo, "GetAppletInfo"}, + {0x00090040, IsRegistered, "IsRegistered"}, + {0x000B0040, InquireNotification, "InquireNotification"}, + {0x000C0104, SendParameter, "SendParameter"}, + {0x000D0080, ReceiveParameter, "ReceiveParameter"}, + {0x000E0080, GlanceParameter, "GlanceParameter"}, + {0x000F0100, CancelParameter, "CancelParameter"}, + {0x00150140, PrepareToStartApplication, "PrepareToStartApplication"}, + {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, + {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, + {0x001E0084, StartLibraryApplet, "StartLibraryApplet"}, + {0x003B0040, nullptr, "CancelLibraryApplet?"}, + {0x003E0080, nullptr, "ReplySleepQuery"}, + {0x00430040, NotifyToWait, "NotifyToWait?"}, + {0x00440000, GetSharedFont, "GetSharedFont?"}, + {0x004B00C2, AppletUtility, "AppletUtility?"}, + {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, + {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, + {0x00510080, GetStartupArgument, "GetStartupArgument"}, + {0x00550040, SetScreenCapPostPermission, "SetScreenCapPostPermission"}, + {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"}, + {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, + {0x01020000, CheckNew3DS, "CheckNew3DS"}}; APT_A_Interface::APT_A_Interface() { Register(FunctionTable); diff --git a/src/core/hle/service/apt/apt_s.cpp b/src/core/hle/service/apt/apt_s.cpp index c70f2201f..76e71669c 100644 --- a/src/core/hle/service/apt/apt_s.cpp +++ b/src/core/hle/service/apt/apt_s.cpp @@ -9,95 +9,94 @@ namespace Service { namespace APT { const Interface::FunctionInfo FunctionTable[] = { - {0x00010040, GetLockHandle, "GetLockHandle"}, - {0x00020080, Initialize, "Initialize"}, - {0x00030040, Enable, "Enable"}, - {0x00040040, nullptr, "Finalize"}, - {0x00050040, GetAppletManInfo, "GetAppletManInfo"}, - {0x00060040, GetAppletInfo, "GetAppletInfo"}, - {0x00070000, nullptr, "GetLastSignaledAppletId"}, - {0x00080000, nullptr, "CountRegisteredApplet"}, - {0x00090040, nullptr, "IsRegistered"}, - {0x000A0040, nullptr, "GetAttribute"}, - {0x000B0040, InquireNotification, "InquireNotification"}, - {0x000C0104, nullptr, "SendParameter"}, - {0x000D0080, ReceiveParameter, "ReceiveParameter"}, - {0x000E0080, GlanceParameter, "GlanceParameter"}, - {0x000F0100, nullptr, "CancelParameter"}, - {0x001000C2, nullptr, "DebugFunc"}, - {0x001100C0, nullptr, "MapProgramIdForDebug"}, - {0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"}, - {0x00130000, nullptr, "GetPreparationState"}, - {0x00140040, nullptr, "SetPreparationState"}, + {0x00010040, GetLockHandle, "GetLockHandle"}, + {0x00020080, Initialize, "Initialize"}, + {0x00030040, Enable, "Enable"}, + {0x00040040, nullptr, "Finalize"}, + {0x00050040, GetAppletManInfo, "GetAppletManInfo"}, + {0x00060040, GetAppletInfo, "GetAppletInfo"}, + {0x00070000, nullptr, "GetLastSignaledAppletId"}, + {0x00080000, nullptr, "CountRegisteredApplet"}, + {0x00090040, nullptr, "IsRegistered"}, + {0x000A0040, nullptr, "GetAttribute"}, + {0x000B0040, InquireNotification, "InquireNotification"}, + {0x000C0104, nullptr, "SendParameter"}, + {0x000D0080, ReceiveParameter, "ReceiveParameter"}, + {0x000E0080, GlanceParameter, "GlanceParameter"}, + {0x000F0100, nullptr, "CancelParameter"}, + {0x001000C2, nullptr, "DebugFunc"}, + {0x001100C0, nullptr, "MapProgramIdForDebug"}, + {0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"}, + {0x00130000, nullptr, "GetPreparationState"}, + {0x00140040, nullptr, "SetPreparationState"}, {0x00150140, PrepareToStartApplication, "PrepareToStartApplication"}, - {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, - {0x00170040, nullptr, "FinishPreloadingLibraryApplet"}, - {0x00180040, PrepareToStartLibraryApplet,"PrepareToStartLibraryApplet"}, - {0x00190040, nullptr, "PrepareToStartSystemApplet"}, - {0x001A0000, nullptr, "PrepareToStartNewestHomeMenu"}, - {0x001B00C4, nullptr, "StartApplication"}, - {0x001C0000, nullptr, "WakeupApplication"}, - {0x001D0000, nullptr, "CancelApplication"}, - {0x001E0084, nullptr, "StartLibraryApplet"}, - {0x001F0084, nullptr, "StartSystemApplet"}, - {0x00200044, nullptr, "StartNewestHomeMenu"}, - {0x00210000, nullptr, "OrderToCloseApplication"}, - {0x00220040, nullptr, "PrepareToCloseApplication"}, - {0x00230040, nullptr, "PrepareToJumpToApplication"}, - {0x00240044, nullptr, "JumpToApplication"}, - {0x002500C0, nullptr, "PrepareToCloseLibraryApplet"}, - {0x00260000, nullptr, "PrepareToCloseSystemApplet"}, - {0x00270044, nullptr, "CloseApplication"}, - {0x00280044, nullptr, "CloseLibraryApplet"}, - {0x00290044, nullptr, "CloseSystemApplet"}, - {0x002A0000, nullptr, "OrderToCloseSystemApplet"}, - {0x002B0000, nullptr, "PrepareToJumpToHomeMenu"}, - {0x002C0044, nullptr, "JumpToHomeMenu"}, - {0x002D0000, nullptr, "PrepareToLeaveHomeMenu"}, - {0x002E0044, nullptr, "LeaveHomeMenu"}, - {0x002F0040, nullptr, "PrepareToLeaveResidentApplet"}, - {0x00300044, nullptr, "LeaveResidentApplet"}, - {0x00310100, nullptr, "PrepareToDoApplicationJump"}, - {0x00320084, nullptr, "DoApplicationJump"}, - {0x00330000, nullptr, "GetProgramIdOnApplicationJump"}, - {0x00340084, nullptr, "SendDeliverArg"}, - {0x00350080, nullptr, "ReceiveDeliverArg"}, - {0x00360040, nullptr, "LoadSysMenuArg"}, - {0x00370042, nullptr, "StoreSysMenuArg"}, - {0x00380040, nullptr, "PreloadResidentApplet"}, - {0x00390040, nullptr, "PrepareToStartResidentApplet"}, - {0x003A0044, nullptr, "StartResidentApplet"}, - {0x003B0040, nullptr, "CancelLibraryApplet"}, - {0x003C0042, nullptr, "SendDspSleep"}, - {0x003D0042, nullptr, "SendDspWakeUp"}, - {0x003E0080, nullptr, "ReplySleepQuery"}, - {0x003F0040, nullptr, "ReplySleepNotificationComplete"}, - {0x00400042, nullptr, "SendCaptureBufferInfo"}, - {0x00410040, nullptr, "ReceiveCaptureBufferInfo"}, - {0x00420080, nullptr, "SleepSystem"}, - {0x00430040, NotifyToWait, "NotifyToWait"}, - {0x00440000, GetSharedFont, "GetSharedFont"}, - {0x00450040, nullptr, "GetWirelessRebootInfo"}, - {0x00460104, nullptr, "Wrap"}, - {0x00470104, nullptr, "Unwrap"}, - {0x00480100, nullptr, "GetProgramInfo"}, - {0x00490180, nullptr, "Reboot"}, - {0x004A0040, nullptr, "GetCaptureInfo"}, - {0x004B00C2, AppletUtility, "AppletUtility"}, - {0x004C0000, nullptr, "SetFatalErrDispMode"}, - {0x004D0080, nullptr, "GetAppletProgramInfo"}, - {0x004E0000, nullptr, "HardwareResetAsync"}, - {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, - {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, - {0x00510080, GetStartupArgument, "GetStartupArgument"}, - {0x00520104, nullptr, "Wrap1"}, - {0x00530104, nullptr, "Unwrap1"}, + {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, + {0x00170040, nullptr, "FinishPreloadingLibraryApplet"}, + {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, + {0x00190040, nullptr, "PrepareToStartSystemApplet"}, + {0x001A0000, nullptr, "PrepareToStartNewestHomeMenu"}, + {0x001B00C4, nullptr, "StartApplication"}, + {0x001C0000, nullptr, "WakeupApplication"}, + {0x001D0000, nullptr, "CancelApplication"}, + {0x001E0084, nullptr, "StartLibraryApplet"}, + {0x001F0084, nullptr, "StartSystemApplet"}, + {0x00200044, nullptr, "StartNewestHomeMenu"}, + {0x00210000, nullptr, "OrderToCloseApplication"}, + {0x00220040, nullptr, "PrepareToCloseApplication"}, + {0x00230040, nullptr, "PrepareToJumpToApplication"}, + {0x00240044, nullptr, "JumpToApplication"}, + {0x002500C0, nullptr, "PrepareToCloseLibraryApplet"}, + {0x00260000, nullptr, "PrepareToCloseSystemApplet"}, + {0x00270044, nullptr, "CloseApplication"}, + {0x00280044, nullptr, "CloseLibraryApplet"}, + {0x00290044, nullptr, "CloseSystemApplet"}, + {0x002A0000, nullptr, "OrderToCloseSystemApplet"}, + {0x002B0000, nullptr, "PrepareToJumpToHomeMenu"}, + {0x002C0044, nullptr, "JumpToHomeMenu"}, + {0x002D0000, nullptr, "PrepareToLeaveHomeMenu"}, + {0x002E0044, nullptr, "LeaveHomeMenu"}, + {0x002F0040, nullptr, "PrepareToLeaveResidentApplet"}, + {0x00300044, nullptr, "LeaveResidentApplet"}, + {0x00310100, nullptr, "PrepareToDoApplicationJump"}, + {0x00320084, nullptr, "DoApplicationJump"}, + {0x00330000, nullptr, "GetProgramIdOnApplicationJump"}, + {0x00340084, nullptr, "SendDeliverArg"}, + {0x00350080, nullptr, "ReceiveDeliverArg"}, + {0x00360040, nullptr, "LoadSysMenuArg"}, + {0x00370042, nullptr, "StoreSysMenuArg"}, + {0x00380040, nullptr, "PreloadResidentApplet"}, + {0x00390040, nullptr, "PrepareToStartResidentApplet"}, + {0x003A0044, nullptr, "StartResidentApplet"}, + {0x003B0040, nullptr, "CancelLibraryApplet"}, + {0x003C0042, nullptr, "SendDspSleep"}, + {0x003D0042, nullptr, "SendDspWakeUp"}, + {0x003E0080, nullptr, "ReplySleepQuery"}, + {0x003F0040, nullptr, "ReplySleepNotificationComplete"}, + {0x00400042, nullptr, "SendCaptureBufferInfo"}, + {0x00410040, nullptr, "ReceiveCaptureBufferInfo"}, + {0x00420080, nullptr, "SleepSystem"}, + {0x00430040, NotifyToWait, "NotifyToWait"}, + {0x00440000, GetSharedFont, "GetSharedFont"}, + {0x00450040, nullptr, "GetWirelessRebootInfo"}, + {0x00460104, nullptr, "Wrap"}, + {0x00470104, nullptr, "Unwrap"}, + {0x00480100, nullptr, "GetProgramInfo"}, + {0x00490180, nullptr, "Reboot"}, + {0x004A0040, nullptr, "GetCaptureInfo"}, + {0x004B00C2, AppletUtility, "AppletUtility"}, + {0x004C0000, nullptr, "SetFatalErrDispMode"}, + {0x004D0080, nullptr, "GetAppletProgramInfo"}, + {0x004E0000, nullptr, "HardwareResetAsync"}, + {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, + {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, + {0x00510080, GetStartupArgument, "GetStartupArgument"}, + {0x00520104, nullptr, "Wrap1"}, + {0x00530104, nullptr, "Unwrap1"}, {0x00550040, SetScreenCapPostPermission, "SetScreenCapPostPermission"}, {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"}, - {0x00580002, nullptr, "GetProgramID"}, - {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, - {0x01020000, CheckNew3DS, "CheckNew3DS"} -}; + {0x00580002, nullptr, "GetProgramID"}, + {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, + {0x01020000, CheckNew3DS, "CheckNew3DS"}}; APT_S_Interface::APT_S_Interface() { Register(FunctionTable); diff --git a/src/core/hle/service/apt/apt_u.cpp b/src/core/hle/service/apt/apt_u.cpp index 7bb804ffa..9c6223dd7 100644 --- a/src/core/hle/service/apt/apt_u.cpp +++ b/src/core/hle/service/apt/apt_u.cpp @@ -9,95 +9,94 @@ namespace Service { namespace APT { const Interface::FunctionInfo FunctionTable[] = { - {0x00010040, GetLockHandle, "GetLockHandle"}, - {0x00020080, Initialize, "Initialize"}, - {0x00030040, Enable, "Enable"}, - {0x00040040, nullptr, "Finalize"}, - {0x00050040, GetAppletManInfo, "GetAppletManInfo"}, - {0x00060040, GetAppletInfo, "GetAppletInfo"}, - {0x00070000, nullptr, "GetLastSignaledAppletId"}, - {0x00080000, nullptr, "CountRegisteredApplet"}, - {0x00090040, IsRegistered, "IsRegistered"}, - {0x000A0040, nullptr, "GetAttribute"}, - {0x000B0040, InquireNotification, "InquireNotification"}, - {0x000C0104, SendParameter, "SendParameter"}, - {0x000D0080, ReceiveParameter, "ReceiveParameter"}, - {0x000E0080, GlanceParameter, "GlanceParameter"}, - {0x000F0100, CancelParameter, "CancelParameter"}, - {0x001000C2, nullptr, "DebugFunc"}, - {0x001100C0, nullptr, "MapProgramIdForDebug"}, - {0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"}, - {0x00130000, nullptr, "GetPreparationState"}, - {0x00140040, nullptr, "SetPreparationState"}, - {0x00150140, PrepareToStartApplication, "PrepareToStartApplication"}, - {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, - {0x00170040, nullptr, "FinishPreloadingLibraryApplet"}, - {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, - {0x00190040, nullptr, "PrepareToStartSystemApplet"}, - {0x001A0000, nullptr, "PrepareToStartNewestHomeMenu"}, - {0x001B00C4, nullptr, "StartApplication"}, - {0x001C0000, nullptr, "WakeupApplication"}, - {0x001D0000, nullptr, "CancelApplication"}, - {0x001E0084, StartLibraryApplet, "StartLibraryApplet"}, - {0x001F0084, nullptr, "StartSystemApplet"}, - {0x00200044, nullptr, "StartNewestHomeMenu"}, - {0x00210000, nullptr, "OrderToCloseApplication"}, - {0x00220040, nullptr, "PrepareToCloseApplication"}, - {0x00230040, nullptr, "PrepareToJumpToApplication"}, - {0x00240044, nullptr, "JumpToApplication"}, - {0x002500C0, nullptr, "PrepareToCloseLibraryApplet"}, - {0x00260000, nullptr, "PrepareToCloseSystemApplet"}, - {0x00270044, nullptr, "CloseApplication"}, - {0x00280044, nullptr, "CloseLibraryApplet"}, - {0x00290044, nullptr, "CloseSystemApplet"}, - {0x002A0000, nullptr, "OrderToCloseSystemApplet"}, - {0x002B0000, nullptr, "PrepareToJumpToHomeMenu"}, - {0x002C0044, nullptr, "JumpToHomeMenu"}, - {0x002D0000, nullptr, "PrepareToLeaveHomeMenu"}, - {0x002E0044, nullptr, "LeaveHomeMenu"}, - {0x002F0040, nullptr, "PrepareToLeaveResidentApplet"}, - {0x00300044, nullptr, "LeaveResidentApplet"}, - {0x00310100, nullptr, "PrepareToDoApplicationJump"}, - {0x00320084, nullptr, "DoApplicationJump"}, - {0x00330000, nullptr, "GetProgramIdOnApplicationJump"}, - {0x00340084, nullptr, "SendDeliverArg"}, - {0x00350080, nullptr, "ReceiveDeliverArg"}, - {0x00360040, nullptr, "LoadSysMenuArg"}, - {0x00370042, nullptr, "StoreSysMenuArg"}, - {0x00380040, nullptr, "PreloadResidentApplet"}, - {0x00390040, nullptr, "PrepareToStartResidentApplet"}, - {0x003A0044, nullptr, "StartResidentApplet"}, - {0x003B0040, nullptr, "CancelLibraryApplet"}, - {0x003C0042, nullptr, "SendDspSleep"}, - {0x003D0042, nullptr, "SendDspWakeUp"}, - {0x003E0080, nullptr, "ReplySleepQuery"}, - {0x003F0040, nullptr, "ReplySleepNotificationComplete"}, - {0x00400042, nullptr, "SendCaptureBufferInfo"}, - {0x00410040, nullptr, "ReceiveCaptureBufferInfo"}, - {0x00420080, nullptr, "SleepSystem"}, - {0x00430040, NotifyToWait, "NotifyToWait"}, - {0x00440000, GetSharedFont, "GetSharedFont"}, - {0x00450040, nullptr, "GetWirelessRebootInfo"}, - {0x00460104, nullptr, "Wrap"}, - {0x00470104, nullptr, "Unwrap"}, - {0x00480100, nullptr, "GetProgramInfo"}, - {0x00490180, nullptr, "Reboot"}, - {0x004A0040, nullptr, "GetCaptureInfo"}, - {0x004B00C2, AppletUtility, "AppletUtility"}, - {0x004C0000, nullptr, "SetFatalErrDispMode"}, - {0x004D0080, nullptr, "GetAppletProgramInfo"}, - {0x004E0000, nullptr, "HardwareResetAsync"}, - {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, - {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, - {0x00510080, GetStartupArgument, "GetStartupArgument"}, - {0x00520104, nullptr, "Wrap1"}, - {0x00530104, nullptr, "Unwrap1"}, - {0x00550040, SetScreenCapPostPermission, "SetScreenCapPostPermission"}, - {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"}, - {0x00580002, nullptr, "GetProgramID"}, - {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, - {0x01020000, CheckNew3DS, "CheckNew3DS"} -}; + {0x00010040, GetLockHandle, "GetLockHandle"}, + {0x00020080, Initialize, "Initialize"}, + {0x00030040, Enable, "Enable"}, + {0x00040040, nullptr, "Finalize"}, + {0x00050040, GetAppletManInfo, "GetAppletManInfo"}, + {0x00060040, GetAppletInfo, "GetAppletInfo"}, + {0x00070000, nullptr, "GetLastSignaledAppletId"}, + {0x00080000, nullptr, "CountRegisteredApplet"}, + {0x00090040, IsRegistered, "IsRegistered"}, + {0x000A0040, nullptr, "GetAttribute"}, + {0x000B0040, InquireNotification, "InquireNotification"}, + {0x000C0104, SendParameter, "SendParameter"}, + {0x000D0080, ReceiveParameter, "ReceiveParameter"}, + {0x000E0080, GlanceParameter, "GlanceParameter"}, + {0x000F0100, CancelParameter, "CancelParameter"}, + {0x001000C2, nullptr, "DebugFunc"}, + {0x001100C0, nullptr, "MapProgramIdForDebug"}, + {0x00120040, nullptr, "SetHomeMenuAppletIdForDebug"}, + {0x00130000, nullptr, "GetPreparationState"}, + {0x00140040, nullptr, "SetPreparationState"}, + {0x00150140, PrepareToStartApplication, "PrepareToStartApplication"}, + {0x00160040, PreloadLibraryApplet, "PreloadLibraryApplet"}, + {0x00170040, nullptr, "FinishPreloadingLibraryApplet"}, + {0x00180040, PrepareToStartLibraryApplet, "PrepareToStartLibraryApplet"}, + {0x00190040, nullptr, "PrepareToStartSystemApplet"}, + {0x001A0000, nullptr, "PrepareToStartNewestHomeMenu"}, + {0x001B00C4, nullptr, "StartApplication"}, + {0x001C0000, nullptr, "WakeupApplication"}, + {0x001D0000, nullptr, "CancelApplication"}, + {0x001E0084, StartLibraryApplet, "StartLibraryApplet"}, + {0x001F0084, nullptr, "StartSystemApplet"}, + {0x00200044, nullptr, "StartNewestHomeMenu"}, + {0x00210000, nullptr, "OrderToCloseApplication"}, + {0x00220040, nullptr, "PrepareToCloseApplication"}, + {0x00230040, nullptr, "PrepareToJumpToApplication"}, + {0x00240044, nullptr, "JumpToApplication"}, + {0x002500C0, nullptr, "PrepareToCloseLibraryApplet"}, + {0x00260000, nullptr, "PrepareToCloseSystemApplet"}, + {0x00270044, nullptr, "CloseApplication"}, + {0x00280044, nullptr, "CloseLibraryApplet"}, + {0x00290044, nullptr, "CloseSystemApplet"}, + {0x002A0000, nullptr, "OrderToCloseSystemApplet"}, + {0x002B0000, nullptr, "PrepareToJumpToHomeMenu"}, + {0x002C0044, nullptr, "JumpToHomeMenu"}, + {0x002D0000, nullptr, "PrepareToLeaveHomeMenu"}, + {0x002E0044, nullptr, "LeaveHomeMenu"}, + {0x002F0040, nullptr, "PrepareToLeaveResidentApplet"}, + {0x00300044, nullptr, "LeaveResidentApplet"}, + {0x00310100, nullptr, "PrepareToDoApplicationJump"}, + {0x00320084, nullptr, "DoApplicationJump"}, + {0x00330000, nullptr, "GetProgramIdOnApplicationJump"}, + {0x00340084, nullptr, "SendDeliverArg"}, + {0x00350080, nullptr, "ReceiveDeliverArg"}, + {0x00360040, nullptr, "LoadSysMenuArg"}, + {0x00370042, nullptr, "StoreSysMenuArg"}, + {0x00380040, nullptr, "PreloadResidentApplet"}, + {0x00390040, nullptr, "PrepareToStartResidentApplet"}, + {0x003A0044, nullptr, "StartResidentApplet"}, + {0x003B0040, nullptr, "CancelLibraryApplet"}, + {0x003C0042, nullptr, "SendDspSleep"}, + {0x003D0042, nullptr, "SendDspWakeUp"}, + {0x003E0080, nullptr, "ReplySleepQuery"}, + {0x003F0040, nullptr, "ReplySleepNotificationComplete"}, + {0x00400042, nullptr, "SendCaptureBufferInfo"}, + {0x00410040, nullptr, "ReceiveCaptureBufferInfo"}, + {0x00420080, nullptr, "SleepSystem"}, + {0x00430040, NotifyToWait, "NotifyToWait"}, + {0x00440000, GetSharedFont, "GetSharedFont"}, + {0x00450040, nullptr, "GetWirelessRebootInfo"}, + {0x00460104, nullptr, "Wrap"}, + {0x00470104, nullptr, "Unwrap"}, + {0x00480100, nullptr, "GetProgramInfo"}, + {0x00490180, nullptr, "Reboot"}, + {0x004A0040, nullptr, "GetCaptureInfo"}, + {0x004B00C2, AppletUtility, "AppletUtility"}, + {0x004C0000, nullptr, "SetFatalErrDispMode"}, + {0x004D0080, nullptr, "GetAppletProgramInfo"}, + {0x004E0000, nullptr, "HardwareResetAsync"}, + {0x004F0080, SetAppCpuTimeLimit, "SetAppCpuTimeLimit"}, + {0x00500040, GetAppCpuTimeLimit, "GetAppCpuTimeLimit"}, + {0x00510080, GetStartupArgument, "GetStartupArgument"}, + {0x00520104, nullptr, "Wrap1"}, + {0x00530104, nullptr, "Unwrap1"}, + {0x00550040, SetScreenCapPostPermission, "SetScreenCapPostPermission"}, + {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"}, + {0x00580002, nullptr, "GetProgramID"}, + {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, + {0x01020000, CheckNew3DS, "CheckNew3DS"}}; APT_U_Interface::APT_U_Interface() { Register(FunctionTable); diff --git a/src/core/hle/service/boss/boss.cpp b/src/core/hle/service/boss/boss.cpp index 419ec976e..867b31fbf 100644 --- a/src/core/hle/service/boss/boss.cpp +++ b/src/core/hle/service/boss/boss.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/service.h" #include "core/hle/service/boss/boss.h" #include "core/hle/service/boss/boss_p.h" #include "core/hle/service/boss/boss_u.h" +#include "core/hle/service/service.h" namespace Service { namespace BOSS { diff --git a/src/core/hle/service/boss/boss_p.cpp b/src/core/hle/service/boss/boss_p.cpp index c498abe4e..dfee8d055 100644 --- a/src/core/hle/service/boss/boss_p.cpp +++ b/src/core/hle/service/boss/boss_p.cpp @@ -11,7 +11,7 @@ namespace BOSS { // const Interface::FunctionInfo FunctionTable[] = { }; BOSS_P_Interface::BOSS_P_Interface() { - //Register(FunctionTable); + // Register(FunctionTable); } } // namespace BOSS diff --git a/src/core/hle/service/boss/boss_u.cpp b/src/core/hle/service/boss/boss_u.cpp index d59babe71..6affa23b1 100644 --- a/src/core/hle/service/boss/boss_u.cpp +++ b/src/core/hle/service/boss/boss_u.cpp @@ -8,10 +8,10 @@ namespace Service { namespace BOSS { const Interface::FunctionInfo FunctionTable[] = { - {0x00020100, nullptr, "GetStorageInfo"}, - {0x000C0082, nullptr, "UnregisterTask"}, - {0x001E0042, nullptr, "CancelTask"}, - {0x00330042, nullptr, "StartBgImmediate"}, + {0x00020100, nullptr, "GetStorageInfo"}, + {0x000C0082, nullptr, "UnregisterTask"}, + {0x001E0042, nullptr, "CancelTask"}, + {0x00330042, nullptr, "StartBgImmediate"}, }; BOSS_U_Interface::BOSS_U_Interface() { diff --git a/src/core/hle/service/cam/cam.cpp b/src/core/hle/service/cam/cam.cpp index 6edcf9610..ec1f9c749 100644 --- a/src/core/hle/service/cam/cam.cpp +++ b/src/core/hle/service/cam/cam.cpp @@ -71,15 +71,15 @@ void GetBufferErrorInterruptEvent(Service::Interface* self) { } void SetReceiving(Service::Interface* self) { - u32* cmd_buff = Kernel::GetCommandBuffer(); + u32* cmd_buff = Kernel::GetCommandBuffer(); - VAddr dest = cmd_buff[1]; - u8 port = cmd_buff[2] & 0xFF; + VAddr dest = cmd_buff[1]; + u8 port = cmd_buff[2] & 0xFF; u32 image_size = cmd_buff[3]; u16 trans_unit = cmd_buff[4] & 0xFFFF; - Kernel::Event* completion_event = (Port)port == Port::Cam2 ? - completion_event_cam2.get() : completion_event_cam1.get(); + Kernel::Event* completion_event = + (Port)port == Port::Cam2 ? completion_event_cam2.get() : completion_event_cam1.get(); completion_event->Signal(); @@ -89,36 +89,36 @@ void SetReceiving(Service::Interface* self) { cmd_buff[3] = Kernel::g_handle_table.Create(completion_event).MoveFrom(); LOG_WARNING(Service_CAM, "(STUBBED) called, addr=0x%X, port=%d, image_size=%d, trans_unit=%d", - dest, port, image_size, trans_unit); + dest, port, image_size, trans_unit); } void SetTransferLines(Service::Interface* self) { - u32* cmd_buff = Kernel::GetCommandBuffer(); + u32* cmd_buff = Kernel::GetCommandBuffer(); - u8 port = cmd_buff[1] & 0xFF; + u8 port = cmd_buff[1] & 0xFF; u16 transfer_lines = cmd_buff[2] & 0xFFFF; - u16 width = cmd_buff[3] & 0xFFFF; - u16 height = cmd_buff[4] & 0xFFFF; + u16 width = cmd_buff[3] & 0xFFFF; + u16 height = cmd_buff[4] & 0xFFFF; cmd_buff[0] = IPC::MakeHeader(0x9, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_WARNING(Service_CAM, "(STUBBED) called, port=%d, lines=%d, width=%d, height=%d", - port, transfer_lines, width, height); + LOG_WARNING(Service_CAM, "(STUBBED) called, port=%d, lines=%d, width=%d, height=%d", port, + transfer_lines, width, height); } void GetMaxLines(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - u16 width = cmd_buff[1] & 0xFFFF; + u16 width = cmd_buff[1] & 0xFFFF; u16 height = cmd_buff[2] & 0xFFFF; cmd_buff[0] = IPC::MakeHeader(0xA, 2, 0); cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = TRANSFER_BYTES / (2 * width); - LOG_WARNING(Service_CAM, "(STUBBED) called, width=%d, height=%d, lines = %d", - width, height, cmd_buff[2]); + LOG_WARNING(Service_CAM, "(STUBBED) called, width=%d, height=%d, lines = %d", width, height, + cmd_buff[2]); } void GetTransferBytes(Service::Interface* self) { @@ -136,7 +136,7 @@ void GetTransferBytes(Service::Interface* self) { void SetTrimming(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - u8 port = cmd_buff[1] & 0xFF; + u8 port = cmd_buff[1] & 0xFF; bool trim = (cmd_buff[2] & 0xFF) != 0; cmd_buff[0] = IPC::MakeHeader(0xE, 1, 0); @@ -148,17 +148,17 @@ void SetTrimming(Service::Interface* self) { void SetTrimmingParamsCenter(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - u8 port = cmd_buff[1] & 0xFF; + u8 port = cmd_buff[1] & 0xFF; s16 trimW = cmd_buff[2] & 0xFFFF; s16 trimH = cmd_buff[3] & 0xFFFF; - s16 camW = cmd_buff[4] & 0xFFFF; - s16 camH = cmd_buff[5] & 0xFFFF; + s16 camW = cmd_buff[4] & 0xFFFF; + s16 camH = cmd_buff[5] & 0xFFFF; cmd_buff[0] = IPC::MakeHeader(0x12, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; LOG_WARNING(Service_CAM, "(STUBBED) called, port=%d, trimW=%d, trimH=%d, camW=%d, camH=%d", - port, trimW, trimH, camW, camH); + port, trimW, trimH, camW, camH); } void Activate(Service::Interface* self) { @@ -169,36 +169,35 @@ void Activate(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x13, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_WARNING(Service_CAM, "(STUBBED) called, cam_select=%d", - cam_select); + LOG_WARNING(Service_CAM, "(STUBBED) called, cam_select=%d", cam_select); } void FlipImage(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u8 cam_select = cmd_buff[1] & 0xFF; - u8 flip = cmd_buff[2] & 0xFF; - u8 context = cmd_buff[3] & 0xFF; + u8 flip = cmd_buff[2] & 0xFF; + u8 context = cmd_buff[3] & 0xFF; cmd_buff[0] = IPC::MakeHeader(0x1D, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_WARNING(Service_CAM, "(STUBBED) called, cam_select=%d, flip=%d, context=%d", - cam_select, flip, context); + LOG_WARNING(Service_CAM, "(STUBBED) called, cam_select=%d, flip=%d, context=%d", cam_select, + flip, context); } void SetSize(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u8 cam_select = cmd_buff[1] & 0xFF; - u8 size = cmd_buff[2] & 0xFF; - u8 context = cmd_buff[3] & 0xFF; + u8 size = cmd_buff[2] & 0xFF; + u8 context = cmd_buff[3] & 0xFF; cmd_buff[0] = IPC::MakeHeader(0x1F, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_WARNING(Service_CAM, "(STUBBED) called, cam_select=%d, size=%d, context=%d", - cam_select, size, context); + LOG_WARNING(Service_CAM, "(STUBBED) called, cam_select=%d, size=%d, context=%d", cam_select, + size, context); } void SetFrameRate(Service::Interface* self) { @@ -210,8 +209,8 @@ void SetFrameRate(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x20, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_WARNING(Service_CAM, "(STUBBED) called, cam_select=%d, frame_rate=%d", - cam_select, frame_rate); + LOG_WARNING(Service_CAM, "(STUBBED) called, cam_select=%d, frame_rate=%d", cam_select, + frame_rate); } void GetStereoCameraCalibrationData(Service::Interface* self) { @@ -293,10 +292,14 @@ void Init() { AddService(new CAM_S_Interface); AddService(new CAM_U_Interface); - completion_event_cam1 = Kernel::Event::Create(ResetType::OneShot, "CAM_U::completion_event_cam1"); - completion_event_cam2 = Kernel::Event::Create(ResetType::OneShot, "CAM_U::completion_event_cam2"); - interrupt_error_event = Kernel::Event::Create(ResetType::OneShot, "CAM_U::interrupt_error_event"); - vsync_interrupt_error_event = Kernel::Event::Create(ResetType::OneShot, "CAM_U::vsync_interrupt_error_event"); + completion_event_cam1 = + Kernel::Event::Create(ResetType::OneShot, "CAM_U::completion_event_cam1"); + completion_event_cam2 = + Kernel::Event::Create(ResetType::OneShot, "CAM_U::completion_event_cam2"); + interrupt_error_event = + Kernel::Event::Create(ResetType::OneShot, "CAM_U::interrupt_error_event"); + vsync_interrupt_error_event = + Kernel::Event::Create(ResetType::OneShot, "CAM_U::vsync_interrupt_error_event"); } void Shutdown() { diff --git a/src/core/hle/service/cam/cam.h b/src/core/hle/service/cam/cam.h index 2f4923728..a87183493 100644 --- a/src/core/hle/service/cam/cam.h +++ b/src/core/hle/service/cam/cam.h @@ -14,12 +14,7 @@ namespace Service { namespace CAM { -enum class Port : u8 { - None = 0, - Cam1 = 1, - Cam2 = 2, - Both = Cam1 | Cam2 -}; +enum class Port : u8 { None = 0, Cam1 = 1, Cam2 = 2, Both = Cam1 | Cam2 }; enum class CameraSelect : u8 { None = 0, @@ -32,28 +27,11 @@ enum class CameraSelect : u8 { All = Out1 | In1 | Out2 }; -enum class Effect : u8 { - None = 0, - Mono = 1, - Sepia = 2, - Negative = 3, - Negafilm = 4, - Sepia01 = 5 -}; +enum class Effect : u8 { None = 0, Mono = 1, Sepia = 2, Negative = 3, Negafilm = 4, Sepia01 = 5 }; -enum class Context : u8 { - None = 0, - A = 1, - B = 2, - Both = A | B -}; +enum class Context : u8 { None = 0, A = 1, B = 2, Both = A | B }; -enum class Flip : u8 { - None = 0, - Horizontal = 1, - Vertical = 2, - Reverse = 3 -}; +enum class Flip : u8 { None = 0, Horizontal = 1, Vertical = 2, Reverse = 3 }; enum class Size : u8 { VGA = 0, @@ -83,11 +61,7 @@ enum class FrameRate : u8 { Rate_30_To_10 = 12 }; -enum class ShutterSoundType : u8 { - Normal = 0, - Movie = 1, - MovieEnd = 2 -}; +enum class ShutterSoundType : u8 { Normal = 0, Movie = 1, MovieEnd = 2 }; enum class WhiteBalance : u8 { BalanceAuto = 0, @@ -106,13 +80,7 @@ enum class WhiteBalance : u8 { BalanceShade = Balance7000K }; -enum class PhotoMode : u8 { - Normal = 0, - Portrait = 1, - Landscape = 2, - Nightview = 3, - Letter0 = 4 -}; +enum class PhotoMode : u8 { Normal = 0, Portrait = 1, Landscape = 2, Nightview = 3, Letter0 = 4 }; enum class LensCorrection : u8 { Off = 0, @@ -140,21 +108,18 @@ enum class Contrast : u8 { High = Pattern07 }; -enum class OutputFormat : u8 { - YUV422 = 0, - RGB565 = 1 -}; +enum class OutputFormat : u8 { YUV422 = 0, RGB565 = 1 }; /// Stereo camera calibration data. struct StereoCameraCalibrationData { - u8 isValidRotationXY; ///< Bool indicating whether the X and Y rotation data is valid. + u8 isValidRotationXY; ///< Bool indicating whether the X and Y rotation data is valid. INSERT_PADDING_BYTES(3); - float_le scale; ///< Scale to match the left camera image with the right. - float_le rotationZ; ///< Z axis rotation to match the left camera image with the right. - float_le translationX; ///< X axis translation to match the left camera image with the right. - float_le translationY; ///< Y axis translation to match the left camera image with the right. - float_le rotationX; ///< X axis rotation to match the left camera image with the right. - float_le rotationY; ///< Y axis rotation to match the left camera image with the right. + float_le scale; ///< Scale to match the left camera image with the right. + float_le rotationZ; ///< Z axis rotation to match the left camera image with the right. + float_le translationX; ///< X axis translation to match the left camera image with the right. + float_le translationY; ///< Y axis translation to match the left camera image with the right. + float_le rotationX; ///< X axis rotation to match the left camera image with the right. + float_le rotationY; ///< Y axis rotation to match the left camera image with the right. float_le angleOfViewRight; ///< Right camera angle of view. float_le angleOfViewLeft; ///< Left camera angle of view. float_le distanceToChart; ///< Distance between cameras and measurement chart. @@ -163,7 +128,8 @@ struct StereoCameraCalibrationData { s16_le imageHeight; ///< Image height. INSERT_PADDING_BYTES(16); }; -static_assert(sizeof(StereoCameraCalibrationData) == 64, "StereoCameraCalibrationData structure size is wrong"); +static_assert(sizeof(StereoCameraCalibrationData) == 64, + "StereoCameraCalibrationData structure size is wrong"); struct PackageParameterCameraSelect { CameraSelect camera; @@ -188,7 +154,8 @@ struct PackageParameterCameraSelect { s16 auto_white_balance_window_height; }; -static_assert(sizeof(PackageParameterCameraSelect) == 28, "PackageParameterCameraSelect structure size is wrong"); +static_assert(sizeof(PackageParameterCameraSelect) == 28, + "PackageParameterCameraSelect structure size is wrong"); /** * Unknown diff --git a/src/core/hle/service/cam/cam_c.cpp b/src/core/hle/service/cam/cam_c.cpp index 8fa7abc85..93b047c1a 100644 --- a/src/core/hle/service/cam/cam_c.cpp +++ b/src/core/hle/service/cam/cam_c.cpp @@ -8,10 +8,10 @@ namespace Service { namespace CAM { // Empty arrays are illegal -- commented out until an entry is added. -//const Interface::FunctionInfo FunctionTable[] = { }; +// const Interface::FunctionInfo FunctionTable[] = { }; CAM_C_Interface::CAM_C_Interface() { - //Register(FunctionTable); + // Register(FunctionTable); } } // namespace CAM diff --git a/src/core/hle/service/cam/cam_q.cpp b/src/core/hle/service/cam/cam_q.cpp index d3ba91e9d..2ba853606 100644 --- a/src/core/hle/service/cam/cam_q.cpp +++ b/src/core/hle/service/cam/cam_q.cpp @@ -8,10 +8,10 @@ namespace Service { namespace CAM { // Empty arrays are illegal -- commented out until an entry is added. -//const Interface::FunctionInfo FunctionTable[] = { }; +// const Interface::FunctionInfo FunctionTable[] = { }; CAM_Q_Interface::CAM_Q_Interface() { - //Register(FunctionTable); + // Register(FunctionTable); } } // namespace CAM diff --git a/src/core/hle/service/cam/cam_s.cpp b/src/core/hle/service/cam/cam_s.cpp index 2a13984d8..f1c6da587 100644 --- a/src/core/hle/service/cam/cam_s.cpp +++ b/src/core/hle/service/cam/cam_s.cpp @@ -8,10 +8,10 @@ namespace Service { namespace CAM { // Empty arrays are illegal -- commented out until an entry is added. -//const Interface::FunctionInfo FunctionTable[] = { }; +// const Interface::FunctionInfo FunctionTable[] = { }; CAM_S_Interface::CAM_S_Interface() { - //Register(FunctionTable); + // Register(FunctionTable); } } // namespace CAM diff --git a/src/core/hle/service/cam/cam_u.cpp b/src/core/hle/service/cam/cam_u.cpp index a1070ebb2..af2123e5b 100644 --- a/src/core/hle/service/cam/cam_u.cpp +++ b/src/core/hle/service/cam/cam_u.cpp @@ -9,68 +9,68 @@ namespace Service { namespace CAM { const Interface::FunctionInfo FunctionTable[] = { - {0x00010040, StartCapture, "StartCapture"}, - {0x00020040, StopCapture, "StopCapture"}, - {0x00030040, nullptr, "IsBusy"}, - {0x00040040, nullptr, "ClearBuffer"}, - {0x00050040, GetVsyncInterruptEvent, "GetVsyncInterruptEvent"}, - {0x00060040, GetBufferErrorInterruptEvent, "GetBufferErrorInterruptEvent"}, - {0x00070102, SetReceiving, "SetReceiving"}, - {0x00080040, nullptr, "IsFinishedReceiving"}, - {0x00090100, SetTransferLines, "SetTransferLines"}, - {0x000A0080, GetMaxLines, "GetMaxLines"}, - {0x000B0100, nullptr, "SetTransferBytes"}, - {0x000C0040, GetTransferBytes, "GetTransferBytes"}, - {0x000D0080, nullptr, "GetMaxBytes"}, - {0x000E0080, SetTrimming, "SetTrimming"}, - {0x000F0040, nullptr, "IsTrimming"}, - {0x00100140, nullptr, "SetTrimmingParams"}, - {0x00110040, nullptr, "GetTrimmingParams"}, - {0x00120140, SetTrimmingParamsCenter, "SetTrimmingParamsCenter"}, - {0x00130040, Activate, "Activate"}, - {0x00140080, nullptr, "SwitchContext"}, - {0x00150080, nullptr, "SetExposure"}, - {0x00160080, nullptr, "SetWhiteBalance"}, - {0x00170080, nullptr, "SetWhiteBalanceWithoutBaseUp"}, - {0x00180080, nullptr, "SetSharpness"}, - {0x00190080, nullptr, "SetAutoExposure"}, - {0x001A0040, nullptr, "IsAutoExposure"}, - {0x001B0080, nullptr, "SetAutoWhiteBalance"}, - {0x001C0040, nullptr, "IsAutoWhiteBalance"}, - {0x001D00C0, FlipImage, "FlipImage"}, - {0x001E0200, nullptr, "SetDetailSize"}, - {0x001F00C0, SetSize, "SetSize"}, - {0x00200080, SetFrameRate, "SetFrameRate"}, - {0x00210080, nullptr, "SetPhotoMode"}, - {0x002200C0, nullptr, "SetEffect"}, - {0x00230080, nullptr, "SetContrast"}, - {0x00240080, nullptr, "SetLensCorrection"}, - {0x002500C0, nullptr, "SetOutputFormat"}, - {0x00260140, nullptr, "SetAutoExposureWindow"}, - {0x00270140, nullptr, "SetAutoWhiteBalanceWindow"}, - {0x00280080, nullptr, "SetNoiseFilter"}, - {0x00290080, nullptr, "SynchronizeVsyncTiming"}, - {0x002A0080, nullptr, "GetLatestVsyncTiming"}, - {0x002B0000, GetStereoCameraCalibrationData, "GetStereoCameraCalibrationData"}, - {0x002C0400, nullptr, "SetStereoCameraCalibrationData"}, - {0x002D00C0, nullptr, "WriteRegisterI2c"}, - {0x002E00C0, nullptr, "WriteMcuVariableI2c"}, - {0x002F0080, nullptr, "ReadRegisterI2cExclusive"}, - {0x00300080, nullptr, "ReadMcuVariableI2cExclusive"}, - {0x00310180, nullptr, "SetImageQualityCalibrationData"}, - {0x00320000, nullptr, "GetImageQualityCalibrationData"}, - {0x003302C0, nullptr, "SetPackageParameterWithoutContext"}, - {0x00340140, nullptr, "SetPackageParameterWithContext"}, - {0x003501C0, nullptr, "SetPackageParameterWithContextDetail"}, - {0x00360000, GetSuitableY2rStandardCoefficient, "GetSuitableY2rStandardCoefficient"}, - {0x00370202, nullptr, "PlayShutterSoundWithWave"}, - {0x00380040, PlayShutterSound, "PlayShutterSound"}, - {0x00390000, DriverInitialize, "DriverInitialize"}, - {0x003A0000, DriverFinalize, "DriverFinalize"}, - {0x003B0000, nullptr, "GetActivatedCamera"}, - {0x003C0000, nullptr, "GetSleepCamera"}, - {0x003D0040, nullptr, "SetSleepCamera"}, - {0x003E0040, nullptr, "SetBrightnessSynchronization"}, + {0x00010040, StartCapture, "StartCapture"}, + {0x00020040, StopCapture, "StopCapture"}, + {0x00030040, nullptr, "IsBusy"}, + {0x00040040, nullptr, "ClearBuffer"}, + {0x00050040, GetVsyncInterruptEvent, "GetVsyncInterruptEvent"}, + {0x00060040, GetBufferErrorInterruptEvent, "GetBufferErrorInterruptEvent"}, + {0x00070102, SetReceiving, "SetReceiving"}, + {0x00080040, nullptr, "IsFinishedReceiving"}, + {0x00090100, SetTransferLines, "SetTransferLines"}, + {0x000A0080, GetMaxLines, "GetMaxLines"}, + {0x000B0100, nullptr, "SetTransferBytes"}, + {0x000C0040, GetTransferBytes, "GetTransferBytes"}, + {0x000D0080, nullptr, "GetMaxBytes"}, + {0x000E0080, SetTrimming, "SetTrimming"}, + {0x000F0040, nullptr, "IsTrimming"}, + {0x00100140, nullptr, "SetTrimmingParams"}, + {0x00110040, nullptr, "GetTrimmingParams"}, + {0x00120140, SetTrimmingParamsCenter, "SetTrimmingParamsCenter"}, + {0x00130040, Activate, "Activate"}, + {0x00140080, nullptr, "SwitchContext"}, + {0x00150080, nullptr, "SetExposure"}, + {0x00160080, nullptr, "SetWhiteBalance"}, + {0x00170080, nullptr, "SetWhiteBalanceWithoutBaseUp"}, + {0x00180080, nullptr, "SetSharpness"}, + {0x00190080, nullptr, "SetAutoExposure"}, + {0x001A0040, nullptr, "IsAutoExposure"}, + {0x001B0080, nullptr, "SetAutoWhiteBalance"}, + {0x001C0040, nullptr, "IsAutoWhiteBalance"}, + {0x001D00C0, FlipImage, "FlipImage"}, + {0x001E0200, nullptr, "SetDetailSize"}, + {0x001F00C0, SetSize, "SetSize"}, + {0x00200080, SetFrameRate, "SetFrameRate"}, + {0x00210080, nullptr, "SetPhotoMode"}, + {0x002200C0, nullptr, "SetEffect"}, + {0x00230080, nullptr, "SetContrast"}, + {0x00240080, nullptr, "SetLensCorrection"}, + {0x002500C0, nullptr, "SetOutputFormat"}, + {0x00260140, nullptr, "SetAutoExposureWindow"}, + {0x00270140, nullptr, "SetAutoWhiteBalanceWindow"}, + {0x00280080, nullptr, "SetNoiseFilter"}, + {0x00290080, nullptr, "SynchronizeVsyncTiming"}, + {0x002A0080, nullptr, "GetLatestVsyncTiming"}, + {0x002B0000, GetStereoCameraCalibrationData, "GetStereoCameraCalibrationData"}, + {0x002C0400, nullptr, "SetStereoCameraCalibrationData"}, + {0x002D00C0, nullptr, "WriteRegisterI2c"}, + {0x002E00C0, nullptr, "WriteMcuVariableI2c"}, + {0x002F0080, nullptr, "ReadRegisterI2cExclusive"}, + {0x00300080, nullptr, "ReadMcuVariableI2cExclusive"}, + {0x00310180, nullptr, "SetImageQualityCalibrationData"}, + {0x00320000, nullptr, "GetImageQualityCalibrationData"}, + {0x003302C0, nullptr, "SetPackageParameterWithoutContext"}, + {0x00340140, nullptr, "SetPackageParameterWithContext"}, + {0x003501C0, nullptr, "SetPackageParameterWithContextDetail"}, + {0x00360000, GetSuitableY2rStandardCoefficient, "GetSuitableY2rStandardCoefficient"}, + {0x00370202, nullptr, "PlayShutterSoundWithWave"}, + {0x00380040, PlayShutterSound, "PlayShutterSound"}, + {0x00390000, DriverInitialize, "DriverInitialize"}, + {0x003A0000, DriverFinalize, "DriverFinalize"}, + {0x003B0000, nullptr, "GetActivatedCamera"}, + {0x003C0000, nullptr, "GetSleepCamera"}, + {0x003D0040, nullptr, "SetSleepCamera"}, + {0x003E0040, nullptr, "SetBrightnessSynchronization"}, }; CAM_U_Interface::CAM_U_Interface() { diff --git a/src/core/hle/service/cecd/cecd.cpp b/src/core/hle/service/cecd/cecd.cpp index 50c03495e..65a1d850b 100644 --- a/src/core/hle/service/cecd/cecd.cpp +++ b/src/core/hle/service/cecd/cecd.cpp @@ -5,10 +5,10 @@ #include "common/logging/log.h" #include "core/hle/kernel/event.h" -#include "core/hle/service/service.h" #include "core/hle/service/cecd/cecd.h" #include "core/hle/service/cecd/cecd_s.h" #include "core/hle/service/cecd/cecd_u.h" +#include "core/hle/service/service.h" namespace Service { namespace CECD { @@ -28,7 +28,7 @@ void GetCecStateAbbreviated(Service::Interface* self) { void GetCecInfoEventHandle(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - cmd_buff[1] = RESULT_SUCCESS.raw; // No error + cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[3] = Kernel::g_handle_table.Create(cecinfo_event).MoveFrom(); // Event handle LOG_WARNING(Service_CECD, "(STUBBED) called"); @@ -37,7 +37,7 @@ void GetCecInfoEventHandle(Service::Interface* self) { void GetChangeStateEventHandle(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - cmd_buff[1] = RESULT_SUCCESS.raw; // No error + cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[3] = Kernel::g_handle_table.Create(change_state_event).MoveFrom(); // Event handle LOG_WARNING(Service_CECD, "(STUBBED) called"); @@ -48,7 +48,8 @@ void Init() { AddService(new CECD_U_Interface); cecinfo_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "CECD_U::cecinfo_event"); - change_state_event = Kernel::Event::Create(Kernel::ResetType::OneShot, "CECD_U::change_state_event"); + change_state_event = + Kernel::Event::Create(Kernel::ResetType::OneShot, "CECD_U::change_state_event"); } void Shutdown() { diff --git a/src/core/hle/service/cecd/cecd.h b/src/core/hle/service/cecd/cecd.h index 435611363..ea97f9266 100644 --- a/src/core/hle/service/cecd/cecd.h +++ b/src/core/hle/service/cecd/cecd.h @@ -11,11 +11,13 @@ class Interface; namespace CECD { enum class CecStateAbbreviated { - CEC_STATE_ABBREV_IDLE = 1, ///< Corresponds to CEC_STATE_IDLE + CEC_STATE_ABBREV_IDLE = 1, ///< Corresponds to CEC_STATE_IDLE CEC_STATE_ABBREV_NOT_LOCAL = 2, ///< Corresponds to CEC_STATEs *FINISH*, *POST, and OVER_BOSS - CEC_STATE_ABBREV_SCANNING = 3, ///< Corresponds to CEC_STATE_SCANNING - CEC_STATE_ABBREV_WLREADY = 4, ///< Corresponds to CEC_STATE_WIRELESS_READY when some unknown bool is true - CEC_STATE_ABBREV_OTHER = 5, ///< Corresponds to CEC_STATEs besides *FINISH*, *POST, and OVER_BOSS and those listed here + CEC_STATE_ABBREV_SCANNING = 3, ///< Corresponds to CEC_STATE_SCANNING + CEC_STATE_ABBREV_WLREADY = + 4, ///< Corresponds to CEC_STATE_WIRELESS_READY when some unknown bool is true + CEC_STATE_ABBREV_OTHER = 5, ///< Corresponds to CEC_STATEs besides *FINISH*, *POST, and + /// OVER_BOSS and those listed here }; /** diff --git a/src/core/hle/service/cecd/cecd_s.cpp b/src/core/hle/service/cecd/cecd_s.cpp index bfd821c07..7477b9320 100644 --- a/src/core/hle/service/cecd/cecd_s.cpp +++ b/src/core/hle/service/cecd/cecd_s.cpp @@ -8,10 +8,10 @@ namespace Service { namespace CECD { // Empty arrays are illegal -- commented out until an entry is added. -//const Interface::FunctionInfo FunctionTable[] = { }; +// const Interface::FunctionInfo FunctionTable[] = { }; CECD_S_Interface::CECD_S_Interface() { - //Register(FunctionTable); + // Register(FunctionTable); } } // namespace CECD diff --git a/src/core/hle/service/cecd/cecd_u.cpp b/src/core/hle/service/cecd/cecd_u.cpp index be6d4d8f6..4b747de7b 100644 --- a/src/core/hle/service/cecd/cecd_u.cpp +++ b/src/core/hle/service/cecd/cecd_u.cpp @@ -9,10 +9,10 @@ namespace Service { namespace CECD { static const Interface::FunctionInfo FunctionTable[] = { - {0x000E0000, GetCecStateAbbreviated, "GetCecStateAbbreviated"}, - {0x000F0000, GetCecInfoEventHandle, "GetCecInfoEventHandle"}, + {0x000E0000, GetCecStateAbbreviated, "GetCecStateAbbreviated"}, + {0x000F0000, GetCecInfoEventHandle, "GetCecInfoEventHandle"}, {0x00100000, GetChangeStateEventHandle, "GetChangeStateEventHandle"}, - {0x00120104, nullptr, "ReadSavedData"}, + {0x00120104, nullptr, "ReadSavedData"}, }; CECD_U_Interface::CECD_U_Interface() { diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index a5dc47322..fe97a69d1 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp @@ -11,7 +11,6 @@ #include "core/file_sys/archive_systemsavedata.h" #include "core/file_sys/file_backend.h" -#include "core/settings.h" #include "core/hle/result.h" #include "core/hle/service/cfg/cfg.h" #include "core/hle/service/cfg/cfg_i.h" @@ -19,6 +18,7 @@ #include "core/hle/service/cfg/cfg_u.h" #include "core/hle/service/fs/archive.h" #include "core/hle/service/service.h" +#include "core/settings.h" namespace Service { namespace CFG { @@ -33,25 +33,29 @@ namespace { * contains information about the blocks in the file */ struct SaveFileConfig { - u16 total_entries; ///< The total number of set entries in the config file - u16 data_entries_offset; ///< The offset where the data for the blocks start, this is hardcoded to 0x455C as per hardware - SaveConfigBlockEntry block_entries[CONFIG_FILE_MAX_BLOCK_ENTRIES]; ///< The block headers, the maximum possible value is 1479 as per hardware - u32 unknown; ///< This field is unknown, possibly padding, 0 has been observed in hardware + u16 total_entries; ///< The total number of set entries in the config file + u16 data_entries_offset; ///< The offset where the data for the blocks start, this is hardcoded + /// to 0x455C as per hardware + SaveConfigBlockEntry block_entries[CONFIG_FILE_MAX_BLOCK_ENTRIES]; ///< The block headers, the + /// maximum possible value is + /// 1479 as per hardware + u32 unknown; ///< This field is unknown, possibly padding, 0 has been observed in hardware }; -static_assert(sizeof(SaveFileConfig) == 0x455C, "SaveFileConfig header must be exactly 0x455C bytes"); +static_assert(sizeof(SaveFileConfig) == 0x455C, + "SaveFileConfig header must be exactly 0x455C bytes"); enum ConfigBlockID { StereoCameraSettingsBlockID = 0x00050005, - SoundOutputModeBlockID = 0x00070001, - ConsoleUniqueIDBlockID = 0x00090001, - UsernameBlockID = 0x000A0000, - BirthdayBlockID = 0x000A0001, - LanguageBlockID = 0x000A0002, - CountryInfoBlockID = 0x000B0000, - CountryNameBlockID = 0x000B0001, - StateNameBlockID = 0x000B0002, - EULAVersionBlockID = 0x000D0000, - ConsoleModelBlockID = 0x000F0004, + SoundOutputModeBlockID = 0x00070001, + ConsoleUniqueIDBlockID = 0x00090001, + UsernameBlockID = 0x000A0000, + BirthdayBlockID = 0x000A0001, + LanguageBlockID = 0x000A0002, + CountryInfoBlockID = 0x000B0000, + CountryNameBlockID = 0x000B0001, + StateNameBlockID = 0x000B0002, + EULAVersionBlockID = 0x000D0000, + ConsoleModelBlockID = 0x000F0004, }; struct UsernameBlock { @@ -68,8 +72,8 @@ struct BirthdayBlock { static_assert(sizeof(BirthdayBlock) == 2, "BirthdayBlock must be exactly 2 bytes"); struct ConsoleModelInfo { - u8 model; ///< The console model (3DS, 2DS, etc) - u8 unknown[3]; ///< Unknown data + u8 model; ///< The console model (3DS, 2DS, etc) + u8 unknown[3]; ///< Unknown data }; static_assert(sizeof(ConsoleModelInfo) == 4, "ConsoleModelInfo must be exactly 4 bytes"); @@ -78,36 +82,36 @@ struct ConsoleCountryInfo { u8 country_code; ///< The country code of the console }; static_assert(sizeof(ConsoleCountryInfo) == 4, "ConsoleCountryInfo must be exactly 4 bytes"); - } static const u64 CFG_SAVE_ID = 0x00010017; static const u64 CONSOLE_UNIQUE_ID = 0xDEADC0DE; -static const ConsoleModelInfo CONSOLE_MODEL = { NINTENDO_3DS_XL, { 0, 0, 0 } }; +static const ConsoleModelInfo CONSOLE_MODEL = {NINTENDO_3DS_XL, {0, 0, 0}}; static const u8 CONSOLE_LANGUAGE = LANGUAGE_EN; -static const UsernameBlock CONSOLE_USERNAME_BLOCK = { u"CITRA", 0, 0 }; -static const BirthdayBlock PROFILE_BIRTHDAY = { 3, 25 }; // March 25th, 2014 +static const UsernameBlock CONSOLE_USERNAME_BLOCK = {u"CITRA", 0, 0}; +static const BirthdayBlock PROFILE_BIRTHDAY = {3, 25}; // March 25th, 2014 static const u8 SOUND_OUTPUT_MODE = SOUND_SURROUND; static const u8 UNITED_STATES_COUNTRY_ID = 49; /// TODO(Subv): Find what the other bytes are -static const ConsoleCountryInfo COUNTRY_INFO = { { 0, 0, 0 }, UNITED_STATES_COUNTRY_ID }; +static const ConsoleCountryInfo COUNTRY_INFO = {{0, 0, 0}, UNITED_STATES_COUNTRY_ID}; /** * TODO(Subv): Find out what this actually is, these values fix some NaN uniforms in some games, * for example Nintendo Zone * Thanks Normmatt for providing this information */ -static const std::array STEREO_CAMERA_SETTINGS = {{ - 62.0f, 289.0f, 76.80000305175781f, 46.08000183105469f, - 10.0f, 5.0f, 55.58000183105469f, 21.56999969482422f -}}; -static_assert(sizeof(STEREO_CAMERA_SETTINGS) == 0x20, "STEREO_CAMERA_SETTINGS must be exactly 0x20 bytes"); +static const std::array STEREO_CAMERA_SETTINGS = { + {62.0f, 289.0f, 76.80000305175781f, 46.08000183105469f, 10.0f, 5.0f, 55.58000183105469f, + 21.56999969482422f}}; +static_assert(sizeof(STEREO_CAMERA_SETTINGS) == 0x20, + "STEREO_CAMERA_SETTINGS must be exactly 0x20 bytes"); static const u32 CONFIG_SAVEFILE_SIZE = 0x8000; static std::array cfg_config_file_buffer; static Service::FS::ArchiveHandle cfg_system_save_data_archive; -static const std::vector cfg_system_savedata_id = { 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x01, 0x00 }; +static const std::vector cfg_system_savedata_id = {0x00, 0x00, 0x00, 0x00, + 0x17, 0x00, 0x01, 0x00}; void GetCountryCodeString(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); @@ -115,7 +119,9 @@ void GetCountryCodeString(Service::Interface* self) { if (country_code_id >= country_codes.size() || 0 == country_codes[country_code_id]) { LOG_ERROR(Service_CFG, "requested country code id=%d is invalid", country_code_id); - cmd_buff[1] = ResultCode(ErrorDescription::NotFound, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent).raw; + cmd_buff[1] = ResultCode(ErrorDescription::NotFound, ErrorModule::Config, + ErrorSummary::WrongArgument, ErrorLevel::Permanent) + .raw; return; } @@ -139,8 +145,11 @@ void GetCountryCodeID(Service::Interface* self) { } if (0 == country_code_id) { - LOG_ERROR(Service_CFG, "requested country code name=%c%c is invalid", country_code & 0xff, country_code >> 8); - cmd_buff[1] = ResultCode(ErrorDescription::NotFound, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent).raw; + LOG_ERROR(Service_CFG, "requested country code name=%c%c is invalid", country_code & 0xff, + country_code >> 8); + cmd_buff[1] = ResultCode(ErrorDescription::NotFound, ErrorModule::Config, + ErrorSummary::WrongArgument, ErrorLevel::Permanent) + .raw; cmd_buff[2] = 0xFFFF; return; } @@ -185,8 +194,8 @@ void GetSystemModel(Service::Interface* self) { u32 data; // TODO(Subv): Find out the correct error codes - cmd_buff[1] = Service::CFG::GetConfigInfoBlock(0x000F0004, 4, 0x8, - reinterpret_cast(&data)).raw; + cmd_buff[1] = + Service::CFG::GetConfigInfoBlock(0x000F0004, 4, 0x8, reinterpret_cast(&data)).raw; cmd_buff[2] = data & 0xFF; } @@ -195,8 +204,8 @@ void GetModelNintendo2DS(Service::Interface* self) { u32 data; // TODO(Subv): Find out the correct error codes - cmd_buff[1] = Service::CFG::GetConfigInfoBlock(0x000F0004, 4, 0x8, - reinterpret_cast(&data)).raw; + cmd_buff[1] = + Service::CFG::GetConfigInfoBlock(0x000F0004, 4, 0x8, reinterpret_cast(&data)).raw; u8 model = data & 0xFF; if (model == Service::CFG::NINTENDO_2DS) @@ -267,24 +276,29 @@ static ResultVal GetConfigInfoBlockPointer(u32 block_id, u32 size, u32 fl // Read the header SaveFileConfig* config = reinterpret_cast(cfg_config_file_buffer.data()); - auto itr = std::find_if(std::begin(config->block_entries), std::end(config->block_entries), - [&](const SaveConfigBlockEntry& entry) { - return entry.block_id == block_id; - }); + auto itr = + std::find_if(std::begin(config->block_entries), std::end(config->block_entries), + [&](const SaveConfigBlockEntry& entry) { return entry.block_id == block_id; }); if (itr == std::end(config->block_entries)) { - LOG_ERROR(Service_CFG, "Config block 0x%X with flags %u and size %u was not found", block_id, flag, size); - return ResultCode(ErrorDescription::NotFound, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent); + LOG_ERROR(Service_CFG, "Config block 0x%X with flags %u and size %u was not found", + block_id, flag, size); + return ResultCode(ErrorDescription::NotFound, ErrorModule::Config, + ErrorSummary::WrongArgument, ErrorLevel::Permanent); } if ((itr->flags & flag) == 0) { - LOG_ERROR(Service_CFG, "Invalid flag %u for config block 0x%X with size %u", flag, block_id, size); - return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent); + LOG_ERROR(Service_CFG, "Invalid flag %u for config block 0x%X with size %u", flag, block_id, + size); + return ResultCode(ErrorDescription::NotAuthorized, ErrorModule::Config, + ErrorSummary::WrongArgument, ErrorLevel::Permanent); } if (itr->size != size) { - LOG_ERROR(Service_CFG, "Invalid size %u for config block 0x%X with flags %u", size, block_id, flag); - return ResultCode(ErrorDescription::InvalidSize, ErrorModule::Config, ErrorSummary::WrongArgument, ErrorLevel::Permanent); + LOG_ERROR(Service_CFG, "Invalid size %u for config block 0x%X with flags %u", size, + block_id, flag); + return ResultCode(ErrorDescription::InvalidSize, ErrorModule::Config, + ErrorSummary::WrongArgument, ErrorLevel::Permanent); } void* pointer; @@ -318,7 +332,7 @@ ResultCode CreateConfigInfoBlk(u32 block_id, u16 size, u16 flags, const void* da return ResultCode(-1); // TODO(Subv): Find the right error code // Insert the block header with offset 0 for now - config->block_entries[config->total_entries] = { block_id, 0, size, flags }; + config->block_entries[config->total_entries] = {block_id, 0, size, flags}; if (size > 4) { u32 offset = config->data_entries_offset; // Perform a search to locate the next offset for the new data @@ -326,8 +340,7 @@ ResultCode CreateConfigInfoBlk(u32 block_id, u16 size, u16 flags, const void* da for (int i = config->total_entries - 1; i >= 0; --i) { // Ignore the blocks that don't have a separate data offset if (config->block_entries[i].size > 4) { - offset = config->block_entries[i].offset_or_data + - config->block_entries[i].size; + offset = config->block_entries[i].offset_or_data + config->block_entries[i].size; break; } } @@ -336,8 +349,7 @@ ResultCode CreateConfigInfoBlk(u32 block_id, u16 size, u16 flags, const void* da // Write the data at the new offset memcpy(&cfg_config_file_buffer[offset], data, size); - } - else { + } else { // The offset_or_data field in the header contains the data itself if it's 4 bytes or less memcpy(&config->block_entries[config->total_entries].offset_or_data, data, size); } @@ -384,28 +396,40 @@ ResultCode FormatConfig() { // 0x00030001 - Unknown res = CreateConfigInfoBlk(0x00030001, 0x8, 0xE, zero_buffer); - if (!res.IsSuccess()) return res; + if (!res.IsSuccess()) + return res; - res = CreateConfigInfoBlk(StereoCameraSettingsBlockID, sizeof(STEREO_CAMERA_SETTINGS), 0xE, STEREO_CAMERA_SETTINGS.data()); - if (!res.IsSuccess()) return res; + res = CreateConfigInfoBlk(StereoCameraSettingsBlockID, sizeof(STEREO_CAMERA_SETTINGS), 0xE, + STEREO_CAMERA_SETTINGS.data()); + if (!res.IsSuccess()) + return res; - res = CreateConfigInfoBlk(SoundOutputModeBlockID, sizeof(SOUND_OUTPUT_MODE), 0xE, &SOUND_OUTPUT_MODE); - if (!res.IsSuccess()) return res; + res = CreateConfigInfoBlk(SoundOutputModeBlockID, sizeof(SOUND_OUTPUT_MODE), 0xE, + &SOUND_OUTPUT_MODE); + if (!res.IsSuccess()) + return res; - res = CreateConfigInfoBlk(ConsoleUniqueIDBlockID, sizeof(CONSOLE_UNIQUE_ID), 0xE, &CONSOLE_UNIQUE_ID); - if (!res.IsSuccess()) return res; + res = CreateConfigInfoBlk(ConsoleUniqueIDBlockID, sizeof(CONSOLE_UNIQUE_ID), 0xE, + &CONSOLE_UNIQUE_ID); + if (!res.IsSuccess()) + return res; - res = CreateConfigInfoBlk(UsernameBlockID, sizeof(CONSOLE_USERNAME_BLOCK), 0xE, &CONSOLE_USERNAME_BLOCK); - if (!res.IsSuccess()) return res; + res = CreateConfigInfoBlk(UsernameBlockID, sizeof(CONSOLE_USERNAME_BLOCK), 0xE, + &CONSOLE_USERNAME_BLOCK); + if (!res.IsSuccess()) + return res; res = CreateConfigInfoBlk(BirthdayBlockID, sizeof(PROFILE_BIRTHDAY), 0xE, &PROFILE_BIRTHDAY); - if (!res.IsSuccess()) return res; + if (!res.IsSuccess()) + return res; res = CreateConfigInfoBlk(LanguageBlockID, sizeof(CONSOLE_LANGUAGE), 0xE, &CONSOLE_LANGUAGE); - if (!res.IsSuccess()) return res; + if (!res.IsSuccess()) + return res; res = CreateConfigInfoBlk(CountryInfoBlockID, sizeof(COUNTRY_INFO), 0xE, &COUNTRY_INFO); - if (!res.IsSuccess()) return res; + if (!res.IsSuccess()) + return res; u16_le country_name_buffer[16][0x40] = {}; std::u16string region_name = Common::UTF8ToUTF16("Gensokyo"); @@ -413,34 +437,44 @@ ResultCode FormatConfig() { std::copy(region_name.cbegin(), region_name.cend(), country_name_buffer[i]); } // 0x000B0001 - Localized names for the profile Country - res = CreateConfigInfoBlk(CountryNameBlockID, sizeof(country_name_buffer), 0xE, country_name_buffer); - if (!res.IsSuccess()) return res; + res = CreateConfigInfoBlk(CountryNameBlockID, sizeof(country_name_buffer), 0xE, + country_name_buffer); + if (!res.IsSuccess()) + return res; // 0x000B0002 - Localized names for the profile State/Province - res = CreateConfigInfoBlk(StateNameBlockID, sizeof(country_name_buffer), 0xE, country_name_buffer); - if (!res.IsSuccess()) return res; + res = CreateConfigInfoBlk(StateNameBlockID, sizeof(country_name_buffer), 0xE, + country_name_buffer); + if (!res.IsSuccess()) + return res; // 0x000B0003 - Unknown, related to country/address (zip code?) res = CreateConfigInfoBlk(0x000B0003, 0x4, 0xE, zero_buffer); - if (!res.IsSuccess()) return res; + if (!res.IsSuccess()) + return res; // 0x000C0000 - Unknown res = CreateConfigInfoBlk(0x000C0000, 0xC0, 0xE, zero_buffer); - if (!res.IsSuccess()) return res; + if (!res.IsSuccess()) + return res; // 0x000C0001 - Unknown res = CreateConfigInfoBlk(0x000C0001, 0x14, 0xE, zero_buffer); - if (!res.IsSuccess()) return res; + if (!res.IsSuccess()) + return res; // 0x000D0000 - Accepted EULA version res = CreateConfigInfoBlk(EULAVersionBlockID, 0x4, 0xE, zero_buffer); - if (!res.IsSuccess()) return res; + if (!res.IsSuccess()) + return res; res = CreateConfigInfoBlk(ConsoleModelBlockID, sizeof(CONSOLE_MODEL), 0xC, &CONSOLE_MODEL); - if (!res.IsSuccess()) return res; + if (!res.IsSuccess()) + return res; // 0x00170000 - Unknown res = CreateConfigInfoBlk(0x00170000, 0x4, 0xE, zero_buffer); - if (!res.IsSuccess()) return res; + if (!res.IsSuccess()) + return res; // Save the buffer to the file res = UpdateConfigNANDSavegame(); @@ -452,15 +486,18 @@ ResultCode FormatConfig() { ResultCode LoadConfigNANDSaveFile() { // Open the SystemSaveData archive 0x00010017 FileSys::Path archive_path(cfg_system_savedata_id); - auto archive_result = Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SystemSaveData, archive_path); + auto archive_result = + Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SystemSaveData, archive_path); // If the archive didn't exist, create the files inside if (archive_result.Code().description == ErrorDescription::FS_NotFormatted) { // Format the archive to create the directories - Service::FS::FormatArchive(Service::FS::ArchiveIdCode::SystemSaveData, FileSys::ArchiveFormatInfo(), archive_path); + Service::FS::FormatArchive(Service::FS::ArchiveIdCode::SystemSaveData, + FileSys::ArchiveFormatInfo(), archive_path); // Open it again to get a valid archive now that the folder exists - archive_result = Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SystemSaveData, archive_path); + archive_result = + Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SystemSaveData, archive_path); } ASSERT_MSG(archive_result.Succeeded(), "Could not open the CFG SystemSaveData archive!"); @@ -515,7 +552,7 @@ std::u16string GetUsername() { } void SetBirthday(u8 month, u8 day) { - BirthdayBlock block = { month, day }; + BirthdayBlock block = {month, day}; SetConfigInfoBlock(BirthdayBlockID, sizeof(block), 4, &block); } diff --git a/src/core/hle/service/cfg/cfg.h b/src/core/hle/service/cfg/cfg.h index 18f60f4ca..8cb231d72 100644 --- a/src/core/hle/service/cfg/cfg.h +++ b/src/core/hle/service/cfg/cfg.h @@ -40,16 +40,13 @@ enum SystemLanguage { LANGUAGE_TW = 11 }; -enum SoundOutputMode { - SOUND_MONO = 0, - SOUND_STEREO = 1, - SOUND_SURROUND = 2 -}; +enum SoundOutputMode { SOUND_MONO = 0, SOUND_STEREO = 1, SOUND_SURROUND = 2 }; /// Block header in the config savedata file struct SaveConfigBlockEntry { u32 block_id; ///< The id of the current block - u32 offset_or_data; ///< This is the absolute offset to the block data if the size is greater than 4 bytes, otherwise it contains the data itself + u32 offset_or_data; ///< This is the absolute offset to the block data if the size is greater + /// than 4 bytes, otherwise it contains the data itself u16 size; ///< The size of the block u16 flags; ///< The flags of the block, possibly used for access control }; @@ -244,7 +241,8 @@ ResultCode GetConfigInfoBlock(u32 block_id, u32 size, u32 flag, void* output); ResultCode SetConfigInfoBlock(u32 block_id, u32 size, u32 flag, const void* input); /** - * Creates a block with the specified id and writes the input data to the cfg savegame buffer in memory. + * Creates a block with the specified id and writes the input data to the cfg savegame buffer in + * memory. * The config savegame file in the filesystem is not updated. * @param block_id The id of the block we want to create * @param size The size of the block we want to create diff --git a/src/core/hle/service/cfg/cfg_i.cpp b/src/core/hle/service/cfg/cfg_i.cpp index 8b0db785f..2ff52c8b8 100644 --- a/src/core/hle/service/cfg/cfg_i.cpp +++ b/src/core/hle/service/cfg/cfg_i.cpp @@ -10,49 +10,49 @@ namespace CFG { const Interface::FunctionInfo FunctionTable[] = { // cfg common - {0x00010082, GetConfigInfoBlk2, "GetConfigInfoBlk2"}, - {0x00020000, SecureInfoGetRegion, "SecureInfoGetRegion"}, - {0x00030040, GenHashConsoleUnique, "GenHashConsoleUnique"}, - {0x00040000, GetRegionCanadaUSA, "GetRegionCanadaUSA"}, - {0x00050000, GetSystemModel, "GetSystemModel"}, - {0x00060000, GetModelNintendo2DS, "GetModelNintendo2DS"}, - {0x00070040, nullptr, "WriteToFirstByteCfgSavegame"}, - {0x00080080, nullptr, "GoThroughTable"}, - {0x00090040, GetCountryCodeString, "GetCountryCodeString"}, - {0x000A0040, GetCountryCodeID, "GetCountryCodeID"}, + {0x00010082, GetConfigInfoBlk2, "GetConfigInfoBlk2"}, + {0x00020000, SecureInfoGetRegion, "SecureInfoGetRegion"}, + {0x00030040, GenHashConsoleUnique, "GenHashConsoleUnique"}, + {0x00040000, GetRegionCanadaUSA, "GetRegionCanadaUSA"}, + {0x00050000, GetSystemModel, "GetSystemModel"}, + {0x00060000, GetModelNintendo2DS, "GetModelNintendo2DS"}, + {0x00070040, nullptr, "WriteToFirstByteCfgSavegame"}, + {0x00080080, nullptr, "GoThroughTable"}, + {0x00090040, GetCountryCodeString, "GetCountryCodeString"}, + {0x000A0040, GetCountryCodeID, "GetCountryCodeID"}, // cfg:i - {0x04010082, GetConfigInfoBlk8, "GetConfigInfoBlk8"}, - {0x04020082, SetConfigInfoBlk4, "SetConfigInfoBlk4"}, - {0x04030000, UpdateConfigNANDSavegame, "UpdateConfigNANDSavegame"}, - {0x04040042, nullptr, "GetLocalFriendCodeSeedData"}, - {0x04050000, nullptr, "GetLocalFriendCodeSeed"}, - {0x04060000, SecureInfoGetRegion, "SecureInfoGetRegion"}, - {0x04070000, nullptr, "SecureInfoGetByte101"}, - {0x04080042, nullptr, "SecureInfoGetSerialNo"}, - {0x04090000, nullptr, "UpdateConfigBlk00040003"}, - {0x08010082, GetConfigInfoBlk8, "GetConfigInfoBlk8"}, - {0x08020082, SetConfigInfoBlk4, "SetConfigInfoBlk4"}, - {0x08030000, UpdateConfigNANDSavegame, "UpdateConfigNANDSavegame"}, - {0x080400C2, nullptr, "CreateConfigInfoBlk"}, - {0x08050000, nullptr, "DeleteConfigNANDSavefile"}, - {0x08060000, FormatConfig, "FormatConfig"}, - {0x08080000, nullptr, "UpdateConfigBlk1"}, - {0x08090000, nullptr, "UpdateConfigBlk2"}, - {0x080A0000, nullptr, "UpdateConfigBlk3"}, - {0x080B0082, nullptr, "SetGetLocalFriendCodeSeedData"}, - {0x080C0042, nullptr, "SetLocalFriendCodeSeedSignature"}, - {0x080D0000, nullptr, "DeleteCreateNANDLocalFriendCodeSeed"}, - {0x080E0000, nullptr, "VerifySigLocalFriendCodeSeed"}, - {0x080F0042, nullptr, "GetLocalFriendCodeSeedData"}, - {0x08100000, nullptr, "GetLocalFriendCodeSeed"}, - {0x08110084, nullptr, "SetSecureInfo"}, - {0x08120000, nullptr, "DeleteCreateNANDSecureInfo"}, - {0x08130000, nullptr, "VerifySigSecureInfo"}, - {0x08140042, nullptr, "SecureInfoGetData"}, - {0x08150042, nullptr, "SecureInfoGetSignature"}, - {0x08160000, SecureInfoGetRegion, "SecureInfoGetRegion"}, - {0x08170000, nullptr, "SecureInfoGetByte101"}, - {0x08180042, nullptr, "SecureInfoGetSerialNo"}, + {0x04010082, GetConfigInfoBlk8, "GetConfigInfoBlk8"}, + {0x04020082, SetConfigInfoBlk4, "SetConfigInfoBlk4"}, + {0x04030000, UpdateConfigNANDSavegame, "UpdateConfigNANDSavegame"}, + {0x04040042, nullptr, "GetLocalFriendCodeSeedData"}, + {0x04050000, nullptr, "GetLocalFriendCodeSeed"}, + {0x04060000, SecureInfoGetRegion, "SecureInfoGetRegion"}, + {0x04070000, nullptr, "SecureInfoGetByte101"}, + {0x04080042, nullptr, "SecureInfoGetSerialNo"}, + {0x04090000, nullptr, "UpdateConfigBlk00040003"}, + {0x08010082, GetConfigInfoBlk8, "GetConfigInfoBlk8"}, + {0x08020082, SetConfigInfoBlk4, "SetConfigInfoBlk4"}, + {0x08030000, UpdateConfigNANDSavegame, "UpdateConfigNANDSavegame"}, + {0x080400C2, nullptr, "CreateConfigInfoBlk"}, + {0x08050000, nullptr, "DeleteConfigNANDSavefile"}, + {0x08060000, FormatConfig, "FormatConfig"}, + {0x08080000, nullptr, "UpdateConfigBlk1"}, + {0x08090000, nullptr, "UpdateConfigBlk2"}, + {0x080A0000, nullptr, "UpdateConfigBlk3"}, + {0x080B0082, nullptr, "SetGetLocalFriendCodeSeedData"}, + {0x080C0042, nullptr, "SetLocalFriendCodeSeedSignature"}, + {0x080D0000, nullptr, "DeleteCreateNANDLocalFriendCodeSeed"}, + {0x080E0000, nullptr, "VerifySigLocalFriendCodeSeed"}, + {0x080F0042, nullptr, "GetLocalFriendCodeSeedData"}, + {0x08100000, nullptr, "GetLocalFriendCodeSeed"}, + {0x08110084, nullptr, "SetSecureInfo"}, + {0x08120000, nullptr, "DeleteCreateNANDSecureInfo"}, + {0x08130000, nullptr, "VerifySigSecureInfo"}, + {0x08140042, nullptr, "SecureInfoGetData"}, + {0x08150042, nullptr, "SecureInfoGetSignature"}, + {0x08160000, SecureInfoGetRegion, "SecureInfoGetRegion"}, + {0x08170000, nullptr, "SecureInfoGetByte101"}, + {0x08180042, nullptr, "SecureInfoGetSerialNo"}, }; CFG_I_Interface::CFG_I_Interface() { diff --git a/src/core/hle/service/cfg/cfg_s.cpp b/src/core/hle/service/cfg/cfg_s.cpp index 12b458783..eed26dec7 100644 --- a/src/core/hle/service/cfg/cfg_s.cpp +++ b/src/core/hle/service/cfg/cfg_s.cpp @@ -10,26 +10,26 @@ namespace CFG { const Interface::FunctionInfo FunctionTable[] = { // cfg common - {0x00010082, GetConfigInfoBlk2, "GetConfigInfoBlk2"}, - {0x00020000, SecureInfoGetRegion, "SecureInfoGetRegion"}, - {0x00030040, GenHashConsoleUnique, "GenHashConsoleUnique"}, - {0x00040000, GetRegionCanadaUSA, "GetRegionCanadaUSA"}, - {0x00050000, GetSystemModel, "GetSystemModel"}, - {0x00060000, GetModelNintendo2DS, "GetModelNintendo2DS"}, - {0x00070040, nullptr, "WriteToFirstByteCfgSavegame"}, - {0x00080080, nullptr, "GoThroughTable"}, - {0x00090040, GetCountryCodeString, "GetCountryCodeString"}, - {0x000A0040, GetCountryCodeID, "GetCountryCodeID"}, + {0x00010082, GetConfigInfoBlk2, "GetConfigInfoBlk2"}, + {0x00020000, SecureInfoGetRegion, "SecureInfoGetRegion"}, + {0x00030040, GenHashConsoleUnique, "GenHashConsoleUnique"}, + {0x00040000, GetRegionCanadaUSA, "GetRegionCanadaUSA"}, + {0x00050000, GetSystemModel, "GetSystemModel"}, + {0x00060000, GetModelNintendo2DS, "GetModelNintendo2DS"}, + {0x00070040, nullptr, "WriteToFirstByteCfgSavegame"}, + {0x00080080, nullptr, "GoThroughTable"}, + {0x00090040, GetCountryCodeString, "GetCountryCodeString"}, + {0x000A0040, GetCountryCodeID, "GetCountryCodeID"}, // cfg:s - {0x04010082, GetConfigInfoBlk8, "GetConfigInfoBlk8"}, - {0x04020082, SetConfigInfoBlk4, "SetConfigInfoBlk4"}, - {0x04030000, UpdateConfigNANDSavegame, "UpdateConfigNANDSavegame"}, - {0x04040042, nullptr, "GetLocalFriendCodeSeedData"}, - {0x04050000, nullptr, "GetLocalFriendCodeSeed"}, - {0x04060000, nullptr, "SecureInfoGetRegion"}, - {0x04070000, nullptr, "SecureInfoGetByte101"}, - {0x04080042, nullptr, "SecureInfoGetSerialNo"}, - {0x04090000, nullptr, "UpdateConfigBlk00040003"}, + {0x04010082, GetConfigInfoBlk8, "GetConfigInfoBlk8"}, + {0x04020082, SetConfigInfoBlk4, "SetConfigInfoBlk4"}, + {0x04030000, UpdateConfigNANDSavegame, "UpdateConfigNANDSavegame"}, + {0x04040042, nullptr, "GetLocalFriendCodeSeedData"}, + {0x04050000, nullptr, "GetLocalFriendCodeSeed"}, + {0x04060000, nullptr, "SecureInfoGetRegion"}, + {0x04070000, nullptr, "SecureInfoGetByte101"}, + {0x04080042, nullptr, "SecureInfoGetSerialNo"}, + {0x04090000, nullptr, "UpdateConfigBlk00040003"}, }; CFG_S_Interface::CFG_S_Interface() { diff --git a/src/core/hle/service/cfg/cfg_u.cpp b/src/core/hle/service/cfg/cfg_u.cpp index 606f7b2eb..f28217134 100644 --- a/src/core/hle/service/cfg/cfg_u.cpp +++ b/src/core/hle/service/cfg/cfg_u.cpp @@ -10,16 +10,16 @@ namespace CFG { const Interface::FunctionInfo FunctionTable[] = { // cfg common - {0x00010082, GetConfigInfoBlk2, "GetConfigInfoBlk2"}, - {0x00020000, SecureInfoGetRegion, "SecureInfoGetRegion"}, - {0x00030040, GenHashConsoleUnique, "GenHashConsoleUnique"}, - {0x00040000, GetRegionCanadaUSA, "GetRegionCanadaUSA"}, - {0x00050000, GetSystemModel, "GetSystemModel"}, - {0x00060000, GetModelNintendo2DS, "GetModelNintendo2DS"}, - {0x00070040, nullptr, "WriteToFirstByteCfgSavegame"}, - {0x00080080, nullptr, "GoThroughTable"}, - {0x00090040, GetCountryCodeString, "GetCountryCodeString"}, - {0x000A0040, GetCountryCodeID, "GetCountryCodeID"}, + {0x00010082, GetConfigInfoBlk2, "GetConfigInfoBlk2"}, + {0x00020000, SecureInfoGetRegion, "SecureInfoGetRegion"}, + {0x00030040, GenHashConsoleUnique, "GenHashConsoleUnique"}, + {0x00040000, GetRegionCanadaUSA, "GetRegionCanadaUSA"}, + {0x00050000, GetSystemModel, "GetSystemModel"}, + {0x00060000, GetModelNintendo2DS, "GetModelNintendo2DS"}, + {0x00070040, nullptr, "WriteToFirstByteCfgSavegame"}, + {0x00080080, nullptr, "GoThroughTable"}, + {0x00090040, GetCountryCodeString, "GetCountryCodeString"}, + {0x000A0040, GetCountryCodeID, "GetCountryCodeID"}, }; CFG_U_Interface::CFG_U_Interface() { diff --git a/src/core/hle/service/csnd_snd.cpp b/src/core/hle/service/csnd_snd.cpp index 913c8dc09..e777ea9d6 100644 --- a/src/core/hle/service/csnd_snd.cpp +++ b/src/core/hle/service/csnd_snd.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/csnd_snd.h" #include #include "common/alignment.h" #include "core/hle/hle.h" #include "core/hle/kernel/mutex.h" #include "core/hle/kernel/shared_memory.h" -#include "core/hle/service/csnd_snd.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace CSND_SND @@ -15,18 +15,18 @@ namespace CSND_SND { const Interface::FunctionInfo FunctionTable[] = { - {0x00010140, Initialize, "Initialize"}, - {0x00020000, Shutdown, "Shutdown"}, - {0x00030040, ExecuteType0Commands, "ExecuteType0Commands"}, - {0x00040080, nullptr, "ExecuteType1Commands"}, - {0x00050000, AcquireSoundChannels, "AcquireSoundChannels"}, - {0x00060000, nullptr, "ReleaseSoundChannels"}, - {0x00070000, nullptr, "AcquireCaptureDevice"}, - {0x00080040, nullptr, "ReleaseCaptureDevice"}, - {0x00090082, nullptr, "FlushDataCache"}, - {0x000A0082, nullptr, "StoreDataCache"}, - {0x000B0082, nullptr, "InvalidateDataCache"}, - {0x000C0000, nullptr, "Reset"}, + {0x00010140, Initialize, "Initialize"}, + {0x00020000, Shutdown, "Shutdown"}, + {0x00030040, ExecuteType0Commands, "ExecuteType0Commands"}, + {0x00040080, nullptr, "ExecuteType1Commands"}, + {0x00050000, AcquireSoundChannels, "AcquireSoundChannels"}, + {0x00060000, nullptr, "ReleaseSoundChannels"}, + {0x00070000, nullptr, "AcquireCaptureDevice"}, + {0x00080040, nullptr, "ReleaseCaptureDevice"}, + {0x00090082, nullptr, "FlushDataCache"}, + {0x000A0082, nullptr, "StoreDataCache"}, + {0x000B0082, nullptr, "InvalidateDataCache"}, + {0x000C0000, nullptr, "Reset"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -44,9 +44,9 @@ void Initialize(Service::Interface* self) { u32 size = Common::AlignUp(cmd_buff[1], Memory::PAGE_SIZE); using Kernel::MemoryPermission; - shared_memory = Kernel::SharedMemory::Create(nullptr, size, - MemoryPermission::ReadWrite, MemoryPermission::ReadWrite, - 0, Kernel::MemoryRegion::BASE, "CSND:SharedMemory"); + shared_memory = Kernel::SharedMemory::Create(nullptr, size, MemoryPermission::ReadWrite, + MemoryPermission::ReadWrite, 0, + Kernel::MemoryRegion::BASE, "CSND:SharedMemory"); mutex = Kernel::Mutex::Create(false); @@ -58,7 +58,7 @@ void Initialize(Service::Interface* self) { void ExecuteType0Commands(Service::Interface* self) { u32* const cmd_buff = Kernel::GetCommandBuffer(); - u8* const ptr = shared_memory->GetPointer(cmd_buff[1]); + u8* const ptr = shared_memory->GetPointer(cmd_buff[1]); if (shared_memory != nullptr && ptr != nullptr) { Type0Command command; diff --git a/src/core/hle/service/csnd_snd.h b/src/core/hle/service/csnd_snd.h index e861f3327..a146d116b 100644 --- a/src/core/hle/service/csnd_snd.h +++ b/src/core/hle/service/csnd_snd.h @@ -25,7 +25,7 @@ struct Type0Command { u32 command_id; u32 finished; u32 flags; - u8 parameters[20]; + u8 parameters[20]; }; void Initialize(Service::Interface* self); diff --git a/src/core/hle/service/dlp/dlp.cpp b/src/core/hle/service/dlp/dlp.cpp index 7c8db794b..fd124e819 100644 --- a/src/core/hle/service/dlp/dlp.cpp +++ b/src/core/hle/service/dlp/dlp.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/service.h" #include "core/hle/service/dlp/dlp.h" #include "core/hle/service/dlp/dlp_clnt.h" #include "core/hle/service/dlp/dlp_fkcl.h" #include "core/hle/service/dlp/dlp_srvr.h" +#include "core/hle/service/service.h" namespace Service { namespace DLP { diff --git a/src/core/hle/service/dlp/dlp_clnt.cpp b/src/core/hle/service/dlp/dlp_clnt.cpp index 0b31d47df..56f934b3f 100644 --- a/src/core/hle/service/dlp/dlp_clnt.cpp +++ b/src/core/hle/service/dlp/dlp_clnt.cpp @@ -8,8 +8,7 @@ namespace Service { namespace DLP { const Interface::FunctionInfo FunctionTable[] = { - {0x000100C3, nullptr, "Initialize"}, - {0x00110000, nullptr, "GetWirelessRebootPassphrase"}, + {0x000100C3, nullptr, "Initialize"}, {0x00110000, nullptr, "GetWirelessRebootPassphrase"}, }; DLP_CLNT_Interface::DLP_CLNT_Interface() { diff --git a/src/core/hle/service/dlp/dlp_fkcl.cpp b/src/core/hle/service/dlp/dlp_fkcl.cpp index a845260e5..29b9d52e0 100644 --- a/src/core/hle/service/dlp/dlp_fkcl.cpp +++ b/src/core/hle/service/dlp/dlp_fkcl.cpp @@ -8,8 +8,7 @@ namespace Service { namespace DLP { const Interface::FunctionInfo FunctionTable[] = { - {0x00010083, nullptr, "Initialize"}, - {0x000F0000, nullptr, "GetWirelessRebootPassphrase"}, + {0x00010083, nullptr, "Initialize"}, {0x000F0000, nullptr, "GetWirelessRebootPassphrase"}, }; DLP_FKCL_Interface::DLP_FKCL_Interface() { diff --git a/src/core/hle/service/dlp/dlp_srvr.cpp b/src/core/hle/service/dlp/dlp_srvr.cpp index da9b30f56..113f6a79f 100644 --- a/src/core/hle/service/dlp/dlp_srvr.cpp +++ b/src/core/hle/service/dlp/dlp_srvr.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/dlp/dlp_srvr.h" #include "common/common_types.h" #include "common/logging/log.h" #include "core/hle/result.h" -#include "core/hle/service/dlp/dlp_srvr.h" namespace Service { namespace DLP { @@ -20,10 +20,10 @@ static void unk_0x000E0040(Interface* self) { } const Interface::FunctionInfo FunctionTable[] = { - {0x00010183, nullptr, "Initialize"}, - {0x00020000, nullptr, "Finalize"}, - {0x000800C0, nullptr, "SendWirelessRebootPassphrase"}, - {0x000E0040, unk_0x000E0040, "unk_0x000E0040"}, + {0x00010183, nullptr, "Initialize"}, + {0x00020000, nullptr, "Finalize"}, + {0x000800C0, nullptr, "SendWirelessRebootPassphrase"}, + {0x000E0040, unk_0x000E0040, "unk_0x000E0040"}, }; DLP_SRVR_Interface::DLP_SRVR_Interface() { diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp index c8aadd9db..70e92c30c 100644 --- a/src/core/hle/service/dsp_dsp.cpp +++ b/src/core/hle/service/dsp_dsp.cpp @@ -23,9 +23,7 @@ namespace DSP_DSP { static Kernel::SharedPtr semaphore_event; /// There are three types of interrupts -enum class InterruptType { - Zero, One, Pipe -}; +enum class InterruptType { Zero, One, Pipe }; constexpr size_t NUM_INTERRUPT_TYPE = 3; class InterruptEvents final { @@ -57,9 +55,8 @@ public: // Actual service implementation only has 6 'slots' for interrupts. constexpr size_t max_number_of_interrupt_events = 6; - size_t number = std::count_if(pipe.begin(), pipe.end(), [](const auto& evt) { - return evt != nullptr; - }); + size_t number = + std::count_if(pipe.begin(), pipe.end(), [](const auto& evt) { return evt != nullptr; }); if (zero != nullptr) number++; @@ -105,7 +102,8 @@ static void ConvertProcessAddressFromDspDram(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0xC, 2, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - // TODO(merry): There is a per-region offset missing in this calculation (that seems to be always zero). + // TODO(merry): There is a per-region offset missing in this calculation (that seems to be + // always zero). cmd_buff[2] = (addr << 1) + (Memory::DSP_RAM_VADDR + 0x40000); LOG_DEBUG(Service_DSP, "addr=0x%08X", addr); @@ -126,15 +124,15 @@ static void ConvertProcessAddressFromDspDram(Service::Interface* self) { static void LoadComponent(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - u32 size = cmd_buff[1]; - u32 prog_mask = cmd_buff[2]; - u32 data_mask = cmd_buff[3]; - u32 desc = cmd_buff[4]; - u32 buffer = cmd_buff[5]; + u32 size = cmd_buff[1]; + u32 prog_mask = cmd_buff[2]; + u32 data_mask = cmd_buff[3]; + u32 desc = cmd_buff[4]; + u32 buffer = cmd_buff[5]; cmd_buff[0] = IPC::MakeHeader(0x11, 2, 2); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - cmd_buff[2] = 1; // Pretend that we actually loaded the DSP firmware + cmd_buff[2] = 1; // Pretend that we actually loaded the DSP firmware cmd_buff[3] = desc; cmd_buff[4] = buffer; @@ -145,12 +143,15 @@ static void LoadComponent(Service::Interface* self) { std::vector component_data(size); Memory::ReadBlock(buffer, component_data.data(), component_data.size()); - LOG_INFO(Service_DSP, "Firmware hash: %#" PRIx64, Common::ComputeHash64(component_data.data(), component_data.size())); + LOG_INFO(Service_DSP, "Firmware hash: %#" PRIx64, + Common::ComputeHash64(component_data.data(), component_data.size())); // Some versions of the firmware have the location of DSP structures listed here. ASSERT(size > 0x37C); - LOG_INFO(Service_DSP, "Structures hash: %#" PRIx64, Common::ComputeHash64(component_data.data() + 0x340, 60)); + LOG_INFO(Service_DSP, "Structures hash: %#" PRIx64, + Common::ComputeHash64(component_data.data() + 0x340, 60)); - LOG_WARNING(Service_DSP, "(STUBBED) called size=0x%X, prog_mask=0x%08X, data_mask=0x%08X, buffer=0x%08X", + LOG_WARNING(Service_DSP, + "(STUBBED) called size=0x%X, prog_mask=0x%08X, data_mask=0x%08X, buffer=0x%08X", size, prog_mask, data_mask, buffer); } @@ -187,13 +188,14 @@ static void GetSemaphoreEventHandle(Service::Interface* self) { static void FlushDataCache(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 address = cmd_buff[1]; - u32 size = cmd_buff[2]; + u32 size = cmd_buff[2]; u32 process = cmd_buff[4]; cmd_buff[0] = IPC::MakeHeader(0x13, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_TRACE(Service_DSP, "called address=0x%08X, size=0x%X, process=0x%08X", address, size, process); + LOG_TRACE(Service_DSP, "called address=0x%08X, size=0x%X, process=0x%08X", address, size, + process); } /** @@ -224,23 +226,29 @@ static void RegisterInterruptEvents(Service::Interface* self) { auto evt = Kernel::g_handle_table.Get(cmd_buff[4]); if (!evt) { - LOG_INFO(Service_DSP, "Invalid event handle! type=%u, pipe=%u, event_handle=0x%08X", type_index, pipe_index, event_handle); + LOG_INFO(Service_DSP, "Invalid event handle! type=%u, pipe=%u, event_handle=0x%08X", + type_index, pipe_index, event_handle); ASSERT(false); // TODO: This should really be handled at an IPC translation layer. } if (interrupt_events.HasTooManyEventsRegistered()) { - LOG_INFO(Service_DSP, "Ran out of space to register interrupts (Attempted to register type=%u, pipe=%u, event_handle=0x%08X)", + LOG_INFO(Service_DSP, "Ran out of space to register interrupts (Attempted to register " + "type=%u, pipe=%u, event_handle=0x%08X)", type_index, pipe_index, event_handle); - cmd_buff[1] = ResultCode(ErrorDescription::InvalidResultValue, ErrorModule::DSP, ErrorSummary::OutOfResource, ErrorLevel::Status).raw; + cmd_buff[1] = ResultCode(ErrorDescription::InvalidResultValue, ErrorModule::DSP, + ErrorSummary::OutOfResource, ErrorLevel::Status) + .raw; return; } interrupt_events.Get(type, pipe) = evt; - LOG_INFO(Service_DSP, "Registered type=%u, pipe=%u, event_handle=0x%08X", type_index, pipe_index, event_handle); + LOG_INFO(Service_DSP, "Registered type=%u, pipe=%u, event_handle=0x%08X", type_index, + pipe_index, event_handle); cmd_buff[1] = RESULT_SUCCESS.raw; } else { interrupt_events.Get(type, pipe) = nullptr; - LOG_INFO(Service_DSP, "Unregistered interrupt=%u, channel=%u, event_handle=0x%08X", type_index, pipe_index, event_handle); + LOG_INFO(Service_DSP, "Unregistered interrupt=%u, channel=%u, event_handle=0x%08X", + type_index, pipe_index, event_handle); cmd_buff[1] = RESULT_SUCCESS.raw; } } @@ -282,13 +290,18 @@ static void WriteProcessPipe(Service::Interface* self) { DSP::HLE::DspPipe pipe = static_cast(pipe_index); if (IPC::StaticBufferDesc(size, 1) != cmd_buff[3]) { - LOG_ERROR(Service_DSP, "IPC static buffer descriptor failed validation (0x%X). pipe=%u, size=0x%X, buffer=0x%08X", cmd_buff[3], pipe_index, size, buffer); + LOG_ERROR(Service_DSP, "IPC static buffer descriptor failed validation (0x%X). pipe=%u, " + "size=0x%X, buffer=0x%08X", + cmd_buff[3], pipe_index, size, buffer); cmd_buff[0] = IPC::MakeHeader(0, 1, 0); - cmd_buff[1] = ResultCode(ErrorDescription::OS_InvalidBufferDescriptor, ErrorModule::OS, ErrorSummary::WrongArgument, ErrorLevel::Permanent).raw; + cmd_buff[1] = ResultCode(ErrorDescription::OS_InvalidBufferDescriptor, ErrorModule::OS, + ErrorSummary::WrongArgument, ErrorLevel::Permanent) + .raw; return; } - ASSERT_MSG(Memory::IsValidVirtualAddress(buffer), "Invalid Buffer: pipe=%u, size=0x%X, buffer=0x%08X", pipe, size, buffer); + ASSERT_MSG(Memory::IsValidVirtualAddress(buffer), + "Invalid Buffer: pipe=%u, size=0x%X, buffer=0x%08X", pipe, size, buffer); std::vector message(size); for (u32 i = 0; i < size; i++) { @@ -327,7 +340,9 @@ static void ReadPipeIfPossible(Service::Interface* self) { DSP::HLE::DspPipe pipe = static_cast(pipe_index); - ASSERT_MSG(Memory::IsValidVirtualAddress(addr), "Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", pipe, unknown, size, addr); + ASSERT_MSG(Memory::IsValidVirtualAddress(addr), + "Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", pipe, unknown, + size, addr); cmd_buff[0] = IPC::MakeHeader(0x10, 1, 2); cmd_buff[1] = RESULT_SUCCESS.raw; // No error @@ -343,7 +358,9 @@ static void ReadPipeIfPossible(Service::Interface* self) { cmd_buff[3] = IPC::StaticBufferDesc(size, 0); cmd_buff[4] = addr; - LOG_DEBUG(Service_DSP, "pipe=%u, unknown=0x%08X, size=0x%X, buffer=0x%08X, return cmd_buff[2]=0x%08X", pipe_index, unknown, size, addr, cmd_buff[2]); + LOG_DEBUG(Service_DSP, + "pipe=%u, unknown=0x%08X, size=0x%X, buffer=0x%08X, return cmd_buff[2]=0x%08X", + pipe_index, unknown, size, addr, cmd_buff[2]); } /** @@ -367,7 +384,9 @@ static void ReadPipe(Service::Interface* self) { DSP::HLE::DspPipe pipe = static_cast(pipe_index); - ASSERT_MSG(Memory::IsValidVirtualAddress(addr), "Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", pipe, unknown, size, addr); + ASSERT_MSG(Memory::IsValidVirtualAddress(addr), + "Invalid addr: pipe=0x%08X, unknown=0x%08X, size=0x%X, buffer=0x%08X", pipe, unknown, + size, addr); if (DSP::HLE::GetPipeReadableSize(pipe) >= size) { std::vector response = DSP::HLE::PipeRead(pipe, size); @@ -384,7 +403,9 @@ static void ReadPipe(Service::Interface* self) { UNREACHABLE(); } - LOG_DEBUG(Service_DSP, "pipe=%u, unknown=0x%08X, size=0x%X, buffer=0x%08X, return cmd_buff[2]=0x%08X", pipe_index, unknown, size, addr, cmd_buff[2]); + LOG_DEBUG(Service_DSP, + "pipe=%u, unknown=0x%08X, size=0x%X, buffer=0x%08X, return cmd_buff[2]=0x%08X", + pipe_index, unknown, size, addr, cmd_buff[2]); } /** @@ -408,7 +429,8 @@ static void GetPipeReadableSize(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[2] = static_cast(DSP::HLE::GetPipeReadableSize(pipe)); - LOG_DEBUG(Service_DSP, "pipe=%u, unknown=0x%08X, return cmd_buff[2]=0x%08X", pipe_index, unknown, cmd_buff[2]); + LOG_DEBUG(Service_DSP, "pipe=%u, unknown=0x%08X, return cmd_buff[2]=0x%08X", pipe_index, + unknown, cmd_buff[2]); } /** @@ -443,7 +465,7 @@ static void GetHeadphoneStatus(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x1F, 2, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - cmd_buff[2] = 0; // Not using headphones + cmd_buff[2] = 0; // Not using headphones LOG_DEBUG(Service_DSP, "called"); } @@ -466,7 +488,8 @@ static void RecvData(Service::Interface* self) { ASSERT_MSG(register_number == 0, "Unknown register_number %u", register_number); - // Application reads this after requesting DSP shutdown, to verify the DSP has indeed shutdown or slept. + // Application reads this after requesting DSP shutdown, to verify the DSP has indeed shutdown + // or slept. cmd_buff[0] = IPC::MakeHeader(0x1, 2, 0); cmd_buff[1] = RESULT_SUCCESS.raw; @@ -512,39 +535,39 @@ static void RecvDataIsReady(Service::Interface* self) { } const Interface::FunctionInfo FunctionTable[] = { - {0x00010040, RecvData, "RecvData"}, - {0x00020040, RecvDataIsReady, "RecvDataIsReady"}, - {0x00030080, nullptr, "SendData"}, - {0x00040040, nullptr, "SendDataIsEmpty"}, - {0x000500C2, nullptr, "SendFifoEx"}, - {0x000600C0, nullptr, "RecvFifoEx"}, - {0x00070040, SetSemaphore, "SetSemaphore"}, - {0x00080000, nullptr, "GetSemaphore"}, - {0x00090040, nullptr, "ClearSemaphore"}, - {0x000A0040, nullptr, "MaskSemaphore"}, - {0x000B0000, nullptr, "CheckSemaphoreRequest"}, + {0x00010040, RecvData, "RecvData"}, + {0x00020040, RecvDataIsReady, "RecvDataIsReady"}, + {0x00030080, nullptr, "SendData"}, + {0x00040040, nullptr, "SendDataIsEmpty"}, + {0x000500C2, nullptr, "SendFifoEx"}, + {0x000600C0, nullptr, "RecvFifoEx"}, + {0x00070040, SetSemaphore, "SetSemaphore"}, + {0x00080000, nullptr, "GetSemaphore"}, + {0x00090040, nullptr, "ClearSemaphore"}, + {0x000A0040, nullptr, "MaskSemaphore"}, + {0x000B0000, nullptr, "CheckSemaphoreRequest"}, {0x000C0040, ConvertProcessAddressFromDspDram, "ConvertProcessAddressFromDspDram"}, - {0x000D0082, WriteProcessPipe, "WriteProcessPipe"}, - {0x000E00C0, ReadPipe, "ReadPipe"}, - {0x000F0080, GetPipeReadableSize, "GetPipeReadableSize"}, - {0x001000C0, ReadPipeIfPossible, "ReadPipeIfPossible"}, - {0x001100C2, LoadComponent, "LoadComponent"}, - {0x00120000, nullptr, "UnloadComponent"}, - {0x00130082, FlushDataCache, "FlushDataCache"}, - {0x00140082, nullptr, "InvalidateDCache"}, - {0x00150082, RegisterInterruptEvents, "RegisterInterruptEvents"}, - {0x00160000, GetSemaphoreEventHandle, "GetSemaphoreEventHandle"}, - {0x00170040, SetSemaphoreMask, "SetSemaphoreMask"}, - {0x00180040, nullptr, "GetPhysicalAddress"}, - {0x00190040, nullptr, "GetVirtualAddress"}, - {0x001A0042, nullptr, "SetIirFilterI2S1_cmd1"}, - {0x001B0042, nullptr, "SetIirFilterI2S1_cmd2"}, - {0x001C0082, nullptr, "SetIirFilterEQ"}, - {0x001D00C0, nullptr, "ReadMultiEx_SPI2"}, - {0x001E00C2, nullptr, "WriteMultiEx_SPI2"}, - {0x001F0000, GetHeadphoneStatus, "GetHeadphoneStatus"}, - {0x00200040, nullptr, "ForceHeadphoneOut"}, - {0x00210000, nullptr, "GetIsDspOccupied"}, + {0x000D0082, WriteProcessPipe, "WriteProcessPipe"}, + {0x000E00C0, ReadPipe, "ReadPipe"}, + {0x000F0080, GetPipeReadableSize, "GetPipeReadableSize"}, + {0x001000C0, ReadPipeIfPossible, "ReadPipeIfPossible"}, + {0x001100C2, LoadComponent, "LoadComponent"}, + {0x00120000, nullptr, "UnloadComponent"}, + {0x00130082, FlushDataCache, "FlushDataCache"}, + {0x00140082, nullptr, "InvalidateDCache"}, + {0x00150082, RegisterInterruptEvents, "RegisterInterruptEvents"}, + {0x00160000, GetSemaphoreEventHandle, "GetSemaphoreEventHandle"}, + {0x00170040, SetSemaphoreMask, "SetSemaphoreMask"}, + {0x00180040, nullptr, "GetPhysicalAddress"}, + {0x00190040, nullptr, "GetVirtualAddress"}, + {0x001A0042, nullptr, "SetIirFilterI2S1_cmd1"}, + {0x001B0042, nullptr, "SetIirFilterI2S1_cmd2"}, + {0x001C0082, nullptr, "SetIirFilterEQ"}, + {0x001D00C0, nullptr, "ReadMultiEx_SPI2"}, + {0x001E00C2, nullptr, "WriteMultiEx_SPI2"}, + {0x001F0000, GetHeadphoneStatus, "GetHeadphoneStatus"}, + {0x00200040, nullptr, "ForceHeadphoneOut"}, + {0x00210000, nullptr, "GetIsDspOccupied"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/err_f.cpp b/src/core/hle/service/err_f.cpp index 5f9cf6e94..2cd8269de 100644 --- a/src/core/hle/service/err_f.cpp +++ b/src/core/hle/service/err_f.cpp @@ -35,70 +35,70 @@ union ErrInfo { u8 specifier; struct { - u8 specifier; // 0x0 - u8 rev_high; // 0x1 - u16 rev_low; // 0x2 - RSL result_code; // 0x4 - u32 address; // 0x8 - INSERT_PADDING_BYTES(4); // 0xC - u32 pid_low; // 0x10 - u32 pid_high; // 0x14 - u32 aid_low; // 0x18 - u32 aid_high; // 0x1C + u8 specifier; // 0x0 + u8 rev_high; // 0x1 + u16 rev_low; // 0x2 + RSL result_code; // 0x4 + u32 address; // 0x8 + INSERT_PADDING_BYTES(4); // 0xC + u32 pid_low; // 0x10 + u32 pid_high; // 0x14 + u32 aid_low; // 0x18 + u32 aid_high; // 0x1C } errtype1; struct { - u8 specifier; // 0x0 - u8 rev_high; // 0x1 - u16 rev_low; // 0x2 - INSERT_PADDING_BYTES(0xC); // 0x4 - u32 pid_low; // 0x10 - u32 pid_high; // 0x14 - u32 aid_low; // 0x18 - u32 aid_high; // 0x1C - u8 error_type; // 0x20 - INSERT_PADDING_BYTES(3); // 0x21 - u32 fault_status_reg; // 0x24 - u32 fault_addr; // 0x28 - u32 fpexc; // 0x2C - u32 finst; // 0x30 - u32 finst2; // 0x34 - INSERT_PADDING_BYTES(0x34); // 0x38 - u32 sp; // 0x6C - u32 pc; // 0x70 - u32 lr; // 0x74 - u32 cpsr; // 0x78 + u8 specifier; // 0x0 + u8 rev_high; // 0x1 + u16 rev_low; // 0x2 + INSERT_PADDING_BYTES(0xC); // 0x4 + u32 pid_low; // 0x10 + u32 pid_high; // 0x14 + u32 aid_low; // 0x18 + u32 aid_high; // 0x1C + u8 error_type; // 0x20 + INSERT_PADDING_BYTES(3); // 0x21 + u32 fault_status_reg; // 0x24 + u32 fault_addr; // 0x28 + u32 fpexc; // 0x2C + u32 finst; // 0x30 + u32 finst2; // 0x34 + INSERT_PADDING_BYTES(0x34); // 0x38 + u32 sp; // 0x6C + u32 pc; // 0x70 + u32 lr; // 0x74 + u32 cpsr; // 0x78 } errtype3; struct { - u8 specifier; // 0x0 - u8 rev_high; // 0x1 - u16 rev_low; // 0x2 - RSL result_code; // 0x4 - INSERT_PADDING_BYTES(8); // 0x8 - u32 pid_low; // 0x10 - u32 pid_high; // 0x14 - u32 aid_low; // 0x18 - u32 aid_high; // 0x1C - char debug_string1[0x2E]; // 0x20 - char debug_string2[0x2E]; // 0x4E + u8 specifier; // 0x0 + u8 rev_high; // 0x1 + u16 rev_low; // 0x2 + RSL result_code; // 0x4 + INSERT_PADDING_BYTES(8); // 0x8 + u32 pid_low; // 0x10 + u32 pid_high; // 0x14 + u32 aid_low; // 0x18 + u32 aid_high; // 0x1C + char debug_string1[0x2E]; // 0x20 + char debug_string2[0x2E]; // 0x4E } errtype4; }; -enum { - PrefetchAbort = 0, - DataAbort = 1, - UndefInstr = 2, - VectorFP = 3 -}; +enum { PrefetchAbort = 0, DataAbort = 1, UndefInstr = 2, VectorFP = 3 }; static std::string GetErrInfo3Type(u8 type_code) { switch (type_code) { - case PrefetchAbort: return "Prefetch Abort"; - case DataAbort: return "Data Abort"; - case UndefInstr: return "Undefined Instruction"; - case VectorFP: return "Vector Floating Point"; - default: return "unknown"; + case PrefetchAbort: + return "Prefetch Abort"; + case DataAbort: + return "Data Abort"; + case UndefInstr: + return "Undefined Instruction"; + case VectorFP: + return "Vector Floating Point"; + default: + return "unknown"; } } @@ -110,8 +110,7 @@ static void ThrowFatalError(Service::Interface* self) { switch (errinfo->specifier) { case ErrSpecifier0: - case ErrSpecifier1: - { + case ErrSpecifier1: { const auto& errtype = errinfo->errtype1; LOG_CRITICAL(Service_ERR, "PID: 0x%08X_0x%08X", errtype.pid_low, errtype.pid_high); LOG_CRITICAL(Service_ERR, "REV: %d", errtype.rev_low | (errtype.rev_high << 16)); @@ -119,15 +118,14 @@ static void ThrowFatalError(Service::Interface* self) { LOG_CRITICAL(Service_ERR, "ADR: 0x%08X", errtype.address); LOG_CRITICAL(Service_ERR, "RSL: 0x%08X", errtype.result_code.raw); - LOG_CRITICAL(Service_ERR, " Level: %u", errtype.result_code.level.Value()); + LOG_CRITICAL(Service_ERR, " Level: %u", errtype.result_code.level.Value()); LOG_CRITICAL(Service_ERR, " Summary: %u", errtype.result_code.summary.Value()); - LOG_CRITICAL(Service_ERR, " Module: %u", errtype.result_code.module.Value()); - LOG_CRITICAL(Service_ERR, " Desc: %u", errtype.result_code.description.Value()); + LOG_CRITICAL(Service_ERR, " Module: %u", errtype.result_code.module.Value()); + LOG_CRITICAL(Service_ERR, " Desc: %u", errtype.result_code.description.Value()); break; } - case ErrSpecifier3: - { + case ErrSpecifier3: { const auto& errtype = errinfo->errtype3; LOG_CRITICAL(Service_ERR, "PID: 0x%08X_0x%08X", errtype.pid_low, errtype.pid_high); LOG_CRITICAL(Service_ERR, "REV: %d", errtype.rev_low | (errtype.rev_high << 16)); @@ -154,18 +152,17 @@ static void ThrowFatalError(Service::Interface* self) { break; } - case ErrSpecifier4: - { + case ErrSpecifier4: { const auto& errtype = errinfo->errtype4; LOG_CRITICAL(Service_ERR, "PID: 0x%08X_0x%08X", errtype.pid_low, errtype.pid_high); LOG_CRITICAL(Service_ERR, "REV: %d", errtype.rev_low | (errtype.rev_high << 16)); LOG_CRITICAL(Service_ERR, "AID: 0x%08X_0x%08X", errtype.aid_low, errtype.aid_high); LOG_CRITICAL(Service_ERR, "RSL: 0x%08X", errtype.result_code.raw); - LOG_CRITICAL(Service_ERR, " Level: %u", errtype.result_code.level.Value()); + LOG_CRITICAL(Service_ERR, " Level: %u", errtype.result_code.level.Value()); LOG_CRITICAL(Service_ERR, " Summary: %u", errtype.result_code.summary.Value()); - LOG_CRITICAL(Service_ERR, " Module: %u", errtype.result_code.module.Value()); - LOG_CRITICAL(Service_ERR, " Desc: %u", errtype.result_code.description.Value()); + LOG_CRITICAL(Service_ERR, " Module: %u", errtype.result_code.module.Value()); + LOG_CRITICAL(Service_ERR, " Desc: %u", errtype.result_code.description.Value()); LOG_CRITICAL(Service_ERR, "%s", errtype.debug_string1); LOG_CRITICAL(Service_ERR, "%s", errtype.debug_string2); @@ -176,9 +173,7 @@ static void ThrowFatalError(Service::Interface* self) { cmd_buff[1] = 0; // No error } -const Interface::FunctionInfo FunctionTable[] = { - {0x00010800, ThrowFatalError, "ThrowFatalError"} -}; +const Interface::FunctionInfo FunctionTable[] = {{0x00010800, ThrowFatalError, "ThrowFatalError"}}; //////////////////////////////////////////////////////////////////////////////////////////////////// // Interface class diff --git a/src/core/hle/service/frd/frd.cpp b/src/core/hle/service/frd/frd.cpp index 29d144365..1e9fe178f 100644 --- a/src/core/hle/service/frd/frd.cpp +++ b/src/core/hle/service/frd/frd.cpp @@ -4,10 +4,10 @@ #include "common/string_util.h" -#include "core/hle/service/service.h" #include "core/hle/service/frd/frd.h" #include "core/hle/service/frd/frd_a.h" #include "core/hle/service/frd/frd_u.h" +#include "core/hle/service/service.h" namespace Service { namespace FRD { @@ -43,7 +43,7 @@ void GetFriendKeyList(Service::Interface* self) { } cmd_buff[1] = RESULT_SUCCESS.raw; // No error - cmd_buff[2] = 0; // 0 friends + cmd_buff[2] = 0; // 0 friends LOG_WARNING(Service_FRD, "(STUBBED) called, unknown=%d, frd_count=%d, frd_key_addr=0x%08X", unknown, frd_count, frd_key_addr); } @@ -61,25 +61,27 @@ void GetFriendProfile(Service::Interface* self) { } cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_FRD, "(STUBBED) called, count=%d, frd_key_addr=0x%08X, profiles_addr=0x%08X", - count, frd_key_addr, profiles_addr); + LOG_WARNING(Service_FRD, + "(STUBBED) called, count=%d, frd_key_addr=0x%08X, profiles_addr=0x%08X", count, + frd_key_addr, profiles_addr); } void GetFriendAttributeFlags(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - u32 count = cmd_buff[1]; - u32 frd_key_addr = cmd_buff[3]; + u32 count = cmd_buff[1]; + u32 frd_key_addr = cmd_buff[3]; u32 attr_flags_addr = cmd_buff[65]; for (u32 i = 0; i < count; ++i) { - //TODO:(mailwl) figure out AttributeFlag size and zero all buffer. Assume 1 byte + // TODO:(mailwl) figure out AttributeFlag size and zero all buffer. Assume 1 byte Memory::Write8(attr_flags_addr + i, 0); } cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_FRD, "(STUBBED) called, count=%d, frd_key_addr=0x%08X, attr_flags_addr=0x%08X", - count, frd_key_addr, attr_flags_addr); + LOG_WARNING(Service_FRD, + "(STUBBED) called, count=%d, frd_key_addr=0x%08X, attr_flags_addr=0x%08X", count, + frd_key_addr, attr_flags_addr); } void GetMyFriendKey(Service::Interface* self) { diff --git a/src/core/hle/service/frd/frd_a.cpp b/src/core/hle/service/frd/frd_a.cpp index 818d610f3..cfc37210b 100644 --- a/src/core/hle/service/frd/frd_a.cpp +++ b/src/core/hle/service/frd/frd_a.cpp @@ -11,7 +11,7 @@ namespace FRD { // const Interface::FunctionInfo FunctionTable[] = { }; FRD_A_Interface::FRD_A_Interface() { - //Register(FunctionTable); + // Register(FunctionTable); } } // namespace FRD diff --git a/src/core/hle/service/frd/frd_u.cpp b/src/core/hle/service/frd/frd_u.cpp index db8666416..bd1c9c16b 100644 --- a/src/core/hle/service/frd/frd_u.cpp +++ b/src/core/hle/service/frd/frd_u.cpp @@ -9,59 +9,59 @@ namespace Service { namespace FRD { const Interface::FunctionInfo FunctionTable[] = { - {0x00010000, nullptr, "HasLoggedIn"}, - {0x00020000, nullptr, "IsOnline"}, - {0x00030000, nullptr, "Login"}, - {0x00040000, nullptr, "Logout"}, - {0x00050000, GetMyFriendKey, "GetMyFriendKey"}, - {0x00060000, nullptr, "GetMyPreference"}, - {0x00070000, nullptr, "GetMyProfile"}, - {0x00080000, GetMyPresence, "GetMyPresence"}, - {0x00090000, GetMyScreenName, "GetMyScreenName"}, - {0x000A0000, nullptr, "GetMyMii"}, - {0x000B0000, nullptr, "GetMyLocalAccountId"}, - {0x000C0000, nullptr, "GetMyPlayingGame"}, - {0x000D0000, nullptr, "GetMyFavoriteGame"}, - {0x000E0000, nullptr, "GetMyNcPrincipalId"}, - {0x000F0000, nullptr, "GetMyComment"}, - {0x00100040, nullptr, "GetMyPassword"}, - {0x00110080, GetFriendKeyList, "GetFriendKeyList"}, - {0x00120042, nullptr, "GetFriendPresence"}, - {0x00130142, nullptr, "GetFriendScreenName"}, - {0x00140044, nullptr, "GetFriendMii"}, - {0x00150042, GetFriendProfile, "GetFriendProfile"}, - {0x00160042, nullptr, "GetFriendRelationship"}, + {0x00010000, nullptr, "HasLoggedIn"}, + {0x00020000, nullptr, "IsOnline"}, + {0x00030000, nullptr, "Login"}, + {0x00040000, nullptr, "Logout"}, + {0x00050000, GetMyFriendKey, "GetMyFriendKey"}, + {0x00060000, nullptr, "GetMyPreference"}, + {0x00070000, nullptr, "GetMyProfile"}, + {0x00080000, GetMyPresence, "GetMyPresence"}, + {0x00090000, GetMyScreenName, "GetMyScreenName"}, + {0x000A0000, nullptr, "GetMyMii"}, + {0x000B0000, nullptr, "GetMyLocalAccountId"}, + {0x000C0000, nullptr, "GetMyPlayingGame"}, + {0x000D0000, nullptr, "GetMyFavoriteGame"}, + {0x000E0000, nullptr, "GetMyNcPrincipalId"}, + {0x000F0000, nullptr, "GetMyComment"}, + {0x00100040, nullptr, "GetMyPassword"}, + {0x00110080, GetFriendKeyList, "GetFriendKeyList"}, + {0x00120042, nullptr, "GetFriendPresence"}, + {0x00130142, nullptr, "GetFriendScreenName"}, + {0x00140044, nullptr, "GetFriendMii"}, + {0x00150042, GetFriendProfile, "GetFriendProfile"}, + {0x00160042, nullptr, "GetFriendRelationship"}, {0x00170042, GetFriendAttributeFlags, "GetFriendAttributeFlags"}, - {0x00180044, nullptr, "GetFriendPlayingGame"}, - {0x00190042, nullptr, "GetFriendFavoriteGame"}, - {0x001A00C4, nullptr, "GetFriendInfo"}, - {0x001B0080, nullptr, "IsIncludedInFriendList"}, - {0x001C0042, nullptr, "UnscrambleLocalFriendCode"}, - {0x001D0002, nullptr, "UpdateGameModeDescription"}, - {0x001E02C2, nullptr, "UpdateGameMode"}, - {0x001F0042, nullptr, "SendInvitation"}, - {0x00200002, nullptr, "AttachToEventNotification"}, - {0x00210040, nullptr, "SetNotificationMask"}, - {0x00220040, nullptr, "GetEventNotification"}, - {0x00230000, nullptr, "GetLastResponseResult"}, - {0x00240040, nullptr, "PrincipalIdToFriendCode"}, - {0x00250080, nullptr, "FriendCodeToPrincipalId"}, - {0x00260080, nullptr, "IsValidFriendCode"}, - {0x00270040, nullptr, "ResultToErrorCode"}, - {0x00280244, nullptr, "RequestGameAuthentication"}, - {0x00290000, nullptr, "GetGameAuthenticationData"}, - {0x002A0204, nullptr, "RequestServiceLocator"}, - {0x002B0000, nullptr, "GetServiceLocatorData"}, - {0x002C0002, nullptr, "DetectNatProperties"}, - {0x002D0000, nullptr, "GetNatProperties"}, - {0x002E0000, nullptr, "GetServerTimeInterval"}, - {0x002F0040, nullptr, "AllowHalfAwake"}, - {0x00300000, nullptr, "GetServerTypes"}, - {0x00310082, nullptr, "GetFriendComment"}, - {0x00320042, nullptr, "SetClientSdkVersion"}, - {0x00330000, nullptr, "GetMyApproachContext"}, - {0x00340046, nullptr, "AddFriendWithApproach"}, - {0x00350082, nullptr, "DecryptApproachContext"}, + {0x00180044, nullptr, "GetFriendPlayingGame"}, + {0x00190042, nullptr, "GetFriendFavoriteGame"}, + {0x001A00C4, nullptr, "GetFriendInfo"}, + {0x001B0080, nullptr, "IsIncludedInFriendList"}, + {0x001C0042, nullptr, "UnscrambleLocalFriendCode"}, + {0x001D0002, nullptr, "UpdateGameModeDescription"}, + {0x001E02C2, nullptr, "UpdateGameMode"}, + {0x001F0042, nullptr, "SendInvitation"}, + {0x00200002, nullptr, "AttachToEventNotification"}, + {0x00210040, nullptr, "SetNotificationMask"}, + {0x00220040, nullptr, "GetEventNotification"}, + {0x00230000, nullptr, "GetLastResponseResult"}, + {0x00240040, nullptr, "PrincipalIdToFriendCode"}, + {0x00250080, nullptr, "FriendCodeToPrincipalId"}, + {0x00260080, nullptr, "IsValidFriendCode"}, + {0x00270040, nullptr, "ResultToErrorCode"}, + {0x00280244, nullptr, "RequestGameAuthentication"}, + {0x00290000, nullptr, "GetGameAuthenticationData"}, + {0x002A0204, nullptr, "RequestServiceLocator"}, + {0x002B0000, nullptr, "GetServiceLocatorData"}, + {0x002C0002, nullptr, "DetectNatProperties"}, + {0x002D0000, nullptr, "GetNatProperties"}, + {0x002E0000, nullptr, "GetServerTimeInterval"}, + {0x002F0040, nullptr, "AllowHalfAwake"}, + {0x00300000, nullptr, "GetServerTypes"}, + {0x00310082, nullptr, "GetFriendComment"}, + {0x00320042, nullptr, "SetClientSdkVersion"}, + {0x00330000, nullptr, "GetMyApproachContext"}, + {0x00340046, nullptr, "AddFriendWithApproach"}, + {0x00350082, nullptr, "DecryptApproachContext"}, }; FRD_U_Interface::FRD_U_Interface() { diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index 4c7aaa7f2..1b851eade 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -3,9 +3,9 @@ // Refer to the license.txt file included. #include +#include #include #include -#include #include #include @@ -25,25 +25,25 @@ #include "core/file_sys/directory_backend.h" #include "core/file_sys/file_backend.h" #include "core/hle/hle.h" -#include "core/hle/service/service.h" +#include "core/hle/result.h" #include "core/hle/service/fs/archive.h" #include "core/hle/service/fs/fs_user.h" -#include "core/hle/result.h" +#include "core/hle/service/service.h" #include "core/memory.h" // Specializes std::hash for ArchiveIdCode, so that we can use it in std::unordered_map. // Workaroung for libstdc++ bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60970 namespace std { - template <> - struct hash { - typedef Service::FS::ArchiveIdCode argument_type; - typedef std::size_t result_type; - - result_type operator()(const argument_type& id_code) const { - typedef std::underlying_type::type Type; - return std::hash()(static_cast(id_code)); - } - }; +template <> +struct hash { + typedef Service::FS::ArchiveIdCode argument_type; + typedef std::size_t result_type; + + result_type operator()(const argument_type& id_code) const { + typedef std::underlying_type::type Type; + return std::hash()(static_cast(id_code)); + } +}; } /// TODO(Subv): Confirm length of these strings @@ -56,197 +56,193 @@ namespace FS { // TODO: Verify code /// Returned when a function is passed an invalid handle. const ResultCode ERR_INVALID_HANDLE(ErrorDescription::InvalidHandle, ErrorModule::FS, - ErrorSummary::InvalidArgument, ErrorLevel::Permanent); + ErrorSummary::InvalidArgument, ErrorLevel::Permanent); /// Returned when a function is passed an invalid archive handle. const ResultCode ERR_INVALID_ARCHIVE_HANDLE(ErrorDescription::FS_ArchiveNotMounted, ErrorModule::FS, - ErrorSummary::NotFound, ErrorLevel::Status); // 0xC8804465 + ErrorSummary::NotFound, + ErrorLevel::Status); // 0xC8804465 // Command to access archive file enum class FileCommand : u32 { - Dummy1 = 0x000100C6, - Control = 0x040100C4, - OpenSubFile = 0x08010100, - Read = 0x080200C2, - Write = 0x08030102, - GetSize = 0x08040000, - SetSize = 0x08050080, - GetAttributes = 0x08060000, - SetAttributes = 0x08070040, - Close = 0x08080000, - Flush = 0x08090000, - SetPriority = 0x080A0040, - GetPriority = 0x080B0000, - OpenLinkFile = 0x080C0000, + Dummy1 = 0x000100C6, + Control = 0x040100C4, + OpenSubFile = 0x08010100, + Read = 0x080200C2, + Write = 0x08030102, + GetSize = 0x08040000, + SetSize = 0x08050080, + GetAttributes = 0x08060000, + SetAttributes = 0x08070040, + Close = 0x08080000, + Flush = 0x08090000, + SetPriority = 0x080A0040, + GetPriority = 0x080B0000, + OpenLinkFile = 0x080C0000, }; // Command to access directory enum class DirectoryCommand : u32 { - Dummy1 = 0x000100C6, - Control = 0x040100C4, - Read = 0x08010042, - Close = 0x08020000, + Dummy1 = 0x000100C6, + Control = 0x040100C4, + Read = 0x08010042, + Close = 0x08020000, }; -File::File(std::unique_ptr&& backend, const FileSys::Path & path) - : path(path), priority(0), backend(std::move(backend)) {} +File::File(std::unique_ptr&& backend, const FileSys::Path& path) + : path(path), priority(0), backend(std::move(backend)) { +} -File::~File() {} +File::~File() { +} ResultVal File::SyncRequest() { u32* cmd_buff = Kernel::GetCommandBuffer(); FileCommand cmd = static_cast(cmd_buff[0]); switch (cmd) { - // Read from file... - case FileCommand::Read: - { - u64 offset = cmd_buff[1] | ((u64)cmd_buff[2]) << 32; - u32 length = cmd_buff[3]; - u32 address = cmd_buff[5]; - LOG_TRACE(Service_FS, "Read %s %s: offset=0x%llx length=%d address=0x%x", - GetTypeName().c_str(), GetName().c_str(), offset, length, address); - - if (offset + length > backend->GetSize()) { - LOG_ERROR(Service_FS, "Reading from out of bounds offset=0x%llX length=0x%08X file_size=0x%llX", - offset, length, backend->GetSize()); - } - - std::vector data(length); - ResultVal read = backend->Read(offset, data.size(), data.data()); - if (read.Failed()) { - cmd_buff[1] = read.Code().raw; - return read.Code(); - } - Memory::WriteBlock(address, data.data(), *read); - cmd_buff[2] = static_cast(*read); - break; + // Read from file... + case FileCommand::Read: { + u64 offset = cmd_buff[1] | ((u64)cmd_buff[2]) << 32; + u32 length = cmd_buff[3]; + u32 address = cmd_buff[5]; + LOG_TRACE(Service_FS, "Read %s %s: offset=0x%llx length=%d address=0x%x", + GetTypeName().c_str(), GetName().c_str(), offset, length, address); + + if (offset + length > backend->GetSize()) { + LOG_ERROR(Service_FS, + "Reading from out of bounds offset=0x%llX length=0x%08X file_size=0x%llX", + offset, length, backend->GetSize()); } - // Write to file... - case FileCommand::Write: - { - u64 offset = cmd_buff[1] | ((u64)cmd_buff[2]) << 32; - u32 length = cmd_buff[3]; - u32 flush = cmd_buff[4]; - u32 address = cmd_buff[6]; - LOG_TRACE(Service_FS, "Write %s %s: offset=0x%llx length=%d address=0x%x, flush=0x%x", - GetTypeName().c_str(), GetName().c_str(), offset, length, address, flush); - - std::vector data(length); - Memory::ReadBlock(address, data.data(), data.size()); - ResultVal written = backend->Write(offset, data.size(), flush != 0, data.data()); - if (written.Failed()) { - cmd_buff[1] = written.Code().raw; - return written.Code(); - } - cmd_buff[2] = static_cast(*written); - break; + std::vector data(length); + ResultVal read = backend->Read(offset, data.size(), data.data()); + if (read.Failed()) { + cmd_buff[1] = read.Code().raw; + return read.Code(); } + Memory::WriteBlock(address, data.data(), *read); + cmd_buff[2] = static_cast(*read); + break; + } - case FileCommand::GetSize: - { - LOG_TRACE(Service_FS, "GetSize %s %s", GetTypeName().c_str(), GetName().c_str()); - u64 size = backend->GetSize(); - cmd_buff[2] = (u32)size; - cmd_buff[3] = size >> 32; - break; + // Write to file... + case FileCommand::Write: { + u64 offset = cmd_buff[1] | ((u64)cmd_buff[2]) << 32; + u32 length = cmd_buff[3]; + u32 flush = cmd_buff[4]; + u32 address = cmd_buff[6]; + LOG_TRACE(Service_FS, "Write %s %s: offset=0x%llx length=%d address=0x%x, flush=0x%x", + GetTypeName().c_str(), GetName().c_str(), offset, length, address, flush); + + std::vector data(length); + Memory::ReadBlock(address, data.data(), data.size()); + ResultVal written = backend->Write(offset, data.size(), flush != 0, data.data()); + if (written.Failed()) { + cmd_buff[1] = written.Code().raw; + return written.Code(); } + cmd_buff[2] = static_cast(*written); + break; + } - case FileCommand::SetSize: - { - u64 size = cmd_buff[1] | ((u64)cmd_buff[2] << 32); - LOG_TRACE(Service_FS, "SetSize %s %s size=%llu", - GetTypeName().c_str(), GetName().c_str(), size); - backend->SetSize(size); - break; - } + case FileCommand::GetSize: { + LOG_TRACE(Service_FS, "GetSize %s %s", GetTypeName().c_str(), GetName().c_str()); + u64 size = backend->GetSize(); + cmd_buff[2] = (u32)size; + cmd_buff[3] = size >> 32; + break; + } - case FileCommand::Close: - { - LOG_TRACE(Service_FS, "Close %s %s", GetTypeName().c_str(), GetName().c_str()); - backend->Close(); - break; - } + case FileCommand::SetSize: { + u64 size = cmd_buff[1] | ((u64)cmd_buff[2] << 32); + LOG_TRACE(Service_FS, "SetSize %s %s size=%llu", GetTypeName().c_str(), GetName().c_str(), + size); + backend->SetSize(size); + break; + } - case FileCommand::Flush: - { - LOG_TRACE(Service_FS, "Flush"); - backend->Flush(); - break; - } + case FileCommand::Close: { + LOG_TRACE(Service_FS, "Close %s %s", GetTypeName().c_str(), GetName().c_str()); + backend->Close(); + break; + } - case FileCommand::OpenLinkFile: - { - LOG_WARNING(Service_FS, "(STUBBED) File command OpenLinkFile %s", GetName().c_str()); - cmd_buff[3] = Kernel::g_handle_table.Create(this).ValueOr(INVALID_HANDLE); - break; - } + case FileCommand::Flush: { + LOG_TRACE(Service_FS, "Flush"); + backend->Flush(); + break; + } - case FileCommand::SetPriority: - { - priority = cmd_buff[1]; - LOG_TRACE(Service_FS, "SetPriority %u", priority); - break; - } + case FileCommand::OpenLinkFile: { + LOG_WARNING(Service_FS, "(STUBBED) File command OpenLinkFile %s", GetName().c_str()); + cmd_buff[3] = Kernel::g_handle_table.Create(this).ValueOr(INVALID_HANDLE); + break; + } - case FileCommand::GetPriority: - { - cmd_buff[2] = priority; - LOG_TRACE(Service_FS, "GetPriority"); - break; - } + case FileCommand::SetPriority: { + priority = cmd_buff[1]; + LOG_TRACE(Service_FS, "SetPriority %u", priority); + break; + } - // Unknown command... - default: - LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd); - ResultCode error = UnimplementedFunction(ErrorModule::FS); - cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. - return error; + case FileCommand::GetPriority: { + cmd_buff[2] = priority; + LOG_TRACE(Service_FS, "GetPriority"); + break; + } + + // Unknown command... + default: + LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd); + ResultCode error = UnimplementedFunction(ErrorModule::FS); + cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. + return error; } cmd_buff[1] = RESULT_SUCCESS.raw; // No error return MakeResult(false); } -Directory::Directory(std::unique_ptr&& backend, const FileSys::Path & path) - : path(path), backend(std::move(backend)) {} +Directory::Directory(std::unique_ptr&& backend, + const FileSys::Path& path) + : path(path), backend(std::move(backend)) { +} -Directory::~Directory() {} +Directory::~Directory() { +} ResultVal Directory::SyncRequest() { u32* cmd_buff = Kernel::GetCommandBuffer(); DirectoryCommand cmd = static_cast(cmd_buff[0]); switch (cmd) { - // Read from directory... - case DirectoryCommand::Read: - { - u32 count = cmd_buff[1]; - u32 address = cmd_buff[3]; - std::vector entries(count); - LOG_TRACE(Service_FS, "Read %s %s: count=%d", - GetTypeName().c_str(), GetName().c_str(), count); - - // Number of entries actually read - u32 read = backend->Read(entries.size(), entries.data()); - cmd_buff[2] = read; - Memory::WriteBlock(address, entries.data(), read * sizeof(FileSys::Entry)); - break; - } + // Read from directory... + case DirectoryCommand::Read: { + u32 count = cmd_buff[1]; + u32 address = cmd_buff[3]; + std::vector entries(count); + LOG_TRACE(Service_FS, "Read %s %s: count=%d", GetTypeName().c_str(), GetName().c_str(), + count); + + // Number of entries actually read + u32 read = backend->Read(entries.size(), entries.data()); + cmd_buff[2] = read; + Memory::WriteBlock(address, entries.data(), read * sizeof(FileSys::Entry)); + break; + } - case DirectoryCommand::Close: - { - LOG_TRACE(Service_FS, "Close %s %s", GetTypeName().c_str(), GetName().c_str()); - backend->Close(); - break; - } + case DirectoryCommand::Close: { + LOG_TRACE(Service_FS, "Close %s %s", GetTypeName().c_str(), GetName().c_str()); + backend->Close(); + break; + } - // Unknown command... - default: - LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd); - ResultCode error = UnimplementedFunction(ErrorModule::FS); - cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. - return MakeResult(false); + // Unknown command... + default: + LOG_ERROR(Service_FS, "Unknown command=0x%08X!", cmd); + ResultCode error = UnimplementedFunction(ErrorModule::FS); + cmd_buff[1] = error.raw; // TODO(Link Mauve): use the correct error code for that. + return MakeResult(false); } cmd_buff[1] = RESULT_SUCCESS.raw; // No error return MakeResult(false); @@ -280,8 +276,8 @@ ResultVal OpenArchive(ArchiveIdCode id_code, FileSys::Path& archi auto itr = id_code_map.find(id_code); if (itr == id_code_map.end()) { // TODO: Verify error against hardware - return ResultCode(ErrorDescription::NotFound, ErrorModule::FS, - ErrorSummary::NotFound, ErrorLevel::Permanent); + return ResultCode(ErrorDescription::NotFound, ErrorModule::FS, ErrorSummary::NotFound, + ErrorLevel::Permanent); } CASCADE_RESULT(std::unique_ptr res, itr->second->Open(archive_path)); @@ -303,19 +299,22 @@ ResultCode CloseArchive(ArchiveHandle handle) { // TODO(yuriks): This might be what the fs:REG service is for. See the Register/Unregister calls in // http://3dbrew.org/wiki/Filesystem_services#ProgramRegistry_service_.22fs:REG.22 -ResultCode RegisterArchiveType(std::unique_ptr&& factory, ArchiveIdCode id_code) { +ResultCode RegisterArchiveType(std::unique_ptr&& factory, + ArchiveIdCode id_code) { auto result = id_code_map.emplace(id_code, std::move(factory)); bool inserted = result.second; ASSERT_MSG(inserted, "Tried to register more than one archive with same id code"); auto& archive = result.first->second; - LOG_DEBUG(Service_FS, "Registered archive %s with id code 0x%08X", archive->GetName().c_str(), id_code); + LOG_DEBUG(Service_FS, "Registered archive %s with id code 0x%08X", archive->GetName().c_str(), + id_code); return RESULT_SUCCESS; } ResultVal> OpenFileFromArchive(ArchiveHandle archive_handle, - const FileSys::Path& path, const FileSys::Mode mode) { + const FileSys::Path& path, + const FileSys::Mode mode) { ArchiveBackend* archive = GetArchive(archive_handle); if (archive == nullptr) return ERR_INVALID_ARCHIVE_HANDLE; @@ -336,8 +335,10 @@ ResultCode DeleteFileFromArchive(ArchiveHandle archive_handle, const FileSys::Pa return archive->DeleteFile(path); } -ResultCode RenameFileBetweenArchives(ArchiveHandle src_archive_handle, const FileSys::Path& src_path, - ArchiveHandle dest_archive_handle, const FileSys::Path& dest_path) { +ResultCode RenameFileBetweenArchives(ArchiveHandle src_archive_handle, + const FileSys::Path& src_path, + ArchiveHandle dest_archive_handle, + const FileSys::Path& dest_path) { ArchiveBackend* src_archive = GetArchive(src_archive_handle); ArchiveBackend* dest_archive = GetArchive(dest_archive_handle); if (src_archive == nullptr || dest_archive == nullptr) @@ -368,7 +369,8 @@ ResultCode DeleteDirectoryFromArchive(ArchiveHandle archive_handle, const FileSy ErrorSummary::Canceled, ErrorLevel::Status); } -ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, u64 file_size) { +ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, + u64 file_size) { ArchiveBackend* archive = GetArchive(archive_handle); if (archive == nullptr) return ERR_INVALID_ARCHIVE_HANDLE; @@ -387,8 +389,10 @@ ResultCode CreateDirectoryFromArchive(ArchiveHandle archive_handle, const FileSy ErrorSummary::Canceled, ErrorLevel::Status); } -ResultCode RenameDirectoryBetweenArchives(ArchiveHandle src_archive_handle, const FileSys::Path& src_path, - ArchiveHandle dest_archive_handle, const FileSys::Path& dest_path) { +ResultCode RenameDirectoryBetweenArchives(ArchiveHandle src_archive_handle, + const FileSys::Path& src_path, + ArchiveHandle dest_archive_handle, + const FileSys::Path& dest_path) { ArchiveBackend* src_archive = GetArchive(src_archive_handle); ArchiveBackend* dest_archive = GetArchive(dest_archive_handle); if (src_archive == nullptr || dest_archive == nullptr) @@ -409,15 +413,15 @@ ResultCode RenameDirectoryBetweenArchives(ArchiveHandle src_archive_handle, cons } ResultVal> OpenDirectoryFromArchive(ArchiveHandle archive_handle, - const FileSys::Path& path) { + const FileSys::Path& path) { ArchiveBackend* archive = GetArchive(archive_handle); if (archive == nullptr) return ERR_INVALID_ARCHIVE_HANDLE; std::unique_ptr backend = archive->OpenDirectory(path); if (backend == nullptr) { - return ResultCode(ErrorDescription::FS_NotFound, ErrorModule::FS, - ErrorSummary::NotFound, ErrorLevel::Permanent); + return ResultCode(ErrorDescription::FS_NotFound, ErrorModule::FS, ErrorSummary::NotFound, + ErrorLevel::Permanent); } auto directory = Kernel::SharedPtr(new Directory(std::move(backend), path)); @@ -431,7 +435,8 @@ ResultVal GetFreeBytesInArchive(ArchiveHandle archive_handle) { return MakeResult(archive->GetFreeBytes()); } -ResultCode FormatArchive(ArchiveIdCode id_code, const FileSys::ArchiveFormatInfo& format_info, const FileSys::Path& path) { +ResultCode FormatArchive(ArchiveIdCode id_code, const FileSys::ArchiveFormatInfo& format_info, + const FileSys::Path& path) { auto archive_itr = id_code_map.find(id_code); if (archive_itr == id_code_map.end()) { return UnimplementedFunction(ErrorModule::FS); // TODO(Subv): Find the right error @@ -440,7 +445,8 @@ ResultCode FormatArchive(ArchiveIdCode id_code, const FileSys::ArchiveFormatInfo return archive_itr->second->Format(path, format_info); } -ResultVal GetArchiveFormatInfo(ArchiveIdCode id_code, FileSys::Path& archive_path) { +ResultVal GetArchiveFormatInfo(ArchiveIdCode id_code, + FileSys::Path& archive_path) { auto archive = id_code_map.find(id_code); if (archive == id_code_map.end()) { return UnimplementedFunction(ErrorModule::FS); // TODO(Subv): Find the right error @@ -449,11 +455,14 @@ ResultVal GetArchiveFormatInfo(ArchiveIdCode id_code return archive->second->GetFormatInfo(archive_path); } -ResultCode CreateExtSaveData(MediaType media_type, u32 high, u32 low, VAddr icon_buffer, u32 icon_size, const FileSys::ArchiveFormatInfo& format_info) { +ResultCode CreateExtSaveData(MediaType media_type, u32 high, u32 low, VAddr icon_buffer, + u32 icon_size, const FileSys::ArchiveFormatInfo& format_info) { // Construct the binary path to the archive first - FileSys::Path path = FileSys::ConstructExtDataBinaryPath(static_cast(media_type), high, low); + FileSys::Path path = + FileSys::ConstructExtDataBinaryPath(static_cast(media_type), high, low); - auto archive = id_code_map.find(media_type == MediaType::NAND ? ArchiveIdCode::SharedExtSaveData : ArchiveIdCode::ExtSaveData); + auto archive = id_code_map.find(media_type == MediaType::NAND ? ArchiveIdCode::SharedExtSaveData + : ArchiveIdCode::ExtSaveData); if (archive == id_code_map.end()) { return UnimplementedFunction(ErrorModule::FS); // TODO(Subv): Find the right error @@ -476,7 +485,8 @@ ResultCode CreateExtSaveData(MediaType media_type, u32 high, u32 low, VAddr icon ResultCode DeleteExtSaveData(MediaType media_type, u32 high, u32 low) { // Construct the binary path to the archive first - FileSys::Path path = FileSys::ConstructExtDataBinaryPath(static_cast(media_type), high, low); + FileSys::Path path = + FileSys::ConstructExtDataBinaryPath(static_cast(media_type), high, low); std::string media_type_directory; if (media_type == MediaType::NAND) { @@ -489,7 +499,8 @@ ResultCode DeleteExtSaveData(MediaType media_type, u32 high, u32 low) { } // Delete all directories (/user, /boss) and the icon file. - std::string base_path = FileSys::GetExtDataContainerPath(media_type_directory, media_type == MediaType::NAND); + std::string base_path = + FileSys::GetExtDataContainerPath(media_type_directory, media_type == MediaType::NAND); std::string extsavedata_path = FileSys::GetExtSaveDataPath(base_path, path); if (FileUtil::Exists(extsavedata_path) && !FileUtil::DeleteDirRecursively(extsavedata_path)) return ResultCode(-1); // TODO(Subv): Find the right error code @@ -530,30 +541,36 @@ void RegisterArchiveTypes() { if (sdmc_factory->Initialize()) RegisterArchiveType(std::move(sdmc_factory), ArchiveIdCode::SDMC); else - LOG_ERROR(Service_FS, "Can't instantiate SDMC archive with path %s", sdmc_directory.c_str()); + LOG_ERROR(Service_FS, "Can't instantiate SDMC archive with path %s", + sdmc_directory.c_str()); // Create the SaveData archive auto savedata_factory = std::make_unique(sdmc_directory); RegisterArchiveType(std::move(savedata_factory), ArchiveIdCode::SaveData); - auto extsavedata_factory = std::make_unique(sdmc_directory, false); + auto extsavedata_factory = + std::make_unique(sdmc_directory, false); if (extsavedata_factory->Initialize()) RegisterArchiveType(std::move(extsavedata_factory), ArchiveIdCode::ExtSaveData); else - LOG_ERROR(Service_FS, "Can't instantiate ExtSaveData archive with path %s", extsavedata_factory->GetMountPoint().c_str()); + LOG_ERROR(Service_FS, "Can't instantiate ExtSaveData archive with path %s", + extsavedata_factory->GetMountPoint().c_str()); - auto sharedextsavedata_factory = std::make_unique(nand_directory, true); + auto sharedextsavedata_factory = + std::make_unique(nand_directory, true); if (sharedextsavedata_factory->Initialize()) RegisterArchiveType(std::move(sharedextsavedata_factory), ArchiveIdCode::SharedExtSaveData); else LOG_ERROR(Service_FS, "Can't instantiate SharedExtSaveData archive with path %s", - sharedextsavedata_factory->GetMountPoint().c_str()); + sharedextsavedata_factory->GetMountPoint().c_str()); // Create the SaveDataCheck archive, basically a small variation of the RomFS archive - auto savedatacheck_factory = std::make_unique(nand_directory); + auto savedatacheck_factory = + std::make_unique(nand_directory); RegisterArchiveType(std::move(savedatacheck_factory), ArchiveIdCode::SaveDataCheck); - auto systemsavedata_factory = std::make_unique(nand_directory); + auto systemsavedata_factory = + std::make_unique(nand_directory); RegisterArchiveType(std::move(systemsavedata_factory), ArchiveIdCode::SystemSaveData); } diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index f7a50a3a7..aad540ff9 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h @@ -28,21 +28,18 @@ namespace FS { /// Supported archive types enum class ArchiveIdCode : u32 { - RomFS = 0x00000003, - SaveData = 0x00000004, - ExtSaveData = 0x00000006, - SharedExtSaveData = 0x00000007, - SystemSaveData = 0x00000008, - SDMC = 0x00000009, - SDMCWriteOnly = 0x0000000A, - SaveDataCheck = 0x2345678A, + RomFS = 0x00000003, + SaveData = 0x00000004, + ExtSaveData = 0x00000006, + SharedExtSaveData = 0x00000007, + SystemSaveData = 0x00000008, + SDMC = 0x00000009, + SDMCWriteOnly = 0x0000000A, + SaveDataCheck = 0x2345678A, }; /// Media types for the archives -enum class MediaType : u32 { - NAND = 0, - SDMC = 1 -}; +enum class MediaType : u32 { NAND = 0, SDMC = 1 }; typedef u64 ArchiveHandle; @@ -51,11 +48,13 @@ public: File(std::unique_ptr&& backend, const FileSys::Path& path); ~File(); - std::string GetName() const override { return "Path: " + path.DebugStr(); } + std::string GetName() const override { + return "Path: " + path.DebugStr(); + } ResultVal SyncRequest() override; FileSys::Path path; ///< Path of the file - u32 priority; ///< Priority of the file. TODO(Subv): Find out what this means + u32 priority; ///< Priority of the file. TODO(Subv): Find out what this means std::unique_ptr backend; ///< File backend interface }; @@ -64,10 +63,12 @@ public: Directory(std::unique_ptr&& backend, const FileSys::Path& path); ~Directory(); - std::string GetName() const override { return "Directory: " + path.DebugStr(); } + std::string GetName() const override { + return "Directory: " + path.DebugStr(); + } ResultVal SyncRequest() override; - FileSys::Path path; ///< Path of the directory + FileSys::Path path; ///< Path of the directory std::unique_ptr backend; ///< File backend interface }; @@ -90,7 +91,8 @@ ResultCode CloseArchive(ArchiveHandle handle); * @param factory File system backend interface to the archive * @param id_code Id code used to access this type of archive */ -ResultCode RegisterArchiveType(std::unique_ptr&& factory, ArchiveIdCode id_code); +ResultCode RegisterArchiveType(std::unique_ptr&& factory, + ArchiveIdCode id_code); /** * Open a File from an Archive @@ -100,7 +102,8 @@ ResultCode RegisterArchiveType(std::unique_ptr&& factor * @return The opened File object as a Session */ ResultVal> OpenFileFromArchive(ArchiveHandle archive_handle, - const FileSys::Path& path, const FileSys::Mode mode); + const FileSys::Path& path, + const FileSys::Mode mode); /** * Delete a File from an Archive @@ -118,8 +121,10 @@ ResultCode DeleteFileFromArchive(ArchiveHandle archive_handle, const FileSys::Pa * @param dest_path Path to the File inside of the destination Archive * @return Whether rename succeeded */ -ResultCode RenameFileBetweenArchives(ArchiveHandle src_archive_handle, const FileSys::Path& src_path, - ArchiveHandle dest_archive_handle, const FileSys::Path& dest_path); +ResultCode RenameFileBetweenArchives(ArchiveHandle src_archive_handle, + const FileSys::Path& src_path, + ArchiveHandle dest_archive_handle, + const FileSys::Path& dest_path); /** * Delete a Directory from an Archive @@ -136,7 +141,8 @@ ResultCode DeleteDirectoryFromArchive(ArchiveHandle archive_handle, const FileSy * @param file_size The size of the new file, filled with zeroes * @return File creation result code */ -ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, u64 file_size); +ResultCode CreateFileInArchive(ArchiveHandle archive_handle, const FileSys::Path& path, + u64 file_size); /** * Create a Directory from an Archive @@ -154,8 +160,10 @@ ResultCode CreateDirectoryFromArchive(ArchiveHandle archive_handle, const FileSy * @param dest_path Path to the Directory inside of the destination Archive * @return Whether rename succeeded */ -ResultCode RenameDirectoryBetweenArchives(ArchiveHandle src_archive_handle, const FileSys::Path& src_path, - ArchiveHandle dest_archive_handle, const FileSys::Path& dest_path); +ResultCode RenameDirectoryBetweenArchives(ArchiveHandle src_archive_handle, + const FileSys::Path& src_path, + ArchiveHandle dest_archive_handle, + const FileSys::Path& dest_path); /** * Open a Directory from an Archive @@ -164,7 +172,7 @@ ResultCode RenameDirectoryBetweenArchives(ArchiveHandle src_archive_handle, cons * @return The opened Directory object as a Session */ ResultVal> OpenDirectoryFromArchive(ArchiveHandle archive_handle, - const FileSys::Path& path); + const FileSys::Path& path); /** * Get the free space in an Archive @@ -181,7 +189,8 @@ ResultVal GetFreeBytesInArchive(ArchiveHandle archive_handle); * @param path The path to the archive, if relevant. * @return ResultCode 0 on success or the corresponding code on error */ -ResultCode FormatArchive(ArchiveIdCode id_code, const FileSys::ArchiveFormatInfo& format_info, const FileSys::Path& path = FileSys::Path()); +ResultCode FormatArchive(ArchiveIdCode id_code, const FileSys::ArchiveFormatInfo& format_info, + const FileSys::Path& path = FileSys::Path()); /** * Retrieves the format info about the archive of the specified type and path. @@ -190,7 +199,8 @@ ResultCode FormatArchive(ArchiveIdCode id_code, const FileSys::ArchiveFormatInfo * @param archive_path The path of the archive, if relevant * @return The format info of the archive, or the corresponding error code if failed. */ -ResultVal GetArchiveFormatInfo(ArchiveIdCode id_code, FileSys::Path& archive_path); +ResultVal GetArchiveFormatInfo(ArchiveIdCode id_code, + FileSys::Path& archive_path); /** * Creates a blank SharedExtSaveData archive for the specified extdata ID @@ -202,7 +212,8 @@ ResultVal GetArchiveFormatInfo(ArchiveIdCode id_code * @param format_info Format information about the new archive * @return ResultCode 0 on success or the corresponding code on error */ -ResultCode CreateExtSaveData(MediaType media_type, u32 high, u32 low, VAddr icon_buffer, u32 icon_size, const FileSys::ArchiveFormatInfo& format_info); +ResultCode CreateExtSaveData(MediaType media_type, u32 high, u32 low, VAddr icon_buffer, + u32 icon_size, const FileSys::ArchiveFormatInfo& format_info); /** * Deletes the SharedExtSaveData archive for the specified extdata ID diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index 937868747..a0adad634 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp @@ -57,14 +57,16 @@ static void OpenFile(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]); - auto filename_type = static_cast(cmd_buff[4]); - u32 filename_size = cmd_buff[5]; - FileSys::Mode mode; mode.hex = cmd_buff[6]; - u32 attributes = cmd_buff[7]; // TODO(Link Mauve): do something with those attributes. - u32 filename_ptr = cmd_buff[9]; + auto filename_type = static_cast(cmd_buff[4]); + u32 filename_size = cmd_buff[5]; + FileSys::Mode mode; + mode.hex = cmd_buff[6]; + u32 attributes = cmd_buff[7]; // TODO(Link Mauve): do something with those attributes. + u32 filename_ptr = cmd_buff[9]; FileSys::Path file_path(filename_type, filename_size, filename_ptr); - LOG_DEBUG(Service_FS, "path=%s, mode=%d attrs=%u", file_path.DebugStr().c_str(), mode.hex, attributes); + LOG_DEBUG(Service_FS, "path=%s, mode=%d attrs=%u", file_path.DebugStr().c_str(), mode.hex, + attributes); ResultVal> file_res = OpenFileFromArchive(archive_handle, file_path, mode); cmd_buff[1] = file_res.Code().raw; @@ -98,24 +100,27 @@ static void OpenFile(Service::Interface* self) { static void OpenFileDirectly(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - auto archive_id = static_cast(cmd_buff[2]); + auto archive_id = static_cast(cmd_buff[2]); auto archivename_type = static_cast(cmd_buff[3]); - u32 archivename_size = cmd_buff[4]; - auto filename_type = static_cast(cmd_buff[5]); - u32 filename_size = cmd_buff[6]; - FileSys::Mode mode; mode.hex = cmd_buff[7]; - u32 attributes = cmd_buff[8]; // TODO(Link Mauve): do something with those attributes. - u32 archivename_ptr = cmd_buff[10]; - u32 filename_ptr = cmd_buff[12]; + u32 archivename_size = cmd_buff[4]; + auto filename_type = static_cast(cmd_buff[5]); + u32 filename_size = cmd_buff[6]; + FileSys::Mode mode; + mode.hex = cmd_buff[7]; + u32 attributes = cmd_buff[8]; // TODO(Link Mauve): do something with those attributes. + u32 archivename_ptr = cmd_buff[10]; + u32 filename_ptr = cmd_buff[12]; FileSys::Path archive_path(archivename_type, archivename_size, archivename_ptr); FileSys::Path file_path(filename_type, filename_size, filename_ptr); LOG_DEBUG(Service_FS, "archive_id=0x%08X archive_path=%s file_path=%s, mode=%u attributes=%d", - archive_id, archive_path.DebugStr().c_str(), file_path.DebugStr().c_str(), mode.hex, attributes); + archive_id, archive_path.DebugStr().c_str(), file_path.DebugStr().c_str(), mode.hex, + attributes); ResultVal archive_handle = OpenArchive(archive_id, archive_path); if (archive_handle.Failed()) { - LOG_ERROR(Service_FS, "failed to get a handle for archive archive_id=0x%08X archive_path=%s", + LOG_ERROR(Service_FS, + "failed to get a handle for archive archive_id=0x%08X archive_path=%s", archive_id, archive_path.DebugStr().c_str()); cmd_buff[1] = archive_handle.Code().raw; cmd_buff[3] = 0; @@ -149,14 +154,14 @@ static void DeleteFile(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]); - auto filename_type = static_cast(cmd_buff[4]); - u32 filename_size = cmd_buff[5]; - u32 filename_ptr = cmd_buff[7]; + auto filename_type = static_cast(cmd_buff[4]); + u32 filename_size = cmd_buff[5]; + u32 filename_ptr = cmd_buff[7]; FileSys::Path file_path(filename_type, filename_size, filename_ptr); - LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", - filename_type, filename_size, file_path.DebugStr().c_str()); + LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", filename_type, filename_size, + file_path.DebugStr().c_str()); cmd_buff[1] = DeleteFileFromArchive(archive_handle, file_path).raw; } @@ -181,22 +186,26 @@ static void RenameFile(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); ArchiveHandle src_archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]); - auto src_filename_type = static_cast(cmd_buff[4]); - u32 src_filename_size = cmd_buff[5]; - ArchiveHandle dest_archive_handle = MakeArchiveHandle(cmd_buff[6], cmd_buff[7]);; - auto dest_filename_type = static_cast(cmd_buff[8]); - u32 dest_filename_size = cmd_buff[9]; - u32 src_filename_ptr = cmd_buff[11]; - u32 dest_filename_ptr = cmd_buff[13]; + auto src_filename_type = static_cast(cmd_buff[4]); + u32 src_filename_size = cmd_buff[5]; + ArchiveHandle dest_archive_handle = MakeArchiveHandle(cmd_buff[6], cmd_buff[7]); + ; + auto dest_filename_type = static_cast(cmd_buff[8]); + u32 dest_filename_size = cmd_buff[9]; + u32 src_filename_ptr = cmd_buff[11]; + u32 dest_filename_ptr = cmd_buff[13]; FileSys::Path src_file_path(src_filename_type, src_filename_size, src_filename_ptr); FileSys::Path dest_file_path(dest_filename_type, dest_filename_size, dest_filename_ptr); - LOG_DEBUG(Service_FS, "src_type=%d src_size=%d src_data=%s dest_type=%d dest_size=%d dest_data=%s", + LOG_DEBUG(Service_FS, + "src_type=%d src_size=%d src_data=%s dest_type=%d dest_size=%d dest_data=%s", src_filename_type, src_filename_size, src_file_path.DebugStr().c_str(), dest_filename_type, dest_filename_size, dest_file_path.DebugStr().c_str()); - cmd_buff[1] = RenameFileBetweenArchives(src_archive_handle, src_file_path, dest_archive_handle, dest_file_path).raw; + cmd_buff[1] = RenameFileBetweenArchives(src_archive_handle, src_file_path, dest_archive_handle, + dest_file_path) + .raw; } /* @@ -214,14 +223,14 @@ static void DeleteDirectory(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]); - auto dirname_type = static_cast(cmd_buff[4]); - u32 dirname_size = cmd_buff[5]; - u32 dirname_ptr = cmd_buff[7]; + auto dirname_type = static_cast(cmd_buff[4]); + u32 dirname_size = cmd_buff[5]; + u32 dirname_ptr = cmd_buff[7]; FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr); - LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", - dirname_type, dirname_size, dir_path.DebugStr().c_str()); + LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", dirname_type, dirname_size, + dir_path.DebugStr().c_str()); cmd_buff[1] = DeleteDirectoryFromArchive(archive_handle, dir_path).raw; } @@ -243,14 +252,15 @@ static void CreateFile(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); ArchiveHandle archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]); - auto filename_type = static_cast(cmd_buff[4]); - u32 filename_size = cmd_buff[5]; - u64 file_size = ((u64)cmd_buff[8] << 32) | cmd_buff[7]; - u32 filename_ptr = cmd_buff[10]; + auto filename_type = static_cast(cmd_buff[4]); + u32 filename_size = cmd_buff[5]; + u64 file_size = ((u64)cmd_buff[8] << 32) | cmd_buff[7]; + u32 filename_ptr = cmd_buff[10]; FileSys::Path file_path(filename_type, filename_size, filename_ptr); - LOG_DEBUG(Service_FS, "type=%d size=%llu data=%s", filename_type, file_size, file_path.DebugStr().c_str()); + LOG_DEBUG(Service_FS, "type=%d size=%llu data=%s", filename_type, file_size, + file_path.DebugStr().c_str()); cmd_buff[1] = CreateFileInArchive(archive_handle, file_path, file_size).raw; } @@ -276,7 +286,8 @@ static void CreateDirectory(Service::Interface* self) { FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr); - LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", dirname_type, dirname_size, dir_path.DebugStr().c_str()); + LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", dirname_type, dirname_size, + dir_path.DebugStr().c_str()); cmd_buff[1] = CreateDirectoryFromArchive(archive_handle, dir_path).raw; } @@ -301,22 +312,25 @@ static void RenameDirectory(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); ArchiveHandle src_archive_handle = MakeArchiveHandle(cmd_buff[2], cmd_buff[3]); - auto src_dirname_type = static_cast(cmd_buff[4]); - u32 src_dirname_size = cmd_buff[5]; + auto src_dirname_type = static_cast(cmd_buff[4]); + u32 src_dirname_size = cmd_buff[5]; ArchiveHandle dest_archive_handle = MakeArchiveHandle(cmd_buff[6], cmd_buff[7]); - auto dest_dirname_type = static_cast(cmd_buff[8]); - u32 dest_dirname_size = cmd_buff[9]; - u32 src_dirname_ptr = cmd_buff[11]; - u32 dest_dirname_ptr = cmd_buff[13]; + auto dest_dirname_type = static_cast(cmd_buff[8]); + u32 dest_dirname_size = cmd_buff[9]; + u32 src_dirname_ptr = cmd_buff[11]; + u32 dest_dirname_ptr = cmd_buff[13]; FileSys::Path src_dir_path(src_dirname_type, src_dirname_size, src_dirname_ptr); FileSys::Path dest_dir_path(dest_dirname_type, dest_dirname_size, dest_dirname_ptr); - LOG_DEBUG(Service_FS, "src_type=%d src_size=%d src_data=%s dest_type=%d dest_size=%d dest_data=%s", + LOG_DEBUG(Service_FS, + "src_type=%d src_size=%d src_data=%s dest_type=%d dest_size=%d dest_data=%s", src_dirname_type, src_dirname_size, src_dir_path.DebugStr().c_str(), dest_dirname_type, dest_dirname_size, dest_dir_path.DebugStr().c_str()); - cmd_buff[1] = RenameDirectoryBetweenArchives(src_archive_handle, src_dir_path, dest_archive_handle, dest_dir_path).raw; + cmd_buff[1] = RenameDirectoryBetweenArchives(src_archive_handle, src_dir_path, + dest_archive_handle, dest_dir_path) + .raw; } /** @@ -342,7 +356,8 @@ static void OpenDirectory(Service::Interface* self) { FileSys::Path dir_path(dirname_type, dirname_size, dirname_ptr); - LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", dirname_type, dirname_size, dir_path.DebugStr().c_str()); + LOG_DEBUG(Service_FS, "type=%d size=%d data=%s", dirname_type, dirname_size, + dir_path.DebugStr().c_str()); ResultVal> dir_res = OpenDirectoryFromArchive(archive_handle, dir_path); cmd_buff[1] = dir_res.Code().raw; @@ -370,13 +385,14 @@ static void OpenDirectory(Service::Interface* self) { static void OpenArchive(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - auto archive_id = static_cast(cmd_buff[1]); + auto archive_id = static_cast(cmd_buff[1]); auto archivename_type = static_cast(cmd_buff[2]); - u32 archivename_size = cmd_buff[3]; - u32 archivename_ptr = cmd_buff[5]; + u32 archivename_size = cmd_buff[3]; + u32 archivename_ptr = cmd_buff[5]; FileSys::Path archive_path(archivename_type, archivename_size, archivename_ptr); - LOG_DEBUG(Service_FS, "archive_id=0x%08X archive_path=%s", archive_id, archive_path.DebugStr().c_str()); + LOG_DEBUG(Service_FS, "archive_id=0x%08X archive_path=%s", archive_id, + archive_path.DebugStr().c_str()); ResultVal handle = OpenArchive(archive_id, archive_path); cmd_buff[1] = handle.Code().raw; @@ -385,7 +401,8 @@ static void OpenArchive(Service::Interface* self) { cmd_buff[3] = (*handle >> 32) & 0xFFFFFFFF; } else { cmd_buff[2] = cmd_buff[3] = 0; - LOG_ERROR(Service_FS, "failed to get a handle for archive archive_id=0x%08X archive_path=%s", + LOG_ERROR(Service_FS, + "failed to get a handle for archive archive_id=0x%08X archive_path=%s", archive_id, archive_path.DebugStr().c_str()); } } @@ -471,7 +488,8 @@ static void FormatSaveData(Service::Interface* self) { if (archive_id != FS::ArchiveIdCode::SaveData) { LOG_ERROR(Service_FS, "tried to format an archive different than SaveData, %u", archive_id); cmd_buff[1] = ResultCode(ErrorDescription::FS_InvalidPath, ErrorModule::FS, - ErrorSummary::InvalidArgument, ErrorLevel::Usage).raw; + ErrorSummary::InvalidArgument, ErrorLevel::Usage) + .raw; return; } @@ -571,18 +589,21 @@ static void CreateExtSaveData(Service::Interface* self) { u32 icon_size = cmd_buff[9]; VAddr icon_buffer = cmd_buff[11]; - LOG_WARNING(Service_FS, "(STUBBED) savedata_high=%08X savedata_low=%08X cmd_buff[3]=%08X " - "cmd_buff[4]=%08X cmd_buff[5]=%08X cmd_buff[6]=%08X cmd_buff[7]=%08X cmd_buff[8]=%08X " - "icon_size=%08X icon_descriptor=%08X icon_buffer=%08X", save_high, save_low, - cmd_buff[3], cmd_buff[4], cmd_buff[5], cmd_buff[6], cmd_buff[7], cmd_buff[8], icon_size, - cmd_buff[10], icon_buffer); + LOG_WARNING( + Service_FS, + "(STUBBED) savedata_high=%08X savedata_low=%08X cmd_buff[3]=%08X " + "cmd_buff[4]=%08X cmd_buff[5]=%08X cmd_buff[6]=%08X cmd_buff[7]=%08X cmd_buff[8]=%08X " + "icon_size=%08X icon_descriptor=%08X icon_buffer=%08X", + save_high, save_low, cmd_buff[3], cmd_buff[4], cmd_buff[5], cmd_buff[6], cmd_buff[7], + cmd_buff[8], icon_size, cmd_buff[10], icon_buffer); FileSys::ArchiveFormatInfo format_info; format_info.number_directories = cmd_buff[5]; format_info.number_files = cmd_buff[6]; format_info.duplicate_data = false; format_info.total_size = 0; - cmd_buff[1] = CreateExtSaveData(media_type, save_high, save_low, icon_buffer, icon_size, format_info).raw; + cmd_buff[1] = + CreateExtSaveData(media_type, save_high, save_low, icon_buffer, icon_size, format_info).raw; } /** @@ -604,7 +625,7 @@ static void DeleteExtSaveData(Service::Interface* self) { u32 unknown = cmd_buff[4]; // TODO(Subv): Figure out what this is LOG_WARNING(Service_FS, "(STUBBED) save_low=%08X save_high=%08X media_type=%08X unknown=%08X", - save_low, save_high, cmd_buff[1] & 0xFF, unknown); + save_low, save_high, cmd_buff[1] & 0xFF, unknown); cmd_buff[1] = DeleteExtSaveData(media_type, save_high, save_low).raw; } @@ -662,10 +683,13 @@ static void CreateSystemSaveData(Service::Interface* self) { u32 savedata_high = cmd_buff[1]; u32 savedata_low = cmd_buff[2]; - LOG_WARNING(Service_FS, "(STUBBED) savedata_high=%08X savedata_low=%08X cmd_buff[3]=%08X " - "cmd_buff[4]=%08X cmd_buff[5]=%08X cmd_buff[6]=%08X cmd_buff[7]=%08X cmd_buff[8]=%08X " - "cmd_buff[9]=%08X", savedata_high, savedata_low, cmd_buff[3], cmd_buff[4], cmd_buff[5], - cmd_buff[6], cmd_buff[7], cmd_buff[8], cmd_buff[9]); + LOG_WARNING( + Service_FS, + "(STUBBED) savedata_high=%08X savedata_low=%08X cmd_buff[3]=%08X " + "cmd_buff[4]=%08X cmd_buff[5]=%08X cmd_buff[6]=%08X cmd_buff[7]=%08X cmd_buff[8]=%08X " + "cmd_buff[9]=%08X", + savedata_high, savedata_low, cmd_buff[3], cmd_buff[4], cmd_buff[5], cmd_buff[6], + cmd_buff[7], cmd_buff[8], cmd_buff[9]); cmd_buff[1] = CreateSystemSaveData(savedata_high, savedata_low).raw; } @@ -692,10 +716,13 @@ static void CreateLegacySystemSaveData(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 savedata_id = cmd_buff[1]; - LOG_WARNING(Service_FS, "(STUBBED) savedata_id=%08X cmd_buff[3]=%08X " - "cmd_buff[4]=%08X cmd_buff[5]=%08X cmd_buff[6]=%08X cmd_buff[7]=%08X cmd_buff[8]=%08X " - "cmd_buff[9]=%08X", savedata_id, cmd_buff[3], cmd_buff[4], cmd_buff[5], - cmd_buff[6], cmd_buff[7], cmd_buff[8], cmd_buff[9]); + LOG_WARNING( + Service_FS, + "(STUBBED) savedata_id=%08X cmd_buff[3]=%08X " + "cmd_buff[4]=%08X cmd_buff[5]=%08X cmd_buff[6]=%08X cmd_buff[7]=%08X cmd_buff[8]=%08X " + "cmd_buff[9]=%08X", + savedata_id, cmd_buff[3], cmd_buff[4], cmd_buff[5], cmd_buff[6], cmd_buff[7], cmd_buff[8], + cmd_buff[9]); cmd_buff[0] = IPC::MakeHeader(0x810, 0x1, 0); // With this command, the SystemSaveData always has save_high = 0 (Always created in the NAND) @@ -721,8 +748,8 @@ static void InitializeWithSdkVersion(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_WARNING(Service_FS, "(STUBBED) called unk1=0x%08X, unk2=0x%08X, unk3=0x%08X", - unk1, unk2, unk3); + LOG_WARNING(Service_FS, "(STUBBED) called unk1=0x%08X, unk2=0x%08X, unk3=0x%08X", unk1, unk2, + unk3); } /** @@ -834,115 +861,114 @@ static void GetFormatInfo(Service::Interface* self) { } const Interface::FunctionInfo FunctionTable[] = { - {0x000100C6, nullptr, "Dummy1"}, - {0x040100C4, nullptr, "Control"}, - {0x08010002, Initialize, "Initialize"}, - {0x080201C2, OpenFile, "OpenFile"}, - {0x08030204, OpenFileDirectly, "OpenFileDirectly"}, - {0x08040142, DeleteFile, "DeleteFile"}, - {0x08050244, RenameFile, "RenameFile"}, - {0x08060142, DeleteDirectory, "DeleteDirectory"}, - {0x08070142, nullptr, "DeleteDirectoryRecursively"}, - {0x08080202, CreateFile, "CreateFile"}, - {0x08090182, CreateDirectory, "CreateDirectory"}, - {0x080A0244, RenameDirectory, "RenameDirectory"}, - {0x080B0102, OpenDirectory, "OpenDirectory"}, - {0x080C00C2, OpenArchive, "OpenArchive"}, - {0x080D0144, nullptr, "ControlArchive"}, - {0x080E0080, CloseArchive, "CloseArchive"}, - {0x080F0180, FormatThisUserSaveData, "FormatThisUserSaveData"}, + {0x000100C6, nullptr, "Dummy1"}, + {0x040100C4, nullptr, "Control"}, + {0x08010002, Initialize, "Initialize"}, + {0x080201C2, OpenFile, "OpenFile"}, + {0x08030204, OpenFileDirectly, "OpenFileDirectly"}, + {0x08040142, DeleteFile, "DeleteFile"}, + {0x08050244, RenameFile, "RenameFile"}, + {0x08060142, DeleteDirectory, "DeleteDirectory"}, + {0x08070142, nullptr, "DeleteDirectoryRecursively"}, + {0x08080202, CreateFile, "CreateFile"}, + {0x08090182, CreateDirectory, "CreateDirectory"}, + {0x080A0244, RenameDirectory, "RenameDirectory"}, + {0x080B0102, OpenDirectory, "OpenDirectory"}, + {0x080C00C2, OpenArchive, "OpenArchive"}, + {0x080D0144, nullptr, "ControlArchive"}, + {0x080E0080, CloseArchive, "CloseArchive"}, + {0x080F0180, FormatThisUserSaveData, "FormatThisUserSaveData"}, {0x08100200, CreateLegacySystemSaveData, "CreateLegacySystemSaveData"}, - {0x08110040, nullptr, "DeleteSystemSaveData"}, - {0x08120080, GetFreeBytes, "GetFreeBytes"}, - {0x08130000, nullptr, "GetCardType"}, - {0x08140000, nullptr, "GetSdmcArchiveResource"}, - {0x08150000, nullptr, "GetNandArchiveResource"}, - {0x08160000, nullptr, "GetSdmcFatfsError"}, - {0x08170000, IsSdmcDetected, "IsSdmcDetected"}, - {0x08180000, IsSdmcWriteable, "IsSdmcWritable"}, - {0x08190042, nullptr, "GetSdmcCid"}, - {0x081A0042, nullptr, "GetNandCid"}, - {0x081B0000, nullptr, "GetSdmcSpeedInfo"}, - {0x081C0000, nullptr, "GetNandSpeedInfo"}, - {0x081D0042, nullptr, "GetSdmcLog"}, - {0x081E0042, nullptr, "GetNandLog"}, - {0x081F0000, nullptr, "ClearSdmcLog"}, - {0x08200000, nullptr, "ClearNandLog"}, - {0x08210000, CardSlotIsInserted, "CardSlotIsInserted"}, - {0x08220000, nullptr, "CardSlotPowerOn"}, - {0x08230000, nullptr, "CardSlotPowerOff"}, - {0x08240000, nullptr, "CardSlotGetCardIFPowerStatus"}, - {0x08250040, nullptr, "CardNorDirectCommand"}, - {0x08260080, nullptr, "CardNorDirectCommandWithAddress"}, - {0x08270082, nullptr, "CardNorDirectRead"}, - {0x082800C2, nullptr, "CardNorDirectReadWithAddress"}, - {0x08290082, nullptr, "CardNorDirectWrite"}, - {0x082A00C2, nullptr, "CardNorDirectWriteWithAddress"}, - {0x082B00C2, nullptr, "CardNorDirectRead_4xIO"}, - {0x082C0082, nullptr, "CardNorDirectCpuWriteWithoutVerify"}, - {0x082D0040, nullptr, "CardNorDirectSectorEraseWithoutVerify"}, - {0x082E0040, nullptr, "GetProductInfo"}, - {0x082F0040, nullptr, "GetProgramLaunchInfo"}, - {0x08300182, nullptr, "CreateExtSaveData"}, - {0x08310180, nullptr, "CreateSharedExtSaveData"}, - {0x08320102, nullptr, "ReadExtSaveDataIcon"}, - {0x08330082, nullptr, "EnumerateExtSaveData"}, - {0x08340082, nullptr, "EnumerateSharedExtSaveData"}, - {0x08350080, nullptr, "DeleteExtSaveData"}, - {0x08360080, nullptr, "DeleteSharedExtSaveData"}, - {0x08370040, nullptr, "SetCardSpiBaudRate"}, - {0x08380040, nullptr, "SetCardSpiBusMode"}, - {0x08390000, nullptr, "SendInitializeInfoTo9"}, - {0x083A0100, nullptr, "GetSpecialContentIndex"}, - {0x083B00C2, nullptr, "GetLegacyRomHeader"}, - {0x083C00C2, nullptr, "GetLegacyBannerData"}, - {0x083D0100, nullptr, "CheckAuthorityToAccessExtSaveData"}, - {0x083E00C2, nullptr, "QueryTotalQuotaSize"}, - {0x083F00C0, nullptr, "GetExtDataBlockSize"}, - {0x08400040, nullptr, "AbnegateAccessRight"}, - {0x08410000, nullptr, "DeleteSdmcRoot"}, - {0x08420040, nullptr, "DeleteAllExtSaveDataOnNand"}, - {0x08430000, nullptr, "InitializeCtrFileSystem"}, - {0x08440000, nullptr, "CreateSeed"}, - {0x084500C2, GetFormatInfo, "GetFormatInfo"}, - {0x08460102, nullptr, "GetLegacyRomHeader2"}, - {0x08470180, nullptr, "FormatCtrCardUserSaveData"}, - {0x08480042, nullptr, "GetSdmcCtrRootPath"}, - {0x08490040, GetArchiveResource, "GetArchiveResource"}, - {0x084A0002, nullptr, "ExportIntegrityVerificationSeed"}, - {0x084B0002, nullptr, "ImportIntegrityVerificationSeed"}, - {0x084C0242, FormatSaveData, "FormatSaveData"}, - {0x084D0102, nullptr, "GetLegacySubBannerData"}, - {0x084E0342, nullptr, "UpdateSha256Context"}, - {0x084F0102, nullptr, "ReadSpecialFile"}, - {0x08500040, nullptr, "GetSpecialFileSize"}, - {0x08510242, CreateExtSaveData, "CreateExtSaveData"}, - {0x08520100, DeleteExtSaveData, "DeleteExtSaveData"}, - {0x08530142, nullptr, "ReadExtSaveDataIcon"}, - {0x085400C0, nullptr, "GetExtDataBlockSize"}, - {0x08550102, nullptr, "EnumerateExtSaveData"}, - {0x08560240, CreateSystemSaveData, "CreateSystemSaveData"}, - {0x08570080, DeleteSystemSaveData, "DeleteSystemSaveData"}, - {0x08580000, nullptr, "StartDeviceMoveAsSource"}, - {0x08590200, nullptr, "StartDeviceMoveAsDestination"}, - {0x085A00C0, nullptr, "SetArchivePriority"}, - {0x085B0080, nullptr, "GetArchivePriority"}, - {0x085C00C0, nullptr, "SetCtrCardLatencyParameter"}, - {0x085D01C0, nullptr, "SetFsCompatibilityInfo"}, - {0x085E0040, nullptr, "ResetCardCompatibilityParameter"}, - {0x085F0040, nullptr, "SwitchCleanupInvalidSaveData"}, - {0x08600042, nullptr, "EnumerateSystemSaveData"}, + {0x08110040, nullptr, "DeleteSystemSaveData"}, + {0x08120080, GetFreeBytes, "GetFreeBytes"}, + {0x08130000, nullptr, "GetCardType"}, + {0x08140000, nullptr, "GetSdmcArchiveResource"}, + {0x08150000, nullptr, "GetNandArchiveResource"}, + {0x08160000, nullptr, "GetSdmcFatfsError"}, + {0x08170000, IsSdmcDetected, "IsSdmcDetected"}, + {0x08180000, IsSdmcWriteable, "IsSdmcWritable"}, + {0x08190042, nullptr, "GetSdmcCid"}, + {0x081A0042, nullptr, "GetNandCid"}, + {0x081B0000, nullptr, "GetSdmcSpeedInfo"}, + {0x081C0000, nullptr, "GetNandSpeedInfo"}, + {0x081D0042, nullptr, "GetSdmcLog"}, + {0x081E0042, nullptr, "GetNandLog"}, + {0x081F0000, nullptr, "ClearSdmcLog"}, + {0x08200000, nullptr, "ClearNandLog"}, + {0x08210000, CardSlotIsInserted, "CardSlotIsInserted"}, + {0x08220000, nullptr, "CardSlotPowerOn"}, + {0x08230000, nullptr, "CardSlotPowerOff"}, + {0x08240000, nullptr, "CardSlotGetCardIFPowerStatus"}, + {0x08250040, nullptr, "CardNorDirectCommand"}, + {0x08260080, nullptr, "CardNorDirectCommandWithAddress"}, + {0x08270082, nullptr, "CardNorDirectRead"}, + {0x082800C2, nullptr, "CardNorDirectReadWithAddress"}, + {0x08290082, nullptr, "CardNorDirectWrite"}, + {0x082A00C2, nullptr, "CardNorDirectWriteWithAddress"}, + {0x082B00C2, nullptr, "CardNorDirectRead_4xIO"}, + {0x082C0082, nullptr, "CardNorDirectCpuWriteWithoutVerify"}, + {0x082D0040, nullptr, "CardNorDirectSectorEraseWithoutVerify"}, + {0x082E0040, nullptr, "GetProductInfo"}, + {0x082F0040, nullptr, "GetProgramLaunchInfo"}, + {0x08300182, nullptr, "CreateExtSaveData"}, + {0x08310180, nullptr, "CreateSharedExtSaveData"}, + {0x08320102, nullptr, "ReadExtSaveDataIcon"}, + {0x08330082, nullptr, "EnumerateExtSaveData"}, + {0x08340082, nullptr, "EnumerateSharedExtSaveData"}, + {0x08350080, nullptr, "DeleteExtSaveData"}, + {0x08360080, nullptr, "DeleteSharedExtSaveData"}, + {0x08370040, nullptr, "SetCardSpiBaudRate"}, + {0x08380040, nullptr, "SetCardSpiBusMode"}, + {0x08390000, nullptr, "SendInitializeInfoTo9"}, + {0x083A0100, nullptr, "GetSpecialContentIndex"}, + {0x083B00C2, nullptr, "GetLegacyRomHeader"}, + {0x083C00C2, nullptr, "GetLegacyBannerData"}, + {0x083D0100, nullptr, "CheckAuthorityToAccessExtSaveData"}, + {0x083E00C2, nullptr, "QueryTotalQuotaSize"}, + {0x083F00C0, nullptr, "GetExtDataBlockSize"}, + {0x08400040, nullptr, "AbnegateAccessRight"}, + {0x08410000, nullptr, "DeleteSdmcRoot"}, + {0x08420040, nullptr, "DeleteAllExtSaveDataOnNand"}, + {0x08430000, nullptr, "InitializeCtrFileSystem"}, + {0x08440000, nullptr, "CreateSeed"}, + {0x084500C2, GetFormatInfo, "GetFormatInfo"}, + {0x08460102, nullptr, "GetLegacyRomHeader2"}, + {0x08470180, nullptr, "FormatCtrCardUserSaveData"}, + {0x08480042, nullptr, "GetSdmcCtrRootPath"}, + {0x08490040, GetArchiveResource, "GetArchiveResource"}, + {0x084A0002, nullptr, "ExportIntegrityVerificationSeed"}, + {0x084B0002, nullptr, "ImportIntegrityVerificationSeed"}, + {0x084C0242, FormatSaveData, "FormatSaveData"}, + {0x084D0102, nullptr, "GetLegacySubBannerData"}, + {0x084E0342, nullptr, "UpdateSha256Context"}, + {0x084F0102, nullptr, "ReadSpecialFile"}, + {0x08500040, nullptr, "GetSpecialFileSize"}, + {0x08510242, CreateExtSaveData, "CreateExtSaveData"}, + {0x08520100, DeleteExtSaveData, "DeleteExtSaveData"}, + {0x08530142, nullptr, "ReadExtSaveDataIcon"}, + {0x085400C0, nullptr, "GetExtDataBlockSize"}, + {0x08550102, nullptr, "EnumerateExtSaveData"}, + {0x08560240, CreateSystemSaveData, "CreateSystemSaveData"}, + {0x08570080, DeleteSystemSaveData, "DeleteSystemSaveData"}, + {0x08580000, nullptr, "StartDeviceMoveAsSource"}, + {0x08590200, nullptr, "StartDeviceMoveAsDestination"}, + {0x085A00C0, nullptr, "SetArchivePriority"}, + {0x085B0080, nullptr, "GetArchivePriority"}, + {0x085C00C0, nullptr, "SetCtrCardLatencyParameter"}, + {0x085D01C0, nullptr, "SetFsCompatibilityInfo"}, + {0x085E0040, nullptr, "ResetCardCompatibilityParameter"}, + {0x085F0040, nullptr, "SwitchCleanupInvalidSaveData"}, + {0x08600042, nullptr, "EnumerateSystemSaveData"}, {0x08610042, InitializeWithSdkVersion, "InitializeWithSdkVersion"}, - {0x08620040, SetPriority, "SetPriority"}, - {0x08630000, GetPriority, "GetPriority"}, - {0x08640000, nullptr, "GetNandInfo"}, - {0x08650140, nullptr, "SetSaveDataSecureValue"}, - {0x086600C0, nullptr, "GetSaveDataSecureValue"}, - {0x086700C4, nullptr, "ControlSecureSave"}, - {0x08680000, nullptr, "GetMediaType"}, - {0x08690000, nullptr, "GetNandEraseCount"}, - {0x086A0082, nullptr, "ReadNandReport"} -}; + {0x08620040, SetPriority, "SetPriority"}, + {0x08630000, GetPriority, "GetPriority"}, + {0x08640000, nullptr, "GetNandInfo"}, + {0x08650140, nullptr, "SetSaveDataSecureValue"}, + {0x086600C0, nullptr, "GetSaveDataSecureValue"}, + {0x086700C4, nullptr, "ControlSecureSave"}, + {0x08680000, nullptr, "GetMediaType"}, + {0x08690000, nullptr, "GetNandEraseCount"}, + {0x086A0082, nullptr, "ReadNandReport"}}; //////////////////////////////////////////////////////////////////////////////////////////////////// // Interface class diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp index ec565f46d..b273aac47 100644 --- a/src/core/hle/service/gsp_gpu.cpp +++ b/src/core/hle/service/gsp_gpu.cpp @@ -5,16 +5,16 @@ #include "common/bit_field.h" #include "common/microprofile.h" -#include "core/memory.h" #include "core/hle/kernel/event.h" #include "core/hle/kernel/shared_memory.h" #include "core/hle/result.h" -#include "core/hw/hw.h" #include "core/hw/gpu.h" +#include "core/hw/hw.h" #include "core/hw/lcd.h" +#include "core/memory.h" -#include "video_core/gpu_debugger.h" #include "video_core/debug_utils/debug_utils.h" +#include "video_core/gpu_debugger.h" #include "gsp_gpu.h" @@ -29,12 +29,16 @@ const static u32 REGS_BEGIN = 0x1EB00000; namespace GSP_GPU { -const ResultCode ERR_GSP_REGS_OUTOFRANGE_OR_MISALIGNED(ErrorDescription::OutofRangeOrMisalignedAddress, ErrorModule::GX, - ErrorSummary::InvalidArgument, ErrorLevel::Usage); // 0xE0E02A01 +const ResultCode + ERR_GSP_REGS_OUTOFRANGE_OR_MISALIGNED(ErrorDescription::OutofRangeOrMisalignedAddress, + ErrorModule::GX, ErrorSummary::InvalidArgument, + ErrorLevel::Usage); // 0xE0E02A01 const ResultCode ERR_GSP_REGS_MISALIGNED(ErrorDescription::MisalignedSize, ErrorModule::GX, - ErrorSummary::InvalidArgument, ErrorLevel::Usage); // 0xE0E02BF2 + ErrorSummary::InvalidArgument, + ErrorLevel::Usage); // 0xE0E02BF2 const ResultCode ERR_GSP_REGS_INVALID_SIZE(ErrorDescription::InvalidSize, ErrorModule::GX, - ErrorSummary::InvalidArgument, ErrorLevel::Usage); // 0xE0E02BEC + ErrorSummary::InvalidArgument, + ErrorLevel::Usage); // 0xE0E02BEC /// Event triggered when GSP interrupt has been signalled Kernel::SharedPtr g_interrupt_event; @@ -73,7 +77,8 @@ static inline InterruptRelayQueue* GetInterruptRelayQueue(u32 thread_id) { * @param data Data to be written */ static void WriteSingleHWReg(u32 base_address, u32 data) { - DEBUG_ASSERT_MSG((base_address & 3) == 0 && base_address < 0x420000, "Write address out of range or misaligned"); + DEBUG_ASSERT_MSG((base_address & 3) == 0 && base_address < 0x420000, + "Write address out of range or misaligned"); HW::Write(base_address + REGS_BEGIN, data); } @@ -90,7 +95,8 @@ static ResultCode WriteHWRegs(u32 base_address, u32 size_in_bytes, VAddr data_va const u32 max_size_in_bytes = 0x80; if (base_address & 3 || base_address >= 0x420000) { - LOG_ERROR(Service_GSP, "Write address was out of range or misaligned! (address=0x%08x, size=0x%08x)", + LOG_ERROR(Service_GSP, + "Write address was out of range or misaligned! (address=0x%08x, size=0x%08x)", base_address, size_in_bytes); return ERR_GSP_REGS_OUTOFRANGE_OR_MISALIGNED; } else if (size_in_bytes <= max_size_in_bytes) { @@ -124,12 +130,14 @@ static ResultCode WriteHWRegs(u32 base_address, u32 size_in_bytes, VAddr data_va * @param masks A pointer to the masks * @return RESULT_SUCCESS if the parameters are valid, error code otherwise */ -static ResultCode WriteHWRegsWithMask(u32 base_address, u32 size_in_bytes, VAddr data_vaddr, VAddr masks_vaddr) { +static ResultCode WriteHWRegsWithMask(u32 base_address, u32 size_in_bytes, VAddr data_vaddr, + VAddr masks_vaddr) { // This magic number is verified to be done by the gsp module const u32 max_size_in_bytes = 0x80; if (base_address & 3 || base_address >= 0x420000) { - LOG_ERROR(Service_GSP, "Write address was out of range or misaligned! (address=0x%08x, size=0x%08x)", + LOG_ERROR(Service_GSP, + "Write address was out of range or misaligned! (address=0x%08x, size=0x%08x)", base_address, size_in_bytes); return ERR_GSP_REGS_OUTOFRANGE_OR_MISALIGNED; } else if (size_in_bytes <= max_size_in_bytes) { @@ -214,7 +222,8 @@ static void ReadHWRegs(Service::Interface* self) { // TODO: Return proper error codes if (reg_addr + size >= 0x420000) { - LOG_ERROR(Service_GSP, "Read address out of range! (address=0x%08x, size=0x%08x)", reg_addr, size); + LOG_ERROR(Service_GSP, "Read address out of range! (address=0x%08x, size=0x%08x)", reg_addr, + size); return; } @@ -243,22 +252,34 @@ ResultCode SetBufferSwap(u32 screen_id, const FrameBufferInfo& info) { PAddr phys_address_left = Memory::VirtualToPhysicalAddress(info.address_left); PAddr phys_address_right = Memory::VirtualToPhysicalAddress(info.address_right); if (info.active_fb == 0) { - WriteSingleHWReg(base_address + 4 * static_cast(GPU_REG_INDEX(framebuffer_config[screen_id].address_left1)), - phys_address_left); - WriteSingleHWReg(base_address + 4 * static_cast(GPU_REG_INDEX(framebuffer_config[screen_id].address_right1)), - phys_address_right); + WriteSingleHWReg( + base_address + + 4 * static_cast(GPU_REG_INDEX(framebuffer_config[screen_id].address_left1)), + phys_address_left); + WriteSingleHWReg( + base_address + + 4 * static_cast(GPU_REG_INDEX(framebuffer_config[screen_id].address_right1)), + phys_address_right); } else { - WriteSingleHWReg(base_address + 4 * static_cast(GPU_REG_INDEX(framebuffer_config[screen_id].address_left2)), - phys_address_left); - WriteSingleHWReg(base_address + 4 * static_cast(GPU_REG_INDEX(framebuffer_config[screen_id].address_right2)), - phys_address_right); + WriteSingleHWReg( + base_address + + 4 * static_cast(GPU_REG_INDEX(framebuffer_config[screen_id].address_left2)), + phys_address_left); + WriteSingleHWReg( + base_address + + 4 * static_cast(GPU_REG_INDEX(framebuffer_config[screen_id].address_right2)), + phys_address_right); } - WriteSingleHWReg(base_address + 4 * static_cast(GPU_REG_INDEX(framebuffer_config[screen_id].stride)), + WriteSingleHWReg(base_address + + 4 * static_cast(GPU_REG_INDEX(framebuffer_config[screen_id].stride)), info.stride); - WriteSingleHWReg(base_address + 4 * static_cast(GPU_REG_INDEX(framebuffer_config[screen_id].color_format)), - info.format); - WriteSingleHWReg(base_address + 4 * static_cast(GPU_REG_INDEX(framebuffer_config[screen_id].active_fb)), - info.shown_fb); + WriteSingleHWReg( + base_address + + 4 * static_cast(GPU_REG_INDEX(framebuffer_config[screen_id].color_format)), + info.format); + WriteSingleHWReg( + base_address + 4 * static_cast(GPU_REG_INDEX(framebuffer_config[screen_id].active_fb)), + info.shown_fb); if (Pica::g_debug_context) Pica::g_debug_context->OnEvent(Pica::DebugContext::Event::BufferSwapped, nullptr); @@ -305,15 +326,15 @@ static void SetBufferSwap(Service::Interface* self) { static void FlushDataCache(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 address = cmd_buff[1]; - u32 size = cmd_buff[2]; + u32 size = cmd_buff[2]; u32 process = cmd_buff[4]; // TODO(purpasmart96): Verify return header on HW cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_DEBUG(Service_GSP, "(STUBBED) called address=0x%08X, size=0x%08X, process=0x%08X", - address, size, process); + LOG_DEBUG(Service_GSP, "(STUBBED) called address=0x%08X, size=0x%08X, process=0x%08X", address, + size, process); } /** @@ -356,11 +377,12 @@ static void RegisterInterruptRelayQueue(Service::Interface* self) { // This specific code is required for a successful initialization, rather than 0 first_initialization = false; cmd_buff[1] = ResultCode(ErrorDescription::GPU_FirstInitialization, ErrorModule::GX, - ErrorSummary::Success, ErrorLevel::Success).raw; + ErrorSummary::Success, ErrorLevel::Success) + .raw; } else { cmd_buff[1] = RESULT_SUCCESS.raw; } - cmd_buff[2] = g_thread_id++; // Thread ID + cmd_buff[2] = g_thread_id++; // Thread ID cmd_buff[4] = Kernel::g_handle_table.Create(g_shared_memory).MoveFrom(); // GSP shared memory g_interrupt_event->Signal(); // TODO(bunnei): Is this correct? @@ -416,7 +438,8 @@ void SignalInterrupt(InterruptId interrupt_id) { // Update framebuffer information if requested // TODO(yuriks): Confirm where this code should be called. It is definitely updated without // executing any GSP commands, only waiting on the event. - int screen_id = (interrupt_id == InterruptId::PDC0) ? 0 : (interrupt_id == InterruptId::PDC1) ? 1 : -1; + int screen_id = + (interrupt_id == InterruptId::PDC0) ? 0 : (interrupt_id == InterruptId::PDC1) ? 1 : -1; if (screen_id != -1) { FrameBufferUpdate* info = GetFrameBufferInfo(thread_id, screen_id); if (info->is_dirty) { @@ -440,25 +463,27 @@ static void ExecuteCommand(const Command& command, u32 thread_id) { switch (command.id) { // GX request DMA - typically used for copying memory from GSP heap to VRAM - case CommandId::REQUEST_DMA: - { + case CommandId::REQUEST_DMA: { MICROPROFILE_SCOPE(GPU_GSP_DMA); - // TODO: Consider attempting rasterizer-accelerated surface blit if that usage is ever possible/likely - Memory::RasterizerFlushRegion(Memory::VirtualToPhysicalAddress(command.dma_request.source_address), - command.dma_request.size); - Memory::RasterizerFlushAndInvalidateRegion(Memory::VirtualToPhysicalAddress(command.dma_request.dest_address), - command.dma_request.size); + // TODO: Consider attempting rasterizer-accelerated surface blit if that usage is ever + // possible/likely + Memory::RasterizerFlushRegion( + Memory::VirtualToPhysicalAddress(command.dma_request.source_address), + command.dma_request.size); + Memory::RasterizerFlushAndInvalidateRegion( + Memory::VirtualToPhysicalAddress(command.dma_request.dest_address), + command.dma_request.size); // TODO(Subv): These memory accesses should not go through the application's memory mapping. // They should go through the GSP module's memory mapping. - Memory::CopyBlock(command.dma_request.dest_address, command.dma_request.source_address, command.dma_request.size); + Memory::CopyBlock(command.dma_request.dest_address, command.dma_request.source_address, + command.dma_request.size); SignalInterrupt(InterruptId::DMA); break; } // TODO: This will need some rework in the future. (why?) - case CommandId::SUBMIT_GPU_CMDLIST: - { + case CommandId::SUBMIT_GPU_CMDLIST: { auto& params = command.submit_gpu_cmdlist; if (params.do_flush) { @@ -468,10 +493,12 @@ static void ExecuteCommand(const Command& command, u32 thread_id) { } WriteGPURegister(static_cast(GPU_REG_INDEX(command_processor_config.address)), - Memory::VirtualToPhysicalAddress(params.address) >> 3); - WriteGPURegister(static_cast(GPU_REG_INDEX(command_processor_config.size)), params.size); + Memory::VirtualToPhysicalAddress(params.address) >> 3); + WriteGPURegister(static_cast(GPU_REG_INDEX(command_processor_config.size)), + params.size); - // TODO: Not sure if we are supposed to always write this .. seems to trigger processing though + // TODO: Not sure if we are supposed to always write this .. seems to trigger processing + // though WriteGPURegister(static_cast(GPU_REG_INDEX(command_processor_config.trigger)), 1); // TODO(yuriks): Figure out the meaning of the `flags` field. @@ -481,67 +508,70 @@ static void ExecuteCommand(const Command& command, u32 thread_id) { // It's assumed that the two "blocks" behave equivalently. // Presumably this is done simply to allow two memory fills to run in parallel. - case CommandId::SET_MEMORY_FILL: - { + case CommandId::SET_MEMORY_FILL: { auto& params = command.memory_fill; if (params.start1 != 0) { WriteGPURegister(static_cast(GPU_REG_INDEX(memory_fill_config[0].address_start)), - Memory::VirtualToPhysicalAddress(params.start1) >> 3); + Memory::VirtualToPhysicalAddress(params.start1) >> 3); WriteGPURegister(static_cast(GPU_REG_INDEX(memory_fill_config[0].address_end)), - Memory::VirtualToPhysicalAddress(params.end1) >> 3); - WriteGPURegister(static_cast(GPU_REG_INDEX(memory_fill_config[0].value_32bit)), params.value1); - WriteGPURegister(static_cast(GPU_REG_INDEX(memory_fill_config[0].control)), params.control1); + Memory::VirtualToPhysicalAddress(params.end1) >> 3); + WriteGPURegister(static_cast(GPU_REG_INDEX(memory_fill_config[0].value_32bit)), + params.value1); + WriteGPURegister(static_cast(GPU_REG_INDEX(memory_fill_config[0].control)), + params.control1); } if (params.start2 != 0) { WriteGPURegister(static_cast(GPU_REG_INDEX(memory_fill_config[1].address_start)), - Memory::VirtualToPhysicalAddress(params.start2) >> 3); + Memory::VirtualToPhysicalAddress(params.start2) >> 3); WriteGPURegister(static_cast(GPU_REG_INDEX(memory_fill_config[1].address_end)), - Memory::VirtualToPhysicalAddress(params.end2) >> 3); - WriteGPURegister(static_cast(GPU_REG_INDEX(memory_fill_config[1].value_32bit)), params.value2); - WriteGPURegister(static_cast(GPU_REG_INDEX(memory_fill_config[1].control)), params.control2); + Memory::VirtualToPhysicalAddress(params.end2) >> 3); + WriteGPURegister(static_cast(GPU_REG_INDEX(memory_fill_config[1].value_32bit)), + params.value2); + WriteGPURegister(static_cast(GPU_REG_INDEX(memory_fill_config[1].control)), + params.control2); } break; } - case CommandId::SET_DISPLAY_TRANSFER: - { + case CommandId::SET_DISPLAY_TRANSFER: { auto& params = command.display_transfer; WriteGPURegister(static_cast(GPU_REG_INDEX(display_transfer_config.input_address)), - Memory::VirtualToPhysicalAddress(params.in_buffer_address) >> 3); + Memory::VirtualToPhysicalAddress(params.in_buffer_address) >> 3); WriteGPURegister(static_cast(GPU_REG_INDEX(display_transfer_config.output_address)), - Memory::VirtualToPhysicalAddress(params.out_buffer_address) >> 3); - WriteGPURegister(static_cast(GPU_REG_INDEX(display_transfer_config.input_size)), params.in_buffer_size); - WriteGPURegister(static_cast(GPU_REG_INDEX(display_transfer_config.output_size)), params.out_buffer_size); - WriteGPURegister(static_cast(GPU_REG_INDEX(display_transfer_config.flags)), params.flags); + Memory::VirtualToPhysicalAddress(params.out_buffer_address) >> 3); + WriteGPURegister(static_cast(GPU_REG_INDEX(display_transfer_config.input_size)), + params.in_buffer_size); + WriteGPURegister(static_cast(GPU_REG_INDEX(display_transfer_config.output_size)), + params.out_buffer_size); + WriteGPURegister(static_cast(GPU_REG_INDEX(display_transfer_config.flags)), + params.flags); WriteGPURegister(static_cast(GPU_REG_INDEX(display_transfer_config.trigger)), 1); break; } - case CommandId::SET_TEXTURE_COPY: - { + case CommandId::SET_TEXTURE_COPY: { auto& params = command.texture_copy; WriteGPURegister((u32)GPU_REG_INDEX(display_transfer_config.input_address), - Memory::VirtualToPhysicalAddress(params.in_buffer_address) >> 3); + Memory::VirtualToPhysicalAddress(params.in_buffer_address) >> 3); WriteGPURegister((u32)GPU_REG_INDEX(display_transfer_config.output_address), - Memory::VirtualToPhysicalAddress(params.out_buffer_address) >> 3); + Memory::VirtualToPhysicalAddress(params.out_buffer_address) >> 3); WriteGPURegister((u32)GPU_REG_INDEX(display_transfer_config.texture_copy.size), - params.size); + params.size); WriteGPURegister((u32)GPU_REG_INDEX(display_transfer_config.texture_copy.input_size), - params.in_width_gap); + params.in_width_gap); WriteGPURegister((u32)GPU_REG_INDEX(display_transfer_config.texture_copy.output_size), - params.out_width_gap); - WriteGPURegister((u32)GPU_REG_INDEX(display_transfer_config.flags), - params.flags); + params.out_width_gap); + WriteGPURegister((u32)GPU_REG_INDEX(display_transfer_config.flags), params.flags); - // NOTE: Actual GSP ORs 1 with current register instead of overwriting. Doesn't seem to matter. + // NOTE: Actual GSP ORs 1 with current register instead of overwriting. Doesn't seem to + // matter. WriteGPURegister((u32)GPU_REG_INDEX(display_transfer_config.trigger), 1); break; } - case CommandId::CACHE_FLUSH: - { + case CommandId::CACHE_FLUSH: { // NOTE: Rasterizer flushing handled elsewhere in CPU read/write and other GPU handlers // Use command.cache_flush.regions to implement this handler break; @@ -552,7 +582,8 @@ static void ExecuteCommand(const Command& command, u32 thread_id) { } if (Pica::g_debug_context) - Pica::g_debug_context->OnEvent(Pica::DebugContext::Event::GSPCommandProcessed, (void*)&command); + Pica::g_debug_context->OnEvent(Pica::DebugContext::Event::GSPCommandProcessed, + (void*)&command); } /** @@ -575,7 +606,7 @@ static void SetLcdForceBlack(Service::Interface* self) { // the color to black (all zero). data.is_enabled.Assign(enable_black); - LCD::Write(HW::VADDR_LCD + 4 * LCD_REG_INDEX(color_fill_top), data.raw); // Top LCD + LCD::Write(HW::VADDR_LCD + 4 * LCD_REG_INDEX(color_fill_top), data.raw); // Top LCD LCD::Write(HW::VADDR_LCD + 4 * LCD_REG_INDEX(color_fill_bottom), data.raw); // Bottom LCD cmd_buff[1] = RESULT_SUCCESS.raw; @@ -679,37 +710,37 @@ static void ReleaseRight(Service::Interface* self) { } const Interface::FunctionInfo FunctionTable[] = { - {0x00010082, WriteHWRegs, "WriteHWRegs"}, - {0x00020084, WriteHWRegsWithMask, "WriteHWRegsWithMask"}, - {0x00030082, nullptr, "WriteHWRegRepeat"}, - {0x00040080, ReadHWRegs, "ReadHWRegs"}, - {0x00050200, SetBufferSwap, "SetBufferSwap"}, - {0x00060082, nullptr, "SetCommandList"}, - {0x000700C2, nullptr, "RequestDma"}, - {0x00080082, FlushDataCache, "FlushDataCache"}, - {0x00090082, nullptr, "InvalidateDataCache"}, - {0x000A0044, nullptr, "RegisterInterruptEvents"}, - {0x000B0040, SetLcdForceBlack, "SetLcdForceBlack"}, - {0x000C0000, TriggerCmdReqQueue, "TriggerCmdReqQueue"}, - {0x000D0140, nullptr, "SetDisplayTransfer"}, - {0x000E0180, nullptr, "SetTextureCopy"}, - {0x000F0200, nullptr, "SetMemoryFill"}, - {0x00100040, SetAxiConfigQoSMode, "SetAxiConfigQoSMode"}, - {0x00110040, nullptr, "SetPerfLogMode"}, - {0x00120000, nullptr, "GetPerfLog"}, - {0x00130042, RegisterInterruptRelayQueue, "RegisterInterruptRelayQueue"}, + {0x00010082, WriteHWRegs, "WriteHWRegs"}, + {0x00020084, WriteHWRegsWithMask, "WriteHWRegsWithMask"}, + {0x00030082, nullptr, "WriteHWRegRepeat"}, + {0x00040080, ReadHWRegs, "ReadHWRegs"}, + {0x00050200, SetBufferSwap, "SetBufferSwap"}, + {0x00060082, nullptr, "SetCommandList"}, + {0x000700C2, nullptr, "RequestDma"}, + {0x00080082, FlushDataCache, "FlushDataCache"}, + {0x00090082, nullptr, "InvalidateDataCache"}, + {0x000A0044, nullptr, "RegisterInterruptEvents"}, + {0x000B0040, SetLcdForceBlack, "SetLcdForceBlack"}, + {0x000C0000, TriggerCmdReqQueue, "TriggerCmdReqQueue"}, + {0x000D0140, nullptr, "SetDisplayTransfer"}, + {0x000E0180, nullptr, "SetTextureCopy"}, + {0x000F0200, nullptr, "SetMemoryFill"}, + {0x00100040, SetAxiConfigQoSMode, "SetAxiConfigQoSMode"}, + {0x00110040, nullptr, "SetPerfLogMode"}, + {0x00120000, nullptr, "GetPerfLog"}, + {0x00130042, RegisterInterruptRelayQueue, "RegisterInterruptRelayQueue"}, {0x00140000, UnregisterInterruptRelayQueue, "UnregisterInterruptRelayQueue"}, - {0x00150002, nullptr, "TryAcquireRight"}, - {0x00160042, AcquireRight, "AcquireRight"}, - {0x00170000, ReleaseRight, "ReleaseRight"}, - {0x00180000, ImportDisplayCaptureInfo, "ImportDisplayCaptureInfo"}, - {0x00190000, nullptr, "SaveVramSysArea"}, - {0x001A0000, nullptr, "RestoreVramSysArea"}, - {0x001B0000, nullptr, "ResetGpuCore"}, - {0x001C0040, nullptr, "SetLedForceOff"}, - {0x001D0040, nullptr, "SetTestCommand"}, - {0x001E0080, nullptr, "SetInternalPriorities"}, - {0x001F0082, nullptr, "StoreDataCache"}, + {0x00150002, nullptr, "TryAcquireRight"}, + {0x00160042, AcquireRight, "AcquireRight"}, + {0x00170000, ReleaseRight, "ReleaseRight"}, + {0x00180000, ImportDisplayCaptureInfo, "ImportDisplayCaptureInfo"}, + {0x00190000, nullptr, "SaveVramSysArea"}, + {0x001A0000, nullptr, "RestoreVramSysArea"}, + {0x001B0000, nullptr, "ResetGpuCore"}, + {0x001C0040, nullptr, "SetLedForceOff"}, + {0x001D0040, nullptr, "SetTestCommand"}, + {0x001E0080, nullptr, "SetInternalPriorities"}, + {0x001F0082, nullptr, "StoreDataCache"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -721,9 +752,9 @@ Interface::Interface() { g_interrupt_event = nullptr; using Kernel::MemoryPermission; - g_shared_memory = Kernel::SharedMemory::Create(nullptr, 0x1000, - MemoryPermission::ReadWrite, MemoryPermission::ReadWrite, - 0, Kernel::MemoryRegion::BASE, "GSP:SharedMemory"); + g_shared_memory = Kernel::SharedMemory::Create(nullptr, 0x1000, MemoryPermission::ReadWrite, + MemoryPermission::ReadWrite, 0, + Kernel::MemoryRegion::BASE, "GSP:SharedMemory"); g_thread_id = 0; gpu_right_acquired = false; diff --git a/src/core/hle/service/gsp_gpu.h b/src/core/hle/service/gsp_gpu.h index 3b4b678a3..e028123f3 100644 --- a/src/core/hle/service/gsp_gpu.h +++ b/src/core/hle/service/gsp_gpu.h @@ -20,30 +20,30 @@ namespace GSP_GPU { /// GSP interrupt ID enum class InterruptId : u8 { - PSC0 = 0x00, - PSC1 = 0x01, - PDC0 = 0x02, // Seems called every vertical screen line - PDC1 = 0x03, // Seems called every frame - PPF = 0x04, - P3D = 0x05, - DMA = 0x06, + PSC0 = 0x00, + PSC1 = 0x01, + PDC0 = 0x02, // Seems called every vertical screen line + PDC1 = 0x03, // Seems called every frame + PPF = 0x04, + P3D = 0x05, + DMA = 0x06, }; /// GSP command ID enum class CommandId : u32 { - REQUEST_DMA = 0x00, + REQUEST_DMA = 0x00, /// Submits a commandlist for execution by the GPU. SUBMIT_GPU_CMDLIST = 0x01, // Fills a given memory range with a particular value - SET_MEMORY_FILL = 0x02, + SET_MEMORY_FILL = 0x02, // Copies an image and optionally performs color-conversion or scaling. // This is highly similar to the GameCube's EFB copy feature - SET_DISPLAY_TRANSFER = 0x03, + SET_DISPLAY_TRANSFER = 0x03, // Conceptionally similar to SET_DISPLAY_TRANSFER and presumable uses the same hardware path - SET_TEXTURE_COPY = 0x04, + SET_TEXTURE_COPY = 0x04, /// Flushes up to 3 cache regions in a single command. CACHE_FLUSH = 0x05, }; @@ -61,19 +61,18 @@ struct InterruptRelayQueue { u32 missed_PDC0; u32 missed_PDC1; - InterruptId slot[0x34]; ///< Interrupt ID slots + InterruptId slot[0x34]; ///< Interrupt ID slots }; -static_assert(sizeof(InterruptRelayQueue) == 0x40, - "InterruptRelayQueue struct has incorrect size"); +static_assert(sizeof(InterruptRelayQueue) == 0x40, "InterruptRelayQueue struct has incorrect size"); struct FrameBufferInfo { BitField<0, 1, u32> active_fb; // 0 = first, 1 = second u32 address_left; u32 address_right; - u32 stride; // maps to 0x1EF00X90 ? - u32 format; // maps to 0x1EF00X70 ? - u32 shown_fb; // maps to 0x1EF00X78 ? + u32 stride; // maps to 0x1EF00X90 ? + u32 format; // maps to 0x1EF00X70 ? + u32 shown_fb; // maps to 0x1EF00X78 ? u32 unknown; }; static_assert(sizeof(FrameBufferInfo) == 0x1c, "Struct has incorrect size"); @@ -91,7 +90,8 @@ static_assert(sizeof(FrameBufferUpdate) == 0x40, "Struct has incorrect size"); // TODO: Not sure if this padding is correct. // Chances are the second block is stored at offset 0x24 rather than 0x20. #ifndef _MSC_VER -static_assert(offsetof(FrameBufferUpdate, framebuffer_info[1]) == 0x20, "FrameBufferInfo element has incorrect alignment"); +static_assert(offsetof(FrameBufferUpdate, framebuffer_info[1]) == 0x20, + "FrameBufferInfo element has incorrect alignment"); #endif /// GSP command @@ -163,13 +163,13 @@ struct CommandBuffer { // Current command index. This index is updated by GSP module after loading the command // data, right before the command is processed. When this index is updated by GSP module, // the total commands field is decreased by one as well. - BitField<0,8,u32> index; + BitField<0, 8, u32> index; // Total commands to process, must not be value 0 when GSP module handles commands. This // must be <=15 when writing a command to shared memory. This is incremented by the // application when writing a command to shared memory, after increasing this value // TriggerCmdReqQueue is only used if this field is value 1. - BitField<8,8,u32> number_commands; + BitField<8, 8, u32> number_commands; }; u32 unk[7]; diff --git a/src/core/hle/service/gsp_lcd.cpp b/src/core/hle/service/gsp_lcd.cpp index c700c21c5..3922cd197 100644 --- a/src/core/hle/service/gsp_lcd.cpp +++ b/src/core/hle/service/gsp_lcd.cpp @@ -9,13 +9,11 @@ namespace GSP_LCD { -const Interface::FunctionInfo FunctionTable[] = { - {0x000F0000, nullptr, "PowerOnAllBacklights"}, - {0x00100000, nullptr, "PowerOffAllBacklights"}, - {0x00110040, nullptr, "PowerOnBacklight"}, - {0x00120040, nullptr, "PowerOffBacklight"}, - {0x00130040, nullptr, "SetLedForceOff"} -}; +const Interface::FunctionInfo FunctionTable[] = {{0x000F0000, nullptr, "PowerOnAllBacklights"}, + {0x00100000, nullptr, "PowerOffAllBacklights"}, + {0x00110040, nullptr, "PowerOnBacklight"}, + {0x00120040, nullptr, "PowerOffBacklight"}, + {0x00130040, nullptr, "SetLedForceOff"}}; //////////////////////////////////////////////////////////////////////////////////////////////////// // Interface class diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index cdec11388..d915a3105 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -4,13 +4,13 @@ #include -#include "common/logging/log.h" #include "common/emu_window.h" +#include "common/logging/log.h" -#include "core/hle/service/service.h" #include "core/hle/service/hid/hid.h" #include "core/hle/service/hid/hid_spvr.h" #include "core/hle/service/hid/hid_user.h" +#include "core/hle/service/service.h" #include "core/core_timing.h" #include "core/hle/kernel/event.h" @@ -37,11 +37,14 @@ static u32 next_accelerometer_index; static u32 next_gyroscope_index; static int enable_accelerometer_count = 0; // positive means enabled -static int enable_gyroscope_count = 0; // positive means enabled +static int enable_gyroscope_count = 0; // positive means enabled static PadState GetCirclePadDirectionState(s16 circle_pad_x, s16 circle_pad_y) { - constexpr float TAN30 = 0.577350269, TAN60 = 1 / TAN30; // 30 degree and 60 degree are angular thresholds for directions - constexpr int CIRCLE_PAD_THRESHOLD_SQUARE = 40 * 40; // a circle pad radius greater than 40 will trigger circle pad direction + constexpr float TAN30 = 0.577350269, + TAN60 = + 1 / TAN30; // 30 degree and 60 degree are angular thresholds for directions + constexpr int CIRCLE_PAD_THRESHOLD_SQUARE = + 40 * 40; // a circle pad radius greater than 40 will trigger circle pad direction PadState state; state.hex = 0; @@ -90,7 +93,7 @@ void Update() { PadState old_state = mem->pad.entries[last_entry_index].current_state; // Compute bitmask with 1s for bits different from the old state - PadState changed = { { (state.hex ^ old_state.hex) } }; + PadState changed = {{(state.hex ^ old_state.hex)}}; // Get the current Pad entry PadDataEntry& pad_entry = mem->pad.entries[mem->pad.index]; @@ -135,11 +138,13 @@ void Update() { // Update accelerometer if (enable_accelerometer_count > 0) { mem->accelerometer.index = next_accelerometer_index; - next_accelerometer_index = (next_accelerometer_index + 1) % mem->accelerometer.entries.size(); + next_accelerometer_index = + (next_accelerometer_index + 1) % mem->accelerometer.entries.size(); - AccelerometerDataEntry& accelerometer_entry = mem->accelerometer.entries[mem->accelerometer.index]; - std::tie(accelerometer_entry.x, accelerometer_entry.y, accelerometer_entry.z) - = VideoCore::g_emu_window->GetAccelerometerState(); + AccelerometerDataEntry& accelerometer_entry = + mem->accelerometer.entries[mem->accelerometer.index]; + std::tie(accelerometer_entry.x, accelerometer_entry.y, accelerometer_entry.z) = + VideoCore::g_emu_window->GetAccelerometerState(); // Make up "raw" entry // TODO(wwylele): @@ -167,8 +172,8 @@ void Update() { next_gyroscope_index = (next_gyroscope_index + 1) % mem->gyroscope.entries.size(); GyroscopeDataEntry& gyroscope_entry = mem->gyroscope.entries[mem->gyroscope.index]; - std::tie(gyroscope_entry.x, gyroscope_entry.y, gyroscope_entry.z) - = VideoCore::g_emu_window->GetGyroscopeState(); + std::tie(gyroscope_entry.x, gyroscope_entry.y, gyroscope_entry.z) = + VideoCore::g_emu_window->GetGyroscopeState(); // Make up "raw" entry mem->gyroscope.raw_entry.x = gyroscope_entry.x; @@ -188,7 +193,7 @@ void Update() { void GetIPCHandles(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - cmd_buff[1] = 0; // No error + cmd_buff[1] = 0; // No error cmd_buff[2] = 0x14000000; // IPC Command Structure translate-header // TODO(yuriks): Return error from SendSyncRequest is this fails (part of IPC marshalling) cmd_buff[3] = Kernel::g_handle_table.Create(Service::HID::shared_mem).MoveFrom(); @@ -259,9 +264,7 @@ void GetGyroscopeLowCalibrateParam(Service::Interface* self) { const s16 param_unit = 6700; // an approximate value taken from hw GyroscopeCalibrateParam param = { - { 0, param_unit, -param_unit }, - { 0, param_unit, -param_unit }, - { 0, param_unit, -param_unit }, + {0, param_unit, -param_unit}, {0, param_unit, -param_unit}, {0, param_unit, -param_unit}, }; memcpy(&cmd_buff[2], ¶m, sizeof(param)); @@ -286,9 +289,9 @@ void Init() { AddService(new HID_SPVR_Interface); using Kernel::MemoryPermission; - shared_mem = SharedMemory::Create(nullptr, 0x1000, - MemoryPermission::ReadWrite, MemoryPermission::Read, - 0, Kernel::MemoryRegion::BASE, "HID:SharedMemory"); + shared_mem = + SharedMemory::Create(nullptr, 0x1000, MemoryPermission::ReadWrite, MemoryPermission::Read, + 0, Kernel::MemoryRegion::BASE, "HID:SharedMemory"); next_pad_index = 0; next_touch_index = 0; @@ -296,9 +299,9 @@ void Init() { // Create event handles event_pad_or_touch_1 = Event::Create(ResetType::OneShot, "HID:EventPadOrTouch1"); event_pad_or_touch_2 = Event::Create(ResetType::OneShot, "HID:EventPadOrTouch2"); - event_accelerometer = Event::Create(ResetType::OneShot, "HID:EventAccelerometer"); - event_gyroscope = Event::Create(ResetType::OneShot, "HID:EventGyroscope"); - event_debug_pad = Event::Create(ResetType::OneShot, "HID:EventDebugPad"); + event_accelerometer = Event::Create(ResetType::OneShot, "HID:EventAccelerometer"); + event_gyroscope = Event::Create(ResetType::OneShot, "HID:EventGyroscope"); + event_debug_pad = Event::Create(ResetType::OneShot, "HID:EventDebugPad"); } void Shutdown() { diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h index 669b1f723..f54ffd8be 100644 --- a/src/core/hle/service/hid/hid.h +++ b/src/core/hle/service/hid/hid.h @@ -9,10 +9,10 @@ #ifndef _MSC_VER #include #endif -#include "core/settings.h" #include "common/bit_field.h" #include "common/common_funcs.h" #include "common/common_types.h" +#include "core/settings.h" namespace Service { @@ -103,7 +103,7 @@ struct SharedMem { struct { s64 index_reset_ticks; ///< CPU tick count for when HID module updated entry index 0 s64 index_reset_ticks_previous; ///< Previous `index_reset_ticks` - u32 index; ///< Index of the last updated pad state entry + u32 index; ///< Index of the last updated pad state entry INSERT_PADDING_WORDS(0x2); @@ -121,7 +121,7 @@ struct SharedMem { struct { s64 index_reset_ticks; ///< CPU tick count for when HID module updated entry index 0 s64 index_reset_ticks_previous; ///< Previous `index_reset_ticks` - u32 index; ///< Index of the last updated touch entry + u32 index; ///< Index of the last updated touch entry INSERT_PADDING_WORDS(0x1); @@ -135,7 +135,7 @@ struct SharedMem { struct { s64 index_reset_ticks; ///< CPU tick count for when HID module updated entry index 0 s64 index_reset_ticks_previous; ///< Previous `index_reset_ticks` - u32 index; ///< Index of the last updated accelerometer entry + u32 index; ///< Index of the last updated accelerometer entry INSERT_PADDING_WORDS(0x1); @@ -149,7 +149,7 @@ struct SharedMem { struct { s64 index_reset_ticks; ///< CPU tick count for when HID module updated entry index 0 s64 index_reset_ticks_previous; ///< Previous `index_reset_ticks` - u32 index; ///< Index of the last updated accelerometer entry + u32 index; ///< Index of the last updated accelerometer entry INSERT_PADDING_WORDS(0x1); @@ -176,9 +176,9 @@ struct GyroscopeCalibrateParam { // is technically allowed since C++11. This macro should be enabled once MSVC adds // support for that. #ifndef _MSC_VER -#define ASSERT_REG_POSITION(field_name, position) \ - static_assert(offsetof(SharedMem, field_name) == position * 4, \ - "Field "#field_name" has invalid position") +#define ASSERT_REG_POSITION(field_name, position) \ + static_assert(offsetof(SharedMem, field_name) == position * 4, \ + "Field " #field_name " has invalid position") ASSERT_REG_POSITION(pad.index_reset_ticks, 0x0); ASSERT_REG_POSITION(touch.index_reset_ticks, 0x2A); @@ -187,33 +187,33 @@ ASSERT_REG_POSITION(touch.index_reset_ticks, 0x2A); #endif // !defined(_MSC_VER) // Pre-defined PadStates for single button presses -const PadState PAD_NONE = {{0}}; -const PadState PAD_A = {{1u << 0}}; -const PadState PAD_B = {{1u << 1}}; -const PadState PAD_SELECT = {{1u << 2}}; -const PadState PAD_START = {{1u << 3}}; -const PadState PAD_RIGHT = {{1u << 4}}; -const PadState PAD_LEFT = {{1u << 5}}; -const PadState PAD_UP = {{1u << 6}}; -const PadState PAD_DOWN = {{1u << 7}}; -const PadState PAD_R = {{1u << 8}}; -const PadState PAD_L = {{1u << 9}}; -const PadState PAD_X = {{1u << 10}}; -const PadState PAD_Y = {{1u << 11}}; - -const PadState PAD_ZL = {{1u << 14}}; -const PadState PAD_ZR = {{1u << 15}}; - -const PadState PAD_TOUCH = {{1u << 20}}; - -const PadState PAD_C_RIGHT = {{1u << 24}}; -const PadState PAD_C_LEFT = {{1u << 25}}; -const PadState PAD_C_UP = {{1u << 26}}; -const PadState PAD_C_DOWN = {{1u << 27}}; +const PadState PAD_NONE = {{0}}; +const PadState PAD_A = {{1u << 0}}; +const PadState PAD_B = {{1u << 1}}; +const PadState PAD_SELECT = {{1u << 2}}; +const PadState PAD_START = {{1u << 3}}; +const PadState PAD_RIGHT = {{1u << 4}}; +const PadState PAD_LEFT = {{1u << 5}}; +const PadState PAD_UP = {{1u << 6}}; +const PadState PAD_DOWN = {{1u << 7}}; +const PadState PAD_R = {{1u << 8}}; +const PadState PAD_L = {{1u << 9}}; +const PadState PAD_X = {{1u << 10}}; +const PadState PAD_Y = {{1u << 11}}; + +const PadState PAD_ZL = {{1u << 14}}; +const PadState PAD_ZR = {{1u << 15}}; + +const PadState PAD_TOUCH = {{1u << 20}}; + +const PadState PAD_C_RIGHT = {{1u << 24}}; +const PadState PAD_C_LEFT = {{1u << 25}}; +const PadState PAD_C_UP = {{1u << 26}}; +const PadState PAD_C_DOWN = {{1u << 27}}; const PadState PAD_CIRCLE_RIGHT = {{1u << 28}}; -const PadState PAD_CIRCLE_LEFT = {{1u << 29}}; -const PadState PAD_CIRCLE_UP = {{1u << 30}}; -const PadState PAD_CIRCLE_DOWN = {{1u << 31}}; +const PadState PAD_CIRCLE_LEFT = {{1u << 29}}; +const PadState PAD_CIRCLE_UP = {{1u << 30}}; +const PadState PAD_CIRCLE_DOWN = {{1u << 31}}; /** * HID::GetIPCHandles service function @@ -305,6 +305,5 @@ void Init(); /// Shutdown HID service void Shutdown(); - } } diff --git a/src/core/hle/service/hid/hid_spvr.cpp b/src/core/hle/service/hid/hid_spvr.cpp index 046e65b11..09007e304 100644 --- a/src/core/hle/service/hid/hid_spvr.cpp +++ b/src/core/hle/service/hid/hid_spvr.cpp @@ -9,16 +9,16 @@ namespace Service { namespace HID { const Interface::FunctionInfo FunctionTable[] = { - {0x000A0000, GetIPCHandles, "GetIPCHandles"}, - {0x000B0000, nullptr, "StartAnalogStickCalibration"}, - {0x000E0000, nullptr, "GetAnalogStickCalibrateParam"}, - {0x00110000, EnableAccelerometer, "EnableAccelerometer"}, - {0x00120000, DisableAccelerometer, "DisableAccelerometer"}, - {0x00130000, EnableGyroscopeLow, "EnableGyroscopeLow"}, - {0x00140000, DisableGyroscopeLow, "DisableGyroscopeLow"}, + {0x000A0000, GetIPCHandles, "GetIPCHandles"}, + {0x000B0000, nullptr, "StartAnalogStickCalibration"}, + {0x000E0000, nullptr, "GetAnalogStickCalibrateParam"}, + {0x00110000, EnableAccelerometer, "EnableAccelerometer"}, + {0x00120000, DisableAccelerometer, "DisableAccelerometer"}, + {0x00130000, EnableGyroscopeLow, "EnableGyroscopeLow"}, + {0x00140000, DisableGyroscopeLow, "DisableGyroscopeLow"}, {0x00150000, GetGyroscopeLowRawToDpsCoefficient, "GetGyroscopeLowRawToDpsCoefficient"}, - {0x00160000, GetGyroscopeLowCalibrateParam, "GetGyroscopeLowCalibrateParam"}, - {0x00170000, GetSoundVolume, "GetSoundVolume"}, + {0x00160000, GetGyroscopeLowCalibrateParam, "GetGyroscopeLowCalibrateParam"}, + {0x00170000, GetSoundVolume, "GetSoundVolume"}, }; HID_SPVR_Interface::HID_SPVR_Interface() { diff --git a/src/core/hle/service/hid/hid_user.cpp b/src/core/hle/service/hid/hid_user.cpp index bb157b83d..42591543c 100644 --- a/src/core/hle/service/hid/hid_user.cpp +++ b/src/core/hle/service/hid/hid_user.cpp @@ -9,16 +9,16 @@ namespace Service { namespace HID { const Interface::FunctionInfo FunctionTable[] = { - {0x000A0000, GetIPCHandles, "GetIPCHandles"}, - {0x000B0000, nullptr, "StartAnalogStickCalibration"}, - {0x000E0000, nullptr, "GetAnalogStickCalibrateParam"}, - {0x00110000, EnableAccelerometer, "EnableAccelerometer"}, - {0x00120000, DisableAccelerometer, "DisableAccelerometer"}, - {0x00130000, EnableGyroscopeLow, "EnableGyroscopeLow"}, - {0x00140000, DisableGyroscopeLow, "DisableGyroscopeLow"}, + {0x000A0000, GetIPCHandles, "GetIPCHandles"}, + {0x000B0000, nullptr, "StartAnalogStickCalibration"}, + {0x000E0000, nullptr, "GetAnalogStickCalibrateParam"}, + {0x00110000, EnableAccelerometer, "EnableAccelerometer"}, + {0x00120000, DisableAccelerometer, "DisableAccelerometer"}, + {0x00130000, EnableGyroscopeLow, "EnableGyroscopeLow"}, + {0x00140000, DisableGyroscopeLow, "DisableGyroscopeLow"}, {0x00150000, GetGyroscopeLowRawToDpsCoefficient, "GetGyroscopeLowRawToDpsCoefficient"}, - {0x00160000, GetGyroscopeLowCalibrateParam, "GetGyroscopeLowCalibrateParam"}, - {0x00170000, GetSoundVolume, "GetSoundVolume"}, + {0x00160000, GetGyroscopeLowCalibrateParam, "GetGyroscopeLowCalibrateParam"}, + {0x00170000, GetSoundVolume, "GetSoundVolume"}, }; HID_U_Interface::HID_U_Interface() { diff --git a/src/core/hle/service/http_c.cpp b/src/core/hle/service/http_c.cpp index 0855ab227..3cf62a4b8 100644 --- a/src/core/hle/service/http_c.cpp +++ b/src/core/hle/service/http_c.cpp @@ -10,56 +10,56 @@ namespace HTTP_C { const Interface::FunctionInfo FunctionTable[] = { - {0x00010044, nullptr, "Initialize"}, - {0x00020082, nullptr, "CreateContext"}, - {0x00030040, nullptr, "CloseContext"}, - {0x00040040, nullptr, "CancelConnection"}, - {0x00050040, nullptr, "GetRequestState"}, - {0x00060040, nullptr, "GetDownloadSizeState"}, - {0x00070040, nullptr, "GetRequestError"}, - {0x00080042, nullptr, "InitializeConnectionSession"}, - {0x00090040, nullptr, "BeginRequest"}, - {0x000A0040, nullptr, "BeginRequestAsync"}, - {0x000B0082, nullptr, "ReceiveData"}, - {0x000C0102, nullptr, "ReceiveDataTimeout"}, - {0x000D0146, nullptr, "SetProxy"}, - {0x000E0040, nullptr, "SetProxyDefault"}, - {0x000F00C4, nullptr, "SetBasicAuthorization"}, - {0x00100080, nullptr, "SetSocketBufferSize"}, - {0x001100C4, nullptr, "AddRequestHeader"}, - {0x001200C4, nullptr, "AddPostDataAscii"}, - {0x001300C4, nullptr, "AddPostDataBinary"}, - {0x00140082, nullptr, "AddPostDataRaw"}, - {0x00150080, nullptr, "SetPostDataType"}, - {0x001600C4, nullptr, "SendPostDataAscii"}, - {0x00170144, nullptr, "SendPostDataAsciiTimeout"}, - {0x001800C4, nullptr, "SendPostDataBinary"}, - {0x00190144, nullptr, "SendPostDataBinaryTimeout"}, - {0x001A0082, nullptr, "SendPostDataRaw"}, - {0x001B0102, nullptr, "SendPOSTDataRawTimeout"}, - {0x001C0080, nullptr, "SetPostDataEncoding"}, - {0x001D0040, nullptr, "NotifyFinishSendPostData"}, - {0x001E00C4, nullptr, "GetResponseHeader"}, - {0x001F0144, nullptr, "GetResponseHeaderTimeout"}, - {0x00200082, nullptr, "GetResponseData"}, - {0x00210102, nullptr, "GetResponseDataTimeout"}, - {0x00220040, nullptr, "GetResponseStatusCode"}, - {0x002300C0, nullptr, "GetResponseStatusCodeTimeout"}, - {0x00240082, nullptr, "AddTrustedRootCA"}, - {0x00250080, nullptr, "AddDefaultCert"}, - {0x00260080, nullptr, "SelectRootCertChain"}, - {0x002700C4, nullptr, "SetClientCert"}, - {0x002B0080, nullptr, "SetSSLOpt"}, - {0x002C0080, nullptr, "SetSSLClearOpt"}, - {0x002D0000, nullptr, "CreateRootCertChain"}, - {0x002E0040, nullptr, "DestroyRootCertChain"}, - {0x002F0082, nullptr, "RootCertChainAddCert"}, - {0x00300080, nullptr, "RootCertChainAddDefaultCert"}, - {0x00350186, nullptr, "SetDefaultProxy"}, - {0x00360000, nullptr, "ClearDNSCache"}, - {0x00370080, nullptr, "SetKeepAlive"}, - {0x003800C0, nullptr, "SetPostDataTypeSize"}, - {0x00390000, nullptr, "Finalize"}, + {0x00010044, nullptr, "Initialize"}, + {0x00020082, nullptr, "CreateContext"}, + {0x00030040, nullptr, "CloseContext"}, + {0x00040040, nullptr, "CancelConnection"}, + {0x00050040, nullptr, "GetRequestState"}, + {0x00060040, nullptr, "GetDownloadSizeState"}, + {0x00070040, nullptr, "GetRequestError"}, + {0x00080042, nullptr, "InitializeConnectionSession"}, + {0x00090040, nullptr, "BeginRequest"}, + {0x000A0040, nullptr, "BeginRequestAsync"}, + {0x000B0082, nullptr, "ReceiveData"}, + {0x000C0102, nullptr, "ReceiveDataTimeout"}, + {0x000D0146, nullptr, "SetProxy"}, + {0x000E0040, nullptr, "SetProxyDefault"}, + {0x000F00C4, nullptr, "SetBasicAuthorization"}, + {0x00100080, nullptr, "SetSocketBufferSize"}, + {0x001100C4, nullptr, "AddRequestHeader"}, + {0x001200C4, nullptr, "AddPostDataAscii"}, + {0x001300C4, nullptr, "AddPostDataBinary"}, + {0x00140082, nullptr, "AddPostDataRaw"}, + {0x00150080, nullptr, "SetPostDataType"}, + {0x001600C4, nullptr, "SendPostDataAscii"}, + {0x00170144, nullptr, "SendPostDataAsciiTimeout"}, + {0x001800C4, nullptr, "SendPostDataBinary"}, + {0x00190144, nullptr, "SendPostDataBinaryTimeout"}, + {0x001A0082, nullptr, "SendPostDataRaw"}, + {0x001B0102, nullptr, "SendPOSTDataRawTimeout"}, + {0x001C0080, nullptr, "SetPostDataEncoding"}, + {0x001D0040, nullptr, "NotifyFinishSendPostData"}, + {0x001E00C4, nullptr, "GetResponseHeader"}, + {0x001F0144, nullptr, "GetResponseHeaderTimeout"}, + {0x00200082, nullptr, "GetResponseData"}, + {0x00210102, nullptr, "GetResponseDataTimeout"}, + {0x00220040, nullptr, "GetResponseStatusCode"}, + {0x002300C0, nullptr, "GetResponseStatusCodeTimeout"}, + {0x00240082, nullptr, "AddTrustedRootCA"}, + {0x00250080, nullptr, "AddDefaultCert"}, + {0x00260080, nullptr, "SelectRootCertChain"}, + {0x002700C4, nullptr, "SetClientCert"}, + {0x002B0080, nullptr, "SetSSLOpt"}, + {0x002C0080, nullptr, "SetSSLClearOpt"}, + {0x002D0000, nullptr, "CreateRootCertChain"}, + {0x002E0040, nullptr, "DestroyRootCertChain"}, + {0x002F0082, nullptr, "RootCertChainAddCert"}, + {0x00300080, nullptr, "RootCertChainAddDefaultCert"}, + {0x00350186, nullptr, "SetDefaultProxy"}, + {0x00360000, nullptr, "ClearDNSCache"}, + {0x00370080, nullptr, "SetKeepAlive"}, + {0x003800C0, nullptr, "SetPostDataTypeSize"}, + {0x00390000, nullptr, "Finalize"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/ir/ir.cpp b/src/core/hle/service/ir/ir.cpp index 079a87e48..fc048ae88 100644 --- a/src/core/hle/service/ir/ir.cpp +++ b/src/core/hle/service/ir/ir.cpp @@ -5,11 +5,11 @@ #include "core/hle/kernel/event.h" #include "core/hle/kernel/shared_memory.h" -#include "core/hle/service/service.h" #include "core/hle/service/ir/ir.h" #include "core/hle/service/ir/ir_rst.h" #include "core/hle/service/ir/ir_u.h" #include "core/hle/service/ir/ir_user.h" +#include "core/hle/service/service.h" namespace Service { namespace IR { @@ -32,14 +32,14 @@ void InitializeIrNopShared(Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 transfer_buff_size = cmd_buff[1]; - u32 recv_buff_size = cmd_buff[2]; - u32 unk1 = cmd_buff[3]; - u32 send_buff_size = cmd_buff[4]; - u32 unk2 = cmd_buff[5]; - u8 baud_rate = cmd_buff[6] & 0xFF; - Handle handle = cmd_buff[8]; - - if(Kernel::g_handle_table.IsValid(handle)) { + u32 recv_buff_size = cmd_buff[2]; + u32 unk1 = cmd_buff[3]; + u32 send_buff_size = cmd_buff[4]; + u32 unk2 = cmd_buff[5]; + u8 baud_rate = cmd_buff[6] & 0xFF; + Handle handle = cmd_buff[8]; + + if (Kernel::g_handle_table.IsValid(handle)) { transfer_shared_memory = Kernel::g_handle_table.Get(handle); transfer_shared_memory->name = "IR:TransferSharedMemory"; } @@ -47,7 +47,7 @@ void InitializeIrNopShared(Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; LOG_WARNING(Service_IR, "(STUBBED) called, transfer_buff_size=%d, recv_buff_size=%d, " - "unk1=%d, send_buff_size=%d, unk2=%d, baud_rate=%u, handle=0x%08X", + "unk1=%d, send_buff_size=%d, unk2=%d, baud_rate=%u, handle=0x%08X", transfer_buff_size, recv_buff_size, unk1, send_buff_size, unk2, baud_rate, handle); } @@ -94,13 +94,13 @@ void Init() { AddService(new IR_User_Interface); using Kernel::MemoryPermission; - shared_memory = SharedMemory::Create(nullptr, 0x1000, - Kernel::MemoryPermission::ReadWrite, Kernel::MemoryPermission::ReadWrite, - 0, Kernel::MemoryRegion::BASE, "IR:SharedMemory"); + shared_memory = SharedMemory::Create(nullptr, 0x1000, Kernel::MemoryPermission::ReadWrite, + Kernel::MemoryPermission::ReadWrite, 0, + Kernel::MemoryRegion::BASE, "IR:SharedMemory"); transfer_shared_memory = nullptr; // Create event handle(s) - handle_event = Event::Create(ResetType::OneShot, "IR:HandleEvent"); + handle_event = Event::Create(ResetType::OneShot, "IR:HandleEvent"); conn_status_event = Event::Create(ResetType::OneShot, "IR:ConnectionStatusEvent"); } diff --git a/src/core/hle/service/ir/ir_rst.cpp b/src/core/hle/service/ir/ir_rst.cpp index c0300f109..1f10ebd3d 100644 --- a/src/core/hle/service/ir/ir_rst.cpp +++ b/src/core/hle/service/ir/ir_rst.cpp @@ -9,10 +9,10 @@ namespace Service { namespace IR { const Interface::FunctionInfo FunctionTable[] = { - {0x00010000, GetHandles, "GetHandles"}, - {0x00020080, nullptr, "Initialize"}, - {0x00030000, nullptr, "Shutdown"}, - {0x00090000, nullptr, "WriteToTwoFields"}, + {0x00010000, GetHandles, "GetHandles"}, + {0x00020080, nullptr, "Initialize"}, + {0x00030000, nullptr, "Shutdown"}, + {0x00090000, nullptr, "WriteToTwoFields"}, }; IR_RST_Interface::IR_RST_Interface() { diff --git a/src/core/hle/service/ir/ir_u.cpp b/src/core/hle/service/ir/ir_u.cpp index 96f76cb83..be4049da9 100644 --- a/src/core/hle/service/ir/ir_u.cpp +++ b/src/core/hle/service/ir/ir_u.cpp @@ -8,24 +8,15 @@ namespace Service { namespace IR { const Interface::FunctionInfo FunctionTable[] = { - {0x00010000, nullptr, "Initialize"}, - {0x00020000, nullptr, "Shutdown"}, - {0x00030042, nullptr, "StartSendTransfer"}, - {0x00040000, nullptr, "WaitSendTransfer"}, - {0x000500C2, nullptr, "StartRecvTransfer"}, - {0x00060000, nullptr, "WaitRecvTransfer"}, - {0x00070080, nullptr, "GetRecvTransferCount"}, - {0x00080000, nullptr, "GetSendState"}, - {0x00090040, nullptr, "SetBitRate"}, - {0x000A0000, nullptr, "GetBitRate"}, - {0x000B0040, nullptr, "SetIRLEDState"}, - {0x000C0000, nullptr, "GetIRLEDRecvState"}, - {0x000D0000, nullptr, "GetSendFinishedEvent"}, - {0x000E0000, nullptr, "GetRecvFinishedEvent"}, - {0x000F0000, nullptr, "GetTransferState"}, - {0x00100000, nullptr, "GetErrorStatus"}, - {0x00110040, nullptr, "SetSleepModeActive"}, - {0x00120040, nullptr, "SetSleepModeState"}, + {0x00010000, nullptr, "Initialize"}, {0x00020000, nullptr, "Shutdown"}, + {0x00030042, nullptr, "StartSendTransfer"}, {0x00040000, nullptr, "WaitSendTransfer"}, + {0x000500C2, nullptr, "StartRecvTransfer"}, {0x00060000, nullptr, "WaitRecvTransfer"}, + {0x00070080, nullptr, "GetRecvTransferCount"}, {0x00080000, nullptr, "GetSendState"}, + {0x00090040, nullptr, "SetBitRate"}, {0x000A0000, nullptr, "GetBitRate"}, + {0x000B0040, nullptr, "SetIRLEDState"}, {0x000C0000, nullptr, "GetIRLEDRecvState"}, + {0x000D0000, nullptr, "GetSendFinishedEvent"}, {0x000E0000, nullptr, "GetRecvFinishedEvent"}, + {0x000F0000, nullptr, "GetTransferState"}, {0x00100000, nullptr, "GetErrorStatus"}, + {0x00110040, nullptr, "SetSleepModeActive"}, {0x00120040, nullptr, "SetSleepModeState"}, }; IR_U_Interface::IR_U_Interface() { diff --git a/src/core/hle/service/ir/ir_user.cpp b/src/core/hle/service/ir/ir_user.cpp index 06a601029..6cff1d544 100644 --- a/src/core/hle/service/ir/ir_user.cpp +++ b/src/core/hle/service/ir/ir_user.cpp @@ -9,32 +9,32 @@ namespace Service { namespace IR { const Interface::FunctionInfo FunctionTable[] = { - {0x00010182, nullptr, "InitializeIrNop"}, - {0x00020000, FinalizeIrNop, "FinalizeIrNop"}, - {0x00030000, nullptr, "ClearReceiveBuffer"}, - {0x00040000, nullptr, "ClearSendBuffer"}, - {0x000500C0, nullptr, "WaitConnection"}, - {0x00060040, RequireConnection, "RequireConnection"}, - {0x000702C0, nullptr, "AutoConnection"}, - {0x00080000, nullptr, "AnyConnection"}, - {0x00090000, Disconnect, "Disconnect"}, - {0x000A0000, nullptr, "GetReceiveEvent"}, - {0x000B0000, nullptr, "GetSendEvent"}, + {0x00010182, nullptr, "InitializeIrNop"}, + {0x00020000, FinalizeIrNop, "FinalizeIrNop"}, + {0x00030000, nullptr, "ClearReceiveBuffer"}, + {0x00040000, nullptr, "ClearSendBuffer"}, + {0x000500C0, nullptr, "WaitConnection"}, + {0x00060040, RequireConnection, "RequireConnection"}, + {0x000702C0, nullptr, "AutoConnection"}, + {0x00080000, nullptr, "AnyConnection"}, + {0x00090000, Disconnect, "Disconnect"}, + {0x000A0000, nullptr, "GetReceiveEvent"}, + {0x000B0000, nullptr, "GetSendEvent"}, {0x000C0000, GetConnectionStatusEvent, "GetConnectionStatusEvent"}, - {0x000D0042, nullptr, "SendIrNop"}, - {0x000E0042, nullptr, "SendIrNopLarge"}, - {0x000F0040, nullptr, "ReceiveIrnop"}, - {0x00100042, nullptr, "ReceiveIrnopLarge"}, - {0x00110040, nullptr, "GetLatestReceiveErrorResult"}, - {0x00120040, nullptr, "GetLatestSendErrorResult"}, - {0x00130000, nullptr, "GetConnectionStatus"}, - {0x00140000, nullptr, "GetTryingToConnectStatus"}, - {0x00150000, nullptr, "GetReceiveSizeFreeAndUsed"}, - {0x00160000, nullptr, "GetSendSizeFreeAndUsed"}, - {0x00170000, nullptr, "GetConnectionRole"}, - {0x00180182, InitializeIrNopShared, "InitializeIrNopShared"}, - {0x00190040, nullptr, "ReleaseReceivedData"}, - {0x001A0040, nullptr, "SetOwnMachineId"}, + {0x000D0042, nullptr, "SendIrNop"}, + {0x000E0042, nullptr, "SendIrNopLarge"}, + {0x000F0040, nullptr, "ReceiveIrnop"}, + {0x00100042, nullptr, "ReceiveIrnopLarge"}, + {0x00110040, nullptr, "GetLatestReceiveErrorResult"}, + {0x00120040, nullptr, "GetLatestSendErrorResult"}, + {0x00130000, nullptr, "GetConnectionStatus"}, + {0x00140000, nullptr, "GetTryingToConnectStatus"}, + {0x00150000, nullptr, "GetReceiveSizeFreeAndUsed"}, + {0x00160000, nullptr, "GetSendSizeFreeAndUsed"}, + {0x00170000, nullptr, "GetConnectionRole"}, + {0x00180182, InitializeIrNopShared, "InitializeIrNopShared"}, + {0x00190040, nullptr, "ReleaseReceivedData"}, + {0x001A0040, nullptr, "SetOwnMachineId"}, }; IR_User_Interface::IR_User_Interface() { diff --git a/src/core/hle/service/ldr_ro/cro_helper.cpp b/src/core/hle/service/ldr_ro/cro_helper.cpp index 3d2a613ee..5757a4e64 100644 --- a/src/core/hle/service/ldr_ro/cro_helper.cpp +++ b/src/core/hle/service/ldr_ro/cro_helper.cpp @@ -14,38 +14,29 @@ namespace LDR_RO { static const ResultCode ERROR_BUFFER_TOO_SMALL = // 0xE0E12C1F - ResultCode(static_cast(31), ErrorModule::RO, ErrorSummary::InvalidArgument, ErrorLevel::Usage); + ResultCode(static_cast(31), ErrorModule::RO, ErrorSummary::InvalidArgument, + ErrorLevel::Usage); static ResultCode CROFormatError(u32 description) { - return ResultCode(static_cast(description), ErrorModule::RO, ErrorSummary::WrongArgument, ErrorLevel::Permanent); + return ResultCode(static_cast(description), ErrorModule::RO, + ErrorSummary::WrongArgument, ErrorLevel::Permanent); } -const std::array CROHelper::ENTRY_SIZE {{ - 1, // code - 1, // data - 1, // module name - sizeof(SegmentEntry), - sizeof(ExportNamedSymbolEntry), - sizeof(ExportIndexedSymbolEntry), - 1, // export strings - sizeof(ExportTreeEntry), - sizeof(ImportModuleEntry), - sizeof(ExternalRelocationEntry), - sizeof(ImportNamedSymbolEntry), - sizeof(ImportIndexedSymbolEntry), - sizeof(ImportAnonymousSymbolEntry), - 1, // import strings - sizeof(StaticAnonymousSymbolEntry), - sizeof(InternalRelocationEntry), - sizeof(StaticRelocationEntry) -}}; - -const std::array CROHelper::FIX_BARRIERS {{ - Fix0Barrier, - Fix1Barrier, - Fix2Barrier, - Fix3Barrier -}}; +const std::array CROHelper::ENTRY_SIZE{ + {1, // code + 1, // data + 1, // module name + sizeof(SegmentEntry), sizeof(ExportNamedSymbolEntry), sizeof(ExportIndexedSymbolEntry), + 1, // export strings + sizeof(ExportTreeEntry), sizeof(ImportModuleEntry), sizeof(ExternalRelocationEntry), + sizeof(ImportNamedSymbolEntry), sizeof(ImportIndexedSymbolEntry), + sizeof(ImportAnonymousSymbolEntry), + 1, // import strings + sizeof(StaticAnonymousSymbolEntry), sizeof(InternalRelocationEntry), + sizeof(StaticRelocationEntry)}}; + +const std::array CROHelper::FIX_BARRIERS{ + {Fix0Barrier, Fix1Barrier, Fix2Barrier, Fix3Barrier}}; VAddr CROHelper::SegmentTagToAddress(SegmentTag segment_tag) const { u32 segment_num = GetField(SegmentNum); @@ -63,7 +54,7 @@ VAddr CROHelper::SegmentTagToAddress(SegmentTag segment_tag) const { } ResultCode CROHelper::ApplyRelocation(VAddr target_address, RelocationType relocation_type, - u32 addend, u32 symbol_address, u32 target_future_address) { + u32 addend, u32 symbol_address, u32 target_future_address) { switch (relocation_type) { case RelocationType::Nothing: @@ -124,7 +115,8 @@ ResultCode CROHelper::ApplyRelocationBatch(VAddr batch, u32 symbol_address, bool return CROFormatError(0x12); } - ResultCode result = ApplyRelocation(relocation_target, relocation.type, relocation.addend, symbol_address, relocation_target); + ResultCode result = ApplyRelocation(relocation_target, relocation.type, relocation.addend, + symbol_address, relocation_target); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying relocation %08X", result.raw); return result; @@ -167,7 +159,7 @@ VAddr CROHelper::FindExportNamedSymbol(const std::string& name) const { if (test_byte >= len) { next.raw = entry.left.raw; - } else if((name[test_byte] >> test_bit_in_byte) & 1) { + } else if ((name[test_byte] >> test_bit_in_byte) & 1) { next.raw = entry.right.raw; } else { next.raw = entry.left.raw; @@ -212,26 +204,13 @@ ResultCode CROHelper::RebaseHeader(u32 cro_size) { return error; // verifies that all offsets are in the correct order - constexpr std::array OFFSET_ORDER = {{ - CodeOffset, - ModuleNameOffset, - SegmentTableOffset, - ExportNamedSymbolTableOffset, - ExportTreeTableOffset, - ExportIndexedSymbolTableOffset, - ExportStringsOffset, - ImportModuleTableOffset, - ExternalRelocationTableOffset, - ImportNamedSymbolTableOffset, - ImportIndexedSymbolTableOffset, - ImportAnonymousSymbolTableOffset, - ImportStringsOffset, - StaticAnonymousSymbolTableOffset, - InternalRelocationTableOffset, - StaticRelocationTableOffset, - DataOffset, - FileSize - }}; + constexpr std::array OFFSET_ORDER = { + {CodeOffset, ModuleNameOffset, SegmentTableOffset, ExportNamedSymbolTableOffset, + ExportTreeTableOffset, ExportIndexedSymbolTableOffset, ExportStringsOffset, + ImportModuleTableOffset, ExternalRelocationTableOffset, ImportNamedSymbolTableOffset, + ImportIndexedSymbolTableOffset, ImportAnonymousSymbolTableOffset, ImportStringsOffset, + StaticAnonymousSymbolTableOffset, InternalRelocationTableOffset, + StaticRelocationTableOffset, DataOffset, FileSize}}; u32 prev_offset = GetField(OFFSET_ORDER[0]); u32 cur_offset; @@ -266,9 +245,9 @@ ResultCode CROHelper::RebaseHeader(u32 cro_size) { return RESULT_SUCCESS; } -ResultVal CROHelper::RebaseSegmentTable(u32 cro_size, - VAddr data_segment_address, u32 data_segment_size, - VAddr bss_segment_address, u32 bss_segment_size) { +ResultVal CROHelper::RebaseSegmentTable(u32 cro_size, VAddr data_segment_address, + u32 data_segment_size, VAddr bss_segment_address, + u32 bss_segment_size) { u32 prev_data_segment = 0; u32 segment_num = GetField(SegmentNum); @@ -309,8 +288,8 @@ ResultCode CROHelper::RebaseExportNamedSymbolTable() { if (entry.name_offset != 0) { entry.name_offset += module_address; - if (entry.name_offset < export_strings_offset - || entry.name_offset >= export_strings_end) { + if (entry.name_offset < export_strings_offset || + entry.name_offset >= export_strings_end) { return CROFormatError(0x11); } } @@ -337,9 +316,13 @@ ResultCode CROHelper::RebaseImportModuleTable() { VAddr import_strings_offset = GetField(ImportStringsOffset); VAddr import_strings_end = import_strings_offset + GetField(ImportStringsSize); VAddr import_indexed_symbol_table_offset = GetField(ImportIndexedSymbolTableOffset); - VAddr index_import_table_end = import_indexed_symbol_table_offset + GetField(ImportIndexedSymbolNum) * sizeof(ImportIndexedSymbolEntry); + VAddr index_import_table_end = + import_indexed_symbol_table_offset + + GetField(ImportIndexedSymbolNum) * sizeof(ImportIndexedSymbolEntry); VAddr import_anonymous_symbol_table_offset = GetField(ImportAnonymousSymbolTableOffset); - VAddr offset_import_table_end = import_anonymous_symbol_table_offset + GetField(ImportAnonymousSymbolNum) * sizeof(ImportAnonymousSymbolEntry); + VAddr offset_import_table_end = + import_anonymous_symbol_table_offset + + GetField(ImportAnonymousSymbolNum) * sizeof(ImportAnonymousSymbolEntry); u32 module_num = GetField(ImportModuleNum); for (u32 i = 0; i < module_num; ++i) { @@ -348,24 +331,24 @@ ResultCode CROHelper::RebaseImportModuleTable() { if (entry.name_offset != 0) { entry.name_offset += module_address; - if (entry.name_offset < import_strings_offset - || entry.name_offset >= import_strings_end) { + if (entry.name_offset < import_strings_offset || + entry.name_offset >= import_strings_end) { return CROFormatError(0x18); } } if (entry.import_indexed_symbol_table_offset != 0) { entry.import_indexed_symbol_table_offset += module_address; - if (entry.import_indexed_symbol_table_offset < import_indexed_symbol_table_offset - || entry.import_indexed_symbol_table_offset > index_import_table_end) { + if (entry.import_indexed_symbol_table_offset < import_indexed_symbol_table_offset || + entry.import_indexed_symbol_table_offset > index_import_table_end) { return CROFormatError(0x18); } } if (entry.import_anonymous_symbol_table_offset != 0) { entry.import_anonymous_symbol_table_offset += module_address; - if (entry.import_anonymous_symbol_table_offset < import_anonymous_symbol_table_offset - || entry.import_anonymous_symbol_table_offset > offset_import_table_end) { + if (entry.import_anonymous_symbol_table_offset < import_anonymous_symbol_table_offset || + entry.import_anonymous_symbol_table_offset > offset_import_table_end) { return CROFormatError(0x18); } } @@ -379,25 +362,27 @@ ResultCode CROHelper::RebaseImportNamedSymbolTable() { VAddr import_strings_offset = GetField(ImportStringsOffset); VAddr import_strings_end = import_strings_offset + GetField(ImportStringsSize); VAddr external_relocation_table_offset = GetField(ExternalRelocationTableOffset); - VAddr external_relocation_table_end = external_relocation_table_offset + GetField(ExternalRelocationNum) * sizeof(ExternalRelocationEntry); + VAddr external_relocation_table_end = + external_relocation_table_offset + + GetField(ExternalRelocationNum) * sizeof(ExternalRelocationEntry); u32 num = GetField(ImportNamedSymbolNum); - for (u32 i = 0; i < num ; ++i) { + for (u32 i = 0; i < num; ++i) { ImportNamedSymbolEntry entry; GetEntry(i, entry); if (entry.name_offset != 0) { entry.name_offset += module_address; - if (entry.name_offset < import_strings_offset - || entry.name_offset >= import_strings_end) { + if (entry.name_offset < import_strings_offset || + entry.name_offset >= import_strings_end) { return CROFormatError(0x1B); } } if (entry.relocation_batch_offset != 0) { entry.relocation_batch_offset += module_address; - if (entry.relocation_batch_offset < external_relocation_table_offset - || entry.relocation_batch_offset > external_relocation_table_end) { + if (entry.relocation_batch_offset < external_relocation_table_offset || + entry.relocation_batch_offset > external_relocation_table_end) { return CROFormatError(0x1B); } } @@ -409,17 +394,19 @@ ResultCode CROHelper::RebaseImportNamedSymbolTable() { ResultCode CROHelper::RebaseImportIndexedSymbolTable() { VAddr external_relocation_table_offset = GetField(ExternalRelocationTableOffset); - VAddr external_relocation_table_end = external_relocation_table_offset + GetField(ExternalRelocationNum) * sizeof(ExternalRelocationEntry); + VAddr external_relocation_table_end = + external_relocation_table_offset + + GetField(ExternalRelocationNum) * sizeof(ExternalRelocationEntry); u32 num = GetField(ImportIndexedSymbolNum); - for (u32 i = 0; i < num ; ++i) { + for (u32 i = 0; i < num; ++i) { ImportIndexedSymbolEntry entry; GetEntry(i, entry); if (entry.relocation_batch_offset != 0) { entry.relocation_batch_offset += module_address; - if (entry.relocation_batch_offset < external_relocation_table_offset - || entry.relocation_batch_offset > external_relocation_table_end) { + if (entry.relocation_batch_offset < external_relocation_table_offset || + entry.relocation_batch_offset > external_relocation_table_end) { return CROFormatError(0x14); } } @@ -431,17 +418,19 @@ ResultCode CROHelper::RebaseImportIndexedSymbolTable() { ResultCode CROHelper::RebaseImportAnonymousSymbolTable() { VAddr external_relocation_table_offset = GetField(ExternalRelocationTableOffset); - VAddr external_relocation_table_end = external_relocation_table_offset + GetField(ExternalRelocationNum) * sizeof(ExternalRelocationEntry); + VAddr external_relocation_table_end = + external_relocation_table_offset + + GetField(ExternalRelocationNum) * sizeof(ExternalRelocationEntry); u32 num = GetField(ImportAnonymousSymbolNum); - for (u32 i = 0; i < num ; ++i) { + for (u32 i = 0; i < num; ++i) { ImportAnonymousSymbolEntry entry; GetEntry(i, entry); if (entry.relocation_batch_offset != 0) { entry.relocation_batch_offset += module_address; - if (entry.relocation_batch_offset < external_relocation_table_offset - || entry.relocation_batch_offset > external_relocation_table_end) { + if (entry.relocation_batch_offset < external_relocation_table_offset || + entry.relocation_batch_offset > external_relocation_table_end) { return CROFormatError(0x17); } } @@ -475,7 +464,8 @@ ResultCode CROHelper::ResetExternalRelocations() { return CROFormatError(0x12); } - ResultCode result = ApplyRelocation(relocation_target, relocation.type, relocation.addend, unresolved_symbol, relocation_target); + ResultCode result = ApplyRelocation(relocation_target, relocation.type, relocation.addend, + unresolved_symbol, relocation_target); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying relocation %08X", result.raw); return result; @@ -528,23 +518,27 @@ ResultCode CROHelper::ClearExternalRelocations() { ResultCode CROHelper::ApplyStaticAnonymousSymbolToCRS(VAddr crs_address) { VAddr static_relocation_table_offset = GetField(StaticRelocationTableOffset); - VAddr static_relocation_table_end = static_relocation_table_offset + GetField(StaticRelocationNum) * sizeof(StaticRelocationEntry); + VAddr static_relocation_table_end = + static_relocation_table_offset + + GetField(StaticRelocationNum) * sizeof(StaticRelocationEntry); CROHelper crs(crs_address); u32 offset_export_num = GetField(StaticAnonymousSymbolNum); - LOG_INFO(Service_LDR, "CRO \"%s\" exports %d static anonymous symbols", ModuleName().data(), offset_export_num); + LOG_INFO(Service_LDR, "CRO \"%s\" exports %d static anonymous symbols", ModuleName().data(), + offset_export_num); for (u32 i = 0; i < offset_export_num; ++i) { StaticAnonymousSymbolEntry entry; GetEntry(i, entry); u32 batch_address = entry.relocation_batch_offset + module_address; - if (batch_address < static_relocation_table_offset - || batch_address > static_relocation_table_end) { + if (batch_address < static_relocation_table_offset || + batch_address > static_relocation_table_end) { return CROFormatError(0x16); } u32 symbol_address = SegmentTagToAddress(entry.symbol_position); - LOG_TRACE(Service_LDR, "CRO \"%s\" exports 0x%08X to the static module", ModuleName().data(), symbol_address); + LOG_TRACE(Service_LDR, "CRO \"%s\" exports 0x%08X to the static module", + ModuleName().data(), symbol_address); ResultCode result = crs.ApplyRelocationBatch(batch_address, symbol_address); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying relocation batch %08X", result.raw); @@ -571,7 +565,8 @@ ResultCode CROHelper::ApplyInternalRelocations(u32 old_data_segment_address) { if (target_segment.type == SegmentType::Data) { // If the relocation is to the .data segment, we need to relocate it in the old buffer - target_address = old_data_segment_address + relocation.target_position.offset_into_segment; + target_address = + old_data_segment_address + relocation.target_position.offset_into_segment; } else { target_address = target_addressB; } @@ -582,8 +577,10 @@ ResultCode CROHelper::ApplyInternalRelocations(u32 old_data_segment_address) { SegmentEntry symbol_segment; GetEntry(relocation.symbol_segment, symbol_segment); - LOG_TRACE(Service_LDR, "Internally relocates 0x%08X with 0x%08X", target_address, symbol_segment.offset); - ResultCode result = ApplyRelocation(target_address, relocation.type, relocation.addend, symbol_segment.offset, target_addressB); + LOG_TRACE(Service_LDR, "Internally relocates 0x%08X with 0x%08X", target_address, + symbol_segment.offset); + ResultCode result = ApplyRelocation(target_address, relocation.type, relocation.addend, + symbol_segment.offset, target_addressB); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying relocation %08X", result.raw); return result; @@ -734,25 +731,29 @@ ResultCode CROHelper::ApplyImportNamedSymbol(VAddr crs_address) { Memory::ReadBlock(relocation_addr, &relocation_entry, sizeof(ExternalRelocationEntry)); if (!relocation_entry.is_batch_resolved) { - ResultCode result = ForEachAutoLinkCRO(crs_address, [&](CROHelper source) -> ResultVal { - std::string symbol_name = Memory::ReadCString(entry.name_offset, import_strings_size); - u32 symbol_address = source.FindExportNamedSymbol(symbol_name); - - if (symbol_address != 0) { - LOG_TRACE(Service_LDR, "CRO \"%s\" imports \"%s\" from \"%s\"", - ModuleName().data(), symbol_name.data(), source.ModuleName().data()); - - ResultCode result = ApplyRelocationBatch(relocation_addr, symbol_address); - if (result.IsError()) { - LOG_ERROR(Service_LDR, "Error applying relocation batch %08X", result.raw); - return result; + ResultCode result = + ForEachAutoLinkCRO(crs_address, [&](CROHelper source) -> ResultVal { + std::string symbol_name = + Memory::ReadCString(entry.name_offset, import_strings_size); + u32 symbol_address = source.FindExportNamedSymbol(symbol_name); + + if (symbol_address != 0) { + LOG_TRACE(Service_LDR, "CRO \"%s\" imports \"%s\" from \"%s\"", + ModuleName().data(), symbol_name.data(), + source.ModuleName().data()); + + ResultCode result = ApplyRelocationBatch(relocation_addr, symbol_address); + if (result.IsError()) { + LOG_ERROR(Service_LDR, "Error applying relocation batch %08X", + result.raw); + return result; + } + + return MakeResult(false); } - return MakeResult(false); - } - - return MakeResult(true); - }); + return MakeResult(true); + }); if (result.IsError()) { return result; } @@ -777,7 +778,6 @@ ResultCode CROHelper::ResetImportNamedSymbol() { LOG_ERROR(Service_LDR, "Error reseting relocation batch %08X", result.raw); return result; } - } return RESULT_SUCCESS; } @@ -831,40 +831,47 @@ ResultCode CROHelper::ApplyModuleImport(VAddr crs_address) { GetEntry(i, entry); std::string want_cro_name = Memory::ReadCString(entry.name_offset, import_strings_size); - ResultCode result = ForEachAutoLinkCRO(crs_address, [&](CROHelper source) -> ResultVal { - if (want_cro_name == source.ModuleName()) { - LOG_INFO(Service_LDR, "CRO \"%s\" imports %d indexed symbols from \"%s\"", - ModuleName().data(), entry.import_indexed_symbol_num, source.ModuleName().data()); - for (u32 j = 0; j < entry.import_indexed_symbol_num; ++j) { - ImportIndexedSymbolEntry im; - entry.GetImportIndexedSymbolEntry(j, im); - ExportIndexedSymbolEntry ex; - source.GetEntry(im.index, ex); - u32 symbol_address = source.SegmentTagToAddress(ex.symbol_position); - LOG_TRACE(Service_LDR, " Imports 0x%08X", symbol_address); - ResultCode result = ApplyRelocationBatch(im.relocation_batch_offset, symbol_address); - if (result.IsError()) { - LOG_ERROR(Service_LDR, "Error applying relocation batch %08X", result.raw); - return result; + ResultCode result = + ForEachAutoLinkCRO(crs_address, [&](CROHelper source) -> ResultVal { + if (want_cro_name == source.ModuleName()) { + LOG_INFO(Service_LDR, "CRO \"%s\" imports %d indexed symbols from \"%s\"", + ModuleName().data(), entry.import_indexed_symbol_num, + source.ModuleName().data()); + for (u32 j = 0; j < entry.import_indexed_symbol_num; ++j) { + ImportIndexedSymbolEntry im; + entry.GetImportIndexedSymbolEntry(j, im); + ExportIndexedSymbolEntry ex; + source.GetEntry(im.index, ex); + u32 symbol_address = source.SegmentTagToAddress(ex.symbol_position); + LOG_TRACE(Service_LDR, " Imports 0x%08X", symbol_address); + ResultCode result = + ApplyRelocationBatch(im.relocation_batch_offset, symbol_address); + if (result.IsError()) { + LOG_ERROR(Service_LDR, "Error applying relocation batch %08X", + result.raw); + return result; + } } - } - LOG_INFO(Service_LDR, "CRO \"%s\" imports %d anonymous symbols from \"%s\"", - ModuleName().data(), entry.import_anonymous_symbol_num, source.ModuleName().data()); - for (u32 j = 0; j < entry.import_anonymous_symbol_num; ++j) { - ImportAnonymousSymbolEntry im; - entry.GetImportAnonymousSymbolEntry(j, im); - u32 symbol_address = source.SegmentTagToAddress(im.symbol_position); - LOG_TRACE(Service_LDR, " Imports 0x%08X", symbol_address); - ResultCode result = ApplyRelocationBatch(im.relocation_batch_offset, symbol_address); - if (result.IsError()) { - LOG_ERROR(Service_LDR, "Error applying relocation batch %08X", result.raw); - return result; + LOG_INFO(Service_LDR, "CRO \"%s\" imports %d anonymous symbols from \"%s\"", + ModuleName().data(), entry.import_anonymous_symbol_num, + source.ModuleName().data()); + for (u32 j = 0; j < entry.import_anonymous_symbol_num; ++j) { + ImportAnonymousSymbolEntry im; + entry.GetImportAnonymousSymbolEntry(j, im); + u32 symbol_address = source.SegmentTagToAddress(im.symbol_position); + LOG_TRACE(Service_LDR, " Imports 0x%08X", symbol_address); + ResultCode result = + ApplyRelocationBatch(im.relocation_batch_offset, symbol_address); + if (result.IsError()) { + LOG_ERROR(Service_LDR, "Error applying relocation batch %08X", + result.raw); + return result; + } } + return MakeResult(false); } - return MakeResult(false); - } - return MakeResult(true); - }); + return MakeResult(true); + }); if (result.IsError()) { return result; } @@ -873,8 +880,8 @@ ResultCode CROHelper::ApplyModuleImport(VAddr crs_address) { } ResultCode CROHelper::ApplyExportNamedSymbol(CROHelper target) { - LOG_DEBUG(Service_LDR, "CRO \"%s\" exports named symbols to \"%s\"", - ModuleName().data(), target.ModuleName().data()); + LOG_DEBUG(Service_LDR, "CRO \"%s\" exports named symbols to \"%s\"", ModuleName().data(), + target.ModuleName().data()); u32 target_import_strings_size = target.GetField(ImportStringsSize); u32 target_symbol_import_num = target.GetField(ImportNamedSymbolNum); for (u32 i = 0; i < target_symbol_import_num; ++i) { @@ -885,7 +892,8 @@ ResultCode CROHelper::ApplyExportNamedSymbol(CROHelper target) { Memory::ReadBlock(relocation_addr, &relocation_entry, sizeof(ExternalRelocationEntry)); if (!relocation_entry.is_batch_resolved) { - std::string symbol_name = Memory::ReadCString(entry.name_offset, target_import_strings_size); + std::string symbol_name = + Memory::ReadCString(entry.name_offset, target_import_strings_size); u32 symbol_address = FindExportNamedSymbol(symbol_name); if (symbol_address != 0) { LOG_TRACE(Service_LDR, " exports symbol \"%s\"", symbol_name.data()); @@ -901,8 +909,8 @@ ResultCode CROHelper::ApplyExportNamedSymbol(CROHelper target) { } ResultCode CROHelper::ResetExportNamedSymbol(CROHelper target) { - LOG_DEBUG(Service_LDR, "CRO \"%s\" unexports named symbols to \"%s\"", - ModuleName().data(), target.ModuleName().data()); + LOG_DEBUG(Service_LDR, "CRO \"%s\" unexports named symbols to \"%s\"", ModuleName().data(), + target.ModuleName().data()); u32 unresolved_symbol = target.GetOnUnresolvedAddress(); u32 target_import_strings_size = target.GetField(ImportStringsSize); u32 target_symbol_import_num = target.GetField(ImportNamedSymbolNum); @@ -914,11 +922,13 @@ ResultCode CROHelper::ResetExportNamedSymbol(CROHelper target) { Memory::ReadBlock(relocation_addr, &relocation_entry, sizeof(ExternalRelocationEntry)); if (relocation_entry.is_batch_resolved) { - std::string symbol_name = Memory::ReadCString(entry.name_offset, target_import_strings_size); + std::string symbol_name = + Memory::ReadCString(entry.name_offset, target_import_strings_size); u32 symbol_address = FindExportNamedSymbol(symbol_name); if (symbol_address != 0) { LOG_TRACE(Service_LDR, " unexports symbol \"%s\"", symbol_name.data()); - ResultCode result = target.ApplyRelocationBatch(relocation_addr, unresolved_symbol, true); + ResultCode result = + target.ApplyRelocationBatch(relocation_addr, unresolved_symbol, true); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying relocation batch %08X", result.raw); return result; @@ -940,8 +950,8 @@ ResultCode CROHelper::ApplyModuleExport(CROHelper target) { if (Memory::ReadCString(entry.name_offset, target_import_string_size) != module_name) continue; - LOG_INFO(Service_LDR, "CRO \"%s\" exports %d indexed symbols to \"%s\"", - module_name.data(), entry.import_indexed_symbol_num, target.ModuleName().data()); + LOG_INFO(Service_LDR, "CRO \"%s\" exports %d indexed symbols to \"%s\"", module_name.data(), + entry.import_indexed_symbol_num, target.ModuleName().data()); for (u32 j = 0; j < entry.import_indexed_symbol_num; ++j) { ImportIndexedSymbolEntry im; entry.GetImportIndexedSymbolEntry(j, im); @@ -949,7 +959,8 @@ ResultCode CROHelper::ApplyModuleExport(CROHelper target) { GetEntry(im.index, ex); u32 symbol_address = SegmentTagToAddress(ex.symbol_position); LOG_TRACE(Service_LDR, " exports symbol 0x%08X", symbol_address); - ResultCode result = target.ApplyRelocationBatch(im.relocation_batch_offset, symbol_address); + ResultCode result = + target.ApplyRelocationBatch(im.relocation_batch_offset, symbol_address); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying relocation batch %08X", result.raw); return result; @@ -957,13 +968,14 @@ ResultCode CROHelper::ApplyModuleExport(CROHelper target) { } LOG_INFO(Service_LDR, "CRO \"%s\" exports %d anonymous symbols to \"%s\"", - module_name.data(), entry.import_anonymous_symbol_num, target.ModuleName().data()); + module_name.data(), entry.import_anonymous_symbol_num, target.ModuleName().data()); for (u32 j = 0; j < entry.import_anonymous_symbol_num; ++j) { ImportAnonymousSymbolEntry im; entry.GetImportAnonymousSymbolEntry(j, im); u32 symbol_address = SegmentTagToAddress(im.symbol_position); LOG_TRACE(Service_LDR, " exports symbol 0x%08X", symbol_address); - ResultCode result = target.ApplyRelocationBatch(im.relocation_batch_offset, symbol_address); + ResultCode result = + target.ApplyRelocationBatch(im.relocation_batch_offset, symbol_address); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying relocation batch %08X", result.raw); return result; @@ -987,12 +999,13 @@ ResultCode CROHelper::ResetModuleExport(CROHelper target) { if (Memory::ReadCString(entry.name_offset, target_import_string_size) != module_name) continue; - LOG_DEBUG(Service_LDR, "CRO \"%s\" unexports indexed symbols to \"%s\"", - module_name.data(), target.ModuleName().data()); + LOG_DEBUG(Service_LDR, "CRO \"%s\" unexports indexed symbols to \"%s\"", module_name.data(), + target.ModuleName().data()); for (u32 j = 0; j < entry.import_indexed_symbol_num; ++j) { ImportIndexedSymbolEntry im; entry.GetImportIndexedSymbolEntry(j, im); - ResultCode result = target.ApplyRelocationBatch(im.relocation_batch_offset, unresolved_symbol, true); + ResultCode result = + target.ApplyRelocationBatch(im.relocation_batch_offset, unresolved_symbol, true); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying relocation batch %08X", result.raw); return result; @@ -1000,11 +1013,12 @@ ResultCode CROHelper::ResetModuleExport(CROHelper target) { } LOG_DEBUG(Service_LDR, "CRO \"%s\" unexports anonymous symbols to \"%s\"", - module_name.data(), target.ModuleName().data()); + module_name.data(), target.ModuleName().data()); for (u32 j = 0; j < entry.import_anonymous_symbol_num; ++j) { ImportAnonymousSymbolEntry im; entry.GetImportAnonymousSymbolEntry(j, im); - ResultCode result = target.ApplyRelocationBatch(im.relocation_batch_offset, unresolved_symbol, true); + ResultCode result = + target.ApplyRelocationBatch(im.relocation_batch_offset, unresolved_symbol, true); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying relocation batch %08X", result.raw); return result; @@ -1025,25 +1039,27 @@ ResultCode CROHelper::ApplyExitRelocations(VAddr crs_address) { ExternalRelocationEntry relocation_entry; Memory::ReadBlock(relocation_addr, &relocation_entry, sizeof(ExternalRelocationEntry)); - if (Memory::ReadCString(entry.name_offset, import_strings_size) == "__aeabi_atexit"){ - ResultCode result = ForEachAutoLinkCRO(crs_address, [&](CROHelper source) -> ResultVal { - u32 symbol_address = source.FindExportNamedSymbol("nnroAeabiAtexit_"); + if (Memory::ReadCString(entry.name_offset, import_strings_size) == "__aeabi_atexit") { + ResultCode result = + ForEachAutoLinkCRO(crs_address, [&](CROHelper source) -> ResultVal { + u32 symbol_address = source.FindExportNamedSymbol("nnroAeabiAtexit_"); - if (symbol_address != 0) { - LOG_DEBUG(Service_LDR, "CRO \"%s\" import exit function from \"%s\"", - ModuleName().data(), source.ModuleName().data()); + if (symbol_address != 0) { + LOG_DEBUG(Service_LDR, "CRO \"%s\" import exit function from \"%s\"", + ModuleName().data(), source.ModuleName().data()); - ResultCode result = ApplyRelocationBatch(relocation_addr, symbol_address); - if (result.IsError()) { - LOG_ERROR(Service_LDR, "Error applying relocation batch %08X", result.raw); - return result; - } + ResultCode result = ApplyRelocationBatch(relocation_addr, symbol_address); + if (result.IsError()) { + LOG_ERROR(Service_LDR, "Error applying relocation batch %08X", + result.raw); + return result; + } - return MakeResult(false); - } + return MakeResult(false); + } - return MakeResult(true); - }); + return MakeResult(true); + }); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error applying exit relocation %08X", result.raw); return result; @@ -1070,9 +1086,9 @@ static ResultCode VerifyStringTableLength(VAddr address, u32 size) { return RESULT_SUCCESS; } -ResultCode CROHelper::Rebase(VAddr crs_address, u32 cro_size, - VAddr data_segment_addresss, u32 data_segment_size, - VAddr bss_segment_address, u32 bss_segment_size, bool is_crs) { +ResultCode CROHelper::Rebase(VAddr crs_address, u32 cro_size, VAddr data_segment_addresss, + u32 data_segment_size, VAddr bss_segment_address, u32 bss_segment_size, + bool is_crs) { ResultCode result = RebaseHeader(cro_size); if (result.IsError()) { @@ -1088,9 +1104,8 @@ ResultCode CROHelper::Rebase(VAddr crs_address, u32 cro_size, u32 prev_data_segment_address = 0; if (!is_crs) { - auto result_val = RebaseSegmentTable(cro_size, - data_segment_addresss, data_segment_size, - bss_segment_address, bss_segment_size); + auto result_val = RebaseSegmentTable(cro_size, data_segment_addresss, data_segment_size, + bss_segment_address, bss_segment_size); if (result_val.Failed()) { LOG_ERROR(Service_LDR, "Error rebasing segment table %08X", result_val.Code().raw); return result_val.Code(); @@ -1374,7 +1389,8 @@ void CROHelper::Unregister(VAddr crs_address) { CROHelper next_head(crs.NextModule()), previous_head(crs.PreviousModule()); CROHelper next(NextModule()), previous(PreviousModule()); - if (module_address == next_head.module_address || module_address == previous_head.module_address) { + if (module_address == next_head.module_address || + module_address == previous_head.module_address) { // removing head if (next.module_address) { // the next is new head @@ -1400,7 +1416,8 @@ void CROHelper::Unregister(VAddr crs_address) { // let head's previous point to the new tail if (next_head.module_address && next_head.PreviousModule() == module_address) { next_head.SetPreviousModule(previous.module_address); - } else if (previous_head.module_address && previous_head.PreviousModule() == module_address) { + } else if (previous_head.module_address && + previous_head.PreviousModule() == module_address) { previous_head.SetPreviousModule(previous.module_address); } else { UNREACHABLE(); @@ -1419,9 +1436,9 @@ u32 CROHelper::GetFixEnd(u32 fix_level) const { u32 entry_size_i = 2; int field = ModuleNameOffset; while (true) { - end = std::max(end, - GetField(static_cast(field)) + - GetField(static_cast(field + 1)) * ENTRY_SIZE[entry_size_i]); + end = std::max(end, GetField(static_cast(field)) + + GetField(static_cast(field + 1)) * + ENTRY_SIZE[entry_size_i]); ++entry_size_i; field += 2; diff --git a/src/core/hle/service/ldr_ro/cro_helper.h b/src/core/hle/service/ldr_ro/cro_helper.h index 34e357afd..e4457d4be 100644 --- a/src/core/hle/service/ldr_ro/cro_helper.h +++ b/src/core/hle/service/ldr_ro/cro_helper.h @@ -10,8 +10,8 @@ #include "common/common_types.h" #include "common/swap.h" -#include "core/memory.h" #include "core/hle/result.h" +#include "core/memory.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace LDR_RO @@ -21,14 +21,17 @@ namespace LDR_RO { // GCC versions < 5.0 do not implement std::is_trivially_copyable. // Excluding MSVC because it has weird behaviour for std::is_trivially_copyable. #if (__GNUC__ >= 5) || defined(__clang__) - #define ASSERT_CRO_STRUCT(name, size) \ - static_assert(std::is_standard_layout::value, "CRO structure " #name " doesn't use standard layout"); \ - static_assert(std::is_trivially_copyable::value, "CRO structure " #name " isn't trivially copyable"); \ - static_assert(sizeof(name) == (size), "Unexpected struct size for CRO structure " #name) +#define ASSERT_CRO_STRUCT(name, size) \ + static_assert(std::is_standard_layout::value, \ + "CRO structure " #name " doesn't use standard layout"); \ + static_assert(std::is_trivially_copyable::value, \ + "CRO structure " #name " isn't trivially copyable"); \ + static_assert(sizeof(name) == (size), "Unexpected struct size for CRO structure " #name) #else - #define ASSERT_CRO_STRUCT(name, size) \ - static_assert(std::is_standard_layout::value, "CRO structure " #name " doesn't use standard layout"); \ - static_assert(sizeof(name) == (size), "Unexpected struct size for CRO structure " #name) +#define ASSERT_CRO_STRUCT(name, size) \ + static_assert(std::is_standard_layout::value, \ + "CRO structure " #name " doesn't use standard layout"); \ + static_assert(sizeof(name) == (size), "Unexpected struct size for CRO structure " #name) #endif static constexpr u32 CRO_HEADER_SIZE = 0x138; @@ -59,9 +62,9 @@ public: * @param is_crs true if the module itself is the static module * @returns ResultCode RESULT_SUCCESS on success, otherwise error code. */ - ResultCode Rebase(VAddr crs_address, u32 cro_size, - VAddr data_segment_addresss, u32 data_segment_size, - VAddr bss_segment_address, u32 bss_segment_size, bool is_crs); + ResultCode Rebase(VAddr crs_address, u32 cro_size, VAddr data_segment_addresss, + u32 data_segment_size, VAddr bss_segment_address, u32 bss_segment_size, + bool is_crs); /** * Unrebases the module. @@ -148,8 +151,10 @@ private: const VAddr module_address; ///< the virtual address of this module /** - * Each item in this enum represents a u32 field in the header begin from address+0x80, successively. - * We don't directly use a struct here, to avoid GetPointer, reinterpret_cast, or Read/WriteBlock repeatedly. + * Each item in this enum represents a u32 field in the header begin from address+0x80, + * successively. + * We don't directly use a struct here, to avoid GetPointer, reinterpret_cast, or + * Read/WriteBlock repeatedly. */ enum HeaderField { Magic = 0, @@ -208,18 +213,20 @@ private: Fix2Barrier = ImportModuleTableOffset, Fix1Barrier = StaticAnonymousSymbolTableOffset, }; - static_assert(Fix0Barrier == (CRO_HEADER_SIZE - CRO_HASH_SIZE) / 4, "CRO Header fields are wrong!"); + static_assert(Fix0Barrier == (CRO_HEADER_SIZE - CRO_HASH_SIZE) / 4, + "CRO Header fields are wrong!"); enum class SegmentType : u32 { - Code = 0, + Code = 0, ROData = 1, - Data = 2, - BSS = 3, + Data = 2, + BSS = 3, }; /** * Identifies a program location inside of a segment. - * Required to refer to program locations because individual segments may be relocated independently of each other. + * Required to refer to program locations because individual segments may be relocated + * independently of each other. */ union SegmentTag { u32_le raw; @@ -227,7 +234,8 @@ private: BitField<4, 28, u32_le> offset_into_segment; SegmentTag() = default; - explicit SegmentTag(u32 raw_) : raw(raw_) {} + explicit SegmentTag(u32 raw_) : raw(raw_) { + } }; /// Information of a segment in this module. @@ -282,7 +290,7 @@ private: /// Identifies an indexed symbol imported from another module. struct ImportIndexedSymbolEntry { - u32_le index; // index of an ExportIndexedSymbolEntry in the exporting module + u32_le index; // index of an ExportIndexedSymbolEntry in the exporting module u32_le relocation_batch_offset; // pointing to a relocation batch in ExternalRelocationTable static constexpr HeaderField TABLE_OFFSET_FIELD = ImportIndexedSymbolTableOffset; @@ -291,8 +299,8 @@ private: /// Identifies an anonymous symbol imported from another module. struct ImportAnonymousSymbolEntry { - SegmentTag symbol_position; // in the exporting segment - u32_le relocation_batch_offset; // pointing to a relocation batch in ExternalRelocationTable + SegmentTag symbol_position; // in the exporting segment + u32_le relocation_batch_offset; // pointing to a relocation batch in ExternalRelocationTable static constexpr HeaderField TABLE_OFFSET_FIELD = ImportAnonymousSymbolTableOffset; }; @@ -300,42 +308,47 @@ private: /// Information of a imported module and symbols imported from it. struct ImportModuleEntry { - u32_le name_offset; // pointing to a substring in ImportStrings - u32_le import_indexed_symbol_table_offset; // pointing to a subtable in ImportIndexedSymbolTable + u32_le name_offset; // pointing to a substring in ImportStrings + u32_le import_indexed_symbol_table_offset; // pointing to a subtable in + // ImportIndexedSymbolTable u32_le import_indexed_symbol_num; - u32_le import_anonymous_symbol_table_offset; // pointing to a subtable in ImportAnonymousSymbolTable + u32_le import_anonymous_symbol_table_offset; // pointing to a subtable in + // ImportAnonymousSymbolTable u32_le import_anonymous_symbol_num; static constexpr HeaderField TABLE_OFFSET_FIELD = ImportModuleTableOffset; void GetImportIndexedSymbolEntry(u32 index, ImportIndexedSymbolEntry& entry) { - Memory::ReadBlock(import_indexed_symbol_table_offset + index * sizeof(ImportIndexedSymbolEntry), - &entry, sizeof(ImportIndexedSymbolEntry)); + Memory::ReadBlock(import_indexed_symbol_table_offset + + index * sizeof(ImportIndexedSymbolEntry), + &entry, sizeof(ImportIndexedSymbolEntry)); } void GetImportAnonymousSymbolEntry(u32 index, ImportAnonymousSymbolEntry& entry) { - Memory::ReadBlock(import_anonymous_symbol_table_offset + index * sizeof(ImportAnonymousSymbolEntry), - &entry, sizeof(ImportAnonymousSymbolEntry)); + Memory::ReadBlock(import_anonymous_symbol_table_offset + + index * sizeof(ImportAnonymousSymbolEntry), + &entry, sizeof(ImportAnonymousSymbolEntry)); } }; ASSERT_CRO_STRUCT(ImportModuleEntry, 20); enum class RelocationType : u8 { - Nothing = 0, - AbsoluteAddress = 2, - RelativeAddress = 3, - ThumbBranch = 10, - ArmBranch = 28, - ModifyArmBranch = 29, - AbsoluteAddress2 = 38, + Nothing = 0, + AbsoluteAddress = 2, + RelativeAddress = 3, + ThumbBranch = 10, + ArmBranch = 28, + ModifyArmBranch = 29, + AbsoluteAddress2 = 38, AlignedRelativeAddress = 42, }; struct RelocationEntry { - SegmentTag target_position; // to self's segment as an ExternalRelocationEntry; to static module segment as a StaticRelocationEntry + SegmentTag target_position; // to self's segment as an ExternalRelocationEntry; to static + // module segment as a StaticRelocationEntry RelocationType type; u8 is_batch_end; - u8 is_batch_resolved; // set at a batch beginning if the batch is resolved + u8 is_batch_resolved; // set at a batch beginning if the batch is resolved INSERT_PADDING_BYTES(1); u32_le addend; }; @@ -366,8 +379,8 @@ private: /// Identifies a special static anonymous symbol (no game is known using this). struct StaticAnonymousSymbolEntry { - SegmentTag symbol_position; // to self's segment - u32_le relocation_batch_offset; // pointing to a relocation batch in StaticRelocationTable + SegmentTag symbol_position; // to self's segment + u32_le relocation_batch_offset; // pointing to a relocation batch in StaticRelocationTable static constexpr HeaderField TABLE_OFFSET_FIELD = StaticAnonymousSymbolTableOffset; }; @@ -446,12 +459,15 @@ private: } /** - * A helper function iterating over all registered auto-link modules, including the static module. + * A helper function iterating over all registered auto-link modules, including the static + * module. * @param crs_address the virtual address of the static module * @param func a function object to operate on a module. It accepts one parameter - * CROHelper and returns ResultVal. It should return true to continue the iteration, + * CROHelper and returns ResultVal. It should return true to continue the + * iteration, * false to stop the iteration, or an error code (which will also stop the iteration). - * @returns ResultCode indicating the result of the operation, RESULT_SUCCESS if all iteration success, + * @returns ResultCode indicating the result of the operation, RESULT_SUCCESS if all iteration + * success, * otherwise error code of the last iteration. */ template @@ -477,8 +493,8 @@ private: * Usually equals to target_address, but will be different for a target in .data segment * @returns ResultCode RESULT_SUCCESS on success, otherwise error code. */ - ResultCode ApplyRelocation(VAddr target_address, RelocationType relocation_type, - u32 addend, u32 symbol_address, u32 target_future_address); + ResultCode ApplyRelocation(VAddr target_address, RelocationType relocation_type, u32 addend, + u32 symbol_address, u32 target_future_address); /** * Clears a relocation to zero @@ -492,7 +508,8 @@ private: * Applies or resets a batch of relocations * @param batch the virtual address of the first relocation in the batch * @param symbol_address the symbol address to be relocated with - * @param reset false to set the batch to resolved state, true to reset the batch to unresolved state + * @param reset false to set the batch to resolved state, true to reset the batch to unresolved + * state * @returns ResultCode RESULT_SUCCESS on success, otherwise error code. */ ResultCode ApplyRelocationBatch(VAddr batch, u32 symbol_address, bool reset = false); @@ -507,7 +524,8 @@ private: /** * Rebases offsets in module header according to module address. * @param cro_size the size of the CRO file - * @returns ResultCode RESULT_SUCCESS if all offsets are verified as valid, otherwise error code. + * @returns ResultCode RESULT_SUCCESS if all offsets are verified as valid, otherwise error + * code. */ ResultCode RebaseHeader(u32 cro_size); @@ -520,43 +538,49 @@ private: * @param bss_segment_size the buffer size for .bss segment * @returns ResultVal with the virtual address of .data segment in CRO. */ - ResultVal RebaseSegmentTable(u32 cro_size, - VAddr data_segment_address, u32 data_segment_size, - VAddr bss_segment_address, u32 bss_segment_size); + ResultVal RebaseSegmentTable(u32 cro_size, VAddr data_segment_address, + u32 data_segment_size, VAddr bss_segment_address, + u32 bss_segment_size); /** * Rebases offsets in exported named symbol table according to module address. - * @returns ResultCode RESULT_SUCCESS if all offsets are verified as valid, otherwise error code. + * @returns ResultCode RESULT_SUCCESS if all offsets are verified as valid, otherwise error + * code. */ ResultCode RebaseExportNamedSymbolTable(); /** * Verifies indices in export tree table. - * @returns ResultCode RESULT_SUCCESS if all indices are verified as valid, otherwise error code. + * @returns ResultCode RESULT_SUCCESS if all indices are verified as valid, otherwise error + * code. */ ResultCode VerifyExportTreeTable() const; /** * Rebases offsets in exported module table according to module address. - * @returns ResultCode RESULT_SUCCESS if all offsets are verified as valid, otherwise error code. + * @returns ResultCode RESULT_SUCCESS if all offsets are verified as valid, otherwise error + * code. */ ResultCode RebaseImportModuleTable(); /** * Rebases offsets in imported named symbol table according to module address. - * @returns ResultCode RESULT_SUCCESS if all offsets are verified as valid, otherwise error code. + * @returns ResultCode RESULT_SUCCESS if all offsets are verified as valid, otherwise error + * code. */ ResultCode RebaseImportNamedSymbolTable(); /** * Rebases offsets in imported indexed symbol table according to module address. - * @returns ResultCode RESULT_SUCCESS if all offsets are verified as valid, otherwise error code. + * @returns ResultCode RESULT_SUCCESS if all offsets are verified as valid, otherwise error + * code. */ ResultCode RebaseImportIndexedSymbolTable(); /** * Rebases offsets in imported anonymous symbol table according to module address. - * @returns ResultCode RESULT_SUCCESS if all offsets are verified as valid, otherwise error code. + * @returns ResultCode RESULT_SUCCESS if all offsets are verified as valid, otherwise error + * code. */ ResultCode RebaseImportAnonymousSymbolTable(); @@ -621,7 +645,8 @@ private: void UnrebaseHeader(); /** - * Looks up all imported named symbols of this module in all registered auto-link modules, and resolves them if found. + * Looks up all imported named symbols of this module in all registered auto-link modules, and + * resolves them if found. * @param crs_address the virtual address of the static module * @returns ResultCode RESULT_SUCCESS on success, otherwise error code. */ @@ -646,7 +671,8 @@ private: ResultCode ResetImportAnonymousSymbol(); /** - * Finds registered auto-link modules that this module imports, and resolves indexed and anonymous symbols exported by them. + * Finds registered auto-link modules that this module imports, and resolves indexed and + * anonymous symbols exported by them. * @param crs_address the virtual address of the static module * @returns ResultCode RESULT_SUCCESS on success, otherwise error code. */ @@ -667,7 +693,8 @@ private: ResultCode ResetExportNamedSymbol(CROHelper target); /** - * Resolves imported indexed and anonymous symbols in the target module which imports this module. + * Resolves imported indexed and anonymous symbols in the target module which imports this + * module. * @param target the module to resolve. * @returns ResultCode RESULT_SUCCESS on success, otherwise error code. */ diff --git a/src/core/hle/service/ldr_ro/ldr_ro.cpp b/src/core/hle/service/ldr_ro/ldr_ro.cpp index 8ba73ea8d..ae5d3921f 100644 --- a/src/core/hle/service/ldr_ro/ldr_ro.cpp +++ b/src/core/hle/service/ldr_ro/ldr_ro.cpp @@ -18,24 +18,33 @@ namespace LDR_RO { -static const ResultCode ERROR_ALREADY_INITIALIZED = // 0xD9612FF9 - ResultCode(ErrorDescription::AlreadyInitialized, ErrorModule::RO, ErrorSummary::Internal, ErrorLevel::Permanent); -static const ResultCode ERROR_NOT_INITIALIZED = // 0xD9612FF8 - ResultCode(ErrorDescription::NotInitialized, ErrorModule::RO, ErrorSummary::Internal, ErrorLevel::Permanent); -static const ResultCode ERROR_BUFFER_TOO_SMALL = // 0xE0E12C1F - ResultCode(static_cast(31), ErrorModule::RO, ErrorSummary::InvalidArgument, ErrorLevel::Usage); -static const ResultCode ERROR_MISALIGNED_ADDRESS = // 0xD9012FF1 - ResultCode(ErrorDescription::MisalignedAddress, ErrorModule::RO, ErrorSummary::WrongArgument, ErrorLevel::Permanent); -static const ResultCode ERROR_MISALIGNED_SIZE = // 0xD9012FF2 - ResultCode(ErrorDescription::MisalignedSize, ErrorModule::RO, ErrorSummary::WrongArgument, ErrorLevel::Permanent); -static const ResultCode ERROR_ILLEGAL_ADDRESS = // 0xE1612C0F - ResultCode(static_cast(15), ErrorModule::RO, ErrorSummary::Internal, ErrorLevel::Usage); -static const ResultCode ERROR_INVALID_MEMORY_STATE = // 0xD8A12C08 - ResultCode(static_cast(8), ErrorModule::RO, ErrorSummary::InvalidState, ErrorLevel::Permanent); -static const ResultCode ERROR_NOT_LOADED = // 0xD8A12C0D - ResultCode(static_cast(13), ErrorModule::RO, ErrorSummary::InvalidState, ErrorLevel::Permanent); -static const ResultCode ERROR_INVALID_DESCRIPTOR = // 0xD9001830 - ResultCode(ErrorDescription::OS_InvalidBufferDescriptor, ErrorModule::OS, ErrorSummary::WrongArgument, ErrorLevel::Permanent); +static const ResultCode ERROR_ALREADY_INITIALIZED = // 0xD9612FF9 + ResultCode(ErrorDescription::AlreadyInitialized, ErrorModule::RO, ErrorSummary::Internal, + ErrorLevel::Permanent); +static const ResultCode ERROR_NOT_INITIALIZED = // 0xD9612FF8 + ResultCode(ErrorDescription::NotInitialized, ErrorModule::RO, ErrorSummary::Internal, + ErrorLevel::Permanent); +static const ResultCode ERROR_BUFFER_TOO_SMALL = // 0xE0E12C1F + ResultCode(static_cast(31), ErrorModule::RO, ErrorSummary::InvalidArgument, + ErrorLevel::Usage); +static const ResultCode ERROR_MISALIGNED_ADDRESS = // 0xD9012FF1 + ResultCode(ErrorDescription::MisalignedAddress, ErrorModule::RO, ErrorSummary::WrongArgument, + ErrorLevel::Permanent); +static const ResultCode ERROR_MISALIGNED_SIZE = // 0xD9012FF2 + ResultCode(ErrorDescription::MisalignedSize, ErrorModule::RO, ErrorSummary::WrongArgument, + ErrorLevel::Permanent); +static const ResultCode ERROR_ILLEGAL_ADDRESS = // 0xE1612C0F + ResultCode(static_cast(15), ErrorModule::RO, ErrorSummary::Internal, + ErrorLevel::Usage); +static const ResultCode ERROR_INVALID_MEMORY_STATE = // 0xD8A12C08 + ResultCode(static_cast(8), ErrorModule::RO, ErrorSummary::InvalidState, + ErrorLevel::Permanent); +static const ResultCode ERROR_NOT_LOADED = // 0xD8A12C0D + ResultCode(static_cast(13), ErrorModule::RO, ErrorSummary::InvalidState, + ErrorLevel::Permanent); +static const ResultCode ERROR_INVALID_DESCRIPTOR = // 0xD9001830 + ResultCode(ErrorDescription::OS_InvalidBufferDescriptor, ErrorModule::OS, + ErrorSummary::WrongArgument, ErrorLevel::Permanent); static MemorySynchronizer memory_synchronizer; @@ -44,10 +53,10 @@ static VAddr loaded_crs; ///< the virtual address of the static module static bool VerifyBufferState(VAddr buffer_ptr, u32 size) { auto vma = Kernel::g_current_process->vm_manager.FindVMA(buffer_ptr); - return vma != Kernel::g_current_process->vm_manager.vma_map.end() - && vma->second.base + vma->second.size >= buffer_ptr + size - && vma->second.permissions == Kernel::VMAPermission::ReadWrite - && vma->second.meminfo_state == Kernel::MemoryState::Private; + return vma != Kernel::g_current_process->vm_manager.vma_map.end() && + vma->second.base + vma->second.size >= buffer_ptr + size && + vma->second.permissions == Kernel::VMAPermission::ReadWrite && + vma->second.meminfo_state == Kernel::MemoryState::Private; } /** @@ -66,13 +75,14 @@ static bool VerifyBufferState(VAddr buffer_ptr, u32 size) { static void Initialize(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); VAddr crs_buffer_ptr = cmd_buff[1]; - u32 crs_size = cmd_buff[2]; - VAddr crs_address = cmd_buff[3]; - u32 descriptor = cmd_buff[4]; - u32 process = cmd_buff[5]; + u32 crs_size = cmd_buff[2]; + VAddr crs_address = cmd_buff[3]; + u32 descriptor = cmd_buff[4]; + u32 process = cmd_buff[5]; - LOG_DEBUG(Service_LDR, "called, crs_buffer_ptr=0x%08X, crs_address=0x%08X, crs_size=0x%X, descriptor=0x%08X, process=0x%08X", - crs_buffer_ptr, crs_address, crs_size, descriptor, process); + LOG_DEBUG(Service_LDR, "called, crs_buffer_ptr=0x%08X, crs_address=0x%08X, crs_size=0x%X, " + "descriptor=0x%08X, process=0x%08X", + crs_buffer_ptr, crs_address, crs_size, descriptor, process); if (descriptor != 0) { LOG_ERROR(Service_LDR, "IPC handle descriptor failed validation (0x%X)", descriptor); @@ -119,7 +129,8 @@ static void Initialize(Service::Interface* self) { return; } - if (crs_address < Memory::PROCESS_IMAGE_VADDR || crs_address + crs_size > Memory::PROCESS_IMAGE_VADDR_END) { + if (crs_address < Memory::PROCESS_IMAGE_VADDR || + crs_address + crs_size > Memory::PROCESS_IMAGE_VADDR_END) { LOG_ERROR(Service_LDR, "CRS mapping address is not in the process image region"); cmd_buff[1] = ERROR_ILLEGAL_ADDRESS.raw; return; @@ -131,14 +142,17 @@ static void Initialize(Service::Interface* self) { // TODO(wwylele): should be memory aliasing std::shared_ptr> crs_mem = std::make_shared>(crs_size); Memory::ReadBlock(crs_buffer_ptr, crs_mem->data(), crs_size); - result = Kernel::g_current_process->vm_manager.MapMemoryBlock(crs_address, crs_mem, 0, crs_size, Kernel::MemoryState::Code).Code(); + result = Kernel::g_current_process->vm_manager + .MapMemoryBlock(crs_address, crs_mem, 0, crs_size, Kernel::MemoryState::Code) + .Code(); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error mapping memory block %08X", result.raw); cmd_buff[1] = result.raw; return; } - result = Kernel::g_current_process->vm_manager.ReprotectRange(crs_address, crs_size, Kernel::VMAPermission::Read); + result = Kernel::g_current_process->vm_manager.ReprotectRange(crs_address, crs_size, + Kernel::VMAPermission::Read); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error reprotecting memory block %08X", result.raw); cmd_buff[1] = result.raw; @@ -186,9 +200,9 @@ static void Initialize(Service::Interface* self) { static void LoadCRR(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 crr_buffer_ptr = cmd_buff[1]; - u32 crr_size = cmd_buff[2]; - u32 descriptor = cmd_buff[3]; - u32 process = cmd_buff[4]; + u32 crr_size = cmd_buff[2]; + u32 descriptor = cmd_buff[3]; + u32 process = cmd_buff[4]; if (descriptor != 0) { LOG_ERROR(Service_LDR, "IPC handle descriptor failed validation (0x%X)", descriptor); @@ -200,7 +214,8 @@ static void LoadCRR(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(2, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_LDR, "(STUBBED) called, crr_buffer_ptr=0x%08X, crr_size=0x%08X, descriptor=0x%08X, process=0x%08X", + LOG_WARNING(Service_LDR, "(STUBBED) called, crr_buffer_ptr=0x%08X, crr_size=0x%08X, " + "descriptor=0x%08X, process=0x%08X", crr_buffer_ptr, crr_size, descriptor, process); } @@ -218,8 +233,8 @@ static void LoadCRR(Service::Interface* self) { static void UnloadCRR(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 crr_buffer_ptr = cmd_buff[1]; - u32 descriptor = cmd_buff[2]; - u32 process = cmd_buff[3]; + u32 descriptor = cmd_buff[2]; + u32 process = cmd_buff[3]; if (descriptor != 0) { LOG_ERROR(Service_LDR, "IPC handle descriptor failed validation (0x%X)", descriptor); @@ -231,7 +246,8 @@ static void UnloadCRR(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(3, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_LDR, "(STUBBED) called, crr_buffer_ptr=0x%08X, descriptor=0x%08X, process=0x%08X", + LOG_WARNING(Service_LDR, + "(STUBBED) called, crr_buffer_ptr=0x%08X, descriptor=0x%08X, process=0x%08X", crr_buffer_ptr, descriptor, process); } @@ -263,27 +279,28 @@ static void UnloadCRR(Service::Interface* self) { */ static void LoadCRO(Service::Interface* self, bool link_on_load_bug_fix) { u32* cmd_buff = Kernel::GetCommandBuffer(); - VAddr cro_buffer_ptr = cmd_buff[1]; - VAddr cro_address = cmd_buff[2]; - u32 cro_size = cmd_buff[3]; + VAddr cro_buffer_ptr = cmd_buff[1]; + VAddr cro_address = cmd_buff[2]; + u32 cro_size = cmd_buff[3]; VAddr data_segment_address = cmd_buff[4]; - u32 zero = cmd_buff[5]; - u32 data_segment_size = cmd_buff[6]; - u32 bss_segment_address = cmd_buff[7]; - u32 bss_segment_size = cmd_buff[8]; - bool auto_link = (cmd_buff[9] & 0xFF) != 0; - u32 fix_level = cmd_buff[10]; - VAddr crr_address = cmd_buff[11]; - u32 descriptor = cmd_buff[12]; - u32 process = cmd_buff[13]; - - LOG_DEBUG(Service_LDR, "called (%s), cro_buffer_ptr=0x%08X, cro_address=0x%08X, cro_size=0x%X, " - "data_segment_address=0x%08X, zero=%d, data_segment_size=0x%X, bss_segment_address=0x%08X, bss_segment_size=0x%X, " - "auto_link=%s, fix_level=%d, crr_address=0x%08X, descriptor=0x%08X, process=0x%08X", - link_on_load_bug_fix ? "new" : "old", cro_buffer_ptr, cro_address, cro_size, - data_segment_address, zero, data_segment_size, bss_segment_address, bss_segment_size, - auto_link ? "true" : "false", fix_level, crr_address, descriptor, process - ); + u32 zero = cmd_buff[5]; + u32 data_segment_size = cmd_buff[6]; + u32 bss_segment_address = cmd_buff[7]; + u32 bss_segment_size = cmd_buff[8]; + bool auto_link = (cmd_buff[9] & 0xFF) != 0; + u32 fix_level = cmd_buff[10]; + VAddr crr_address = cmd_buff[11]; + u32 descriptor = cmd_buff[12]; + u32 process = cmd_buff[13]; + + LOG_DEBUG(Service_LDR, + "called (%s), cro_buffer_ptr=0x%08X, cro_address=0x%08X, cro_size=0x%X, " + "data_segment_address=0x%08X, zero=%d, data_segment_size=0x%X, " + "bss_segment_address=0x%08X, bss_segment_size=0x%X, " + "auto_link=%s, fix_level=%d, crr_address=0x%08X, descriptor=0x%08X, process=0x%08X", + link_on_load_bug_fix ? "new" : "old", cro_buffer_ptr, cro_address, cro_size, + data_segment_address, zero, data_segment_size, bss_segment_address, bss_segment_size, + auto_link ? "true" : "false", fix_level, crr_address, descriptor, process); if (descriptor != 0) { LOG_ERROR(Service_LDR, "IPC handle descriptor failed validation (0x%X)", descriptor); @@ -330,8 +347,8 @@ static void LoadCRO(Service::Interface* self, bool link_on_load_bug_fix) { return; } - if (cro_address < Memory::PROCESS_IMAGE_VADDR - || cro_address + cro_size > Memory::PROCESS_IMAGE_VADDR_END) { + if (cro_address < Memory::PROCESS_IMAGE_VADDR || + cro_address + cro_size > Memory::PROCESS_IMAGE_VADDR_END) { LOG_ERROR(Service_LDR, "CRO mapping address is not in the process image region"); cmd_buff[1] = ERROR_ILLEGAL_ADDRESS.raw; return; @@ -339,7 +356,9 @@ static void LoadCRO(Service::Interface* self, bool link_on_load_bug_fix) { if (zero) { LOG_ERROR(Service_LDR, "Zero is not zero %d", zero); - cmd_buff[1] = ResultCode(static_cast(29), ErrorModule::RO, ErrorSummary::Internal, ErrorLevel::Usage).raw; + cmd_buff[1] = ResultCode(static_cast(29), ErrorModule::RO, + ErrorSummary::Internal, ErrorLevel::Usage) + .raw; return; } @@ -349,14 +368,17 @@ static void LoadCRO(Service::Interface* self, bool link_on_load_bug_fix) { // TODO(wwylele): should be memory aliasing std::shared_ptr> cro_mem = std::make_shared>(cro_size); Memory::ReadBlock(cro_buffer_ptr, cro_mem->data(), cro_size); - result = Kernel::g_current_process->vm_manager.MapMemoryBlock(cro_address, cro_mem, 0, cro_size, Kernel::MemoryState::Code).Code(); + result = Kernel::g_current_process->vm_manager + .MapMemoryBlock(cro_address, cro_mem, 0, cro_size, Kernel::MemoryState::Code) + .Code(); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error mapping memory block %08X", result.raw); cmd_buff[1] = result.raw; return; } - result = Kernel::g_current_process->vm_manager.ReprotectRange(cro_address, cro_size, Kernel::VMAPermission::Read); + result = Kernel::g_current_process->vm_manager.ReprotectRange(cro_address, cro_size, + Kernel::VMAPermission::Read); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error reprotecting memory block %08X", result.raw); Kernel::g_current_process->vm_manager.UnmapRange(cro_address, cro_size); @@ -384,7 +406,8 @@ static void LoadCRO(Service::Interface* self, bool link_on_load_bug_fix) { return; } - result = cro.Rebase(loaded_crs, cro_size, data_segment_address, data_segment_size, bss_segment_address, bss_segment_size, false); + result = cro.Rebase(loaded_crs, cro_size, data_segment_address, data_segment_size, + bss_segment_address, bss_segment_size, false); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error rebasing CRO %08X", result.raw); Kernel::g_current_process->vm_manager.UnmapRange(cro_address, cro_size); @@ -409,7 +432,8 @@ static void LoadCRO(Service::Interface* self, bool link_on_load_bug_fix) { // TODO(wwylele): verify the behaviour when buffer_ptr == address if (cro_buffer_ptr != cro_address) { if (fix_size != cro_size) { - result = Kernel::g_current_process->vm_manager.UnmapRange(cro_address + fix_size, cro_size - fix_size); + result = Kernel::g_current_process->vm_manager.UnmapRange(cro_address + fix_size, + cro_size - fix_size); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error unmapping memory block %08X", result.raw); Kernel::g_current_process->vm_manager.UnmapRange(cro_address, cro_size); @@ -426,7 +450,8 @@ static void LoadCRO(Service::Interface* self, bool link_on_load_bug_fix) { u32 exe_size; std::tie(exe_begin, exe_size) = cro.GetExecutablePages(); if (exe_begin) { - result = Kernel::g_current_process->vm_manager.ReprotectRange(exe_begin, exe_size, Kernel::VMAPermission::ReadExecute); + result = Kernel::g_current_process->vm_manager.ReprotectRange( + exe_begin, exe_size, Kernel::VMAPermission::ReadExecute); if (result.IsError()) { LOG_ERROR(Service_LDR, "Error reprotecting memory block %08X", result.raw); Kernel::g_current_process->vm_manager.UnmapRange(cro_address, fix_size); @@ -437,8 +462,8 @@ static void LoadCRO(Service::Interface* self, bool link_on_load_bug_fix) { Core::g_app_core->ClearInstructionCache(); - LOG_INFO(Service_LDR, "CRO \"%s\" loaded at 0x%08X, fixed_end=0x%08X", - cro.ModuleName().data(), cro_address, cro_address+fix_size); + LOG_INFO(Service_LDR, "CRO \"%s\" loaded at 0x%08X, fixed_end=0x%08X", cro.ModuleName().data(), + cro_address, cro_address + fix_size); cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = fix_size; @@ -464,14 +489,15 @@ static void LoadCRO(Service::Interface* self) { */ static void UnloadCRO(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - VAddr cro_address = cmd_buff[1]; - u32 zero = cmd_buff[2]; - VAddr cro_buffer_ptr = cmd_buff[3]; - u32 descriptor = cmd_buff[4]; - u32 process = cmd_buff[5]; + VAddr cro_address = cmd_buff[1]; + u32 zero = cmd_buff[2]; + VAddr cro_buffer_ptr = cmd_buff[3]; + u32 descriptor = cmd_buff[4]; + u32 process = cmd_buff[5]; - LOG_DEBUG(Service_LDR, "called, cro_address=0x%08X, zero=%d, cro_buffer_ptr=0x%08X, descriptor=0x%08X, process=0x%08X", - cro_address, zero, cro_buffer_ptr, descriptor, process); + LOG_DEBUG(Service_LDR, "called, cro_address=0x%08X, zero=%d, cro_buffer_ptr=0x%08X, " + "descriptor=0x%08X, process=0x%08X", + cro_address, zero, cro_buffer_ptr, descriptor, process); if (descriptor != 0) { LOG_ERROR(Service_LDR, "IPC handle descriptor failed validation (0x%X)", descriptor); @@ -558,11 +584,11 @@ static void UnloadCRO(Service::Interface* self) { static void LinkCRO(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); VAddr cro_address = cmd_buff[1]; - u32 descriptor = cmd_buff[2]; - u32 process = cmd_buff[3]; + u32 descriptor = cmd_buff[2]; + u32 process = cmd_buff[3]; LOG_DEBUG(Service_LDR, "called, cro_address=0x%08X, descriptor=0x%08X, process=0x%08X", - cro_address, descriptor, process); + cro_address, descriptor, process); if (descriptor != 0) { LOG_ERROR(Service_LDR, "IPC handle descriptor failed validation (0x%X)", descriptor); @@ -620,11 +646,11 @@ static void LinkCRO(Service::Interface* self) { static void UnlinkCRO(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); VAddr cro_address = cmd_buff[1]; - u32 descriptor = cmd_buff[2]; - u32 process = cmd_buff[3]; + u32 descriptor = cmd_buff[2]; + u32 process = cmd_buff[3]; LOG_DEBUG(Service_LDR, "called, cro_address=0x%08X, descriptor=0x%08X, process=0x%08X", - cro_address, descriptor, process); + cro_address, descriptor, process); if (descriptor != 0) { LOG_ERROR(Service_LDR, "IPC handle descriptor failed validation (0x%X)", descriptor); @@ -682,11 +708,11 @@ static void UnlinkCRO(Service::Interface* self) { static void Shutdown(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); VAddr crs_buffer_ptr = cmd_buff[1]; - u32 descriptor = cmd_buff[2]; - u32 process = cmd_buff[3]; + u32 descriptor = cmd_buff[2]; + u32 process = cmd_buff[3]; LOG_DEBUG(Service_LDR, "called, crs_buffer_ptr=0x%08X, descriptor=0x%08X, process=0x%08X", - crs_buffer_ptr, descriptor, process); + crs_buffer_ptr, descriptor, process); if (descriptor != 0) { LOG_ERROR(Service_LDR, "IPC handle descriptor failed validation (0x%X)", descriptor); @@ -724,15 +750,11 @@ static void Shutdown(Service::Interface* self) { } const Interface::FunctionInfo FunctionTable[] = { - {0x000100C2, Initialize, "Initialize"}, - {0x00020082, LoadCRR, "LoadCRR"}, - {0x00030042, UnloadCRR, "UnloadCRR"}, - {0x000402C2, LoadCRO, "LoadCRO"}, - {0x000500C2, UnloadCRO, "UnloadCRO"}, - {0x00060042, LinkCRO, "LinkCRO"}, - {0x00070042, UnlinkCRO, "UnlinkCRO"}, - {0x00080042, Shutdown, "Shutdown"}, - {0x000902C2, LoadCRO, "LoadCRO_New"}, + {0x000100C2, Initialize, "Initialize"}, {0x00020082, LoadCRR, "LoadCRR"}, + {0x00030042, UnloadCRR, "UnloadCRR"}, {0x000402C2, LoadCRO, "LoadCRO"}, + {0x000500C2, UnloadCRO, "UnloadCRO"}, {0x00060042, LinkCRO, "LinkCRO"}, + {0x00070042, UnlinkCRO, "UnlinkCRO"}, {0x00080042, Shutdown, "Shutdown"}, + {0x000902C2, LoadCRO, "LoadCRO_New"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/ldr_ro/memory_synchronizer.cpp b/src/core/hle/service/ldr_ro/memory_synchronizer.cpp index 4402876e6..aed6d3365 100644 --- a/src/core/hle/service/ldr_ro/memory_synchronizer.cpp +++ b/src/core/hle/service/ldr_ro/memory_synchronizer.cpp @@ -14,9 +14,8 @@ namespace LDR_RO { auto MemorySynchronizer::FindMemoryBlock(VAddr mapping, VAddr original) { - auto block = std::find_if(memory_blocks.begin(), memory_blocks.end(), [=](MemoryBlock& b){ - return b.original == original; - }); + auto block = std::find_if(memory_blocks.begin(), memory_blocks.end(), + [=](MemoryBlock& b) { return b.original == original; }); ASSERT(block->mapping == mapping); return block; } diff --git a/src/core/hle/service/mic_u.cpp b/src/core/hle/service/mic_u.cpp index f792bc9cd..edd1ea97b 100644 --- a/src/core/hle/service/mic_u.cpp +++ b/src/core/hle/service/mic_u.cpp @@ -10,22 +10,22 @@ namespace MIC_U { const Interface::FunctionInfo FunctionTable[] = { - {0x00010042, nullptr, "MapSharedMem"}, - {0x00020000, nullptr, "UnmapSharedMem"}, - {0x00030140, nullptr, "Initialize"}, - {0x00040040, nullptr, "AdjustSampling"}, - {0x00050000, nullptr, "StopSampling"}, - {0x00060000, nullptr, "IsSampling"}, - {0x00070000, nullptr, "GetEventHandle"}, - {0x00080040, nullptr, "SetGain"}, - {0x00090000, nullptr, "GetGain"}, - {0x000A0040, nullptr, "SetPower"}, - {0x000B0000, nullptr, "GetPower"}, - {0x000C0042, nullptr, "size"}, - {0x000D0040, nullptr, "SetClamp"}, - {0x000E0000, nullptr, "GetClamp"}, - {0x000F0040, nullptr, "SetAllowShellClosed"}, - {0x00100040, nullptr, "unknown_input2"}, + {0x00010042, nullptr, "MapSharedMem"}, + {0x00020000, nullptr, "UnmapSharedMem"}, + {0x00030140, nullptr, "Initialize"}, + {0x00040040, nullptr, "AdjustSampling"}, + {0x00050000, nullptr, "StopSampling"}, + {0x00060000, nullptr, "IsSampling"}, + {0x00070000, nullptr, "GetEventHandle"}, + {0x00080040, nullptr, "SetGain"}, + {0x00090000, nullptr, "GetGain"}, + {0x000A0040, nullptr, "SetPower"}, + {0x000B0000, nullptr, "GetPower"}, + {0x000C0042, nullptr, "size"}, + {0x000D0040, nullptr, "SetClamp"}, + {0x000E0000, nullptr, "GetClamp"}, + {0x000F0040, nullptr, "SetAllowShellClosed"}, + {0x00100040, nullptr, "unknown_input2"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/ndm/ndm.cpp b/src/core/hle/service/ndm/ndm.cpp index bc9c3413d..9f1536aef 100644 --- a/src/core/hle/service/ndm/ndm.cpp +++ b/src/core/hle/service/ndm/ndm.cpp @@ -2,23 +2,21 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/ndm/ndm.h" #include "common/common_types.h" #include "common/logging/log.h" -#include "core/hle/service/service.h" -#include "core/hle/service/ndm/ndm.h" #include "core/hle/service/ndm/ndm_u.h" +#include "core/hle/service/service.h" namespace Service { namespace NDM { -enum : u32 { - DEFAULT_RETRY_INTERVAL = 10, - DEFAULT_SCAN_INTERVAL = 30 -}; +enum : u32 { DEFAULT_RETRY_INTERVAL = 10, DEFAULT_SCAN_INTERVAL = 30 }; static DaemonMask daemon_bit_mask = DaemonMask::Default; static DaemonMask default_daemon_bit_mask = DaemonMask::Default; -static std::array daemon_status = { DaemonStatus::Idle, DaemonStatus::Idle, DaemonStatus::Idle, DaemonStatus::Idle }; +static std::array daemon_status = {DaemonStatus::Idle, DaemonStatus::Idle, + DaemonStatus::Idle, DaemonStatus::Idle}; static ExclusiveState exclusive_state = ExclusiveState::None; static u32 scan_interval = DEFAULT_SCAN_INTERVAL; static u32 retry_interval = DEFAULT_RETRY_INTERVAL; @@ -72,7 +70,8 @@ void UnlockState(Service::Interface* self) { void SuspendDaemons(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 bit_mask = cmd_buff[1] & 0xF; - daemon_bit_mask = static_cast(static_cast(default_daemon_bit_mask) & ~bit_mask); + daemon_bit_mask = + static_cast(static_cast(default_daemon_bit_mask) & ~bit_mask); for (size_t index = 0; index < daemon_status.size(); ++index) { if (bit_mask & (1 << index)) { daemon_status[index] = DaemonStatus::Suspended; @@ -229,8 +228,7 @@ void Init() { } void Shutdown() { - } -}// namespace NDM -}// namespace Service +} // namespace NDM +} // namespace Service diff --git a/src/core/hle/service/ndm/ndm.h b/src/core/hle/service/ndm/ndm.h index 5c2b968dc..fb574541d 100644 --- a/src/core/hle/service/ndm/ndm.h +++ b/src/core/hle/service/ndm/ndm.h @@ -12,36 +12,26 @@ class Interface; namespace NDM { -enum class Daemon : u32 { - Cec = 0, - Boss = 1, - Nim = 2, - Friend = 3 -}; +enum class Daemon : u32 { Cec = 0, Boss = 1, Nim = 2, Friend = 3 }; enum class DaemonMask : u32 { - None = 0, - Cec = (1 << static_cast(Daemon::Cec)), - Boss = (1 << static_cast(Daemon::Boss)), - Nim = (1 << static_cast(Daemon::Nim)), - Friend = (1 << static_cast(Daemon::Friend)), + None = 0, + Cec = (1 << static_cast(Daemon::Cec)), + Boss = (1 << static_cast(Daemon::Boss)), + Nim = (1 << static_cast(Daemon::Nim)), + Friend = (1 << static_cast(Daemon::Friend)), Default = Cec | Friend, - All = Cec | Boss | Nim | Friend + All = Cec | Boss | Nim | Friend }; -enum class DaemonStatus : u32 { - Busy = 0, - Idle = 1, - Suspending = 2, - Suspended = 3 -}; +enum class DaemonStatus : u32 { Busy = 0, Idle = 1, Suspending = 2, Suspended = 3 }; enum class ExclusiveState : u32 { - None = 0, - Infrastructure = 1, + None = 0, + Infrastructure = 1, LocalCommunications = 2, - Streetpass = 3, - StreetpassData = 4, + Streetpass = 3, + StreetpassData = 4, }; /** @@ -205,7 +195,6 @@ void SetRetryInterval(Service::Interface* self); */ void GetRetryInterval(Service::Interface* self); - /** * NDM::OverrideDefaultDaemons service function * Inputs: @@ -233,7 +222,8 @@ void ResetDefaultDaemons(Service::Interface* self); * 1 : Result, 0 on success, otherwise error code * 2 : Daemon bit mask * Note: - * Gets the current default daemon bit mask. The default value is (DAEMONMASK_CEC | DAEMONMASK_FRIENDS) + * Gets the current default daemon bit mask. The default value is (DAEMONMASK_CEC | + * DAEMONMASK_FRIENDS) */ void GetDefaultDaemons(Service::Interface* self); @@ -252,5 +242,5 @@ void Init(); /// Shutdown NDM service void Shutdown(); -}// namespace NDM -}// namespace Service +} // namespace NDM +} // namespace Service diff --git a/src/core/hle/service/ndm/ndm_u.cpp b/src/core/hle/service/ndm/ndm_u.cpp index 3ff0744ee..f5c7a341a 100644 --- a/src/core/hle/service/ndm/ndm_u.cpp +++ b/src/core/hle/service/ndm/ndm_u.cpp @@ -9,28 +9,28 @@ namespace Service { namespace NDM { const Interface::FunctionInfo FunctionTable[] = { - {0x00010042, EnterExclusiveState, "EnterExclusiveState"}, - {0x00020002, LeaveExclusiveState, "LeaveExclusiveState"}, - {0x00030000, QueryExclusiveMode, "QueryExclusiveMode"}, - {0x00040002, LockState, "LockState"}, - {0x00050002, UnlockState, "UnlockState"}, - {0x00060040, SuspendDaemons, "SuspendDaemons"}, - {0x00070040, ResumeDaemons, "ResumeDaemons"}, - {0x00080040, SuspendScheduler, "SuspendScheduler"}, - {0x00090000, ResumeScheduler, "ResumeScheduler"}, - {0x000A0000, nullptr, "GetCurrentState"}, - {0x000B0000, nullptr, "GetTargetState"}, - {0x000C0000, nullptr, ""}, - {0x000D0040, QueryStatus, "QueryStatus"}, - {0x000E0040, GetDaemonDisableCount, "GetDaemonDisableCount"}, - {0x000F0000, GetSchedulerDisableCount,"GetSchedulerDisableCount"}, - {0x00100040, SetScanInterval, "SetScanInterval"}, - {0x00110000, GetScanInterval, "GetScanInterval"}, - {0x00120040, SetRetryInterval, "SetRetryInterval"}, - {0x00130000, GetRetryInterval, "GetRetryInterval"}, - {0x00140040, OverrideDefaultDaemons, "OverrideDefaultDaemons"}, - {0x00150000, ResetDefaultDaemons, "ResetDefaultDaemons"}, - {0x00160000, GetDefaultDaemons, "GetDefaultDaemons"}, + {0x00010042, EnterExclusiveState, "EnterExclusiveState"}, + {0x00020002, LeaveExclusiveState, "LeaveExclusiveState"}, + {0x00030000, QueryExclusiveMode, "QueryExclusiveMode"}, + {0x00040002, LockState, "LockState"}, + {0x00050002, UnlockState, "UnlockState"}, + {0x00060040, SuspendDaemons, "SuspendDaemons"}, + {0x00070040, ResumeDaemons, "ResumeDaemons"}, + {0x00080040, SuspendScheduler, "SuspendScheduler"}, + {0x00090000, ResumeScheduler, "ResumeScheduler"}, + {0x000A0000, nullptr, "GetCurrentState"}, + {0x000B0000, nullptr, "GetTargetState"}, + {0x000C0000, nullptr, ""}, + {0x000D0040, QueryStatus, "QueryStatus"}, + {0x000E0040, GetDaemonDisableCount, "GetDaemonDisableCount"}, + {0x000F0000, GetSchedulerDisableCount, "GetSchedulerDisableCount"}, + {0x00100040, SetScanInterval, "SetScanInterval"}, + {0x00110000, GetScanInterval, "GetScanInterval"}, + {0x00120040, SetRetryInterval, "SetRetryInterval"}, + {0x00130000, GetRetryInterval, "GetRetryInterval"}, + {0x00140040, OverrideDefaultDaemons, "OverrideDefaultDaemons"}, + {0x00150000, ResetDefaultDaemons, "ResetDefaultDaemons"}, + {0x00160000, GetDefaultDaemons, "GetDefaultDaemons"}, {0x00170000, ClearHalfAwakeMacFilter, "ClearHalfAwakeMacFilter"}, }; diff --git a/src/core/hle/service/news/news.cpp b/src/core/hle/service/news/news.cpp index b3f500694..983e0777c 100644 --- a/src/core/hle/service/news/news.cpp +++ b/src/core/hle/service/news/news.cpp @@ -4,10 +4,10 @@ #include "common/logging/log.h" -#include "core/hle/service/service.h" #include "core/hle/service/news/news.h" #include "core/hle/service/news/news_s.h" #include "core/hle/service/news/news_u.h" +#include "core/hle/service/service.h" namespace Service { namespace NEWS { diff --git a/src/core/hle/service/news/news_s.cpp b/src/core/hle/service/news/news_s.cpp index 39b5a50f8..dda3d0f6a 100644 --- a/src/core/hle/service/news/news_s.cpp +++ b/src/core/hle/service/news/news_s.cpp @@ -9,19 +9,19 @@ namespace Service { namespace NEWS { const Interface::FunctionInfo FunctionTable[] = { - {0x000100C6, nullptr, "AddNotification"}, - {0x00050000, nullptr, "GetTotalNotifications"}, - {0x00060042, nullptr, "SetNewsDBHeader"}, - {0x00070082, nullptr, "SetNotificationHeader"}, - {0x00080082, nullptr, "SetNotificationMessage"}, - {0x00090082, nullptr, "SetNotificationImage"}, - {0x000A0042, nullptr, "GetNewsDBHeader"}, - {0x000B0082, nullptr, "GetNotificationHeader"}, - {0x000C0082, nullptr, "GetNotificationMessage"}, - {0x000D0082, nullptr, "GetNotificationImage"}, - {0x000E0040, nullptr, "SetInfoLEDPattern"}, - {0x00120082, nullptr, "GetNotificationHeaderOther"}, - {0x00130000, nullptr, "WriteNewsDBSavedata"}, + {0x000100C6, nullptr, "AddNotification"}, + {0x00050000, nullptr, "GetTotalNotifications"}, + {0x00060042, nullptr, "SetNewsDBHeader"}, + {0x00070082, nullptr, "SetNotificationHeader"}, + {0x00080082, nullptr, "SetNotificationMessage"}, + {0x00090082, nullptr, "SetNotificationImage"}, + {0x000A0042, nullptr, "GetNewsDBHeader"}, + {0x000B0082, nullptr, "GetNotificationHeader"}, + {0x000C0082, nullptr, "GetNotificationMessage"}, + {0x000D0082, nullptr, "GetNotificationImage"}, + {0x000E0040, nullptr, "SetInfoLEDPattern"}, + {0x00120082, nullptr, "GetNotificationHeaderOther"}, + {0x00130000, nullptr, "WriteNewsDBSavedata"}, }; NEWS_S_Interface::NEWS_S_Interface() { diff --git a/src/core/hle/service/news/news_u.cpp b/src/core/hle/service/news/news_u.cpp index 6b75cc24e..a07e466de 100644 --- a/src/core/hle/service/news/news_u.cpp +++ b/src/core/hle/service/news/news_u.cpp @@ -8,7 +8,7 @@ namespace Service { namespace NEWS { const Interface::FunctionInfo FunctionTable[] = { - {0x000100C6, nullptr, "AddNotification"}, + {0x000100C6, nullptr, "AddNotification"}, }; NEWS_U_Interface::NEWS_U_Interface() { diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp index ed42464ce..f3c01d6e6 100644 --- a/src/core/hle/service/nim/nim.cpp +++ b/src/core/hle/service/nim/nim.cpp @@ -5,11 +5,11 @@ #include "common/common_types.h" #include "common/logging/log.h" -#include "core/hle/service/service.h" #include "core/hle/service/nim/nim.h" #include "core/hle/service/nim/nim_aoc.h" #include "core/hle/service/nim/nim_s.h" #include "core/hle/service/nim/nim_u.h" +#include "core/hle/service/service.h" namespace Service { namespace NIM { diff --git a/src/core/hle/service/nim/nim_aoc.cpp b/src/core/hle/service/nim/nim_aoc.cpp index 4a4818d57..2d0fb6fc4 100644 --- a/src/core/hle/service/nim/nim_aoc.cpp +++ b/src/core/hle/service/nim/nim_aoc.cpp @@ -8,14 +8,14 @@ namespace Service { namespace NIM { const Interface::FunctionInfo FunctionTable[] = { - {0x00030042, nullptr, "SetApplicationId"}, - {0x00040042, nullptr, "SetTin"}, - {0x000902D0, nullptr, "ListContentSetsEx"}, - {0x00180000, nullptr, "GetBalance"}, - {0x001D0000, nullptr, "GetCustomerSupportCode"}, - {0x00210000, nullptr, "Initialize"}, - {0x00240282, nullptr, "CalculateContentsRequiredSize"}, - {0x00250000, nullptr, "RefreshServerTime"}, + {0x00030042, nullptr, "SetApplicationId"}, + {0x00040042, nullptr, "SetTin"}, + {0x000902D0, nullptr, "ListContentSetsEx"}, + {0x00180000, nullptr, "GetBalance"}, + {0x001D0000, nullptr, "GetCustomerSupportCode"}, + {0x00210000, nullptr, "Initialize"}, + {0x00240282, nullptr, "CalculateContentsRequiredSize"}, + {0x00250000, nullptr, "RefreshServerTime"}, }; NIM_AOC_Interface::NIM_AOC_Interface() { diff --git a/src/core/hle/service/nim/nim_s.cpp b/src/core/hle/service/nim/nim_s.cpp index dcaa0255a..e2ba693c9 100644 --- a/src/core/hle/service/nim/nim_s.cpp +++ b/src/core/hle/service/nim/nim_s.cpp @@ -8,10 +8,10 @@ namespace Service { namespace NIM { const Interface::FunctionInfo FunctionTable[] = { - {0x000A0000, nullptr, "CheckSysupdateAvailableSOAP"}, - {0x0016020A, nullptr, "ListTitles"}, - {0x002D0042, nullptr, "DownloadTickets"}, - {0x00420240, nullptr, "StartDownload"}, + {0x000A0000, nullptr, "CheckSysupdateAvailableSOAP"}, + {0x0016020A, nullptr, "ListTitles"}, + {0x002D0042, nullptr, "DownloadTickets"}, + {0x00420240, nullptr, "StartDownload"}, }; NIM_S_Interface::NIM_S_Interface() { @@ -20,4 +20,3 @@ NIM_S_Interface::NIM_S_Interface() { } // namespace NIM } // namespace Service - diff --git a/src/core/hle/service/nim/nim_u.cpp b/src/core/hle/service/nim/nim_u.cpp index eae45ebc0..7e07d02e8 100644 --- a/src/core/hle/service/nim/nim_u.cpp +++ b/src/core/hle/service/nim/nim_u.cpp @@ -9,12 +9,12 @@ namespace Service { namespace NIM { const Interface::FunctionInfo FunctionTable[] = { - {0x00010000, nullptr, "StartSysUpdate"}, - {0x00020000, nullptr, "GetUpdateDownloadProgress"}, - {0x00040000, nullptr, "FinishTitlesInstall"}, - {0x00050000, nullptr, "CheckForSysUpdateEvent"}, - {0x00090000, CheckSysUpdateAvailable, "CheckSysUpdateAvailable"}, - {0x000A0000, nullptr, "GetState"}, + {0x00010000, nullptr, "StartSysUpdate"}, + {0x00020000, nullptr, "GetUpdateDownloadProgress"}, + {0x00040000, nullptr, "FinishTitlesInstall"}, + {0x00050000, nullptr, "CheckForSysUpdateEvent"}, + {0x00090000, CheckSysUpdateAvailable, "CheckSysUpdateAvailable"}, + {0x000A0000, nullptr, "GetState"}, }; NIM_U_Interface::NIM_U_Interface() { @@ -23,4 +23,3 @@ NIM_U_Interface::NIM_U_Interface() { } // namespace NIM } // namespace Service - diff --git a/src/core/hle/service/ns_s.cpp b/src/core/hle/service/ns_s.cpp index 072918d62..6693f7c08 100644 --- a/src/core/hle/service/ns_s.cpp +++ b/src/core/hle/service/ns_s.cpp @@ -10,21 +10,21 @@ namespace NS_S { const Interface::FunctionInfo FunctionTable[] = { - {0x000100C0, nullptr, "LaunchFIRM"}, - {0x000200C0, nullptr, "LaunchTitle"}, - {0x00030000, nullptr, "TerminateApplication"}, - {0x00040040, nullptr, "TerminateProcess"}, - {0x000500C0, nullptr, "LaunchApplicationFIRM"}, - {0x00060042, nullptr, "SetFIRMParams4A0"}, - {0x00070042, nullptr, "CardUpdateInitialize"}, - {0x00080000, nullptr, "CardUpdateShutdown"}, - {0x000D0140, nullptr, "SetTWLBannerHMAC"}, - {0x000E0000, nullptr, "ShutdownAsync"}, - {0x00100180, nullptr, "RebootSystem"}, - {0x00110100, nullptr, "TerminateTitle"}, - {0x001200C0, nullptr, "SetApplicationCpuTimeLimit"}, - {0x00150140, nullptr, "LaunchApplication"}, - {0x00160000, nullptr, "RebootSystemClean"}, + {0x000100C0, nullptr, "LaunchFIRM"}, + {0x000200C0, nullptr, "LaunchTitle"}, + {0x00030000, nullptr, "TerminateApplication"}, + {0x00040040, nullptr, "TerminateProcess"}, + {0x000500C0, nullptr, "LaunchApplicationFIRM"}, + {0x00060042, nullptr, "SetFIRMParams4A0"}, + {0x00070042, nullptr, "CardUpdateInitialize"}, + {0x00080000, nullptr, "CardUpdateShutdown"}, + {0x000D0140, nullptr, "SetTWLBannerHMAC"}, + {0x000E0000, nullptr, "ShutdownAsync"}, + {0x00100180, nullptr, "RebootSystem"}, + {0x00110100, nullptr, "TerminateTitle"}, + {0x001200C0, nullptr, "SetApplicationCpuTimeLimit"}, + {0x00150140, nullptr, "LaunchApplication"}, + {0x00160000, nullptr, "RebootSystemClean"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/nwm_uds.cpp b/src/core/hle/service/nwm_uds.cpp index ae4640409..ed417fa9a 100644 --- a/src/core/hle/service/nwm_uds.cpp +++ b/src/core/hle/service/nwm_uds.cpp @@ -54,22 +54,23 @@ static void Shutdown(Service::Interface* self) { static void RecvBeaconBroadcastData(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); u32 out_buffer_size = cmd_buff[1]; - u32 unk1 = cmd_buff[2]; - u32 unk2 = cmd_buff[3]; - u32 mac_address = cmd_buff[4]; + u32 unk1 = cmd_buff[2]; + u32 unk2 = cmd_buff[3]; + u32 mac_address = cmd_buff[4]; - u32 unk3 = cmd_buff[6]; + u32 unk3 = cmd_buff[6]; - u32 wlan_comm_id = cmd_buff[15]; - u32 ctr_gen_id = cmd_buff[16]; - u32 value = cmd_buff[17]; - u32 input_handle = cmd_buff[18]; + u32 wlan_comm_id = cmd_buff[15]; + u32 ctr_gen_id = cmd_buff[16]; + u32 value = cmd_buff[17]; + u32 input_handle = cmd_buff[18]; u32 new_buffer_size = cmd_buff[19]; - u32 out_buffer_ptr = cmd_buff[20]; + u32 out_buffer_ptr = cmd_buff[20]; cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_WARNING(Service_NWM, "(STUBBED) called out_buffer_size=0x%08X, unk1=0x%08X, unk2=0x%08X," + LOG_WARNING(Service_NWM, + "(STUBBED) called out_buffer_size=0x%08X, unk1=0x%08X, unk2=0x%08X," "mac_address=0x%08X, unk3=0x%08X, wlan_comm_id=0x%08X, ctr_gen_id=0x%08X," "value=%u, input_handle=0x%08X, new_buffer_size=0x%08X, out_buffer_ptr=0x%08X", out_buffer_size, unk1, unk2, mac_address, unk3, wlan_comm_id, ctr_gen_id, value, @@ -92,46 +93,47 @@ static void RecvBeaconBroadcastData(Service::Interface* self) { */ static void Initialize(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); - u32 unk1 = cmd_buff[1]; - u32 unk2 = cmd_buff[12]; - u32 value = cmd_buff[13]; + u32 unk1 = cmd_buff[1]; + u32 unk2 = cmd_buff[12]; + u32 value = cmd_buff[13]; u32 handle = cmd_buff[14]; cmd_buff[1] = RESULT_SUCCESS.raw; cmd_buff[2] = 0; - cmd_buff[3] = Kernel::g_handle_table.Create(handle_event).MoveFrom(); //TODO(purpasmart): Verify if this is a event handle + cmd_buff[3] = Kernel::g_handle_table.Create(handle_event) + .MoveFrom(); // TODO(purpasmart): Verify if this is a event handle LOG_WARNING(Service_NWM, "(STUBBED) called unk1=0x%08X, unk2=0x%08X, value=%u, handle=0x%08X", unk1, unk2, value, handle); } const Interface::FunctionInfo FunctionTable[] = { - {0x00020000, nullptr, "Scrap"}, - {0x00030000, Shutdown, "Shutdown"}, - {0x00040402, nullptr, "CreateNetwork"}, - {0x00050040, nullptr, "EjectClient"}, - {0x00060000, nullptr, "EjectSpectator"}, - {0x00070080, nullptr, "UpdateNetworkAttribute"}, - {0x00080000, nullptr, "DestroyNetwork"}, - {0x000A0000, nullptr, "DisconnectNetwork"}, - {0x000B0000, nullptr, "GetConnectionStatus"}, - {0x000D0040, nullptr, "GetNodeInformation"}, - {0x000F0404, RecvBeaconBroadcastData, "RecvBeaconBroadcastData"}, - {0x00100042, nullptr, "SetBeaconAdditionalData"}, - {0x00110040, nullptr, "GetApplicationData"}, - {0x00120100, nullptr, "Bind"}, - {0x00130040, nullptr, "Unbind"}, - {0x001400C0, nullptr, "RecvBroadcastDataFrame"}, - {0x00150080, nullptr, "SetMaxSendDelay"}, - {0x00170182, nullptr, "SendTo"}, - {0x001A0000, nullptr, "GetChannel"}, - {0x001B0302, Initialize, "Initialize"}, - {0x001D0044, nullptr, "BeginHostingNetwork"}, - {0x001E0084, nullptr, "ConnectToNetwork"}, - {0x001F0006, nullptr, "DecryptBeaconData"}, - {0x00200040, nullptr, "Flush"}, - {0x00210080, nullptr, "SetProbeResponseParam"}, - {0x00220402, nullptr, "ScanOnConnection"}, + {0x00020000, nullptr, "Scrap"}, + {0x00030000, Shutdown, "Shutdown"}, + {0x00040402, nullptr, "CreateNetwork"}, + {0x00050040, nullptr, "EjectClient"}, + {0x00060000, nullptr, "EjectSpectator"}, + {0x00070080, nullptr, "UpdateNetworkAttribute"}, + {0x00080000, nullptr, "DestroyNetwork"}, + {0x000A0000, nullptr, "DisconnectNetwork"}, + {0x000B0000, nullptr, "GetConnectionStatus"}, + {0x000D0040, nullptr, "GetNodeInformation"}, + {0x000F0404, RecvBeaconBroadcastData, "RecvBeaconBroadcastData"}, + {0x00100042, nullptr, "SetBeaconAdditionalData"}, + {0x00110040, nullptr, "GetApplicationData"}, + {0x00120100, nullptr, "Bind"}, + {0x00130040, nullptr, "Unbind"}, + {0x001400C0, nullptr, "RecvBroadcastDataFrame"}, + {0x00150080, nullptr, "SetMaxSendDelay"}, + {0x00170182, nullptr, "SendTo"}, + {0x001A0000, nullptr, "GetChannel"}, + {0x001B0302, Initialize, "Initialize"}, + {0x001D0044, nullptr, "BeginHostingNetwork"}, + {0x001E0084, nullptr, "ConnectToNetwork"}, + {0x001F0006, nullptr, "DecryptBeaconData"}, + {0x00200040, nullptr, "Flush"}, + {0x00210080, nullptr, "SetProbeResponseParam"}, + {0x00220402, nullptr, "ScanOnConnection"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/pm_app.cpp b/src/core/hle/service/pm_app.cpp index 05d01bc48..7d91694f6 100644 --- a/src/core/hle/service/pm_app.cpp +++ b/src/core/hle/service/pm_app.cpp @@ -10,18 +10,18 @@ namespace PM_APP { const Interface::FunctionInfo FunctionTable[] = { - {0x00010140, nullptr, "LaunchTitle"}, - {0x00020082, nullptr, "LaunchFIRMSetParams"}, - {0x00030080, nullptr, "TerminateProcesse"}, - {0x00040100, nullptr, "TerminateProcessTID"}, - {0x000500C0, nullptr, "TerminateProcessTID_unknown"}, - {0x00070042, nullptr, "GetFIRMLaunchParams"}, - {0x00080100, nullptr, "GetTitleExheaderFlags"}, - {0x00090042, nullptr, "SetFIRMLaunchParams"}, - {0x000A0140, nullptr, "SetResourceLimit"}, - {0x000B0140, nullptr, "GetResourceLimitMax"}, - {0x000C0080, nullptr, "UnregisterProcess"}, - {0x000D0240, nullptr, "LaunchTitleUpdate"}, + {0x00010140, nullptr, "LaunchTitle"}, + {0x00020082, nullptr, "LaunchFIRMSetParams"}, + {0x00030080, nullptr, "TerminateProcesse"}, + {0x00040100, nullptr, "TerminateProcessTID"}, + {0x000500C0, nullptr, "TerminateProcessTID_unknown"}, + {0x00070042, nullptr, "GetFIRMLaunchParams"}, + {0x00080100, nullptr, "GetTitleExheaderFlags"}, + {0x00090042, nullptr, "SetFIRMLaunchParams"}, + {0x000A0140, nullptr, "SetResourceLimit"}, + {0x000B0140, nullptr, "GetResourceLimitMax"}, + {0x000C0080, nullptr, "UnregisterProcess"}, + {0x000D0240, nullptr, "LaunchTitleUpdate"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index e2c17d93b..80fa09f5f 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp @@ -2,21 +2,21 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/ptm/ptm.h" #include "common/logging/log.h" -#include "core/settings.h" #include "core/file_sys/file_backend.h" #include "core/hle/service/fs/archive.h" -#include "core/hle/service/ptm/ptm.h" #include "core/hle/service/ptm/ptm_play.h" #include "core/hle/service/ptm/ptm_sysm.h" #include "core/hle/service/ptm/ptm_u.h" #include "core/hle/service/service.h" +#include "core/settings.h" namespace Service { namespace PTM { /// Values for the default gamecoin.dat file -static const GameCoin default_game_coin = { 0x4F00, 42, 0, 0, 0, 2014, 12, 29 }; +static const GameCoin default_game_coin = {0x4F00, 42, 0, 0, 0, 2014, 12, 29}; /// Id of the SharedExtData archive used by the PTM process static const std::vector ptm_shared_extdata_id = {0, 0, 0, 0, 0x0B, 0, 0, 0xF0, 0, 0, 0, 0}; @@ -51,7 +51,8 @@ void GetBatteryLevel(Service::Interface* self) { // it returns a valid result without implementing full functionality. cmd_buff[1] = RESULT_SUCCESS.raw; - cmd_buff[2] = static_cast(ChargeLevels::CompletelyFull); // Set to a completely full battery + cmd_buff[2] = + static_cast(ChargeLevels::CompletelyFull); // Set to a completely full battery LOG_WARNING(Service_PTM, "(STUBBED) called"); } @@ -94,7 +95,8 @@ void CheckNew3DS(Service::Interface* self) { const bool is_new_3ds = Settings::values.is_new_3ds; if (is_new_3ds) { - LOG_CRITICAL(Service_PTM, "The option 'is_new_3ds' is enabled as part of the 'System' settings. Citra does not fully support New 3DS emulation yet!"); + LOG_CRITICAL(Service_PTM, "The option 'is_new_3ds' is enabled as part of the 'System' " + "settings. Citra does not fully support New 3DS emulation yet!"); } cmd_buff[1] = RESULT_SUCCESS.raw; @@ -111,15 +113,19 @@ void Init() { shell_open = true; battery_is_charging = true; - // Open the SharedExtSaveData archive 0xF000000B and create the gamecoin.dat file if it doesn't exist + // Open the SharedExtSaveData archive 0xF000000B and create the gamecoin.dat file if it doesn't + // exist FileSys::Path archive_path(ptm_shared_extdata_id); - auto archive_result = Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, archive_path); + auto archive_result = + Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, archive_path); // If the archive didn't exist, create the files inside if (archive_result.Code().description == ErrorDescription::FS_NotFormatted) { // Format the archive to create the directories - Service::FS::FormatArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, FileSys::ArchiveFormatInfo(), archive_path); + Service::FS::FormatArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, + FileSys::ArchiveFormatInfo(), archive_path); // Open it again to get a valid archive now that the folder exists - archive_result = Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, archive_path); + archive_result = + Service::FS::OpenArchive(Service::FS::ArchiveIdCode::SharedExtSaveData, archive_path); ASSERT_MSG(archive_result.Succeeded(), "Could not open the PTM SharedExtSaveData archive!"); FileSys::Path gamecoin_path("gamecoin.dat"); @@ -127,17 +133,18 @@ void Init() { open_mode.write_flag.Assign(1); open_mode.create_flag.Assign(1); // Open the file and write the default gamecoin information - auto gamecoin_result = Service::FS::OpenFileFromArchive(*archive_result, gamecoin_path, open_mode); + auto gamecoin_result = + Service::FS::OpenFileFromArchive(*archive_result, gamecoin_path, open_mode); if (gamecoin_result.Succeeded()) { auto gamecoin = gamecoin_result.MoveFrom(); - gamecoin->backend->Write(0, sizeof(GameCoin), 1, reinterpret_cast(&default_game_coin)); + gamecoin->backend->Write(0, sizeof(GameCoin), 1, + reinterpret_cast(&default_game_coin)); gamecoin->backend->Close(); } } } void Shutdown() { - } } // namespace PTM diff --git a/src/core/hle/service/ptm/ptm.h b/src/core/hle/service/ptm/ptm.h index 7ef8877c7..6e163a6f9 100644 --- a/src/core/hle/service/ptm/ptm.h +++ b/src/core/hle/service/ptm/ptm.h @@ -14,23 +14,24 @@ namespace PTM { /// Charge levels used by PTM functions enum class ChargeLevels : u32 { - CriticalBattery = 1, - LowBattery = 2, - HalfFull = 3, - MostlyFull = 4, - CompletelyFull = 5, + CriticalBattery = 1, + LowBattery = 2, + HalfFull = 3, + MostlyFull = 4, + CompletelyFull = 5, }; /** * Represents the gamecoin file structure in the SharedExtData archive - * More information in 3dbrew (http://www.3dbrew.org/wiki/Extdata#Shared_Extdata_0xf000000b_gamecoin.dat) + * More information in 3dbrew + * (http://www.3dbrew.org/wiki/Extdata#Shared_Extdata_0xf000000b_gamecoin.dat) */ struct GameCoin { - u32 magic; ///< Magic number: 0x4F00 - u16 total_coins; ///< Total Play Coins + u32 magic; ///< Magic number: 0x4F00 + u16 total_coins; ///< Total Play Coins u16 total_coins_on_date; ///< Total Play Coins obtained on the date stored below. - u32 step_count; ///< Total step count at the time a new Play Coin was obtained. - u32 last_step_count; ///< Step count for the day the last Play Coin was obtained + u32 step_count; ///< Total step count at the time a new Play Coin was obtained. + u32 last_step_count; ///< Step count for the day the last Play Coin was obtained u16 year; u8 month; u8 day; diff --git a/src/core/hle/service/ptm/ptm_play.cpp b/src/core/hle/service/ptm/ptm_play.cpp index ca5dd0403..2e0c6e1a3 100644 --- a/src/core/hle/service/ptm/ptm_play.cpp +++ b/src/core/hle/service/ptm/ptm_play.cpp @@ -8,10 +8,10 @@ namespace Service { namespace PTM { const Interface::FunctionInfo FunctionTable[] = { - {0x08070082, nullptr, "GetPlayHistory"}, - {0x08080000, nullptr, "GetPlayHistoryStart"}, - {0x08090000, nullptr, "GetPlayHistoryLength"}, - {0x080B0080, nullptr, "CalcPlayHistoryStart"}, + {0x08070082, nullptr, "GetPlayHistory"}, + {0x08080000, nullptr, "GetPlayHistoryStart"}, + {0x08090000, nullptr, "GetPlayHistoryLength"}, + {0x080B0080, nullptr, "CalcPlayHistoryStart"}, }; PTM_Play_Interface::PTM_Play_Interface() { diff --git a/src/core/hle/service/ptm/ptm_play.h b/src/core/hle/service/ptm/ptm_play.h index e5c3e04df..47f229581 100644 --- a/src/core/hle/service/ptm/ptm_play.h +++ b/src/core/hle/service/ptm/ptm_play.h @@ -13,9 +13,9 @@ class PTM_Play_Interface : public Service::Interface { public: PTM_Play_Interface(); -std::string GetPortName() const override { - return "ptm:play"; -} + std::string GetPortName() const override { + return "ptm:play"; + } }; } // namespace PTM diff --git a/src/core/hle/service/ptm/ptm_sysm.cpp b/src/core/hle/service/ptm/ptm_sysm.cpp index cc4ef1101..693158dbf 100644 --- a/src/core/hle/service/ptm/ptm_sysm.cpp +++ b/src/core/hle/service/ptm/ptm_sysm.cpp @@ -9,37 +9,37 @@ namespace Service { namespace PTM { const Interface::FunctionInfo FunctionTable[] = { - {0x040100C0, nullptr, "SetRtcAlarmEx"}, - {0x04020042, nullptr, "ReplySleepQuery"}, - {0x04030042, nullptr, "NotifySleepPreparationComplete"}, - {0x04040102, nullptr, "SetWakeupTrigger"}, - {0x04050000, nullptr, "GetAwakeReason"}, - {0x04060000, nullptr, "RequestSleep"}, - {0x040700C0, nullptr, "ShutdownAsync"}, - {0x04080000, nullptr, "Awake"}, - {0x04090080, nullptr, "RebootAsync"}, - {0x040A0000, CheckNew3DS, "CheckNew3DS"}, - {0x08010640, nullptr, "SetInfoLEDPattern"}, - {0x08020040, nullptr, "SetInfoLEDPatternHeader"}, - {0x08030000, nullptr, "GetInfoLEDStatus"}, - {0x08040040, nullptr, "SetBatteryEmptyLEDPattern"}, - {0x08050000, nullptr, "ClearStepHistory"}, - {0x080600C2, nullptr, "SetStepHistory"}, - {0x08070082, nullptr, "GetPlayHistory"}, - {0x08080000, nullptr, "GetPlayHistoryStart"}, - {0x08090000, nullptr, "GetPlayHistoryLength"}, - {0x080A0000, nullptr, "ClearPlayHistory"}, - {0x080B0080, nullptr, "CalcPlayHistoryStart"}, - {0x080C0080, nullptr, "SetUserTime"}, - {0x080D0000, nullptr, "InvalidateSystemTime"}, - {0x080E0140, nullptr, "NotifyPlayEvent"}, - {0x080F0000, IsLegacyPowerOff, "IsLegacyPowerOff"}, - {0x08100000, nullptr, "ClearLegacyPowerOff"}, - {0x08110000, GetShellState, "GetShellState"}, - {0x08120000, nullptr, "IsShutdownByBatteryEmpty"}, - {0x08130000, nullptr, "FormatSavedata"}, - {0x08140000, nullptr, "GetLegacyJumpProhibitedFlag"}, - {0x08180040, nullptr, "ConfigureNew3DSCPU"}, + {0x040100C0, nullptr, "SetRtcAlarmEx"}, + {0x04020042, nullptr, "ReplySleepQuery"}, + {0x04030042, nullptr, "NotifySleepPreparationComplete"}, + {0x04040102, nullptr, "SetWakeupTrigger"}, + {0x04050000, nullptr, "GetAwakeReason"}, + {0x04060000, nullptr, "RequestSleep"}, + {0x040700C0, nullptr, "ShutdownAsync"}, + {0x04080000, nullptr, "Awake"}, + {0x04090080, nullptr, "RebootAsync"}, + {0x040A0000, CheckNew3DS, "CheckNew3DS"}, + {0x08010640, nullptr, "SetInfoLEDPattern"}, + {0x08020040, nullptr, "SetInfoLEDPatternHeader"}, + {0x08030000, nullptr, "GetInfoLEDStatus"}, + {0x08040040, nullptr, "SetBatteryEmptyLEDPattern"}, + {0x08050000, nullptr, "ClearStepHistory"}, + {0x080600C2, nullptr, "SetStepHistory"}, + {0x08070082, nullptr, "GetPlayHistory"}, + {0x08080000, nullptr, "GetPlayHistoryStart"}, + {0x08090000, nullptr, "GetPlayHistoryLength"}, + {0x080A0000, nullptr, "ClearPlayHistory"}, + {0x080B0080, nullptr, "CalcPlayHistoryStart"}, + {0x080C0080, nullptr, "SetUserTime"}, + {0x080D0000, nullptr, "InvalidateSystemTime"}, + {0x080E0140, nullptr, "NotifyPlayEvent"}, + {0x080F0000, IsLegacyPowerOff, "IsLegacyPowerOff"}, + {0x08100000, nullptr, "ClearLegacyPowerOff"}, + {0x08110000, GetShellState, "GetShellState"}, + {0x08120000, nullptr, "IsShutdownByBatteryEmpty"}, + {0x08130000, nullptr, "FormatSavedata"}, + {0x08140000, nullptr, "GetLegacyJumpProhibitedFlag"}, + {0x08180040, nullptr, "ConfigureNew3DSCPU"}, }; PTM_Sysm_Interface::PTM_Sysm_Interface() { diff --git a/src/core/hle/service/ptm/ptm_u.cpp b/src/core/hle/service/ptm/ptm_u.cpp index 17e764866..65e868393 100644 --- a/src/core/hle/service/ptm/ptm_u.cpp +++ b/src/core/hle/service/ptm/ptm_u.cpp @@ -9,21 +9,21 @@ namespace Service { namespace PTM { const Interface::FunctionInfo FunctionTable[] = { - {0x00010002, nullptr, "RegisterAlarmClient"}, - {0x00020080, nullptr, "SetRtcAlarm"}, - {0x00030000, nullptr, "GetRtcAlarm"}, - {0x00040000, nullptr, "CancelRtcAlarm"}, - {0x00050000, GetAdapterState, "GetAdapterState"}, - {0x00060000, GetShellState, "GetShellState"}, - {0x00070000, GetBatteryLevel, "GetBatteryLevel"}, + {0x00010002, nullptr, "RegisterAlarmClient"}, + {0x00020080, nullptr, "SetRtcAlarm"}, + {0x00030000, nullptr, "GetRtcAlarm"}, + {0x00040000, nullptr, "CancelRtcAlarm"}, + {0x00050000, GetAdapterState, "GetAdapterState"}, + {0x00060000, GetShellState, "GetShellState"}, + {0x00070000, GetBatteryLevel, "GetBatteryLevel"}, {0x00080000, GetBatteryChargeState, "GetBatteryChargeState"}, - {0x00090000, nullptr, "GetPedometerState"}, - {0x000A0042, nullptr, "GetStepHistoryEntry"}, - {0x000B00C2, nullptr, "GetStepHistory"}, - {0x000C0000, GetTotalStepCount, "GetTotalStepCount"}, - {0x000D0040, nullptr, "SetPedometerRecordingMode"}, - {0x000E0000, nullptr, "GetPedometerRecordingMode"}, - {0x000F0084, nullptr, "GetStepHistoryAll"}, + {0x00090000, nullptr, "GetPedometerState"}, + {0x000A0042, nullptr, "GetStepHistoryEntry"}, + {0x000B00C2, nullptr, "GetStepHistory"}, + {0x000C0000, GetTotalStepCount, "GetTotalStepCount"}, + {0x000D0040, nullptr, "SetPedometerRecordingMode"}, + {0x000E0000, nullptr, "GetPedometerRecordingMode"}, + {0x000F0084, nullptr, "GetStepHistoryAll"}, }; PTM_U_Interface::PTM_U_Interface() { diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index 5b8440b77..a531aad87 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -5,7 +5,6 @@ #include "common/logging/log.h" #include "common/string_util.h" -#include "core/hle/service/service.h" #include "core/hle/service/ac_u.h" #include "core/hle/service/act_a.h" #include "core/hle/service/act_u.h" @@ -19,6 +18,7 @@ #include "core/hle/service/ns_s.h" #include "core/hle/service/nwm_uds.h" #include "core/hle/service/pm_app.h" +#include "core/hle/service/service.h" #include "core/hle/service/soc_u.h" #include "core/hle/service/srv.h" #include "core/hle/service/ssl_c.h" @@ -29,10 +29,10 @@ #include "core/hle/service/boss/boss.h" #include "core/hle/service/cam/cam.h" #include "core/hle/service/cecd/cecd.h" +#include "core/hle/service/cfg/cfg.h" #include "core/hle/service/dlp/dlp.h" #include "core/hle/service/frd/frd.h" #include "core/hle/service/fs/archive.h" -#include "core/hle/service/cfg/cfg.h" #include "core/hle/service/hid/hid.h" #include "core/hle/service/ir/ir.h" #include "core/hle/service/ldr_ro/ldr_ro.h" @@ -50,11 +50,13 @@ std::unordered_map> g_srv_services; * Creates a function string for logging, complete with the name (or header code, depending * on what's passed in) the port name, and all the cmd_buff arguments. */ -static std::string MakeFunctionString(const char* name, const char* port_name, const u32* cmd_buff) { +static std::string MakeFunctionString(const char* name, const char* port_name, + const u32* cmd_buff) { // Number of params == bits 0-5 + bits 6-11 int num_params = (cmd_buff[0] & 0x3F) + ((cmd_buff[0] >> 6) & 0x3F); - std::string function_string = Common::StringFromFormat("function '%s': port=%s", name, port_name); + std::string function_string = + Common::StringFromFormat("function '%s': port=%s", name, port_name); for (int i = 1; i <= num_params; ++i) { function_string += Common::StringFromFormat(", cmd_buff[%i]=0x%X", i, cmd_buff[i]); } @@ -66,14 +68,19 @@ ResultVal Interface::SyncRequest() { auto itr = m_functions.find(cmd_buff[0]); if (itr == m_functions.end() || itr->second.func == nullptr) { - std::string function_name = (itr == m_functions.end()) ? Common::StringFromFormat("0x%08X", cmd_buff[0]) : itr->second.name; - LOG_ERROR(Service, "unknown / unimplemented %s", MakeFunctionString(function_name.c_str(), GetPortName().c_str(), cmd_buff).c_str()); + std::string function_name = (itr == m_functions.end()) + ? Common::StringFromFormat("0x%08X", cmd_buff[0]) + : itr->second.name; + LOG_ERROR( + Service, "unknown / unimplemented %s", + MakeFunctionString(function_name.c_str(), GetPortName().c_str(), cmd_buff).c_str()); // TODO(bunnei): Hack - ignore error cmd_buff[1] = 0; return MakeResult(false); } - LOG_TRACE(Service, "%s", MakeFunctionString(itr->second.name, GetPortName().c_str(), cmd_buff).c_str()); + LOG_TRACE(Service, "%s", + MakeFunctionString(itr->second.name, GetPortName().c_str(), cmd_buff).c_str()); itr->second.func(this); @@ -163,6 +170,4 @@ void Shutdown() { g_kernel_named_ports.clear(); LOG_DEBUG(Service, "shutdown OK"); } - - } diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index f31135212..cd216f27e 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -28,13 +28,15 @@ class Interface : public Kernel::Session { // just something that encapsulates a session and acts as a helper to implement service // processes. public: - std::string GetName() const override { return GetPortName(); } + std::string GetName() const override { + return GetPortName(); + } typedef void (*Function)(Interface*); struct FunctionInfo { - u32 id; - Function func; + u32 id; + Function func; const char* name; }; @@ -49,7 +51,6 @@ public: ResultVal SyncRequest() override; protected: - /** * Registers the functions in the service */ @@ -62,7 +63,6 @@ protected: private: boost::container::flat_map m_functions; - }; /// Initialize ServiceManager diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp index 9b285567b..695b286c0 100644 --- a/src/core/hle/service/soc_u.cpp +++ b/src/core/hle/service/soc_u.cpp @@ -19,40 +19,40 @@ #include "core/memory.h" #ifdef _WIN32 - #include - #include - - // MinGW does not define several errno constants - #ifndef _MSC_VER - #define EBADMSG 104 - #define ENODATA 120 - #define ENOMSG 122 - #define ENOSR 124 - #define ENOSTR 125 - #define ETIME 137 - #define EIDRM 2001 - #define ENOLINK 2002 - #endif // _MSC_VER +#include +#include + +// MinGW does not define several errno constants +#ifndef _MSC_VER +#define EBADMSG 104 +#define ENODATA 120 +#define ENOMSG 122 +#define ENOSR 124 +#define ENOSTR 125 +#define ETIME 137 +#define EIDRM 2001 +#define ENOLINK 2002 +#endif // _MSC_VER #else - #include - #include - #include - #include - #include - #include - #include +#include +#include +#include +#include +#include +#include +#include #endif #ifdef _WIN32 -# define WSAEAGAIN WSAEWOULDBLOCK -# define WSAEMULTIHOP -1 // Invalid dummy value -# define ERRNO(x) WSA##x -# define GET_ERRNO WSAGetLastError() -# define poll(x, y, z) WSAPoll(x, y, z); +#define WSAEAGAIN WSAEWOULDBLOCK +#define WSAEMULTIHOP -1 // Invalid dummy value +#define ERRNO(x) WSA##x +#define GET_ERRNO WSAGetLastError() +#define poll(x, y, z) WSAPoll(x, y, z); #else -# define ERRNO(x) x -# define GET_ERRNO errno -# define closesocket(x) close(x) +#define ERRNO(x) x +#define GET_ERRNO errno +#define closesocket(x) close(x) #endif static const s32 SOCKET_ERROR_VALUE = -1; @@ -63,84 +63,82 @@ static const s32 SOCKET_ERROR_VALUE = -1; namespace SOC_U { /// Holds the translation from system network errors to 3DS network errors -static const std::unordered_map error_map = { { - { E2BIG, 1 }, - { ERRNO(EACCES), 2 }, - { ERRNO(EADDRINUSE), 3 }, - { ERRNO(EADDRNOTAVAIL), 4 }, - { ERRNO(EAFNOSUPPORT), 5 }, - { ERRNO(EAGAIN), 6 }, - { ERRNO(EALREADY), 7 }, - { ERRNO(EBADF), 8 }, - { EBADMSG, 9 }, - { EBUSY, 10 }, - { ECANCELED, 11 }, - { ECHILD, 12 }, - { ERRNO(ECONNABORTED), 13 }, - { ERRNO(ECONNREFUSED), 14 }, - { ERRNO(ECONNRESET), 15 }, - { EDEADLK, 16 }, - { ERRNO(EDESTADDRREQ), 17 }, - { EDOM, 18 }, - { ERRNO(EDQUOT), 19 }, - { EEXIST, 20 }, - { ERRNO(EFAULT), 21 }, - { EFBIG, 22 }, - { ERRNO(EHOSTUNREACH), 23 }, - { EIDRM, 24 }, - { EILSEQ, 25 }, - { ERRNO(EINPROGRESS), 26 }, - { ERRNO(EINTR), 27 }, - { ERRNO(EINVAL), 28 }, - { EIO, 29 }, - { ERRNO(EISCONN), 30 }, - { EISDIR, 31 }, - { ERRNO(ELOOP), 32 }, - { ERRNO(EMFILE), 33 }, - { EMLINK, 34 }, - { ERRNO(EMSGSIZE), 35 }, - { ERRNO(EMULTIHOP), 36 }, - { ERRNO(ENAMETOOLONG), 37 }, - { ERRNO(ENETDOWN), 38 }, - { ERRNO(ENETRESET), 39 }, - { ERRNO(ENETUNREACH), 40 }, - { ENFILE, 41 }, - { ERRNO(ENOBUFS), 42 }, - { ENODATA, 43 }, - { ENODEV, 44 }, - { ENOENT, 45 }, - { ENOEXEC, 46 }, - { ENOLCK, 47 }, - { ENOLINK, 48 }, - { ENOMEM, 49 }, - { ENOMSG, 50 }, - { ERRNO(ENOPROTOOPT), 51 }, - { ENOSPC, 52 }, - { ENOSR, 53 }, - { ENOSTR, 54 }, - { ENOSYS, 55 }, - { ERRNO(ENOTCONN), 56 }, - { ENOTDIR, 57 }, - { ERRNO(ENOTEMPTY), 58 }, - { ERRNO(ENOTSOCK), 59 }, - { ENOTSUP, 60 }, - { ENOTTY, 61 }, - { ENXIO, 62 }, - { ERRNO(EOPNOTSUPP), 63 }, - { EOVERFLOW, 64 }, - { EPERM, 65 }, - { EPIPE, 66 }, - { EPROTO, 67 }, - { ERRNO(EPROTONOSUPPORT), 68 }, - { ERRNO(EPROTOTYPE), 69 }, - { ERANGE, 70 }, - { EROFS, 71 }, - { ESPIPE, 72 }, - { ESRCH, 73 }, - { ERRNO(ESTALE), 74 }, - { ETIME, 75 }, - { ERRNO(ETIMEDOUT), 76 } -}}; +static const std::unordered_map error_map = {{{E2BIG, 1}, + {ERRNO(EACCES), 2}, + {ERRNO(EADDRINUSE), 3}, + {ERRNO(EADDRNOTAVAIL), 4}, + {ERRNO(EAFNOSUPPORT), 5}, + {ERRNO(EAGAIN), 6}, + {ERRNO(EALREADY), 7}, + {ERRNO(EBADF), 8}, + {EBADMSG, 9}, + {EBUSY, 10}, + {ECANCELED, 11}, + {ECHILD, 12}, + {ERRNO(ECONNABORTED), 13}, + {ERRNO(ECONNREFUSED), 14}, + {ERRNO(ECONNRESET), 15}, + {EDEADLK, 16}, + {ERRNO(EDESTADDRREQ), 17}, + {EDOM, 18}, + {ERRNO(EDQUOT), 19}, + {EEXIST, 20}, + {ERRNO(EFAULT), 21}, + {EFBIG, 22}, + {ERRNO(EHOSTUNREACH), 23}, + {EIDRM, 24}, + {EILSEQ, 25}, + {ERRNO(EINPROGRESS), 26}, + {ERRNO(EINTR), 27}, + {ERRNO(EINVAL), 28}, + {EIO, 29}, + {ERRNO(EISCONN), 30}, + {EISDIR, 31}, + {ERRNO(ELOOP), 32}, + {ERRNO(EMFILE), 33}, + {EMLINK, 34}, + {ERRNO(EMSGSIZE), 35}, + {ERRNO(EMULTIHOP), 36}, + {ERRNO(ENAMETOOLONG), 37}, + {ERRNO(ENETDOWN), 38}, + {ERRNO(ENETRESET), 39}, + {ERRNO(ENETUNREACH), 40}, + {ENFILE, 41}, + {ERRNO(ENOBUFS), 42}, + {ENODATA, 43}, + {ENODEV, 44}, + {ENOENT, 45}, + {ENOEXEC, 46}, + {ENOLCK, 47}, + {ENOLINK, 48}, + {ENOMEM, 49}, + {ENOMSG, 50}, + {ERRNO(ENOPROTOOPT), 51}, + {ENOSPC, 52}, + {ENOSR, 53}, + {ENOSTR, 54}, + {ENOSYS, 55}, + {ERRNO(ENOTCONN), 56}, + {ENOTDIR, 57}, + {ERRNO(ENOTEMPTY), 58}, + {ERRNO(ENOTSOCK), 59}, + {ENOTSUP, 60}, + {ENOTTY, 61}, + {ENXIO, 62}, + {ERRNO(EOPNOTSUPP), 63}, + {EOVERFLOW, 64}, + {EPERM, 65}, + {EPIPE, 66}, + {EPROTO, 67}, + {ERRNO(EPROTONOSUPPORT), 68}, + {ERRNO(EPROTOTYPE), 69}, + {ERANGE, 70}, + {EROFS, 71}, + {ESPIPE, 72}, + {ESRCH, 73}, + {ERRNO(ESTALE), 74}, + {ETIME, 75}, + {ERRNO(ETIMEDOUT), 76}}}; /// Converts a network error from platform-specific to 3ds-specific static int TranslateError(int error) { @@ -153,21 +151,21 @@ static int TranslateError(int error) { /// Holds the translation from system network socket options to 3DS network socket options /// Note: -1 = No effect/unavailable -static const std::unordered_map sockopt_map = { { - { 0x0004, SO_REUSEADDR }, - { 0x0080, -1 }, - { 0x0100, -1 }, - { 0x1001, SO_SNDBUF }, - { 0x1002, SO_RCVBUF }, - { 0x1003, -1 }, +static const std::unordered_map sockopt_map = {{ + {0x0004, SO_REUSEADDR}, + {0x0080, -1}, + {0x0100, -1}, + {0x1001, SO_SNDBUF}, + {0x1002, SO_RCVBUF}, + {0x1003, -1}, #ifdef _WIN32 /// Unsupported in WinSock2 - { 0x1004, -1 }, + {0x1004, -1}, #else - { 0x1004, SO_RCVLOWAT }, + {0x1004, SO_RCVLOWAT}, #endif - { 0x1008, SO_TYPE }, - { 0x1009, SO_ERROR }, + {0x1008, SO_TYPE}, + {0x1009, SO_ERROR}, }}; /// Converts a socket option from 3ds-specific to platform-specific @@ -203,7 +201,8 @@ struct CTRPollFD { return *this; } - /// Translates the resulting events of a Poll operation from platform-specific to 3ds specific + /// Translates the resulting events of a Poll operation from platform-specific to 3ds + /// specific static Events TranslateTo3DS(u32 input_event) { Events ev = {}; if (input_event & POLLIN) @@ -221,7 +220,8 @@ struct CTRPollFD { return ev; } - /// Translates the resulting events of a Poll operation from 3ds specific to platform specific + /// Translates the resulting events of a Poll operation from 3ds specific to platform + /// specific static u32 TranslateToPlatform(Events input_event) { u32 ret = 0; if (input_event.pollin) @@ -239,7 +239,7 @@ struct CTRPollFD { return ret; } }; - Events events; ///< Events to poll for (input) + Events events; ///< Events to poll for (input) Events revents; ///< Events received (output) /// Converts a platform-specific pollfd to a 3ds specific structure @@ -265,17 +265,17 @@ struct CTRPollFD { union CTRSockAddr { /// Structure to represent a raw sockaddr struct { - u8 len; ///< The length of the entire structure, only the set fields count - u8 sa_family; ///< The address family of the sockaddr + u8 len; ///< The length of the entire structure, only the set fields count + u8 sa_family; ///< The address family of the sockaddr u8 sa_data[0x1A]; ///< The extra data, this varies, depending on the address family } raw; /// Structure to represent the 3ds' sockaddr_in structure struct CTRSockAddrIn { - u8 len; ///< The length of the entire structure + u8 len; ///< The length of the entire structure u8 sin_family; ///< The address family of the sockaddr_in - u16 sin_port; ///< The port associated with this sockaddr_in - u32 sin_addr; ///< The actual address of the sockaddr_in + u16 sin_port; ///< The port associated with this sockaddr_in + u32 sin_addr; ///< The actual address of the sockaddr_in } in; /// Convert a 3DS CTRSockAddr to a platform-specific sockaddr @@ -286,8 +286,7 @@ union CTRSockAddr { // We can not guarantee ABI compatibility between platforms so we copy the fields manually switch (result.sa_family) { - case AF_INET: - { + case AF_INET: { sockaddr_in* result_in = reinterpret_cast(&result); result_in->sin_port = ctr_addr.in.sin_port; result_in->sin_addr.s_addr = ctr_addr.in.sin_addr; @@ -307,8 +306,7 @@ union CTRSockAddr { result.raw.sa_family = static_cast(addr.sa_family); // We can not guarantee ABI compatibility between platforms so we copy the fields manually switch (result.raw.sa_family) { - case AF_INET: - { + case AF_INET: { sockaddr_in const* addr_in = reinterpret_cast(&addr); result.raw.len = sizeof(CTRSockAddrIn); result.in.sin_port = addr_in->sin_port; @@ -341,24 +339,27 @@ static void Socket(Service::Interface* self) { // Only 0 is allowed according to 3dbrew, using 0 will let the OS decide which protocol to use if (protocol != 0) { - cmd_buffer[1] = UnimplementedFunction(ErrorModule::SOC).raw; // TODO(Subv): Correct error code + cmd_buffer[1] = + UnimplementedFunction(ErrorModule::SOC).raw; // TODO(Subv): Correct error code return; } if (domain != AF_INET) { - cmd_buffer[1] = UnimplementedFunction(ErrorModule::SOC).raw; // TODO(Subv): Correct error code + cmd_buffer[1] = + UnimplementedFunction(ErrorModule::SOC).raw; // TODO(Subv): Correct error code return; } if (type != SOCK_DGRAM && type != SOCK_STREAM) { - cmd_buffer[1] = UnimplementedFunction(ErrorModule::SOC).raw; // TODO(Subv): Correct error code + cmd_buffer[1] = + UnimplementedFunction(ErrorModule::SOC).raw; // TODO(Subv): Correct error code return; } u32 socket_handle = static_cast(::socket(domain, type, protocol)); if ((s32)socket_handle != SOCKET_ERROR_VALUE) - open_sockets[socket_handle] = { socket_handle, true }; + open_sockets[socket_handle] = {socket_handle, true}; int result = 0; if ((s32)socket_handle == SOCKET_ERROR_VALUE) @@ -406,8 +407,8 @@ static void Fcntl(Service::Interface* self) { int result = 0; u32 posix_ret = 0; // TODO: Check what hardware returns for F_SETFL (unspecified by POSIX) SCOPE_EXIT({ - cmd_buffer[1] = result; - cmd_buffer[2] = posix_ret; + cmd_buffer[1] = result; + cmd_buffer[2] = posix_ret; }); if (ctr_cmd == 3) { // F_GETFL @@ -493,7 +494,7 @@ static void Accept(Service::Interface* self) { u32 ret = static_cast(::accept(socket_handle, &addr, &addr_len)); if ((s32)ret != SOCKET_ERROR_VALUE) - open_sockets[ret] = { ret, true }; + open_sockets[ret] = {ret, true}; int result = 0; if ((s32)ret == SOCKET_ERROR_VALUE) { @@ -573,9 +574,11 @@ static void SendTo(Service::Interface* self) { int ret = -1; if (addr_len > 0) { sockaddr dest_addr = CTRSockAddr::ToPlatform(ctr_dest_addr); - ret = ::sendto(socket_handle, reinterpret_cast(input_buff.data()), len, flags, &dest_addr, sizeof(dest_addr)); + ret = ::sendto(socket_handle, reinterpret_cast(input_buff.data()), len, flags, + &dest_addr, sizeof(dest_addr)); } else { - ret = ::sendto(socket_handle, reinterpret_cast(input_buff.data()), len, flags, nullptr, 0); + ret = ::sendto(socket_handle, reinterpret_cast(input_buff.data()), len, flags, + nullptr, 0); } int result = 0; @@ -596,8 +599,7 @@ static void RecvFrom(Service::Interface* self) { u32 flags = cmd_buffer[3]; socklen_t addr_len = static_cast(cmd_buffer[4]); - struct - { + struct { u32 output_buffer_descriptor; u32 output_buffer_addr; u32 address_buffer_descriptor; @@ -619,11 +621,13 @@ static void RecvFrom(Service::Interface* self) { std::vector output_buff(len); sockaddr src_addr; socklen_t src_addr_len = sizeof(src_addr); - int ret = ::recvfrom(socket_handle, reinterpret_cast(output_buff.data()), len, flags, &src_addr, &src_addr_len); + int ret = ::recvfrom(socket_handle, reinterpret_cast(output_buff.data()), len, flags, + &src_addr, &src_addr_len); if (ret >= 0 && buffer_parameters.output_src_address_buffer != 0 && src_addr_len > 0) { CTRSockAddr ctr_src_addr = CTRSockAddr::FromPlatform(src_addr); - Memory::WriteBlock(buffer_parameters.output_src_address_buffer, &ctr_src_addr, sizeof(ctr_src_addr)); + Memory::WriteBlock(buffer_parameters.output_src_address_buffer, &ctr_src_addr, + sizeof(ctr_src_addr)); } int result = 0; @@ -633,7 +637,8 @@ static void RecvFrom(Service::Interface* self) { total_received = 0; } else { // Write only the data we received to avoid overwriting parts of the buffer with zeros - Memory::WriteBlock(buffer_parameters.output_buffer_addr, output_buff.data(), total_received); + Memory::WriteBlock(buffer_parameters.output_buffer_addr, output_buff.data(), + total_received); } cmd_buffer[1] = result; @@ -648,7 +653,8 @@ static void Poll(Service::Interface* self) { VAddr input_fds_addr = cmd_buffer[6]; VAddr output_fds_addr = cmd_buffer[0x104 >> 2]; - if (!Memory::IsValidVirtualAddress(input_fds_addr) || !Memory::IsValidVirtualAddress(output_fds_addr)) { + if (!Memory::IsValidVirtualAddress(input_fds_addr) || + !Memory::IsValidVirtualAddress(output_fds_addr)) { cmd_buffer[1] = -1; // TODO(Subv): Find correct error code. return; } @@ -656,7 +662,8 @@ static void Poll(Service::Interface* self) { std::vector ctr_fds(nfds); Memory::ReadBlock(input_fds_addr, ctr_fds.data(), nfds * sizeof(CTRPollFD)); - // The 3ds_pollfd and the pollfd structures may be different (Windows/Linux have different sizes) + // The 3ds_pollfd and the pollfd structures may be different (Windows/Linux have different + // sizes) // so we have to copy the data std::vector platform_pollfd(nfds); std::transform(ctr_fds.begin(), ctr_fds.end(), platform_pollfd.begin(), CTRPollFD::ToPlatform); @@ -664,7 +671,8 @@ static void Poll(Service::Interface* self) { const int ret = ::poll(platform_pollfd.data(), nfds, timeout); // Now update the output pollfd structure - std::transform(platform_pollfd.begin(), platform_pollfd.end(), ctr_fds.begin(), CTRPollFD::FromPlatform); + std::transform(platform_pollfd.begin(), platform_pollfd.end(), ctr_fds.begin(), + CTRPollFD::FromPlatform); Memory::WriteBlock(output_fds_addr, ctr_fds.data(), nfds * sizeof(CTRPollFD)); @@ -775,7 +783,7 @@ static void Connect(Service::Interface* self) { } static void InitializeSockets(Service::Interface* self) { - // TODO(Subv): Implement +// TODO(Subv): Implement #ifdef _WIN32 WSADATA data; WSAStartup(MAKEWORD(2, 2), &data); @@ -808,7 +816,7 @@ static void GetSockOpt(Service::Interface* self) { int ret = -1; int err = 0; - if(optname < 0) { + if (optname < 0) { #ifdef _WIN32 err = WSAEINVAL; #else @@ -818,7 +826,7 @@ static void GetSockOpt(Service::Interface* self) { // 0x100 = static buffer offset (bytes) // + 0x4 = 2nd pointer (u32) position // >> 2 = convert to u32 offset instead of byte offset (cmd_buffer = u32*) - char* optval = reinterpret_cast(Memory::GetPointer(cmd_buffer[0x104 >> 2])); + char* optval = reinterpret_cast(Memory::GetPointer(cmd_buffer[0x104 >> 2])); ret = ::getsockopt(socket_handle, level, optname, optval, &optlen); err = 0; @@ -842,7 +850,7 @@ static void SetSockOpt(Service::Interface* self) { int ret = -1; int err = 0; - if(optname < 0) { + if (optname < 0) { #ifdef _WIN32 err = WSAEINVAL; #else @@ -850,7 +858,7 @@ static void SetSockOpt(Service::Interface* self) { #endif } else { socklen_t optlen = static_cast(cmd_buffer[4]); - const char* optval = reinterpret_cast(Memory::GetPointer(cmd_buffer[8])); + const char* optval = reinterpret_cast(Memory::GetPointer(cmd_buffer[8])); ret = static_cast(::setsockopt(socket_handle, level, optname, optval, optlen)); err = 0; @@ -865,39 +873,39 @@ static void SetSockOpt(Service::Interface* self) { } const Interface::FunctionInfo FunctionTable[] = { - {0x00010044, InitializeSockets, "InitializeSockets"}, - {0x000200C2, Socket, "Socket"}, - {0x00030082, Listen, "Listen"}, - {0x00040082, Accept, "Accept"}, - {0x00050084, Bind, "Bind"}, - {0x00060084, Connect, "Connect"}, - {0x00070104, nullptr, "recvfrom_other"}, - {0x00080102, RecvFrom, "RecvFrom"}, - {0x00090106, nullptr, "sendto_other"}, - {0x000A0106, SendTo, "SendTo"}, - {0x000B0042, Close, "Close"}, - {0x000C0082, Shutdown, "Shutdown"}, - {0x000D0082, nullptr, "GetHostByName"}, - {0x000E00C2, nullptr, "GetHostByAddr"}, - {0x000F0106, nullptr, "GetAddrInfo"}, - {0x00100102, nullptr, "GetNameInfo"}, - {0x00110102, GetSockOpt, "GetSockOpt"}, - {0x00120104, SetSockOpt, "SetSockOpt"}, - {0x001300C2, Fcntl, "Fcntl"}, - {0x00140084, Poll, "Poll"}, - {0x00150042, nullptr, "SockAtMark"}, - {0x00160000, GetHostId, "GetHostId"}, - {0x00170082, GetSockName, "GetSockName"}, - {0x00180082, GetPeerName, "GetPeerName"}, - {0x00190000, ShutdownSockets, "ShutdownSockets"}, - {0x001A00C0, nullptr, "GetNetworkOpt"}, - {0x001B0040, nullptr, "ICMPSocket"}, - {0x001C0104, nullptr, "ICMPPing"}, - {0x001D0040, nullptr, "ICMPCancel"}, - {0x001E0040, nullptr, "ICMPClose"}, - {0x001F0040, nullptr, "GetResolverInfo"}, - {0x00210002, nullptr, "CloseSockets"}, - {0x00230040, nullptr, "AddGlobalSocket"}, + {0x00010044, InitializeSockets, "InitializeSockets"}, + {0x000200C2, Socket, "Socket"}, + {0x00030082, Listen, "Listen"}, + {0x00040082, Accept, "Accept"}, + {0x00050084, Bind, "Bind"}, + {0x00060084, Connect, "Connect"}, + {0x00070104, nullptr, "recvfrom_other"}, + {0x00080102, RecvFrom, "RecvFrom"}, + {0x00090106, nullptr, "sendto_other"}, + {0x000A0106, SendTo, "SendTo"}, + {0x000B0042, Close, "Close"}, + {0x000C0082, Shutdown, "Shutdown"}, + {0x000D0082, nullptr, "GetHostByName"}, + {0x000E00C2, nullptr, "GetHostByAddr"}, + {0x000F0106, nullptr, "GetAddrInfo"}, + {0x00100102, nullptr, "GetNameInfo"}, + {0x00110102, GetSockOpt, "GetSockOpt"}, + {0x00120104, SetSockOpt, "SetSockOpt"}, + {0x001300C2, Fcntl, "Fcntl"}, + {0x00140084, Poll, "Poll"}, + {0x00150042, nullptr, "SockAtMark"}, + {0x00160000, GetHostId, "GetHostId"}, + {0x00170082, GetSockName, "GetSockName"}, + {0x00180082, GetPeerName, "GetPeerName"}, + {0x00190000, ShutdownSockets, "ShutdownSockets"}, + {0x001A00C0, nullptr, "GetNetworkOpt"}, + {0x001B0040, nullptr, "ICMPSocket"}, + {0x001C0104, nullptr, "ICMPPing"}, + {0x001D0040, nullptr, "ICMPCancel"}, + {0x001E0040, nullptr, "ICMPClose"}, + {0x001F0040, nullptr, "GetResolverInfo"}, + {0x00210002, nullptr, "CloseSockets"}, + {0x00230040, nullptr, "AddGlobalSocket"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index 3c05f836b..fda9d8acf 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp @@ -5,8 +5,8 @@ #include "common/common_types.h" #include "common/logging/log.h" -#include "core/hle/service/srv.h" #include "core/hle/kernel/event.h" +#include "core/hle/service/srv.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace SRV @@ -28,13 +28,14 @@ static void RegisterClient(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); if (cmd_buff[1] != IPC::CallingPidDesc()) { - cmd_buff[0] = IPC::MakeHeader(0x0, 0x1, 0); //0x40 + cmd_buff[0] = IPC::MakeHeader(0x0, 0x1, 0); // 0x40 cmd_buff[1] = ResultCode(ErrorDescription::OS_InvalidBufferDescriptor, ErrorModule::OS, - ErrorSummary::WrongArgument, ErrorLevel::Permanent).raw; + ErrorSummary::WrongArgument, ErrorLevel::Permanent) + .raw; return; } - cmd_buff[0] = IPC::MakeHeader(0x1, 0x1, 0); //0x10040 - cmd_buff[1] = RESULT_SUCCESS.raw; // No error + cmd_buff[0] = IPC::MakeHeader(0x1, 0x1, 0); // 0x10040 + cmd_buff[1] = RESULT_SUCCESS.raw; // No error LOG_WARNING(Service_SRV, "(STUBBED) called"); } @@ -56,7 +57,7 @@ static void EnableNotification(Service::Interface* self) { event_handle->Clear(); cmd_buff[0] = IPC::MakeHeader(0x2, 0x1, 0x2); // 0x20042 - cmd_buff[1] = RESULT_SUCCESS.raw; // No error + cmd_buff[1] = RESULT_SUCCESS.raw; // No error cmd_buff[2] = IPC::CopyHandleDesc(1); cmd_buff[3] = Kernel::g_handle_table.Create(event_handle).MoveFrom(); LOG_WARNING(Service_SRV, "(STUBBED) called"); @@ -105,7 +106,7 @@ static void Subscribe(Service::Interface* self) { u32 notification_id = cmd_buff[1]; cmd_buff[0] = IPC::MakeHeader(0x9, 0x1, 0); // 0x90040 - cmd_buff[1] = RESULT_SUCCESS.raw; // No error + cmd_buff[1] = RESULT_SUCCESS.raw; // No error LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x%X", notification_id); } @@ -124,7 +125,7 @@ static void Unsubscribe(Service::Interface* self) { u32 notification_id = cmd_buff[1]; cmd_buff[0] = IPC::MakeHeader(0xA, 0x1, 0); // 0xA0040 - cmd_buff[1] = RESULT_SUCCESS.raw; // No error + cmd_buff[1] = RESULT_SUCCESS.raw; // No error LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x%X", notification_id); } @@ -145,25 +146,26 @@ static void PublishToSubscriber(Service::Interface* self) { u8 flags = cmd_buff[2] & 0xFF; cmd_buff[0] = IPC::MakeHeader(0xC, 0x1, 0); // 0xC0040 - cmd_buff[1] = RESULT_SUCCESS.raw; // No error - LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x%X, flags=%u", notification_id, flags); + cmd_buff[1] = RESULT_SUCCESS.raw; // No error + LOG_WARNING(Service_SRV, "(STUBBED) called, notification_id=0x%X, flags=%u", notification_id, + flags); } const Interface::FunctionInfo FunctionTable[] = { - {0x00010002, RegisterClient, "RegisterClient"}, - {0x00020000, EnableNotification, "EnableNotification"}, - {0x00030100, nullptr, "RegisterService"}, - {0x000400C0, nullptr, "UnregisterService"}, - {0x00050100, GetServiceHandle, "GetServiceHandle"}, - {0x000600C2, nullptr, "RegisterPort"}, - {0x000700C0, nullptr, "UnregisterPort"}, - {0x00080100, nullptr, "GetPort"}, - {0x00090040, Subscribe, "Subscribe"}, - {0x000A0040, Unsubscribe, "Unsubscribe"}, - {0x000B0000, nullptr, "ReceiveNotification"}, - {0x000C0080, PublishToSubscriber, "PublishToSubscriber"}, - {0x000D0040, nullptr, "PublishAndGetSubscriber"}, - {0x000E00C0, nullptr, "IsServiceRegistered"}, + {0x00010002, RegisterClient, "RegisterClient"}, + {0x00020000, EnableNotification, "EnableNotification"}, + {0x00030100, nullptr, "RegisterService"}, + {0x000400C0, nullptr, "UnregisterService"}, + {0x00050100, GetServiceHandle, "GetServiceHandle"}, + {0x000600C2, nullptr, "RegisterPort"}, + {0x000700C0, nullptr, "UnregisterPort"}, + {0x00080100, nullptr, "GetPort"}, + {0x00090040, Subscribe, "Subscribe"}, + {0x000A0040, Unsubscribe, "Unsubscribe"}, + {0x000B0000, nullptr, "ReceiveNotification"}, + {0x000C0080, PublishToSubscriber, "PublishToSubscriber"}, + {0x000D0040, nullptr, "PublishAndGetSubscriber"}, + {0x000E00C0, nullptr, "IsServiceRegistered"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/ssl_c.cpp b/src/core/hle/service/ssl_c.cpp index a8aff1abf..47c4a8cb0 100644 --- a/src/core/hle/service/ssl_c.cpp +++ b/src/core/hle/service/ssl_c.cpp @@ -37,7 +37,8 @@ static void GenerateRandomData(Service::Interface* self) { u32 i = 0; while (i < size) { if ((i % 4) == 0) { - // The random number generator returns 4 bytes worth of data, so generate new random data when i == 0 and when i is divisible by 4 + // The random number generator returns 4 bytes worth of data, so generate new random + // data when i == 0 and when i is divisible by 4 data = rand_gen(); } @@ -59,27 +60,26 @@ static void GenerateRandomData(Service::Interface* self) { } const Interface::FunctionInfo FunctionTable[] = { - {0x00010002, Initialize, "Initialize"}, - {0x000200C2, nullptr, "CreateContext"}, - {0x00030000, nullptr, "CreateRootCertChain"}, - {0x00040040, nullptr, "DestroyRootCertChain"}, - {0x00050082, nullptr, "AddTrustedRootCA"}, - {0x00060080, nullptr, "RootCertChainAddDefaultCert"}, - {0x00070080, nullptr, "RootCertChainRemoveCert"}, - {0x000E0040, nullptr, "OpenDefaultClientCertContext"}, - {0x000F0040, nullptr, "CloseClientCertContext"}, - {0x00110042, GenerateRandomData, "GenerateRandomData"}, - {0x00120042, nullptr, "InitializeConnectionSession"}, - {0x00130040, nullptr, "StartConnection"}, - {0x00140040, nullptr, "StartConnectionGetOut"}, - {0x00150082, nullptr, "Read"}, - {0x00170082, nullptr, "Write"}, - {0x00180080, nullptr, "ContextSetRootCertChain"}, - {0x00190080, nullptr, "ContextSetClientCert"}, - {0x001B0080, nullptr, "ContextClearOpt"}, - {0x001E0040, nullptr, "DestroyContext"}, - {0x001F0082, nullptr, "ContextInitSharedmem"} -}; + {0x00010002, Initialize, "Initialize"}, + {0x000200C2, nullptr, "CreateContext"}, + {0x00030000, nullptr, "CreateRootCertChain"}, + {0x00040040, nullptr, "DestroyRootCertChain"}, + {0x00050082, nullptr, "AddTrustedRootCA"}, + {0x00060080, nullptr, "RootCertChainAddDefaultCert"}, + {0x00070080, nullptr, "RootCertChainRemoveCert"}, + {0x000E0040, nullptr, "OpenDefaultClientCertContext"}, + {0x000F0040, nullptr, "CloseClientCertContext"}, + {0x00110042, GenerateRandomData, "GenerateRandomData"}, + {0x00120042, nullptr, "InitializeConnectionSession"}, + {0x00130040, nullptr, "StartConnection"}, + {0x00140040, nullptr, "StartConnectionGetOut"}, + {0x00150082, nullptr, "Read"}, + {0x00170082, nullptr, "Write"}, + {0x00180080, nullptr, "ContextSetRootCertChain"}, + {0x00190080, nullptr, "ContextSetClientCert"}, + {0x001B0080, nullptr, "ContextClearOpt"}, + {0x001E0040, nullptr, "DestroyContext"}, + {0x001F0082, nullptr, "ContextInitSharedmem"}}; //////////////////////////////////////////////////////////////////////////////////////////////////// // Interface class diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp index d16578f87..278548e0e 100644 --- a/src/core/hle/service/y2r_u.cpp +++ b/src/core/hle/service/y2r_u.cpp @@ -39,16 +39,16 @@ static u32 transfer_end_interrupt_enabled = 0; static u32 spacial_dithering_enabled = 0; static const CoefficientSet standard_coefficients[4] = { - {{ 0x100, 0x166, 0xB6, 0x58, 0x1C5, -0x166F, 0x10EE, -0x1C5B }}, // ITU_Rec601 - {{ 0x100, 0x193, 0x77, 0x2F, 0x1DB, -0x1933, 0xA7C, -0x1D51 }}, // ITU_Rec709 - {{ 0x12A, 0x198, 0xD0, 0x64, 0x204, -0x1BDE, 0x10F2, -0x229B }}, // ITU_Rec601_Scaling - {{ 0x12A, 0x1CA, 0x88, 0x36, 0x21C, -0x1F04, 0x99C, -0x2421 }}, // ITU_Rec709_Scaling + {{0x100, 0x166, 0xB6, 0x58, 0x1C5, -0x166F, 0x10EE, -0x1C5B}}, // ITU_Rec601 + {{0x100, 0x193, 0x77, 0x2F, 0x1DB, -0x1933, 0xA7C, -0x1D51}}, // ITU_Rec709 + {{0x12A, 0x198, 0xD0, 0x64, 0x204, -0x1BDE, 0x10F2, -0x229B}}, // ITU_Rec601_Scaling + {{0x12A, 0x1CA, 0x88, 0x36, 0x21C, -0x1F04, 0x99C, -0x2421}}, // ITU_Rec709_Scaling }; ResultCode ConversionConfiguration::SetInputLineWidth(u16 width) { if (width == 0 || width > 1024 || width % 8 != 0) { return ResultCode(ErrorDescription::OutOfRange, ErrorModule::CAM, - ErrorSummary::InvalidArgument, ErrorLevel::Usage); // 0xE0E053FD + ErrorSummary::InvalidArgument, ErrorLevel::Usage); // 0xE0E053FD } // Note: The hardware uses the register value 0 to represent a width of 1024, so for a width of @@ -61,7 +61,7 @@ ResultCode ConversionConfiguration::SetInputLineWidth(u16 width) { ResultCode ConversionConfiguration::SetInputLines(u16 lines) { if (lines == 0 || lines > 1024) { return ResultCode(ErrorDescription::OutOfRange, ErrorModule::CAM, - ErrorSummary::InvalidArgument, ErrorLevel::Usage); // 0xE0E053FD + ErrorSummary::InvalidArgument, ErrorLevel::Usage); // 0xE0E053FD } // Note: In what appears to be a bug, the `camera` module does not set the hardware register at @@ -73,11 +73,12 @@ ResultCode ConversionConfiguration::SetInputLines(u16 lines) { return RESULT_SUCCESS; } -ResultCode ConversionConfiguration::SetStandardCoefficient(StandardCoefficient standard_coefficient) { +ResultCode +ConversionConfiguration::SetStandardCoefficient(StandardCoefficient standard_coefficient) { size_t index = static_cast(standard_coefficient); if (index >= ARRAY_SIZE(standard_coefficients)) { return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::CAM, - ErrorSummary::InvalidArgument, ErrorLevel::Usage); // 0xE0E053ED + ErrorSummary::InvalidArgument, ErrorLevel::Usage); // 0xE0E053ED } std::memcpy(coefficients.data(), standard_coefficients[index].data(), sizeof(coefficients)); @@ -294,8 +295,10 @@ static void SetSendingY(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x10, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_DEBUG(Service_Y2R, "called image_size=0x%08X, transfer_unit=%hu, transfer_stride=%hu, src_process_handle=0x%08X", - conversion.src_Y.image_size, conversion.src_Y.transfer_unit, conversion.src_Y.gap, cmd_buff[6]); + LOG_DEBUG(Service_Y2R, "called image_size=0x%08X, transfer_unit=%hu, transfer_stride=%hu, " + "src_process_handle=0x%08X", + conversion.src_Y.image_size, conversion.src_Y.transfer_unit, conversion.src_Y.gap, + cmd_buff[6]); } static void SetSendingU(Service::Interface* self) { @@ -309,8 +312,10 @@ static void SetSendingU(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x11, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_DEBUG(Service_Y2R, "called image_size=0x%08X, transfer_unit=%hu, transfer_stride=%hu, src_process_handle=0x%08X", - conversion.src_U.image_size, conversion.src_U.transfer_unit, conversion.src_U.gap, cmd_buff[6]); + LOG_DEBUG(Service_Y2R, "called image_size=0x%08X, transfer_unit=%hu, transfer_stride=%hu, " + "src_process_handle=0x%08X", + conversion.src_U.image_size, conversion.src_U.transfer_unit, conversion.src_U.gap, + cmd_buff[6]); } static void SetSendingV(Service::Interface* self) { @@ -324,8 +329,10 @@ static void SetSendingV(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x12, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_DEBUG(Service_Y2R, "called image_size=0x%08X, transfer_unit=%hu, transfer_stride=%hu, src_process_handle=0x%08X", - conversion.src_V.image_size, conversion.src_V.transfer_unit, conversion.src_V.gap, cmd_buff[6]); + LOG_DEBUG(Service_Y2R, "called image_size=0x%08X, transfer_unit=%hu, transfer_stride=%hu, " + "src_process_handle=0x%08X", + conversion.src_V.image_size, conversion.src_V.transfer_unit, conversion.src_V.gap, + cmd_buff[6]); } static void SetSendingYUYV(Service::Interface* self) { @@ -339,8 +346,10 @@ static void SetSendingYUYV(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x13, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_DEBUG(Service_Y2R, "called image_size=0x%08X, transfer_unit=%hu, transfer_stride=%hu, src_process_handle=0x%08X", - conversion.src_YUYV.image_size, conversion.src_YUYV.transfer_unit, conversion.src_YUYV.gap, cmd_buff[6]); + LOG_DEBUG(Service_Y2R, "called image_size=0x%08X, transfer_unit=%hu, transfer_stride=%hu, " + "src_process_handle=0x%08X", + conversion.src_YUYV.image_size, conversion.src_YUYV.transfer_unit, + conversion.src_YUYV.gap, cmd_buff[6]); } /** @@ -418,8 +427,10 @@ static void SetReceiving(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x18, 1, 0); cmd_buff[1] = RESULT_SUCCESS.raw; - LOG_DEBUG(Service_Y2R, "called image_size=0x%08X, transfer_unit=%hu, transfer_stride=%hu, dst_process_handle=0x%08X", - conversion.dst.image_size, conversion.dst.transfer_unit, conversion.dst.gap, cmd_buff[6]); + LOG_DEBUG(Service_Y2R, "called image_size=0x%08X, transfer_unit=%hu, transfer_stride=%hu, " + "dst_process_handle=0x%08X", + conversion.dst.image_size, conversion.dst.transfer_unit, conversion.dst.gap, + cmd_buff[6]); } /** @@ -486,8 +497,8 @@ static void SetCoefficient(Service::Interface* self) { cmd_buff[1] = RESULT_SUCCESS.raw; LOG_DEBUG(Service_Y2R, "called coefficients=[%hX, %hX, %hX, %hX, %hX, %hX, %hX, %hX]", - coefficients[0], coefficients[1], coefficients[2], coefficients[3], - coefficients[4], coefficients[5], coefficients[6], coefficients[7]); + coefficients[0], coefficients[1], coefficients[2], coefficients[3], coefficients[4], + coefficients[5], coefficients[6], coefficients[7]); } static void GetCoefficient(Service::Interface* self) { @@ -575,8 +586,10 @@ static void StartConversion(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); // dst_image_size would seem to be perfect for this, but it doesn't include the gap :( - u32 total_output_size = conversion.input_lines * (conversion.dst.transfer_unit + conversion.dst.gap); - Memory::RasterizerFlushAndInvalidateRegion(Memory::VirtualToPhysicalAddress(conversion.dst.address), total_output_size); + u32 total_output_size = + conversion.input_lines * (conversion.dst.transfer_unit + conversion.dst.gap); + Memory::RasterizerFlushAndInvalidateRegion( + Memory::VirtualToPhysicalAddress(conversion.dst.address), total_output_size); HW::Y2R::PerformConversion(conversion); @@ -648,10 +661,13 @@ cleanup: cmd_buff[0] = IPC::MakeHeader(0x29, 1, 0); cmd_buff[1] = result.raw; - LOG_DEBUG(Service_Y2R, "called input_format=%hhu output_format=%hhu rotation=%hhu block_alignment=%hhu " - "input_line_width=%hu input_lines=%hu standard_coefficient=%hhu reserved=%hhu alpha=%hX", - params->input_format, params->output_format, params->rotation, params->block_alignment, - params->input_line_width, params->input_lines, params->standard_coefficient, params->padding, params->alpha); + LOG_DEBUG( + Service_Y2R, + "called input_format=%hhu output_format=%hhu rotation=%hhu block_alignment=%hhu " + "input_line_width=%hu input_lines=%hu standard_coefficient=%hhu reserved=%hhu alpha=%hX", + params->input_format, params->output_format, params->rotation, params->block_alignment, + params->input_line_width, params->input_lines, params->standard_coefficient, + params->padding, params->alpha); } static void PingProcess(Service::Interface* self) { @@ -699,7 +715,6 @@ static void DriverFinalize(Service::Interface* self) { LOG_DEBUG(Service_Y2R, "called"); } - static void GetPackageParameter(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); @@ -711,51 +726,51 @@ static void GetPackageParameter(Service::Interface* self) { } const Interface::FunctionInfo FunctionTable[] = { - {0x00010040, SetInputFormat, "SetInputFormat"}, - {0x00020000, GetInputFormat, "GetInputFormat"}, - {0x00030040, SetOutputFormat, "SetOutputFormat"}, - {0x00040000, GetOutputFormat, "GetOutputFormat"}, - {0x00050040, SetRotation, "SetRotation"}, - {0x00060000, GetRotation, "GetRotation"}, - {0x00070040, SetBlockAlignment, "SetBlockAlignment"}, - {0x00080000, GetBlockAlignment, "GetBlockAlignment"}, - {0x00090040, SetSpacialDithering, "SetSpacialDithering"}, - {0x000A0000, GetSpacialDithering, "GetSpacialDithering"}, - {0x000B0040, SetTemporalDithering, "SetTemporalDithering"}, - {0x000C0000, GetTemporalDithering, "GetTemporalDithering"}, + {0x00010040, SetInputFormat, "SetInputFormat"}, + {0x00020000, GetInputFormat, "GetInputFormat"}, + {0x00030040, SetOutputFormat, "SetOutputFormat"}, + {0x00040000, GetOutputFormat, "GetOutputFormat"}, + {0x00050040, SetRotation, "SetRotation"}, + {0x00060000, GetRotation, "GetRotation"}, + {0x00070040, SetBlockAlignment, "SetBlockAlignment"}, + {0x00080000, GetBlockAlignment, "GetBlockAlignment"}, + {0x00090040, SetSpacialDithering, "SetSpacialDithering"}, + {0x000A0000, GetSpacialDithering, "GetSpacialDithering"}, + {0x000B0040, SetTemporalDithering, "SetTemporalDithering"}, + {0x000C0000, GetTemporalDithering, "GetTemporalDithering"}, {0x000D0040, SetTransferEndInterrupt, "SetTransferEndInterrupt"}, {0x000E0000, GetTransferEndInterrupt, "GetTransferEndInterrupt"}, - {0x000F0000, GetTransferEndEvent, "GetTransferEndEvent"}, - {0x00100102, SetSendingY, "SetSendingY"}, - {0x00110102, SetSendingU, "SetSendingU"}, - {0x00120102, SetSendingV, "SetSendingV"}, - {0x00130102, SetSendingYUYV, "SetSendingYUYV"}, - {0x00140000, IsFinishedSendingYuv, "IsFinishedSendingYuv"}, - {0x00150000, IsFinishedSendingY, "IsFinishedSendingY"}, - {0x00160000, IsFinishedSendingU, "IsFinishedSendingU"}, - {0x00170000, IsFinishedSendingV, "IsFinishedSendingV"}, - {0x00180102, SetReceiving, "SetReceiving"}, - {0x00190000, IsFinishedReceiving, "IsFinishedReceiving"}, - {0x001A0040, SetInputLineWidth, "SetInputLineWidth"}, - {0x001B0000, GetInputLineWidth, "GetInputLineWidth"}, - {0x001C0040, SetInputLines, "SetInputLines"}, - {0x001D0000, GetInputLines, "GetInputLines"}, - {0x001E0100, SetCoefficient, "SetCoefficient"}, - {0x001F0000, GetCoefficient, "GetCoefficient"}, - {0x00200040, SetStandardCoefficient, "SetStandardCoefficient"}, - {0x00210040, GetStandardCoefficient, "GetStandardCoefficient"}, - {0x00220040, SetAlpha, "SetAlpha"}, - {0x00230000, GetAlpha, "GetAlpha"}, - {0x00240200, SetDitheringWeightParams,"SetDitheringWeightParams"}, - {0x00250000, GetDitheringWeightParams,"GetDitheringWeightParams"}, - {0x00260000, StartConversion, "StartConversion"}, - {0x00270000, StopConversion, "StopConversion"}, - {0x00280000, IsBusyConversion, "IsBusyConversion"}, - {0x002901C0, SetPackageParameter, "SetPackageParameter"}, - {0x002A0000, PingProcess, "PingProcess"}, - {0x002B0000, DriverInitialize, "DriverInitialize"}, - {0x002C0000, DriverFinalize, "DriverFinalize"}, - {0x002D0000, GetPackageParameter, "GetPackageParameter"}, + {0x000F0000, GetTransferEndEvent, "GetTransferEndEvent"}, + {0x00100102, SetSendingY, "SetSendingY"}, + {0x00110102, SetSendingU, "SetSendingU"}, + {0x00120102, SetSendingV, "SetSendingV"}, + {0x00130102, SetSendingYUYV, "SetSendingYUYV"}, + {0x00140000, IsFinishedSendingYuv, "IsFinishedSendingYuv"}, + {0x00150000, IsFinishedSendingY, "IsFinishedSendingY"}, + {0x00160000, IsFinishedSendingU, "IsFinishedSendingU"}, + {0x00170000, IsFinishedSendingV, "IsFinishedSendingV"}, + {0x00180102, SetReceiving, "SetReceiving"}, + {0x00190000, IsFinishedReceiving, "IsFinishedReceiving"}, + {0x001A0040, SetInputLineWidth, "SetInputLineWidth"}, + {0x001B0000, GetInputLineWidth, "GetInputLineWidth"}, + {0x001C0040, SetInputLines, "SetInputLines"}, + {0x001D0000, GetInputLines, "GetInputLines"}, + {0x001E0100, SetCoefficient, "SetCoefficient"}, + {0x001F0000, GetCoefficient, "GetCoefficient"}, + {0x00200040, SetStandardCoefficient, "SetStandardCoefficient"}, + {0x00210040, GetStandardCoefficient, "GetStandardCoefficient"}, + {0x00220040, SetAlpha, "SetAlpha"}, + {0x00230000, GetAlpha, "GetAlpha"}, + {0x00240200, SetDitheringWeightParams, "SetDitheringWeightParams"}, + {0x00250000, GetDitheringWeightParams, "GetDitheringWeightParams"}, + {0x00260000, StartConversion, "StartConversion"}, + {0x00270000, StopConversion, "StopConversion"}, + {0x00280000, IsBusyConversion, "IsBusyConversion"}, + {0x002901C0, SetPackageParameter, "SetPackageParameter"}, + {0x002A0000, PingProcess, "PingProcess"}, + {0x002B0000, DriverInitialize, "DriverInitialize"}, + {0x002C0000, DriverFinalize, "DriverFinalize"}, + {0x002D0000, GetPackageParameter, "GetPackageParameter"}, }; //////////////////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 396a8d91a4423d9c793eeff0798d544613647511 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sun, 18 Sep 2016 18:01:46 -0700 Subject: Manually tweak source formatting and then re-run clang-format --- src/audio_core/codec.cpp | 2 +- src/audio_core/hle/dsp.cpp | 3 +- src/audio_core/hle/dsp.h | 72 ++++++---- src/audio_core/hle/filter.cpp | 2 + src/audio_core/hle/mixers.cpp | 5 +- src/audio_core/hle/pipe.cpp | 10 +- src/audio_core/hle/pipe.h | 14 +- src/audio_core/hle/source.cpp | 44 +++--- src/audio_core/interpolate.cpp | 20 +-- src/audio_core/interpolate.h | 4 +- src/audio_core/null_sink.h | 3 +- src/audio_core/sink.h | 4 +- src/audio_core/sink_details.h | 3 +- src/citra/citra.cpp | 10 +- src/citra/emu_window/emu_window_sdl2.cpp | 1 + src/citra/emu_window/emu_window_sdl2.h | 4 +- src/citra_qt/bootmanager.cpp | 11 +- src/citra_qt/bootmanager.h | 4 +- src/citra_qt/configure_audio.cpp | 3 +- src/citra_qt/configure_debug.cpp | 3 +- src/citra_qt/configure_dialog.cpp | 8 +- src/citra_qt/configure_general.cpp | 4 +- src/citra_qt/configure_graphics.cpp | 4 +- src/citra_qt/configure_input.cpp | 49 +++---- src/citra_qt/configure_system.cpp | 15 +- src/citra_qt/debugger/callstack.cpp | 3 +- src/citra_qt/debugger/disassembler.cpp | 6 +- src/citra_qt/debugger/graphics_breakpoints.cpp | 6 +- src/citra_qt/debugger/graphics_cmdlists.cpp | 3 +- src/citra_qt/debugger/graphics_surface.cpp | 11 +- src/citra_qt/debugger/graphics_vertex_shader.cpp | 3 +- src/citra_qt/debugger/ramview.cpp | 3 +- src/citra_qt/debugger/registers.cpp | 3 +- src/citra_qt/game_list_p.h | 18 +-- src/citra_qt/hotkeys.cpp | 3 +- src/citra_qt/main.h | 4 +- src/common/bit_set.h | 18 +-- src/common/chunk_file.h | 9 +- src/common/code_block.h | 3 +- src/common/common_funcs.h | 3 +- src/common/emu_window.h | 7 +- src/common/file_util.cpp | 3 +- src/common/math_util.h | 6 +- src/common/profiler.cpp | 3 +- src/common/scope_exit.h | 3 +- src/common/swap.h | 3 +- src/common/synchronized_wrapper.h | 3 +- src/common/thread.h | 6 +- src/common/vector_math.h | 18 +-- src/common/x64/emitter.cpp | 2 +- src/common/x64/emitter.h | 6 +- src/core/arm/arm_interface.h | 3 +- src/core/arm/dyncom/arm_dyncom.cpp | 3 +- src/core/arm/dyncom/arm_dyncom_trans.cpp | 3 +- src/core/arm/skyeye_common/armstate.h | 6 +- src/core/arm/skyeye_common/vfp/vfpdouble.cpp | 2 +- src/core/arm/skyeye_common/vfp/vfpsingle.cpp | 14 +- src/core/core.cpp | 3 +- src/core/core_timing.cpp | 6 +- src/core/file_sys/archive_backend.h | 36 +++-- src/core/file_sys/archive_savedata.cpp | 7 +- src/core/file_sys/archive_savedatacheck.cpp | 3 +- src/core/file_sys/archive_systemsavedata.cpp | 3 +- src/core/file_sys/directory_backend.h | 6 +- src/core/file_sys/disk_archive.h | 3 +- src/core/file_sys/file_backend.h | 6 +- src/core/file_sys/ivfc_archive.h | 9 +- src/core/hle/applets/applet.h | 6 +- src/core/hle/applets/erreula.cpp | 3 +- src/core/hle/applets/erreula.h | 3 +- src/core/hle/applets/mii_selector.cpp | 3 +- src/core/hle/applets/mii_selector.h | 3 +- src/core/hle/applets/swkbd.h | 3 +- src/core/hle/kernel/address_arbiter.cpp | 6 +- src/core/hle/kernel/client_port.cpp | 6 +- src/core/hle/kernel/event.cpp | 6 +- src/core/hle/kernel/kernel.h | 3 +- src/core/hle/kernel/mutex.cpp | 6 +- src/core/hle/kernel/process.cpp | 12 +- src/core/hle/kernel/resource_limit.cpp | 9 +- src/core/hle/kernel/resource_limit.h | 4 +- src/core/hle/kernel/semaphore.cpp | 6 +- src/core/hle/kernel/server_port.cpp | 11 +- src/core/hle/kernel/server_port.h | 4 +- src/core/hle/kernel/session.cpp | 6 +- src/core/hle/kernel/shared_memory.cpp | 6 +- src/core/hle/kernel/thread.cpp | 6 +- src/core/hle/kernel/timer.cpp | 9 +- src/core/hle/result.h | 3 +- src/core/hle/service/am/am.cpp | 3 +- src/core/hle/service/am/am_app.cpp | 2 +- src/core/hle/service/am/am_net.cpp | 2 +- src/core/hle/service/am/am_sys.cpp | 46 +++--- src/core/hle/service/am/am_u.cpp | 72 +++++----- src/core/hle/service/apt/apt.cpp | 6 +- src/core/hle/service/apt/apt.h | 14 +- src/core/hle/service/apt/apt_a.cpp | 5 +- src/core/hle/service/apt/apt_s.cpp | 5 +- src/core/hle/service/apt/apt_u.cpp | 5 +- src/core/hle/service/boss/boss.cpp | 3 +- src/core/hle/service/cam/cam.h | 54 ++++++-- src/core/hle/service/cam/cam_u.cpp | 2 +- src/core/hle/service/cecd/cecd_u.cpp | 2 +- src/core/hle/service/cfg/cfg.cpp | 13 +- src/core/hle/service/cfg/cfg.h | 15 +- src/core/hle/service/cfg/cfg_i.cpp | 2 +- src/core/hle/service/cfg/cfg_s.cpp | 2 +- src/core/hle/service/cfg/cfg_u.cpp | 2 +- src/core/hle/service/dlp/dlp.cpp | 3 +- src/core/hle/service/err_f.cpp | 4 +- src/core/hle/service/frd/frd.cpp | 3 +- src/core/hle/service/frd/frd_u.cpp | 2 +- src/core/hle/service/fs/archive.cpp | 12 +- src/core/hle/service/fs/fs_user.cpp | 3 +- src/core/hle/service/gsp_gpu.cpp | 7 +- src/core/hle/service/gsp_lcd.cpp | 14 +- src/core/hle/service/hid/hid.cpp | 9 +- src/core/hle/service/hid/hid_spvr.cpp | 2 +- src/core/hle/service/hid/hid_user.cpp | 2 +- src/core/hle/service/ir/ir_rst.cpp | 2 +- src/core/hle/service/ir/ir_u.cpp | 29 ++-- src/core/hle/service/ir/ir_user.cpp | 2 +- src/core/hle/service/ldr_ro/cro_helper.cpp | 47 ++++--- src/core/hle/service/ldr_ro/cro_helper.h | 9 +- src/core/hle/service/ldr_ro/ldr_ro.cpp | 14 +- src/core/hle/service/ndm/ndm.cpp | 13 +- src/core/hle/service/ndm/ndm.h | 9 +- src/core/hle/service/ndm/ndm_u.cpp | 2 +- src/core/hle/service/news/news.cpp | 3 +- src/core/hle/service/news/news_s.cpp | 2 +- src/core/hle/service/nim/nim.cpp | 3 +- src/core/hle/service/nim/nim_u.cpp | 2 +- src/core/hle/service/ptm/ptm.cpp | 3 +- src/core/hle/service/ptm/ptm_sysm.cpp | 2 +- src/core/hle/service/ptm/ptm_u.cpp | 2 +- src/core/hle/service/soc_u.cpp | 154 +++++++++++---------- src/core/hle/service/ssl_c.cpp | 3 +- src/core/hle/service/y2r_u.cpp | 4 +- src/core/hw/hw.cpp | 3 +- src/core/hw/y2r.cpp | 32 +++-- src/core/loader/3dsx.h | 3 +- src/core/loader/elf.h | 3 +- src/core/loader/loader.h | 6 +- src/core/loader/ncch.h | 3 +- src/core/tracer/citrace.h | 7 +- src/core/tracer/recorder.cpp | 3 +- src/video_core/clipper.cpp | 3 +- src/video_core/command_processor.cpp | 3 +- src/video_core/debug_utils/debug_utils.cpp | 37 ++--- src/video_core/debug_utils/debug_utils.h | 6 +- src/video_core/gpu_debugger.h | 3 +- src/video_core/pica.h | 25 +++- src/video_core/primitive_assembly.cpp | 3 +- src/video_core/rasterizer.cpp | 42 +++--- src/video_core/rasterizer_interface.h | 3 +- src/video_core/renderer_base.h | 3 +- src/video_core/renderer_opengl/gl_rasterizer.cpp | 10 +- src/video_core/renderer_opengl/gl_rasterizer.h | 9 +- .../renderer_opengl/gl_rasterizer_cache.cpp | 4 +- .../renderer_opengl/gl_rasterizer_cache.h | 4 +- src/video_core/renderer_opengl/gl_shader_gen.cpp | 4 +- src/video_core/renderer_opengl/pica_to_gl.h | 16 ++- src/video_core/renderer_opengl/renderer_opengl.cpp | 32 ++--- src/video_core/renderer_opengl/renderer_opengl.h | 7 +- src/video_core/shader/shader.cpp | 4 +- src/video_core/shader/shader.h | 3 +- src/video_core/shader/shader_interpreter.cpp | 5 +- src/video_core/shader/shader_jit_x64.cpp | 3 +- src/video_core/swrasterizer.h | 15 +- 169 files changed, 808 insertions(+), 812 deletions(-) (limited to 'src/core/hle/service') diff --git a/src/audio_core/codec.cpp b/src/audio_core/codec.cpp index c7efae753..4edfe9be0 100644 --- a/src/audio_core/codec.cpp +++ b/src/audio_core/codec.cpp @@ -23,7 +23,7 @@ StereoBuffer16 DecodeADPCM(const u8* const data, const size_t sample_count, constexpr size_t FRAME_LEN = 8; constexpr size_t SAMPLES_PER_FRAME = 14; - constexpr std::array SIGNED_NIBBLES{ + constexpr std::array SIGNED_NIBBLES = { {0, 1, 2, 3, 4, 5, 6, 7, -8, -7, -6, -5, -4, -3, -2, -1}}; const size_t ret_size = diff --git a/src/audio_core/hle/dsp.cpp b/src/audio_core/hle/dsp.cpp index 5c8afa111..aaa3a280f 100644 --- a/src/audio_core/hle/dsp.cpp +++ b/src/audio_core/hle/dsp.cpp @@ -49,7 +49,8 @@ static SharedMemory& WriteRegion() { static std::array sources = { Source(0), Source(1), Source(2), Source(3), Source(4), Source(5), Source(6), Source(7), Source(8), Source(9), Source(10), Source(11), Source(12), Source(13), Source(14), Source(15), - Source(16), Source(17), Source(18), Source(19), Source(20), Source(21), Source(22), Source(23)}; + Source(16), Source(17), Source(18), Source(19), Source(20), Source(21), Source(22), Source(23), +}; static Mixers mixers; static StereoFrame16 GenerateCurrentFrame() { diff --git a/src/audio_core/hle/dsp.h b/src/audio_core/hle/dsp.h index 5b216eb87..f4c4b01e2 100644 --- a/src/audio_core/hle/dsp.h +++ b/src/audio_core/hle/dsp.h @@ -23,16 +23,15 @@ class Sink; namespace DSP { namespace HLE { -// The application-accessible region of DSP memory consists of two parts. -// Both are marked as IO and have Read/Write permissions. +// The application-accessible region of DSP memory consists of two parts. Both are marked as IO and +// have Read/Write permissions. // // First Region: 0x1FF50000 (Size: 0x8000) // Second Region: 0x1FF70000 (Size: 0x8000) // // The DSP reads from each region alternately based on the frame counter for each region much like a // double-buffer. The frame counter is located as the very last u16 of each region and is -// incremented -// each audio tick. +// incremented each audio tick. constexpr VAddr region0_base = 0x1FF50000; constexpr VAddr region1_base = 0x1FF70000; @@ -92,14 +91,12 @@ static_assert(std::is_trivially_copyable::value, "u32_dsp isn't trivial // See also: DSP::HLE::PipeRead. // // Note that the above addresses do vary slightly between audio firmwares observed; the addresses -// are -// not fixed in stone. The addresses above are only an examplar; they're what this implementation -// does and provides to applications. +// are not fixed in stone. The addresses above are only an examplar; they're what this +// implementation does and provides to applications. // // Application requests the DSP service to convert DSP addresses into ARM11 virtual addresses using -// the -// ConvertProcessAddressFromDspDram service call. Applications seem to derive the addresses for the -// second region via: +// the ConvertProcessAddressFromDspDram service call. Applications seem to derive the addresses for +// the second region via: // second_region_dsp_addr = first_region_dsp_addr | 0x10000 // // Applications maintain most of its own audio state, the memory region is used mainly for @@ -107,7 +104,7 @@ static_assert(std::is_trivially_copyable::value, "u32_dsp isn't trivial // // In the documentation below, filter and effect transfer functions are specified in the z domain. // (If you are more familiar with the Laplace transform, z = exp(sT). The z domain is the digital -// frequency domain, just like how the s domain is the analog frequency domain.) +// frequency domain, just like how the s domain is the analog frequency domain.) #define INSERT_PADDING_DSPWORDS(num_words) INSERT_PADDING_BYTES(2 * (num_words)) @@ -137,8 +134,8 @@ struct SourceConfiguration { BitField<0, 1, u32_le> format_dirty; BitField<1, 1, u32_le> mono_or_stereo_dirty; BitField<2, 1, u32_le> adpcm_coefficients_dirty; - BitField<3, 1, u32_le> - partial_embedded_buffer_dirty; ///< Tends to be set when a looped buffer is queued. + /// Tends to be set when a looped buffer is queued. + BitField<3, 1, u32_le> partial_embedded_buffer_dirty; BitField<4, 1, u32_le> partial_reset_flag; BitField<16, 1, u32_le> enable_dirty; @@ -146,8 +143,8 @@ struct SourceConfiguration { BitField<18, 1, u32_le> rate_multiplier_dirty; BitField<19, 1, u32_le> buffer_queue_dirty; BitField<20, 1, u32_le> loop_related_dirty; - BitField<21, 1, u32_le> - play_position_dirty; ///< Tends to also be set when embedded buffer is updated. + /// Tends to also be set when embedded buffer is updated. + BitField<21, 1, u32_le> play_position_dirty; BitField<22, 1, u32_le> filters_enabled_dirty; BitField<23, 1, u32_le> simple_filter_dirty; BitField<24, 1, u32_le> biquad_filter_dirty; @@ -162,9 +159,9 @@ struct SourceConfiguration { // Gain control /** - * Gain is between 0.0-1.0. This determines how much will this source appear on - * each of the 12 channels that feed into the intermediate mixers. - * Each of the three intermediate mixers is fed two left and two right channels. + * Gain is between 0.0-1.0. This determines how much will this source appear on each of the + * 12 channels that feed into the intermediate mixers. Each of the three intermediate mixers + * is fed two left and two right channels. */ float_le gain[3][4]; @@ -173,7 +170,11 @@ struct SourceConfiguration { /// Multiplier for sample rate. Resampling occurs with the selected interpolation method. float_le rate_multiplier; - enum class InterpolationMode : u8 { Polyphase = 0, Linear = 1, None = 2 }; + enum class InterpolationMode : u8 { + Polyphase = 0, + Linear = 1, + None = 2, + }; InterpolationMode interpolation_mode; INSERT_PADDING_BYTES(1); ///< Interpolation related @@ -197,8 +198,7 @@ struct SourceConfiguration { * The transfer function of this filter is: * H(z) = (b0 + b1 z^-1 + b2 z^-2) / (1 - a1 z^-1 - a2 z^-2) * Nintendo chose to negate the feedbackward coefficients. This differs from standard - * notation - * as in: https://ccrma.stanford.edu/~jos/filters/Direct_Form_I.html + * notation as in: https://ccrma.stanford.edu/~jos/filters/Direct_Form_I.html * Values are signed fixed point with 14 fractional bits. */ struct BiquadFilter { @@ -246,8 +246,8 @@ struct SourceConfiguration { u8 is_looping; /// This value is shown in SourceStatus::previous_buffer_id when this buffer has - /// finished. - /// This allows the emulated application to tell what buffer is currently playing + /// finished. This allows the emulated application to tell what buffer is currently + /// playing. u16_le buffer_id; INSERT_PADDING_DSPWORDS(1); @@ -275,9 +275,16 @@ struct SourceConfiguration { /// Note a sample takes up different number of bytes in different buffer formats. u32_dsp length; - enum class MonoOrStereo : u16_le { Mono = 1, Stereo = 2 }; + enum class MonoOrStereo : u16_le { + Mono = 1, + Stereo = 2, + }; - enum class Format : u16_le { PCM8 = 0, PCM16 = 1, ADPCM = 2 }; + enum class Format : u16_le { + PCM8 = 0, + PCM16 = 1, + ADPCM = 2, + }; union { u16_le flags1_raw; @@ -349,12 +356,16 @@ struct DspConfiguration { }; /// The DSP has three intermediate audio mixers. This controls the volume level (0.0-1.0) for - /// each at the final mixer + /// each at the final mixer. float_le volume[3]; INSERT_PADDING_DSPWORDS(3); - enum class OutputFormat : u16_le { Mono = 0, Stereo = 1, Surround = 2 }; + enum class OutputFormat : u16_le { + Mono = 0, + Stereo = 1, + Surround = 2, + }; OutputFormat output_format; @@ -386,9 +397,10 @@ struct DspConfiguration { u16_le enable; INSERT_PADDING_DSPWORDS(1); u16_le outputs; - u32_dsp work_buffer_address; ///< The application allocates a block of memory for the DSP to - /// use as a work buffer. - u16_le frame_count; ///< Frames to delay by + /// The application allocates a block of memory for the DSP to use as a work buffer. + u32_dsp work_buffer_address; + /// Frames to delay by + u16_le frame_count; // Coefficients s16_le g; ///< Fixed point with 7 fractional bits diff --git a/src/audio_core/hle/filter.cpp b/src/audio_core/hle/filter.cpp index ab8814e59..da2a4684e 100644 --- a/src/audio_core/hle/filter.cpp +++ b/src/audio_core/hle/filter.cpp @@ -61,6 +61,7 @@ void SourceFilters::SimpleFilter::Reset() { void SourceFilters::SimpleFilter::Configure( SourceConfiguration::Configuration::SimpleFilter config) { + a1 = config.a1; b0 = config.b0; } @@ -91,6 +92,7 @@ void SourceFilters::BiquadFilter::Reset() { void SourceFilters::BiquadFilter::Configure( SourceConfiguration::Configuration::BiquadFilter config) { + a1 = config.a1; a2 = config.a2; b0 = config.b0; diff --git a/src/audio_core/hle/mixers.cpp b/src/audio_core/hle/mixers.cpp index a661a7b27..126f328bc 100644 --- a/src/audio_core/hle/mixers.cpp +++ b/src/audio_core/hle/mixers.cpp @@ -77,9 +77,8 @@ void Mixers::ParseConfig(DspConfiguration& config) { if (config.headphones_connected_dirty) { config.headphones_connected_dirty.Assign(0); - // Do nothing. - // (Note: Whether headphones are connected does affect coefficients used for surround - // sound.) + // Do nothing. (Note: Whether headphones are connected does affect coefficients used for + // surround sound.) LOG_TRACE(Audio_DSP, "mixers headphones_connected=%hu", config.headphones_connected); } diff --git a/src/audio_core/hle/pipe.cpp b/src/audio_core/hle/pipe.cpp index fe67d2503..f2b6d6552 100644 --- a/src/audio_core/hle/pipe.cpp +++ b/src/audio_core/hle/pipe.cpp @@ -97,7 +97,8 @@ static void AudioPipeWriteStructAddresses() { 0x8000 + offsetof(SharedMemory, unknown11) / 2, 0x8000 + offsetof(SharedMemory, unknown12) / 2, 0x8000 + offsetof(SharedMemory, unknown13) / 2, - 0x8000 + offsetof(SharedMemory, unknown14) / 2}; + 0x8000 + offsetof(SharedMemory, unknown14) / 2, + }; // Begin with a u16 denoting the number of structs. WriteU16(DspPipe::Audio, static_cast(struct_addresses.size())); @@ -118,7 +119,12 @@ void PipeWrite(DspPipe pipe_number, const std::vector& buffer) { return; } - enum class StateChange { Initalize = 0, Shutdown = 1, Wakeup = 2, Sleep = 3 }; + enum class StateChange { + Initalize = 0, + Shutdown = 1, + Wakeup = 2, + Sleep = 3, + }; // The difference between Initialize and Wakeup is that Input state is maintained // when sleeping but isn't when turning it off and on again. (TODO: Implement this.) diff --git a/src/audio_core/hle/pipe.h b/src/audio_core/hle/pipe.h index 73b857a90..6d7fd92ab 100644 --- a/src/audio_core/hle/pipe.h +++ b/src/audio_core/hle/pipe.h @@ -15,7 +15,12 @@ namespace HLE { /// Reset the pipes by setting pipe positions back to the beginning. void ResetPipes(); -enum class DspPipe { Debug = 0, Dma = 1, Audio = 2, Binary = 3 }; +enum class DspPipe { + Debug = 0, + Dma = 1, + Audio = 2, + Binary = 3, +}; constexpr size_t NUM_DSP_PIPE = 8; /** @@ -46,7 +51,12 @@ size_t GetPipeReadableSize(DspPipe pipe_number); */ void PipeWrite(DspPipe pipe_number, const std::vector& buffer); -enum class DspState { Off, On, Sleeping }; +enum class DspState { + Off, + On, + Sleeping, +}; + /// Get the state of the DSP DspState GetDspState(); diff --git a/src/audio_core/hle/source.cpp b/src/audio_core/hle/source.cpp index fad0ce2ad..249acc449 100644 --- a/src/audio_core/hle/source.cpp +++ b/src/audio_core/hle/source.cpp @@ -163,16 +163,18 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config, if (config.embedded_buffer_dirty) { config.embedded_buffer_dirty.Assign(0); - state.input_queue.emplace(Buffer{config.physical_address, - config.length, - static_cast(config.adpcm_ps), - {config.adpcm_yn[0], config.adpcm_yn[1]}, - config.adpcm_dirty.ToBool(), - config.is_looping.ToBool(), - config.buffer_id, - state.mono_or_stereo, - state.format, - false}); + state.input_queue.emplace(Buffer{ + config.physical_address, + config.length, + static_cast(config.adpcm_ps), + {config.adpcm_yn[0], config.adpcm_yn[1]}, + config.adpcm_dirty.ToBool(), + config.is_looping.ToBool(), + config.buffer_id, + state.mono_or_stereo, + state.format, + false, + }); LOG_TRACE(Audio_DSP, "enqueuing embedded addr=0x%08x len=%u id=%hu", config.physical_address, config.length, config.buffer_id); } @@ -182,16 +184,18 @@ void Source::ParseConfig(SourceConfiguration::Configuration& config, for (size_t i = 0; i < 4; i++) { if (config.buffers_dirty & (1 << i)) { const auto& b = config.buffers[i]; - state.input_queue.emplace(Buffer{b.physical_address, - b.length, - static_cast(b.adpcm_ps), - {b.adpcm_yn[0], b.adpcm_yn[1]}, - b.adpcm_dirty != 0, - b.is_looping != 0, - b.buffer_id, - state.mono_or_stereo, - state.format, - true}); + state.input_queue.emplace(Buffer{ + b.physical_address, + b.length, + static_cast(b.adpcm_ps), + {b.adpcm_yn[0], b.adpcm_yn[1]}, + b.adpcm_dirty != 0, + b.is_looping != 0, + b.buffer_id, + state.mono_or_stereo, + state.format, + true, + }); LOG_TRACE(Audio_DSP, "enqueuing queued %zu addr=0x%08x len=%u id=%hu", i, b.physical_address, b.length, b.buffer_id); } diff --git a/src/audio_core/interpolate.cpp b/src/audio_core/interpolate.cpp index 7751c545d..cb1c58a67 100644 --- a/src/audio_core/interpolate.cpp +++ b/src/audio_core/interpolate.cpp @@ -71,15 +71,17 @@ StereoBuffer16 None(State& state, const StereoBuffer16& input, float rate_multip StereoBuffer16 Linear(State& state, const StereoBuffer16& input, float rate_multiplier) { // Note on accuracy: Some values that this produces are +/- 1 from the actual firmware. - return StepOverSamples(state, input, rate_multiplier, [](u64 fraction, const auto& x0, - const auto& x1, const auto& x2) { - // This is a saturated subtraction. (Verified by black-box fuzzing.) - s64 delta0 = MathUtil::Clamp(x1[0] - x0[0], -32768, 32767); - s64 delta1 = MathUtil::Clamp(x1[1] - x0[1], -32768, 32767); - - return std::array{static_cast(x0[0] + fraction * delta0 / scale_factor), - static_cast(x0[1] + fraction * delta1 / scale_factor)}; - }); + return StepOverSamples(state, input, rate_multiplier, + [](u64 fraction, const auto& x0, const auto& x1, const auto& x2) { + // This is a saturated subtraction. (Verified by black-box fuzzing.) + s64 delta0 = MathUtil::Clamp(x1[0] - x0[0], -32768, 32767); + s64 delta1 = MathUtil::Clamp(x1[1] - x0[1], -32768, 32767); + + return std::array{ + static_cast(x0[0] + fraction * delta0 / scale_factor), + static_cast(x0[1] + fraction * delta1 / scale_factor), + }; + }); } } // namespace AudioInterp diff --git a/src/audio_core/interpolate.h b/src/audio_core/interpolate.h index 99e5b9657..2d2e60311 100644 --- a/src/audio_core/interpolate.h +++ b/src/audio_core/interpolate.h @@ -25,7 +25,7 @@ struct State { * @param input Input buffer. * @param rate_multiplier Stretch factor. Must be a positive non-zero value. * rate_multiplier > 1.0 performs decimation and rate_multipler < 1.0 - * performs upsampling. + * performs upsampling. * @return The resampled audio buffer. */ StereoBuffer16 None(State& state, const StereoBuffer16& input, float rate_multiplier); @@ -35,7 +35,7 @@ StereoBuffer16 None(State& state, const StereoBuffer16& input, float rate_multip * @param input Input buffer. * @param rate_multiplier Stretch factor. Must be a positive non-zero value. * rate_multiplier > 1.0 performs decimation and rate_multipler < 1.0 - * performs upsampling. + * performs upsampling. * @return The resampled audio buffer. */ StereoBuffer16 Linear(State& state, const StereoBuffer16& input, float rate_multiplier); diff --git a/src/audio_core/null_sink.h b/src/audio_core/null_sink.h index b82cd3b9a..9931c4778 100644 --- a/src/audio_core/null_sink.h +++ b/src/audio_core/null_sink.h @@ -19,8 +19,7 @@ public: return native_sample_rate; } - void EnqueueSamples(const s16*, size_t) override { - } + void EnqueueSamples(const s16*, size_t) override {} size_t SamplesInQueue() const override { return 0; diff --git a/src/audio_core/sink.h b/src/audio_core/sink.h index c938e87d2..f5ce55a6b 100644 --- a/src/audio_core/sink.h +++ b/src/audio_core/sink.h @@ -12,8 +12,8 @@ namespace AudioCore { /** * This class is an interface for an audio sink. An audio sink accepts samples in stereo signed - * PCM16 format to be output. - * Sinks *do not* handle resampling and expect the correct sample rate. They are dumb outputs. + * PCM16 format to be output. Sinks *do not* handle resampling and expect the correct sample rate. + * They are dumb outputs. */ class Sink { public: diff --git a/src/audio_core/sink_details.h b/src/audio_core/sink_details.h index 34110c97a..4b30cf835 100644 --- a/src/audio_core/sink_details.h +++ b/src/audio_core/sink_details.h @@ -14,8 +14,7 @@ class Sink; struct SinkDetails { SinkDetails(const char* id_, std::function()> factory_) - : id(id_), factory(factory_) { - } + : id(id_), factory(factory_) {} /// Name for this sink. const char* id; diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index 7b387e258..1b8f8cffe 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -69,10 +69,12 @@ int main(int argc, char** argv) { #endif std::string boot_filename; - static struct option long_options[] = {{"gdbport", required_argument, 0, 'g'}, - {"help", no_argument, 0, 'h'}, - {"version", no_argument, 0, 'v'}, - {0, 0, 0, 0}}; + static struct option long_options[] = { + {"gdbport", required_argument, 0, 'g'}, + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'v'}, + {0, 0, 0, 0}, + }; while (optind < argc) { char arg = getopt_long(argc, argv, "g:hv", long_options, &option_index); diff --git a/src/citra/emu_window/emu_window_sdl2.cpp b/src/citra/emu_window/emu_window_sdl2.cpp index 12f3e2c71..42f2a7553 100644 --- a/src/citra/emu_window/emu_window_sdl2.cpp +++ b/src/citra/emu_window/emu_window_sdl2.cpp @@ -181,5 +181,6 @@ void EmuWindow_SDL2::ReloadSetKeymaps() { void EmuWindow_SDL2::OnMinimalClientAreaChangeRequest( const std::pair& minimal_size) { + SDL_SetWindowMinimumSize(render_window, minimal_size.first, minimal_size.second); } diff --git a/src/citra/emu_window/emu_window_sdl2.h b/src/citra/emu_window/emu_window_sdl2.h index 693dfb14b..d4d86821d 100644 --- a/src/citra/emu_window/emu_window_sdl2.h +++ b/src/citra/emu_window/emu_window_sdl2.h @@ -47,8 +47,8 @@ private: void OnResize(); /// Called when a configuration change affects the minimal size of the window - void - OnMinimalClientAreaChangeRequest(const std::pair& minimal_size) override; + void OnMinimalClientAreaChangeRequest( + const std::pair& minimal_size) override; /// Is the window still open? bool is_open = true; diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 01cc6b9ca..53d035b32 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -28,8 +28,7 @@ #define COPYRIGHT "Copyright (C) 2013-2014 Citra Team" EmuThread::EmuThread(GRenderWindow* render_window) - : exec_step(false), running(false), stop_run(false), render_window(render_window) { -} + : exec_step(false), running(false), stop_run(false), render_window(render_window) {} void EmuThread::run() { render_window->MakeCurrent(); @@ -84,8 +83,7 @@ void EmuThread::run() { class GGLWidgetInternal : public QGLWidget { public: GGLWidgetInternal(QGLFormat fmt, GRenderWindow* parent) - : QGLWidget(fmt, parent), parent(parent) { - } + : QGLWidget(fmt, parent), parent(parent) {} void paintEvent(QPaintEvent* ev) override { if (do_painting) { @@ -153,8 +151,7 @@ void GRenderWindow::DoneCurrent() { child->doneCurrent(); } -void GRenderWindow::PollEvents() { -} +void GRenderWindow::PollEvents() {} // On Qt 5.0+, this correctly gets the size of the framebuffer (pixels). // @@ -306,8 +303,8 @@ void GRenderWindow::OnEmulationStopping() { void GRenderWindow::showEvent(QShowEvent* event) { QWidget::showEvent(event); -// windowHandle() is not initialized until the Window is shown, so we connect it here. #if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0) + // windowHandle() is not initialized until the Window is shown, so we connect it here. connect(this->windowHandle(), SIGNAL(screenChanged(QScreen*)), this, SLOT(OnFramebufferSizeChanged()), Qt::UniqueConnection); #endif diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h index e0e4341df..59241684d 100644 --- a/src/citra_qt/bootmanager.h +++ b/src/citra_qt/bootmanager.h @@ -144,8 +144,8 @@ signals: void Closed(); private: - void - OnMinimalClientAreaChangeRequest(const std::pair& minimal_size) override; + void OnMinimalClientAreaChangeRequest( + const std::pair& minimal_size) override; GGLWidgetInternal* child; diff --git a/src/citra_qt/configure_audio.cpp b/src/citra_qt/configure_audio.cpp index 29900536c..944047d05 100644 --- a/src/citra_qt/configure_audio.cpp +++ b/src/citra_qt/configure_audio.cpp @@ -22,8 +22,7 @@ ConfigureAudio::ConfigureAudio(QWidget* parent) this->setConfiguration(); } -ConfigureAudio::~ConfigureAudio() { -} +ConfigureAudio::~ConfigureAudio() {} void ConfigureAudio::setConfiguration() { int new_sink_index = 0; diff --git a/src/citra_qt/configure_debug.cpp b/src/citra_qt/configure_debug.cpp index b6b44723c..dde8d670e 100644 --- a/src/citra_qt/configure_debug.cpp +++ b/src/citra_qt/configure_debug.cpp @@ -12,8 +12,7 @@ ConfigureDebug::ConfigureDebug(QWidget* parent) : QWidget(parent), ui(new Ui::Co this->setConfiguration(); } -ConfigureDebug::~ConfigureDebug() { -} +ConfigureDebug::~ConfigureDebug() {} void ConfigureDebug::setConfiguration() { ui->toggle_gdbstub->setChecked(Settings::values.use_gdbstub); diff --git a/src/citra_qt/configure_dialog.cpp b/src/citra_qt/configure_dialog.cpp index 837934c81..c33c95540 100644 --- a/src/citra_qt/configure_dialog.cpp +++ b/src/citra_qt/configure_dialog.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/config.h" #include "citra_qt/configure_dialog.h" +#include "citra_qt/config.h" #include "ui_configure.h" #include "core/settings.h" @@ -13,11 +13,9 @@ ConfigureDialog::ConfigureDialog(QWidget* parent) : QDialog(parent), ui(new Ui:: this->setConfiguration(); } -ConfigureDialog::~ConfigureDialog() { -} +ConfigureDialog::~ConfigureDialog() {} -void ConfigureDialog::setConfiguration() { -} +void ConfigureDialog::setConfiguration() {} void ConfigureDialog::applyConfiguration() { ui->generalTab->applyConfiguration(); diff --git a/src/citra_qt/configure_general.cpp b/src/citra_qt/configure_general.cpp index 7bfba6dd0..3e6f76bfe 100644 --- a/src/citra_qt/configure_general.cpp +++ b/src/citra_qt/configure_general.cpp @@ -11,14 +11,14 @@ ConfigureGeneral::ConfigureGeneral(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureGeneral) { + ui->setupUi(this); this->setConfiguration(); ui->toggle_cpu_jit->setEnabled(!System::IsPoweredOn()); } -ConfigureGeneral::~ConfigureGeneral() { -} +ConfigureGeneral::~ConfigureGeneral() {} void ConfigureGeneral::setConfiguration() { ui->toggle_deepscan->setChecked(UISettings::values.gamedir_deepscan); diff --git a/src/citra_qt/configure_graphics.cpp b/src/citra_qt/configure_graphics.cpp index adc9cb5ef..bde6727cc 100644 --- a/src/citra_qt/configure_graphics.cpp +++ b/src/citra_qt/configure_graphics.cpp @@ -10,14 +10,14 @@ ConfigureGraphics::ConfigureGraphics(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureGraphics) { + ui->setupUi(this); this->setConfiguration(); ui->toggle_vsync->setEnabled(!System::IsPoweredOn()); } -ConfigureGraphics::~ConfigureGraphics() { -} +ConfigureGraphics::~ConfigureGraphics() {} void ConfigureGraphics::setConfiguration() { ui->toggle_hw_renderer->setChecked(Settings::values.use_hw_renderer); diff --git a/src/citra_qt/configure_input.cpp b/src/citra_qt/configure_input.cpp index af473f841..7900134ca 100644 --- a/src/citra_qt/configure_input.cpp +++ b/src/citra_qt/configure_input.cpp @@ -10,34 +10,35 @@ ConfigureInput::ConfigureInput(QWidget* parent) : QWidget(parent), ui(std::make_unique()) { + ui->setupUi(this); // Initialize mapping of input enum to UI button. input_mapping = { - {std::make_pair(Settings::NativeInput::Values::A, ui->buttonA)}, - {std::make_pair(Settings::NativeInput::Values::B, ui->buttonB)}, - {std::make_pair(Settings::NativeInput::Values::X, ui->buttonX)}, - {std::make_pair(Settings::NativeInput::Values::Y, ui->buttonY)}, - {std::make_pair(Settings::NativeInput::Values::L, ui->buttonL)}, - {std::make_pair(Settings::NativeInput::Values::R, ui->buttonR)}, - {std::make_pair(Settings::NativeInput::Values::ZL, ui->buttonZL)}, - {std::make_pair(Settings::NativeInput::Values::ZR, ui->buttonZR)}, - {std::make_pair(Settings::NativeInput::Values::START, ui->buttonStart)}, - {std::make_pair(Settings::NativeInput::Values::SELECT, ui->buttonSelect)}, - {std::make_pair(Settings::NativeInput::Values::HOME, ui->buttonHome)}, - {std::make_pair(Settings::NativeInput::Values::DUP, ui->buttonDpadUp)}, - {std::make_pair(Settings::NativeInput::Values::DDOWN, ui->buttonDpadDown)}, - {std::make_pair(Settings::NativeInput::Values::DLEFT, ui->buttonDpadLeft)}, - {std::make_pair(Settings::NativeInput::Values::DRIGHT, ui->buttonDpadRight)}, - {std::make_pair(Settings::NativeInput::Values::CUP, ui->buttonCStickUp)}, - {std::make_pair(Settings::NativeInput::Values::CDOWN, ui->buttonCStickDown)}, - {std::make_pair(Settings::NativeInput::Values::CLEFT, ui->buttonCStickLeft)}, - {std::make_pair(Settings::NativeInput::Values::CRIGHT, ui->buttonCStickRight)}, - {std::make_pair(Settings::NativeInput::Values::CIRCLE_UP, ui->buttonCircleUp)}, - {std::make_pair(Settings::NativeInput::Values::CIRCLE_DOWN, ui->buttonCircleDown)}, - {std::make_pair(Settings::NativeInput::Values::CIRCLE_LEFT, ui->buttonCircleLeft)}, - {std::make_pair(Settings::NativeInput::Values::CIRCLE_RIGHT, ui->buttonCircleRight)}, - {std::make_pair(Settings::NativeInput::Values::CIRCLE_MODIFIER, ui->buttonCircleMod)}, + {Settings::NativeInput::Values::A, ui->buttonA}, + {Settings::NativeInput::Values::B, ui->buttonB}, + {Settings::NativeInput::Values::X, ui->buttonX}, + {Settings::NativeInput::Values::Y, ui->buttonY}, + {Settings::NativeInput::Values::L, ui->buttonL}, + {Settings::NativeInput::Values::R, ui->buttonR}, + {Settings::NativeInput::Values::ZL, ui->buttonZL}, + {Settings::NativeInput::Values::ZR, ui->buttonZR}, + {Settings::NativeInput::Values::START, ui->buttonStart}, + {Settings::NativeInput::Values::SELECT, ui->buttonSelect}, + {Settings::NativeInput::Values::HOME, ui->buttonHome}, + {Settings::NativeInput::Values::DUP, ui->buttonDpadUp}, + {Settings::NativeInput::Values::DDOWN, ui->buttonDpadDown}, + {Settings::NativeInput::Values::DLEFT, ui->buttonDpadLeft}, + {Settings::NativeInput::Values::DRIGHT, ui->buttonDpadRight}, + {Settings::NativeInput::Values::CUP, ui->buttonCStickUp}, + {Settings::NativeInput::Values::CDOWN, ui->buttonCStickDown}, + {Settings::NativeInput::Values::CLEFT, ui->buttonCStickLeft}, + {Settings::NativeInput::Values::CRIGHT, ui->buttonCStickRight}, + {Settings::NativeInput::Values::CIRCLE_UP, ui->buttonCircleUp}, + {Settings::NativeInput::Values::CIRCLE_DOWN, ui->buttonCircleDown}, + {Settings::NativeInput::Values::CIRCLE_LEFT, ui->buttonCircleLeft}, + {Settings::NativeInput::Values::CIRCLE_RIGHT, ui->buttonCircleRight}, + {Settings::NativeInput::Values::CIRCLE_MODIFIER, ui->buttonCircleMod}, }; // Attach handle click method to each button click. diff --git a/src/citra_qt/configure_system.cpp b/src/citra_qt/configure_system.cpp index d89b342df..732e15dda 100644 --- a/src/citra_qt/configure_system.cpp +++ b/src/citra_qt/configure_system.cpp @@ -10,7 +10,9 @@ #include "core/hle/service/fs/archive.h" #include "core/system.h" -static const std::array days_in_month = {{31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}}; +static const std::array days_in_month = {{ + 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, +}}; ConfigureSystem::ConfigureSystem(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureSystem) { ui->setupUi(this); @@ -20,8 +22,7 @@ ConfigureSystem::ConfigureSystem(QWidget* parent) : QWidget(parent), ui(new Ui:: this->setConfiguration(); } -ConfigureSystem::~ConfigureSystem() { -} +ConfigureSystem::~ConfigureSystem() {} void ConfigureSystem::setConfiguration() { enabled = !System::IsPoweredOn(); @@ -51,8 +52,8 @@ void ConfigureSystem::setConfiguration() { void ConfigureSystem::ReadSystemSettings() { // set username username = Service::CFG::GetUsername(); - // ui->edit_username->setText(QString::fromStdU16String(username)); // TODO(wwylele): Use this - // when we move to Qt 5.5 + // TODO(wwylele): Use this when we move to Qt 5.5 + // ui->edit_username->setText(QString::fromStdU16String(username)); ui->edit_username->setText( QString::fromUtf16(reinterpret_cast(username.data()))); @@ -80,8 +81,8 @@ void ConfigureSystem::applyConfiguration() { bool modified = false; // apply username - // std::u16string new_username = ui->edit_username->text().toStdU16String(); // TODO(wwylele): - // Use this when we move to Qt 5.5 + // TODO(wwylele): Use this when we move to Qt 5.5 + // std::u16string new_username = ui->edit_username->text().toStdU16String(); std::u16string new_username( reinterpret_cast(ui->edit_username->text().utf16())); if (new_username != username) { diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp index a87046acb..db266b506 100644 --- a/src/citra_qt/debugger/callstack.cpp +++ b/src/citra_qt/debugger/callstack.cpp @@ -78,8 +78,7 @@ void CallstackWidget::OnDebugModeEntered() { } } -void CallstackWidget::OnDebugModeLeft() { -} +void CallstackWidget::OnDebugModeLeft() {} void CallstackWidget::Clear() { for (int row = 0; row < callstack_model->rowCount(); row++) { diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp index b523fe9a7..803e8b172 100644 --- a/src/citra_qt/debugger/disassembler.cpp +++ b/src/citra_qt/debugger/disassembler.cpp @@ -19,8 +19,7 @@ DisassemblerModel::DisassemblerModel(QObject* parent) : QAbstractListModel(parent), base_address(0), code_size(0), program_counter(0), - selection(QModelIndex()) { -} + selection(QModelIndex()) {} int DisassemblerModel::columnCount(const QModelIndex& parent) const { return 3; @@ -241,8 +240,7 @@ void DisassemblerWidget::OnDebugModeEntered() { model_index, QItemSelectionModel::SelectCurrent | QItemSelectionModel::Rows); } -void DisassemblerWidget::OnDebugModeLeft() { -} +void DisassemblerWidget::OnDebugModeLeft() {} int DisassemblerWidget::SelectedRow() { QModelIndex index = disasm_ui.treeView->selectionModel()->currentIndex(); diff --git a/src/citra_qt/debugger/graphics_breakpoints.cpp b/src/citra_qt/debugger/graphics_breakpoints.cpp index 953840e7f..b31eba533 100644 --- a/src/citra_qt/debugger/graphics_breakpoints.cpp +++ b/src/citra_qt/debugger/graphics_breakpoints.cpp @@ -16,8 +16,7 @@ BreakPointModel::BreakPointModel(std::shared_ptr debug_context, QObject* parent) : QAbstractListModel(parent), context_weak(debug_context), at_breakpoint(debug_context->at_breakpoint), - active_breakpoint(debug_context->active_breakpoint) { -} + active_breakpoint(debug_context->active_breakpoint) {} int BreakPointModel::columnCount(const QModelIndex& parent) const { return 1; @@ -42,7 +41,8 @@ QVariant BreakPointModel::data(const QModelIndex& index, int role) const { {Pica::DebugContext::Event::IncomingDisplayTransfer, tr("Incoming display transfer")}, {Pica::DebugContext::Event::GSPCommandProcessed, tr("GSP command processed")}, - {Pica::DebugContext::Event::BufferSwapped, tr("Buffers swapped")}}; + {Pica::DebugContext::Event::BufferSwapped, tr("Buffers swapped")}, + }; DEBUG_ASSERT(map.size() == static_cast(Pica::DebugContext::Event::NumEvents)); return (map.find(event) != map.end()) ? map.at(event) : QString(); diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index daf1cf1de..b088ad29d 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp @@ -51,8 +51,7 @@ public: } }; -GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractListModel(parent) { -} +GPUCommandListModel::GPUCommandListModel(QObject* parent) : QAbstractListModel(parent) {} int GPUCommandListModel::rowCount(const QModelIndex& parent) const { return static_cast(pica_trace.writes.size()); diff --git a/src/citra_qt/debugger/graphics_surface.cpp b/src/citra_qt/debugger/graphics_surface.cpp index 839fca124..bb998acc4 100644 --- a/src/citra_qt/debugger/graphics_surface.cpp +++ b/src/citra_qt/debugger/graphics_surface.cpp @@ -25,10 +25,8 @@ #include "video_core/utils.h" SurfacePicture::SurfacePicture(QWidget* parent, GraphicsSurfaceWidget* surface_widget_) - : QLabel(parent), surface_widget(surface_widget_) { -} -SurfacePicture::~SurfacePicture() { -} + : QLabel(parent), surface_widget(surface_widget_) {} +SurfacePicture::~SurfacePicture() {} void SurfacePicture::mousePressEvent(QMouseEvent* event) { // Only do something while the left mouse button is held down @@ -707,9 +705,8 @@ unsigned int GraphicsSurfaceWidget::NibblesPerPixel(GraphicsSurfaceWidget::Forma case Format::D16: return 2 * 2; default: - UNREACHABLE_MSG("GraphicsSurfaceWidget::BytesPerPixel: this " - "should not be reached as this function should " - "be given a format which is in " + UNREACHABLE_MSG("GraphicsSurfaceWidget::BytesPerPixel: this should not be reached as this " + "function should be given a format which is in " "GraphicsSurfaceWidget::Format. Instead got %i", static_cast(format)); return 0; diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics_vertex_shader.cpp index c49327f9c..0f02bc3da 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics_vertex_shader.cpp @@ -29,8 +29,7 @@ using nihstro::SourceRegister; using nihstro::SwizzlePattern; GraphicsVertexShaderModel::GraphicsVertexShaderModel(GraphicsVertexShaderWidget* parent) - : QAbstractTableModel(parent), par(parent) { -} + : QAbstractTableModel(parent), par(parent) {} int GraphicsVertexShaderModel::columnCount(const QModelIndex& parent) const { return 3; diff --git a/src/citra_qt/debugger/ramview.cpp b/src/citra_qt/debugger/ramview.cpp index 63f2850e1..10a09dda8 100644 --- a/src/citra_qt/debugger/ramview.cpp +++ b/src/citra_qt/debugger/ramview.cpp @@ -4,8 +4,7 @@ #include "citra_qt/debugger/ramview.h" -GRamView::GRamView(QWidget* parent) : QHexEdit(parent) { -} +GRamView::GRamView(QWidget* parent) : QHexEdit(parent) {} void GRamView::OnCPUStepped() { // TODO: QHexEdit doesn't show vertical scroll bars for > 10MB data streams... diff --git a/src/citra_qt/debugger/registers.cpp b/src/citra_qt/debugger/registers.cpp index 82da0022f..87c8c3418 100644 --- a/src/citra_qt/debugger/registers.cpp +++ b/src/citra_qt/debugger/registers.cpp @@ -75,8 +75,7 @@ void RegistersWidget::OnDebugModeEntered() { UpdateVFPSystemRegisterValues(); } -void RegistersWidget::OnDebugModeLeft() { -} +void RegistersWidget::OnDebugModeLeft() {} void RegistersWidget::OnEmulationStarting(EmuThread* emu_thread) { setEnabled(true); diff --git a/src/citra_qt/game_list_p.h b/src/citra_qt/game_list_p.h index bcb3fccbd..c8a9ee5db 100644 --- a/src/citra_qt/game_list_p.h +++ b/src/citra_qt/game_list_p.h @@ -59,12 +59,9 @@ static QString GetQStringShortTitleFromSMDH(const Loader::SMDH& smdh, class GameListItem : public QStandardItem { public: - GameListItem() : QStandardItem() { - } - GameListItem(const QString& string) : QStandardItem(string) { - } - virtual ~GameListItem() override { - } + GameListItem() : QStandardItem() {} + GameListItem(const QString& string) : QStandardItem(string) {} + virtual ~GameListItem() override {} }; /** @@ -79,8 +76,7 @@ public: static const int FullPathRole = Qt::UserRole + 1; static const int TitleRole = Qt::UserRole + 2; - GameListItemPath() : GameListItem() { - } + GameListItemPath() : GameListItem() {} GameListItemPath(const QString& game_path, const std::vector& smdh_data) : GameListItem() { setData(game_path, FullPathRole); @@ -124,8 +120,7 @@ class GameListItemSize : public GameListItem { public: static const int SizeRole = Qt::UserRole + 1; - GameListItemSize() : GameListItem() { - } + GameListItemSize() : GameListItem() {} GameListItemSize(const qulonglong size_bytes) : GameListItem() { setData(size_bytes, SizeRole); } @@ -161,8 +156,7 @@ class GameListWorker : public QObject, public QRunnable { public: GameListWorker(QString dir_path, bool deep_scan) - : QObject(), QRunnable(), dir_path(dir_path), deep_scan(deep_scan) { - } + : QObject(), QRunnable(), dir_path(dir_path), deep_scan(deep_scan) {} public slots: /// Starts the processing of directory tree information. diff --git a/src/citra_qt/hotkeys.cpp b/src/citra_qt/hotkeys.cpp index 6301259d8..3e38223ee 100644 --- a/src/citra_qt/hotkeys.cpp +++ b/src/citra_qt/hotkeys.cpp @@ -12,8 +12,7 @@ #include "citra_qt/ui_settings.h" struct Hotkey { - Hotkey() : shortcut(nullptr), context(Qt::WindowShortcut) { - } + Hotkey() : shortcut(nullptr), context(Qt::WindowShortcut) {} QKeySequence keyseq; QShortcut* shortcut; diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 717c68382..10157310e 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -26,8 +26,8 @@ class GPUCommandListWidget; class GMainWindow : public QMainWindow { Q_OBJECT - static const int max_recent_files_item = - 10; ///< Max number of recently loaded items to keep track + /// Max number of recently loaded items to keep track of + static const int max_recent_files_item = 10; // TODO: Make use of this! enum { diff --git a/src/common/bit_set.h b/src/common/bit_set.h index b83cbbb36..c48b3b769 100644 --- a/src/common/bit_set.h +++ b/src/common/bit_set.h @@ -102,10 +102,8 @@ public: // A reference to a particular bit, returned from operator[]. class Ref { public: - Ref(Ref&& other) : m_bs(other.m_bs), m_mask(other.m_mask) { - } - Ref(BitSet* bs, IntTy mask) : m_bs(bs), m_mask(mask) { - } + Ref(Ref&& other) : m_bs(other.m_bs), m_mask(other.m_mask) {} + Ref(BitSet* bs, IntTy mask) : m_bs(bs), m_mask(mask) {} operator bool() const { return (m_bs->m_val & m_mask) != 0; } @@ -122,10 +120,8 @@ public: // A STL-like iterator is required to be able to use range-based for loops. class Iterator { public: - Iterator(const Iterator& other) : m_val(other.m_val), m_bit(other.m_bit) { - } - Iterator(IntTy val, int bit) : m_val(val), m_bit(bit) { - } + Iterator(const Iterator& other) : m_val(other.m_val), m_bit(other.m_bit) {} + Iterator(IntTy val, int bit) : m_val(val), m_bit(bit) {} Iterator& operator=(Iterator other) { new (this) Iterator(other); return *this; @@ -160,10 +156,8 @@ public: int m_bit; }; - BitSet() : m_val(0) { - } - explicit BitSet(IntTy val) : m_val(val) { - } + BitSet() : m_val(0) {} + explicit BitSet(IntTy val) : m_val(val) {} BitSet(std::initializer_list init) { m_val = 0; for (int bit : init) diff --git a/src/common/chunk_file.h b/src/common/chunk_file.h index 3b36c0a9e..2bf3c774b 100644 --- a/src/common/chunk_file.h +++ b/src/common/chunk_file.h @@ -50,8 +50,7 @@ class PointerWrap; class PointerWrapSection { public: PointerWrapSection(PointerWrap& p, int ver, const char* title) - : p_(p), ver_(ver), title_(title) { - } + : p_(p), ver_(ver), title_(title) {} ~PointerWrapSection(); bool operator==(const int& v) const { @@ -134,11 +133,9 @@ public: Error error; public: - PointerWrap(u8** ptr_, Mode mode_) : ptr(ptr_), mode(mode_), error(ERROR_NONE) { - } + PointerWrap(u8** ptr_, Mode mode_) : ptr(ptr_), mode(mode_), error(ERROR_NONE) {} PointerWrap(unsigned char** ptr_, int mode_) - : ptr((u8**)ptr_), mode((Mode)mode_), error(ERROR_NONE) { - } + : ptr((u8**)ptr_), mode((Mode)mode_), error(ERROR_NONE) {} PointerWrapSection Section(const char* title, int ver) { return Section(title, ver, ver); diff --git a/src/common/code_block.h b/src/common/code_block.h index 58696737e..099088925 100644 --- a/src/common/code_block.h +++ b/src/common/code_block.h @@ -27,8 +27,7 @@ protected: size_t region_size; public: - CodeBlock() : region(nullptr), region_size(0) { - } + CodeBlock() : region(nullptr), region_size(0) {} virtual ~CodeBlock() { if (region) FreeCodeSpace(); diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index ad5bdbc08..7032c2117 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h @@ -86,8 +86,7 @@ inline u64 _rotr64(u64 x, unsigned int shift) { extern "C" { __declspec(dllimport) void __stdcall DebugBreak(void); } -#define Crash() \ - { DebugBreak(); } +#define Crash() DebugBreak() // cstdlib provides these on MSVC #define rotr _rotr diff --git a/src/common/emu_window.h b/src/common/emu_window.h index de8badd4f..20131300d 100644 --- a/src/common/emu_window.h +++ b/src/common/emu_window.h @@ -229,8 +229,7 @@ protected: circle_pad_y = 0; touch_pressed = false; } - virtual ~EmuWindow() { - } + virtual ~EmuWindow() {} /** * Processes any pending configuration changes from the last SetConfig call. @@ -272,8 +271,8 @@ private: * For the request to be honored, EmuWindow implementations will usually reimplement this * function. */ - virtual void - OnMinimalClientAreaChangeRequest(const std::pair& minimal_size) { + virtual void OnMinimalClientAreaChangeRequest( + const std::pair& minimal_size) { // By default, ignore this request and do nothing. } diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index c8723a4b3..96afe2ca0 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -828,8 +828,7 @@ void SplitFilename83(const std::string& filename, std::array& short_nam } } -IOFile::IOFile() { -} +IOFile::IOFile() {} IOFile::IOFile(const std::string& filename, const char openmode[]) { Open(filename, openmode); diff --git a/src/common/math_util.h b/src/common/math_util.h index 696bd43ea..41d89666c 100644 --- a/src/common/math_util.h +++ b/src/common/math_util.h @@ -27,12 +27,10 @@ struct Rectangle { T right; T bottom; - Rectangle() { - } + Rectangle() {} Rectangle(T left, T top, T right, T bottom) - : left(left), top(top), right(right), bottom(bottom) { - } + : left(left), top(top), right(right), bottom(bottom) {} T GetWidth() const { return std::abs(static_cast::type>(right - left)); diff --git a/src/common/profiler.cpp b/src/common/profiler.cpp index 992ec25b2..231a0afc1 100644 --- a/src/common/profiler.cpp +++ b/src/common/profiler.cpp @@ -14,8 +14,7 @@ namespace Common { namespace Profiling { ProfilingManager::ProfilingManager() - : last_frame_end(Clock::now()), this_frame_start(Clock::now()) { -} + : last_frame_end(Clock::now()), this_frame_start(Clock::now()) {} void ProfilingManager::BeginFrame() { this_frame_start = Clock::now(); diff --git a/src/common/scope_exit.h b/src/common/scope_exit.h index 73b2a262e..072ab285d 100644 --- a/src/common/scope_exit.h +++ b/src/common/scope_exit.h @@ -10,8 +10,7 @@ namespace detail { template struct ScopeExitHelper { - explicit ScopeExitHelper(Func&& func) : func(std::move(func)) { - } + explicit ScopeExitHelper(Func&& func) : func(std::move(func)) {} ~ScopeExitHelper() { func(); } diff --git a/src/common/swap.h b/src/common/swap.h index 1794144fb..72c50d789 100644 --- a/src/common/swap.h +++ b/src/common/swap.h @@ -168,8 +168,7 @@ public: return swap(value); } swap_struct_t() = default; - swap_struct_t(const T& v) : value(swap(v)) { - } + swap_struct_t(const T& v) : value(swap(v)) {} template swapped_t& operator=(const S& source) { diff --git a/src/common/synchronized_wrapper.h b/src/common/synchronized_wrapper.h index 8dc4ddeac..04b4f2e51 100644 --- a/src/common/synchronized_wrapper.h +++ b/src/common/synchronized_wrapper.h @@ -19,8 +19,7 @@ template class SynchronizedWrapper { public: template - SynchronizedWrapper(Args&&... args) : data(std::forward(args)...) { - } + SynchronizedWrapper(Args&&... args) : data(std::forward(args)...) {} private: template diff --git a/src/common/thread.h b/src/common/thread.h index b189dc764..499c151c2 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -39,8 +39,7 @@ void SetCurrentThreadAffinity(u32 mask); class Event { public: - Event() : is_set(false) { - } + Event() : is_set(false) {} void Set() { std::lock_guard lk(mutex); @@ -71,8 +70,7 @@ private: class Barrier { public: - explicit Barrier(size_t count_) : count(count_), waiting(0), generation(0) { - } + explicit Barrier(size_t count_) : count(count_), waiting(0), generation(0) {} /// Blocks until all "count" threads have called Sync() void Sync() { diff --git a/src/common/vector_math.h b/src/common/vector_math.h index b2d630829..2d56f168c 100644 --- a/src/common/vector_math.h +++ b/src/common/vector_math.h @@ -60,10 +60,8 @@ public: } Vec2() = default; - Vec2(const T a[2]) : x(a[0]), y(a[1]) { - } - Vec2(const T& _x, const T& _y) : x(_x), y(_y) { - } + Vec2(const T a[2]) : x(a[0]), y(a[1]) {} + Vec2(const T& _x, const T& _y) : x(_x), y(_y) {} template Vec2 Cast() const { @@ -201,10 +199,8 @@ public: } Vec3() = default; - Vec3(const T a[3]) : x(a[0]), y(a[1]), z(a[2]) { - } - Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) { - } + Vec3(const T a[3]) : x(a[0]), y(a[1]), z(a[2]) {} + Vec3(const T& _x, const T& _y, const T& _z) : x(_x), y(_y), z(_z) {} template Vec3 Cast() const { @@ -409,10 +405,8 @@ public: } Vec4() = default; - Vec4(const T a[4]) : x(a[0]), y(a[1]), z(a[2]), w(a[3]) { - } - Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) { - } + Vec4(const T a[4]) : x(a[0]), y(a[1]), z(a[2]), w(a[3]) {} + Vec4(const T& _x, const T& _y, const T& _z, const T& _w) : x(_x), y(_y), z(_z), w(_w) {} template Vec4 Cast() const { diff --git a/src/common/x64/emitter.cpp b/src/common/x64/emitter.cpp index 1a9fd6a6b..7cf350b4a 100644 --- a/src/common/x64/emitter.cpp +++ b/src/common/x64/emitter.cpp @@ -222,7 +222,7 @@ void OpArg::WriteVex(XEmitter* emit, X64Reg regOp1, X64Reg regOp2, int L, int pp void OpArg::WriteRest(XEmitter* emit, int extraBytes, X64Reg _operandReg, bool warn_64bit_offset) const { if (_operandReg == INVALID_REG) - _operandReg = (X64Reg) this->operandReg; + _operandReg = (X64Reg)this->operandReg; int mod = 0; int ireg = indexReg; bool SIB = false; diff --git a/src/common/x64/emitter.h b/src/common/x64/emitter.h index 467f7812f..6c9dc3d6b 100644 --- a/src/common/x64/emitter.h +++ b/src/common/x64/emitter.h @@ -233,8 +233,7 @@ struct OpArg { constexpr OpArg() = default; // dummy op arg, used for storage constexpr OpArg(u64 offset_, int scale_, X64Reg rmReg = RAX, X64Reg scaledReg = RAX) : scale(static_cast(scale_)), offsetOrBaseReg(static_cast(rmReg)), - indexReg(static_cast(scaledReg)), offset(offset_) { - } + indexReg(static_cast(scaledReg)), offset(offset_) {} constexpr bool operator==(const OpArg& b) const { return operandReg == b.operandReg && scale == b.scale && @@ -454,8 +453,7 @@ public: code = code_ptr; flags_locked = false; } - virtual ~XEmitter() { - } + virtual ~XEmitter() {} void WriteModRM(int mod, int rm, int reg); void WriteSIB(int scale, int index, int base); diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 919da6737..e466b21b2 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h @@ -15,8 +15,7 @@ struct ThreadContext; /// Generic ARM11 CPU interface class ARM_Interface : NonCopyable { public: - virtual ~ARM_Interface() { - } + virtual ~ARM_Interface() {} /** * Runs the CPU for the given number of instructions diff --git a/src/core/arm/dyncom/arm_dyncom.cpp b/src/core/arm/dyncom/arm_dyncom.cpp index d84917529..912560402 100644 --- a/src/core/arm/dyncom/arm_dyncom.cpp +++ b/src/core/arm/dyncom/arm_dyncom.cpp @@ -21,8 +21,7 @@ ARM_DynCom::ARM_DynCom(PrivilegeMode initial_mode) { state = std::make_unique(initial_mode); } -ARM_DynCom::~ARM_DynCom() { -} +ARM_DynCom::~ARM_DynCom() {} void ARM_DynCom::ClearInstructionCache() { state->instruction_cache.clear(); diff --git a/src/core/arm/dyncom/arm_dyncom_trans.cpp b/src/core/arm/dyncom/arm_dyncom_trans.cpp index e056d890c..526cf28f3 100644 --- a/src/core/arm/dyncom/arm_dyncom_trans.cpp +++ b/src/core/arm/dyncom/arm_dyncom_trans.cpp @@ -1883,6 +1883,7 @@ const transop_fp_t arm_instruction_trans[] = { // All the thumb instructions should be placed the end of table INTERPRETER_TRANSLATE(b_2_thumb), INTERPRETER_TRANSLATE(b_cond_thumb), INTERPRETER_TRANSLATE(bl_1_thumb), INTERPRETER_TRANSLATE(bl_2_thumb), - INTERPRETER_TRANSLATE(blx_1_thumb)}; + INTERPRETER_TRANSLATE(blx_1_thumb), +}; const size_t arm_instruction_trans_len = sizeof(arm_instruction_trans) / sizeof(transop_fp_t); diff --git a/src/core/arm/skyeye_common/armstate.h b/src/core/arm/skyeye_common/armstate.h index 66567c285..f31fb207c 100644 --- a/src/core/arm/skyeye_common/armstate.h +++ b/src/core/arm/skyeye_common/armstate.h @@ -237,10 +237,8 @@ private: void ResetMPCoreCP15Registers(); // Defines a reservation granule of 2 words, which protects the first 2 words starting at the - // tag. - // This is the smallest granule allowed by the v7 spec, and is coincidentally just large enough - // to - // support LDR/STREXD. + // tag. This is the smallest granule allowed by the v7 spec, and is coincidentally just large + // enough to support LDR/STREXD. static const u32 RESERVATION_GRANULE_MASK = 0xFFFFFFF8; u32 exclusive_tag; // The address for which the local monitor is in exclusive access mode diff --git a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp index 4d89743e7..2886f351f 100644 --- a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp @@ -51,10 +51,10 @@ * =========================================================================== */ -#include "core/arm/skyeye_common/vfp/vfp.h" #include #include "common/logging/log.h" #include "core/arm/skyeye_common/vfp/asm_vfp.h" +#include "core/arm/skyeye_common/vfp/vfp.h" #include "core/arm/skyeye_common/vfp/vfp_helper.h" static struct vfp_double vfp_double_default_qnan = { diff --git a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp index 3c21efe62..bf157e2c3 100644 --- a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp @@ -280,13 +280,15 @@ static u32 vfp_single_fneg(ARMul_State* state, int sd, int unused, s32 m, u32 fp return 0; } -static const u16 sqrt_oddadjust[] = {0x0004, 0x0022, 0x005d, 0x00b1, 0x011d, 0x019f, - 0x0236, 0x02e0, 0x039c, 0x0468, 0x0545, 0x0631, - 0x072b, 0x0832, 0x0946, 0x0a67}; +static const u16 sqrt_oddadjust[] = { + 0x0004, 0x0022, 0x005d, 0x00b1, 0x011d, 0x019f, 0x0236, 0x02e0, + 0x039c, 0x0468, 0x0545, 0x0631, 0x072b, 0x0832, 0x0946, 0x0a67, +}; -static const u16 sqrt_evenadjust[] = {0x0a2d, 0x08af, 0x075a, 0x0629, 0x051a, 0x0429, - 0x0356, 0x029e, 0x0200, 0x0179, 0x0109, 0x00af, - 0x0068, 0x0034, 0x0012, 0x0002}; +static const u16 sqrt_evenadjust[] = { + 0x0a2d, 0x08af, 0x075a, 0x0629, 0x051a, 0x0429, 0x0356, 0x029e, + 0x0200, 0x0179, 0x0109, 0x00af, 0x0068, 0x0034, 0x0012, 0x0002, +}; u32 vfp_estimate_sqrt_significand(u32 exponent, u32 significand) { int index; diff --git a/src/core/core.cpp b/src/core/core.cpp index 4f9eca416..71a13dd33 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -28,8 +28,7 @@ void RunLoop(int tight_loop) { GDBStub::HandlePacket(); // If the loop is halted and we want to step, use a tiny (1) number of instructions to - // execute. - // Otherwise get out of the loop function. + // execute. Otherwise, get out of the loop function. if (GDBStub::GetCpuHaltFlag()) { if (GDBStub::GetCpuStepFlag()) { GDBStub::SetCpuStepFlag(false); diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index b7b988cf1..fb88ecaf2 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -23,11 +23,9 @@ int g_clock_rate_arm11 = 268123480; namespace CoreTiming { struct EventType { - EventType() { - } + EventType() {} - EventType(TimedCallback cb, const char* n) : callback(cb), name(n) { - } + EventType(TimedCallback cb, const char* n) : callback(cb), name(n) {} TimedCallback callback; const char* name; diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index 79fde9710..7f64fe4e2 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h @@ -21,7 +21,13 @@ class FileBackend; class DirectoryBackend; // Path string type -enum LowPathType : u32 { Invalid = 0, Empty = 1, Binary = 2, Char = 3, Wchar = 4 }; +enum LowPathType : u32 { + Invalid = 0, + Empty = 1, + Binary = 2, + Char = 3, + Wchar = 4, +}; union Mode { u32 hex; @@ -32,12 +38,9 @@ union Mode { class Path { public: - Path() : type(Invalid) { - } - Path(const char* path) : type(Char), string(path) { - } - Path(std::vector binary_data) : type(Binary), binary(std::move(binary_data)) { - } + Path() : type(Invalid) {} + Path(const char* path) : type(Char), string(path) {} + Path(std::vector binary_data) : type(Binary), binary(std::move(binary_data)) {} Path(LowPathType type, u32 size, u32 pointer); LowPathType GetType() const { @@ -61,22 +64,18 @@ private: std::u16string u16str; }; +/// Parameters of the archive, as specified in the Create or Format call. struct ArchiveFormatInfo { - u32_le total_size; ///< The pre-defined size of the archive, as specified in the Create or - /// Format call - u32_le number_directories; ///< The pre-defined number of directories in the archive, as - /// specified in the Create or Format call - u32_le number_files; ///< The pre-defined number of files in the archive, as specified in the - /// Create or Format call - u8 duplicate_data; ///< Whether the archive should duplicate the data, as specified in the - /// Create or Format call + u32_le total_size; ///< The pre-defined size of the archive. + u32_le number_directories; ///< The pre-defined number of directories in the archive. + u32_le number_files; ///< The pre-defined number of files in the archive. + u8 duplicate_data; ///< Whether the archive should duplicate the data. }; static_assert(std::is_pod::value, "ArchiveFormatInfo is not POD"); class ArchiveBackend : NonCopyable { public: - virtual ~ArchiveBackend() { - } + virtual ~ArchiveBackend() {} /** * Get a descriptive name for the archive (e.g. "RomFS", "SaveData", etc.) @@ -153,8 +152,7 @@ public: class ArchiveFactory : NonCopyable { public: - virtual ~ArchiveFactory() { - } + virtual ~ArchiveFactory() {} /** * Get a descriptive name for the archive (e.g. "RomFS", "SaveData", etc.) diff --git a/src/core/file_sys/archive_savedata.cpp b/src/core/file_sys/archive_savedata.cpp index 9a264091f..860f2fca8 100644 --- a/src/core/file_sys/archive_savedata.cpp +++ b/src/core/file_sys/archive_savedata.cpp @@ -48,11 +48,10 @@ ResultVal> ArchiveFactory_SaveData::Open(const P std::string concrete_mount_point = GetSaveDataPath(mount_point, Kernel::g_current_process->codeset->program_id); if (!FileUtil::Exists(concrete_mount_point)) { - // When a SaveData archive is created for the first time, it is not yet formatted - // and the save file/directory structure expected by the game has not yet been initialized. + // When a SaveData archive is created for the first time, it is not yet formatted and the + // save file/directory structure expected by the game has not yet been initialized. // Returning the NotFormatted error code will signal the game to provision the SaveData - // archive - // with the files and folders that it expects. + // archive with the files and folders that it expects. return ResultCode(ErrorDescription::FS_NotFormatted, ErrorModule::FS, ErrorSummary::InvalidState, ErrorLevel::Status); } diff --git a/src/core/file_sys/archive_savedatacheck.cpp b/src/core/file_sys/archive_savedatacheck.cpp index fd9b84302..50fe004fe 100644 --- a/src/core/file_sys/archive_savedatacheck.cpp +++ b/src/core/file_sys/archive_savedatacheck.cpp @@ -30,8 +30,7 @@ static std::string GetSaveDataCheckPath(const std::string& mount_point, u32 high } ArchiveFactory_SaveDataCheck::ArchiveFactory_SaveDataCheck(const std::string& nand_directory) - : mount_point(GetSaveDataCheckContainerPath(nand_directory)) { -} + : mount_point(GetSaveDataCheckContainerPath(nand_directory)) {} ResultVal> ArchiveFactory_SaveDataCheck::Open(const Path& path) { auto vec = path.AsBinary(); diff --git a/src/core/file_sys/archive_systemsavedata.cpp b/src/core/file_sys/archive_systemsavedata.cpp index 1fb858247..0261ab547 100644 --- a/src/core/file_sys/archive_systemsavedata.cpp +++ b/src/core/file_sys/archive_systemsavedata.cpp @@ -49,8 +49,7 @@ Path ConstructSystemSaveDataBinaryPath(u32 high, u32 low) { } ArchiveFactory_SystemSaveData::ArchiveFactory_SystemSaveData(const std::string& nand_path) - : base_path(GetSystemSaveDataContainerPath(nand_path)) { -} + : base_path(GetSystemSaveDataContainerPath(nand_path)) {} ResultVal> ArchiveFactory_SystemSaveData::Open(const Path& path) { std::string fullpath = GetSystemSaveDataPath(base_path, path); diff --git a/src/core/file_sys/directory_backend.h b/src/core/file_sys/directory_backend.h index c402ee60b..9706e909b 100644 --- a/src/core/file_sys/directory_backend.h +++ b/src/core/file_sys/directory_backend.h @@ -38,10 +38,8 @@ static_assert(offsetof(Entry, file_size) == 0x220, "Wrong offset for file_size i class DirectoryBackend : NonCopyable { public: - DirectoryBackend() { - } - virtual ~DirectoryBackend() { - } + DirectoryBackend() {} + virtual ~DirectoryBackend() {} /** * Open the directory diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h index 3f620128f..64e36f5ea 100644 --- a/src/core/file_sys/disk_archive.h +++ b/src/core/file_sys/disk_archive.h @@ -29,8 +29,7 @@ namespace FileSys { */ class DiskArchive : public ArchiveBackend { public: - DiskArchive(const std::string& mount_point_) : mount_point(mount_point_) { - } + DiskArchive(const std::string& mount_point_) : mount_point(mount_point_) {} virtual std::string GetName() const override { return "DiskArchive: " + mount_point; diff --git a/src/core/file_sys/file_backend.h b/src/core/file_sys/file_backend.h index 9eae697c2..3496facd4 100644 --- a/src/core/file_sys/file_backend.h +++ b/src/core/file_sys/file_backend.h @@ -16,10 +16,8 @@ namespace FileSys { class FileBackend : NonCopyable { public: - FileBackend() { - } - virtual ~FileBackend() { - } + FileBackend() {} + virtual ~FileBackend() {} /** * Open the file diff --git a/src/core/file_sys/ivfc_archive.h b/src/core/file_sys/ivfc_archive.h index dab1958f6..0d15550da 100644 --- a/src/core/file_sys/ivfc_archive.h +++ b/src/core/file_sys/ivfc_archive.h @@ -30,8 +30,7 @@ namespace FileSys { class IVFCArchive : public ArchiveBackend { public: IVFCArchive(std::shared_ptr file, u64 offset, u64 size) - : romfs_file(file), data_offset(offset), data_size(size) { - } + : romfs_file(file), data_offset(offset), data_size(size) {} std::string GetName() const override; @@ -55,8 +54,7 @@ protected: class IVFCFile : public FileBackend { public: IVFCFile(std::shared_ptr file, u64 offset, u64 size) - : romfs_file(file), data_offset(offset), data_size(size) { - } + : romfs_file(file), data_offset(offset), data_size(size) {} ResultCode Open() override { return RESULT_SUCCESS; @@ -68,8 +66,7 @@ public: bool Close() const override { return false; } - void Flush() const override { - } + void Flush() const override {} private: std::shared_ptr romfs_file; diff --git a/src/core/hle/applets/applet.h b/src/core/hle/applets/applet.h index 350a58594..1850ad261 100644 --- a/src/core/hle/applets/applet.h +++ b/src/core/hle/applets/applet.h @@ -14,10 +14,8 @@ namespace Applets { class Applet { public: - virtual ~Applet() { - } - Applet(Service::APT::AppletId id) : id(id) { - } + virtual ~Applet() {} + Applet(Service::APT::AppletId id) : id(id) {} /** * Creates an instance of the Applet subclass identified by the parameter. diff --git a/src/core/hle/applets/erreula.cpp b/src/core/hle/applets/erreula.cpp index 144d6a152..457cbb1bd 100644 --- a/src/core/hle/applets/erreula.cpp +++ b/src/core/hle/applets/erreula.cpp @@ -67,8 +67,7 @@ ResultCode ErrEula::StartImpl(const Service::APT::AppletStartupParameter& parame return RESULT_SUCCESS; } -void ErrEula::Update() { -} +void ErrEula::Update() {} } // namespace Applets } // namespace HLE diff --git a/src/core/hle/applets/erreula.h b/src/core/hle/applets/erreula.h index dd1d1aee4..a7ec7ec01 100644 --- a/src/core/hle/applets/erreula.h +++ b/src/core/hle/applets/erreula.h @@ -12,8 +12,7 @@ namespace Applets { class ErrEula final : public Applet { public: - explicit ErrEula(Service::APT::AppletId id) : Applet(id) { - } + explicit ErrEula(Service::APT::AppletId id) : Applet(id) {} ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) override; ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) override; diff --git a/src/core/hle/applets/mii_selector.cpp b/src/core/hle/applets/mii_selector.cpp index 19e603eda..79264d349 100644 --- a/src/core/hle/applets/mii_selector.cpp +++ b/src/core/hle/applets/mii_selector.cpp @@ -85,7 +85,6 @@ ResultCode MiiSelector::StartImpl(const Service::APT::AppletStartupParameter& pa return RESULT_SUCCESS; } -void MiiSelector::Update() { -} +void MiiSelector::Update() {} } } // namespace diff --git a/src/core/hle/applets/mii_selector.h b/src/core/hle/applets/mii_selector.h index dba4abc8d..26966a271 100644 --- a/src/core/hle/applets/mii_selector.h +++ b/src/core/hle/applets/mii_selector.h @@ -66,8 +66,7 @@ ASSERT_REG_POSITION(unk_6C, 0x6C); class MiiSelector final : public Applet { public: - MiiSelector(Service::APT::AppletId id) : Applet(id), started(false) { - } + MiiSelector(Service::APT::AppletId id) : Applet(id), started(false) {} ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) override; ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) override; diff --git a/src/core/hle/applets/swkbd.h b/src/core/hle/applets/swkbd.h index f50673912..4e2f9de62 100644 --- a/src/core/hle/applets/swkbd.h +++ b/src/core/hle/applets/swkbd.h @@ -53,8 +53,7 @@ static_assert(sizeof(SoftwareKeyboardConfig) == 0x400, "Software Keyboard Config class SoftwareKeyboard final : public Applet { public: - SoftwareKeyboard(Service::APT::AppletId id) : Applet(id), started(false) { - } + SoftwareKeyboard(Service::APT::AppletId id) : Applet(id), started(false) {} ResultCode ReceiveParameter(const Service::APT::MessageParameter& parameter) override; ResultCode StartImpl(const Service::APT::AppletStartupParameter& parameter) override; diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index 2ff652f13..3506c2d48 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp @@ -16,10 +16,8 @@ namespace Kernel { -AddressArbiter::AddressArbiter() { -} -AddressArbiter::~AddressArbiter() { -} +AddressArbiter::AddressArbiter() {} +AddressArbiter::~AddressArbiter() {} SharedPtr AddressArbiter::Create(std::string name) { SharedPtr address_arbiter(new AddressArbiter); diff --git a/src/core/hle/kernel/client_port.cpp b/src/core/hle/kernel/client_port.cpp index 5df769c6a..444ce8d45 100644 --- a/src/core/hle/kernel/client_port.cpp +++ b/src/core/hle/kernel/client_port.cpp @@ -10,9 +10,7 @@ namespace Kernel { -ClientPort::ClientPort() { -} -ClientPort::~ClientPort() { -} +ClientPort::ClientPort() {} +ClientPort::~ClientPort() {} } // namespace diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index 63375818d..f056eb7c3 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp @@ -14,10 +14,8 @@ namespace Kernel { -Event::Event() { -} -Event::~Event() { -} +Event::Event() {} +Event::~Event() {} SharedPtr Event::Create(ResetType reset_type, std::string name) { SharedPtr evt(new Event); diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index cc39652d5..c683fcb80 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -58,8 +58,7 @@ enum { class Object : NonCopyable { public: - virtual ~Object() { - } + virtual ~Object() {} /// Returns a unique identifier for the object. For debugging purposes only. unsigned int GetObjectId() const { diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index f92810804..edb97d324 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp @@ -33,10 +33,8 @@ void ReleaseThreadMutexes(Thread* thread) { thread->held_mutexes.clear(); } -Mutex::Mutex() { -} -Mutex::~Mutex() { -} +Mutex::Mutex() {} +Mutex::~Mutex() {} SharedPtr Mutex::Create(bool initial_locked, std::string name) { SharedPtr mutex(new Mutex); diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index cc37e574c..b764f750f 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -26,10 +26,8 @@ SharedPtr CodeSet::Create(std::string name, u64 program_id) { return codeset; } -CodeSet::CodeSet() { -} -CodeSet::~CodeSet() { -} +CodeSet::CodeSet() {} +CodeSet::~CodeSet() {} u32 Process::next_process_id; @@ -282,10 +280,8 @@ ResultCode Process::LinearFree(VAddr target, u32 size) { return RESULT_SUCCESS; } -Kernel::Process::Process() { -} -Kernel::Process::~Process() { -} +Kernel::Process::Process() {} +Kernel::Process::~Process() {} SharedPtr g_current_process; } diff --git a/src/core/hle/kernel/resource_limit.cpp b/src/core/hle/kernel/resource_limit.cpp index 7bd1c1e08..bb0baed6f 100644 --- a/src/core/hle/kernel/resource_limit.cpp +++ b/src/core/hle/kernel/resource_limit.cpp @@ -12,10 +12,8 @@ namespace Kernel { static SharedPtr resource_limits[4]; -ResourceLimit::ResourceLimit() { -} -ResourceLimit::~ResourceLimit() { -} +ResourceLimit::ResourceLimit() {} +ResourceLimit::~ResourceLimit() {} SharedPtr ResourceLimit::Create(std::string name) { SharedPtr resource_limit(new ResourceLimit); @@ -150,7 +148,6 @@ void ResourceLimitsInit() { resource_limits[static_cast(ResourceLimitCategory::OTHER)] = resource_limit; } -void ResourceLimitsShutdown() { -} +void ResourceLimitsShutdown() {} } // namespace diff --git a/src/core/hle/kernel/resource_limit.h b/src/core/hle/kernel/resource_limit.h index c08e744e6..5d8b31a2d 100644 --- a/src/core/hle/kernel/resource_limit.h +++ b/src/core/hle/kernel/resource_limit.h @@ -92,8 +92,8 @@ public: s32 max_cpu_time = 0; // TODO(Subv): Increment these in their respective Kernel::T::Create functions, keeping in mind - // that - // APPLICATION resource limits should not be affected by the objects created by service modules. + // that APPLICATION resource limits should not be affected by the objects created by service + // modules. // Currently we have no way of distinguishing if a Create was called by the running application, // or by a service module. Approach this once we have separated the service modules into their // own processes diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp index 71e41079b..16ac22f1d 100644 --- a/src/core/hle/kernel/semaphore.cpp +++ b/src/core/hle/kernel/semaphore.cpp @@ -10,10 +10,8 @@ namespace Kernel { -Semaphore::Semaphore() { -} -Semaphore::~Semaphore() { -} +Semaphore::Semaphore() {} +Semaphore::~Semaphore() {} ResultVal> Semaphore::Create(s32 initial_count, s32 max_count, std::string name) { diff --git a/src/core/hle/kernel/server_port.cpp b/src/core/hle/kernel/server_port.cpp index 7c690fa7f..57e93cad4 100644 --- a/src/core/hle/kernel/server_port.cpp +++ b/src/core/hle/kernel/server_port.cpp @@ -13,10 +13,8 @@ namespace Kernel { -ServerPort::ServerPort() { -} -ServerPort::~ServerPort() { -} +ServerPort::ServerPort() {} +ServerPort::~ServerPort() {} bool ServerPort::ShouldWait() { // If there are no pending sessions, we wait until a new one is added. @@ -27,8 +25,9 @@ void ServerPort::Acquire() { ASSERT_MSG(!ShouldWait(), "object unavailable!"); } -std::tuple, SharedPtr> -ServerPort::CreatePortPair(u32 max_sessions, std::string name) { +std::tuple, SharedPtr> ServerPort::CreatePortPair( + u32 max_sessions, std::string name) { + SharedPtr server_port(new ServerPort); SharedPtr client_port(new ClientPort); diff --git a/src/core/hle/kernel/server_port.h b/src/core/hle/kernel/server_port.h index e43d48674..c3f2ae177 100644 --- a/src/core/hle/kernel/server_port.h +++ b/src/core/hle/kernel/server_port.h @@ -23,8 +23,8 @@ public: * @param name Optional name of the ports * @return The created port tuple */ - static std::tuple, SharedPtr> - CreatePortPair(u32 max_sessions, std::string name = "UnknownPort"); + static std::tuple, SharedPtr> CreatePortPair( + u32 max_sessions, std::string name = "UnknownPort"); std::string GetTypeName() const override { return "ServerPort"; diff --git a/src/core/hle/kernel/session.cpp b/src/core/hle/kernel/session.cpp index 61457845a..8a2a7e3fd 100644 --- a/src/core/hle/kernel/session.cpp +++ b/src/core/hle/kernel/session.cpp @@ -7,8 +7,6 @@ namespace Kernel { -Session::Session() { -} -Session::~Session() { -} +Session::Session() {} +Session::~Session() {} } diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index 74f40930c..bf511a338 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp @@ -12,10 +12,8 @@ namespace Kernel { -SharedMemory::SharedMemory() { -} -SharedMemory::~SharedMemory() { -} +SharedMemory::SharedMemory() {} +SharedMemory::~SharedMemory() {} SharedPtr SharedMemory::Create(SharedPtr owner_process, u32 size, MemoryPermission permissions, diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 59272715f..0df03c9d5 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -61,10 +61,8 @@ inline static u32 const NewThreadId() { return next_thread_id++; } -Thread::Thread() { -} -Thread::~Thread() { -} +Thread::Thread() {} +Thread::~Thread() {} Thread* GetCurrentThread() { return current_thread; diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index 255cb1aca..427a81923 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp @@ -20,10 +20,8 @@ static int timer_callback_event_type; // us to simply use a pool index or similar. static Kernel::HandleTable timer_callback_handle_table; -Timer::Timer() { -} -Timer::~Timer() { -} +Timer::Timer() {} +Timer::~Timer() {} SharedPtr Timer::Create(ResetType reset_type, std::string name) { SharedPtr timer(new Timer); @@ -103,7 +101,6 @@ void TimersInit() { timer_callback_event_type = CoreTiming::RegisterEvent("TimerCallback", TimerCallback); } -void TimersShutdown() { -} +void TimersShutdown() {} } // namespace diff --git a/src/core/hle/result.h b/src/core/hle/result.h index 6e3dd9cd2..492c1ffa6 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h @@ -213,8 +213,7 @@ union ResultCode { // error BitField<31, 1, u32> is_error; - explicit ResultCode(u32 raw) : raw(raw) { - } + explicit ResultCode(u32 raw) : raw(raw) {} ResultCode(ErrorDescription description_, ErrorModule module_, ErrorSummary summary_, ErrorLevel level_) : raw(0) { diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index b653523a4..528bb1848 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -186,8 +186,7 @@ void Init() { AddService(new AM_U_Interface); } -void Shutdown() { -} +void Shutdown() {} } // namespace AM diff --git a/src/core/hle/service/am/am_app.cpp b/src/core/hle/service/am/am_app.cpp index bfc1ca6bd..827e60335 100644 --- a/src/core/hle/service/am/am_app.cpp +++ b/src/core/hle/service/am/am_app.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/am/am.h" #include "core/hle/service/am/am_app.h" +#include "core/hle/service/am/am.h" namespace Service { namespace AM { diff --git a/src/core/hle/service/am/am_net.cpp b/src/core/hle/service/am/am_net.cpp index 3a597a34c..d9d9d78c8 100644 --- a/src/core/hle/service/am/am_net.cpp +++ b/src/core/hle/service/am/am_net.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/am/am.h" #include "core/hle/service/am/am_net.h" +#include "core/hle/service/am/am.h" namespace Service { namespace AM { diff --git a/src/core/hle/service/am/am_sys.cpp b/src/core/hle/service/am/am_sys.cpp index 8bb58cab7..6f441f9e7 100644 --- a/src/core/hle/service/am/am_sys.cpp +++ b/src/core/hle/service/am/am_sys.cpp @@ -2,33 +2,35 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/am/am.h" #include "core/hle/service/am/am_sys.h" +#include "core/hle/service/am/am.h" namespace Service { namespace AM { -const Interface::FunctionInfo FunctionTable[] = {{0x00010040, GetTitleCount, "GetTitleCount"}, - {0x00020082, GetTitleList, "GetTitleList"}, - {0x00030084, GetTitleInfo, "GetTitleInfo"}, - {0x000400C0, nullptr, "DeleteApplicationTitle"}, - {0x000500C0, nullptr, "GetTitleProductCode"}, - {0x000600C0, nullptr, "GetTitleExtDataId"}, - {0x00070080, DeleteTicket, "DeleteTicket"}, - {0x00080000, GetTicketCount, "GetTicketCount"}, - {0x00090082, GetTicketList, "GetTicketList"}, - {0x000A0000, nullptr, "GetDeviceID"}, - {0x000D0084, nullptr, "GetPendingTitleInfo"}, - {0x000E00C0, nullptr, "DeletePendingTitle"}, - {0x00140040, nullptr, "FinalizePendingTitles"}, - {0x00150040, nullptr, "DeleteAllPendingTitles"}, - {0x00180080, nullptr, "InitializeTitleDatabase"}, - {0x00190040, nullptr, "ReloadDBS"}, - {0x001A00C0, nullptr, "GetDSiWareExportSize"}, - {0x001B0144, nullptr, "ExportDSiWare"}, - {0x001C0084, nullptr, "ImportDSiWare"}, - {0x00230080, nullptr, "GetPendingTitleCount"}, - {0x002400C2, nullptr, "GetPendingTitleList"}}; +const Interface::FunctionInfo FunctionTable[] = { + {0x00010040, GetTitleCount, "GetTitleCount"}, + {0x00020082, GetTitleList, "GetTitleList"}, + {0x00030084, GetTitleInfo, "GetTitleInfo"}, + {0x000400C0, nullptr, "DeleteApplicationTitle"}, + {0x000500C0, nullptr, "GetTitleProductCode"}, + {0x000600C0, nullptr, "GetTitleExtDataId"}, + {0x00070080, DeleteTicket, "DeleteTicket"}, + {0x00080000, GetTicketCount, "GetTicketCount"}, + {0x00090082, GetTicketList, "GetTicketList"}, + {0x000A0000, nullptr, "GetDeviceID"}, + {0x000D0084, nullptr, "GetPendingTitleInfo"}, + {0x000E00C0, nullptr, "DeletePendingTitle"}, + {0x00140040, nullptr, "FinalizePendingTitles"}, + {0x00150040, nullptr, "DeleteAllPendingTitles"}, + {0x00180080, nullptr, "InitializeTitleDatabase"}, + {0x00190040, nullptr, "ReloadDBS"}, + {0x001A00C0, nullptr, "GetDSiWareExportSize"}, + {0x001B0144, nullptr, "ExportDSiWare"}, + {0x001C0084, nullptr, "ImportDSiWare"}, + {0x00230080, nullptr, "GetPendingTitleCount"}, + {0x002400C2, nullptr, "GetPendingTitleList"}, +}; AM_SYS_Interface::AM_SYS_Interface() { Register(FunctionTable); diff --git a/src/core/hle/service/am/am_u.cpp b/src/core/hle/service/am/am_u.cpp index 32d47741f..c40e56205 100644 --- a/src/core/hle/service/am/am_u.cpp +++ b/src/core/hle/service/am/am_u.cpp @@ -2,46 +2,48 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/am/am.h" #include "core/hle/service/am/am_u.h" +#include "core/hle/service/am/am.h" namespace Service { namespace AM { -const Interface::FunctionInfo FunctionTable[] = {{0x00010040, GetTitleCount, "GetTitleCount"}, - {0x00020082, GetTitleList, "GetTitleList"}, - {0x00030084, GetTitleInfo, "GetTitleInfo"}, - {0x000400C0, nullptr, "DeleteApplicationTitle"}, - {0x000500C0, nullptr, "GetTitleProductCode"}, - {0x000600C0, nullptr, "GetTitleExtDataId"}, - {0x00070080, DeleteTicket, "DeleteTicket"}, - {0x00080000, GetTicketCount, "GetTicketCount"}, - {0x00090082, GetTicketList, "GetTicketList"}, - {0x000A0000, nullptr, "GetDeviceID"}, - {0x000D0084, nullptr, "GetPendingTitleInfo"}, - {0x000E00C0, nullptr, "DeletePendingTitle"}, - {0x00140040, nullptr, "FinalizePendingTitles"}, - {0x00150040, nullptr, "DeleteAllPendingTitles"}, - {0x00180080, nullptr, "InitializeTitleDatabase"}, - {0x00190040, nullptr, "ReloadDBS"}, - {0x001A00C0, nullptr, "GetDSiWareExportSize"}, - {0x001B0144, nullptr, "ExportDSiWare"}, - {0x001C0084, nullptr, "ImportDSiWare"}, - {0x00230080, nullptr, "TitleIDListGetTotal2"}, - {0x002400C2, nullptr, "GetTitleIDList2"}, - {0x04010080, nullptr, "InstallFIRM"}, - {0x04020040, nullptr, "StartInstallCIADB0"}, - {0x04030000, nullptr, "StartInstallCIADB1"}, - {0x04040002, nullptr, "AbortCIAInstall"}, - {0x04050002, nullptr, "CloseCIAFinalizeInstall"}, - {0x04060002, nullptr, "CloseCIA"}, - {0x040700C2, nullptr, "FinalizeTitlesInstall"}, - {0x04080042, nullptr, "GetCiaFileInfo"}, - {0x040E00C2, nullptr, "InstallTitlesFinish"}, - {0x040F0000, nullptr, "InstallNATIVEFIRM"}, - {0x041000C0, nullptr, "DeleteTitle"}, - {0x04120000, nullptr, "Initialize"}, - {0x041700C0, nullptr, "MigrateAGBtoSAV"}}; +const Interface::FunctionInfo FunctionTable[] = { + {0x00010040, GetTitleCount, "GetTitleCount"}, + {0x00020082, GetTitleList, "GetTitleList"}, + {0x00030084, GetTitleInfo, "GetTitleInfo"}, + {0x000400C0, nullptr, "DeleteApplicationTitle"}, + {0x000500C0, nullptr, "GetTitleProductCode"}, + {0x000600C0, nullptr, "GetTitleExtDataId"}, + {0x00070080, DeleteTicket, "DeleteTicket"}, + {0x00080000, GetTicketCount, "GetTicketCount"}, + {0x00090082, GetTicketList, "GetTicketList"}, + {0x000A0000, nullptr, "GetDeviceID"}, + {0x000D0084, nullptr, "GetPendingTitleInfo"}, + {0x000E00C0, nullptr, "DeletePendingTitle"}, + {0x00140040, nullptr, "FinalizePendingTitles"}, + {0x00150040, nullptr, "DeleteAllPendingTitles"}, + {0x00180080, nullptr, "InitializeTitleDatabase"}, + {0x00190040, nullptr, "ReloadDBS"}, + {0x001A00C0, nullptr, "GetDSiWareExportSize"}, + {0x001B0144, nullptr, "ExportDSiWare"}, + {0x001C0084, nullptr, "ImportDSiWare"}, + {0x00230080, nullptr, "TitleIDListGetTotal2"}, + {0x002400C2, nullptr, "GetTitleIDList2"}, + {0x04010080, nullptr, "InstallFIRM"}, + {0x04020040, nullptr, "StartInstallCIADB0"}, + {0x04030000, nullptr, "StartInstallCIADB1"}, + {0x04040002, nullptr, "AbortCIAInstall"}, + {0x04050002, nullptr, "CloseCIAFinalizeInstall"}, + {0x04060002, nullptr, "CloseCIA"}, + {0x040700C2, nullptr, "FinalizeTitlesInstall"}, + {0x04080042, nullptr, "GetCiaFileInfo"}, + {0x040E00C2, nullptr, "InstallTitlesFinish"}, + {0x040F0000, nullptr, "InstallNATIVEFIRM"}, + {0x041000C0, nullptr, "DeleteTitle"}, + {0x04120000, nullptr, "Initialize"}, + {0x041700C0, nullptr, "MigrateAGBtoSAV"}, +}; AM_U_Interface::AM_U_Interface() { Register(FunctionTable); diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index c798e8752..dfc1e9c08 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -90,10 +90,8 @@ void GetSharedFont(Service::Interface* self) { cmd_buff[0] = IPC::MakeHeader(0x44, 2, 2); cmd_buff[1] = RESULT_SUCCESS.raw; // No error // Since the SharedMemory interface doesn't provide the address at which the memory was - // allocated, - // the real APT service calculates this address by scanning the entire address space (using - // svcQueryMemory) - // and searches for an allocation of the same size as the Shared Font. + // allocated, the real APT service calculates this address by scanning the entire address space + // (using svcQueryMemory) and searches for an allocation of the same size as the Shared Font. cmd_buff[2] = target_address; cmd_buff[3] = IPC::CopyHandleDesc(); cmd_buff[4] = Kernel::g_handle_table.Create(shared_font_mem).MoveFrom(); diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h index fe8b8a7b8..7597b0d3e 100644 --- a/src/core/hle/service/apt/apt.h +++ b/src/core/hle/service/apt/apt.h @@ -183,12 +183,10 @@ void GetAppletInfo(Service::Interface* self); /** * APT::IsRegistered service function. This returns whether the specified AppID is registered with - * NS yet. - * An AppID is "registered" once the process associated with the AppID uses APT:Enable. Home Menu - * uses this - * command to determine when the launched process is running and to determine when to stop using GSP - * etc, - * while displaying the "Nintendo 3DS" loading screen. + * NS yet. An AppID is "registered" once the process associated with the AppID uses APT:Enable. Home + * Menu uses this command to determine when the launched process is running and to determine when to + * stop using GSP, etc., while displaying the "Nintendo 3DS" loading screen. + * * Inputs: * 1 : AppID * Outputs: @@ -264,10 +262,10 @@ void GlanceParameter(Service::Interface* self); * (same flag cleared by APT:ReceiveParameter). * Inputs: * 1 : Flag, when non-zero NS will compare the word after this one with a field in the NS - * state. + * state. * 2 : Unknown, this is the same as the first unknown field returned by APT:ReceiveParameter. * 3 : Flag, when non-zero NS will compare the word after this one with a field in the NS - * state. + * state. * 4 : AppID * Outputs: * 0 : Return header diff --git a/src/core/hle/service/apt/apt_a.cpp b/src/core/hle/service/apt/apt_a.cpp index 7d47d7675..09198d52b 100644 --- a/src/core/hle/service/apt/apt_a.cpp +++ b/src/core/hle/service/apt/apt_a.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/apt/apt.h" #include "core/hle/service/apt/apt_a.h" +#include "core/hle/service/apt/apt.h" namespace Service { namespace APT { @@ -36,7 +36,8 @@ const Interface::FunctionInfo FunctionTable[] = { {0x00550040, SetScreenCapPostPermission, "SetScreenCapPostPermission"}, {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"}, {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, - {0x01020000, CheckNew3DS, "CheckNew3DS"}}; + {0x01020000, CheckNew3DS, "CheckNew3DS"}, +}; APT_A_Interface::APT_A_Interface() { Register(FunctionTable); diff --git a/src/core/hle/service/apt/apt_s.cpp b/src/core/hle/service/apt/apt_s.cpp index 76e71669c..f5afb78e8 100644 --- a/src/core/hle/service/apt/apt_s.cpp +++ b/src/core/hle/service/apt/apt_s.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/apt/apt.h" #include "core/hle/service/apt/apt_s.h" +#include "core/hle/service/apt/apt.h" namespace Service { namespace APT { @@ -96,7 +96,8 @@ const Interface::FunctionInfo FunctionTable[] = { {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"}, {0x00580002, nullptr, "GetProgramID"}, {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, - {0x01020000, CheckNew3DS, "CheckNew3DS"}}; + {0x01020000, CheckNew3DS, "CheckNew3DS"}, +}; APT_S_Interface::APT_S_Interface() { Register(FunctionTable); diff --git a/src/core/hle/service/apt/apt_u.cpp b/src/core/hle/service/apt/apt_u.cpp index 9c6223dd7..184534b01 100644 --- a/src/core/hle/service/apt/apt_u.cpp +++ b/src/core/hle/service/apt/apt_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/apt/apt.h" #include "core/hle/service/apt/apt_u.h" +#include "core/hle/service/apt/apt.h" namespace Service { namespace APT { @@ -96,7 +96,8 @@ const Interface::FunctionInfo FunctionTable[] = { {0x00560000, GetScreenCapPostPermission, "GetScreenCapPostPermission"}, {0x00580002, nullptr, "GetProgramID"}, {0x01010000, CheckNew3DSApp, "CheckNew3DSApp"}, - {0x01020000, CheckNew3DS, "CheckNew3DS"}}; + {0x01020000, CheckNew3DS, "CheckNew3DS"}, +}; APT_U_Interface::APT_U_Interface() { Register(FunctionTable); diff --git a/src/core/hle/service/boss/boss.cpp b/src/core/hle/service/boss/boss.cpp index 867b31fbf..757a8c2c7 100644 --- a/src/core/hle/service/boss/boss.cpp +++ b/src/core/hle/service/boss/boss.cpp @@ -17,8 +17,7 @@ void Init() { AddService(new BOSS_U_Interface); } -void Shutdown() { -} +void Shutdown() {} } // namespace BOSS diff --git a/src/core/hle/service/cam/cam.h b/src/core/hle/service/cam/cam.h index a87183493..ec9b835f1 100644 --- a/src/core/hle/service/cam/cam.h +++ b/src/core/hle/service/cam/cam.h @@ -24,14 +24,31 @@ enum class CameraSelect : u8 { In1Out1 = Out1 | In1, Out1Out2 = Out1 | Out2, In1Out2 = In1 | Out2, - All = Out1 | In1 | Out2 + All = Out1 | In1 | Out2, }; -enum class Effect : u8 { None = 0, Mono = 1, Sepia = 2, Negative = 3, Negafilm = 4, Sepia01 = 5 }; +enum class Effect : u8 { + None = 0, + Mono = 1, + Sepia = 2, + Negative = 3, + Negafilm = 4, + Sepia01 = 5, +}; -enum class Context : u8 { None = 0, A = 1, B = 2, Both = A | B }; +enum class Context : u8 { + None = 0, + A = 1, + B = 2, + Both = A | B, +}; -enum class Flip : u8 { None = 0, Horizontal = 1, Vertical = 2, Reverse = 3 }; +enum class Flip : u8 { + None = 0, + Horizontal = 1, + Vertical = 2, + Reverse = 3, +}; enum class Size : u8 { VGA = 0, @@ -42,7 +59,7 @@ enum class Size : u8 { DS_LCD = 5, DS_LCDx4 = 6, CTR_TOP_LCD = 7, - CTR_BOTTOM_LCD = QVGA + CTR_BOTTOM_LCD = QVGA, }; enum class FrameRate : u8 { @@ -58,10 +75,14 @@ enum class FrameRate : u8 { Rate_30_To_5 = 9, Rate_15_To_10 = 10, Rate_20_To_10 = 11, - Rate_30_To_10 = 12 + Rate_30_To_10 = 12, }; -enum class ShutterSoundType : u8 { Normal = 0, Movie = 1, MovieEnd = 2 }; +enum class ShutterSoundType : u8 { + Normal = 0, + Movie = 1, + MovieEnd = 2, +}; enum class WhiteBalance : u8 { BalanceAuto = 0, @@ -77,10 +98,16 @@ enum class WhiteBalance : u8 { BalanceDaylight = Balance5200K, BalanceCloudy = Balance6000K, BalanceHorizon = Balance6000K, - BalanceShade = Balance7000K + BalanceShade = Balance7000K, }; -enum class PhotoMode : u8 { Normal = 0, Portrait = 1, Landscape = 2, Nightview = 3, Letter0 = 4 }; +enum class PhotoMode : u8 { + Normal = 0, + Portrait = 1, + Landscape = 2, + Nightview = 3, + Letter0 = 4, +}; enum class LensCorrection : u8 { Off = 0, @@ -88,7 +115,7 @@ enum class LensCorrection : u8 { On90 = 2, Dark = Off, Normal = On70, - Bright = On90 + Bright = On90, }; enum class Contrast : u8 { @@ -105,10 +132,13 @@ enum class Contrast : u8 { Pattern11 = 11, Low = Pattern05, Normal = Pattern06, - High = Pattern07 + High = Pattern07, }; -enum class OutputFormat : u8 { YUV422 = 0, RGB565 = 1 }; +enum class OutputFormat : u8 { + YUV422 = 0, + RGB565 = 1, +}; /// Stereo camera calibration data. struct StereoCameraCalibrationData { diff --git a/src/core/hle/service/cam/cam_u.cpp b/src/core/hle/service/cam/cam_u.cpp index af2123e5b..125aa7d1f 100644 --- a/src/core/hle/service/cam/cam_u.cpp +++ b/src/core/hle/service/cam/cam_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/cam/cam.h" #include "core/hle/service/cam/cam_u.h" +#include "core/hle/service/cam/cam.h" namespace Service { namespace CAM { diff --git a/src/core/hle/service/cecd/cecd_u.cpp b/src/core/hle/service/cecd/cecd_u.cpp index 4b747de7b..f220bba12 100644 --- a/src/core/hle/service/cecd/cecd_u.cpp +++ b/src/core/hle/service/cecd/cecd_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/cecd/cecd.h" #include "core/hle/service/cecd/cecd_u.h" +#include "core/hle/service/cecd/cecd.h" namespace Service { namespace CECD { diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index fe97a69d1..aff033bde 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp @@ -101,8 +101,9 @@ static const ConsoleCountryInfo COUNTRY_INFO = {{0, 0, 0}, UNITED_STATES_COUNTRY * Thanks Normmatt for providing this information */ static const std::array STEREO_CAMERA_SETTINGS = { - {62.0f, 289.0f, 76.80000305175781f, 46.08000183105469f, 10.0f, 5.0f, 55.58000183105469f, - 21.56999969482422f}}; + 62.0f, 289.0f, 76.80000305175781f, 46.08000183105469f, + 10.0f, 5.0f, 55.58000183105469f, 21.56999969482422f, +}; static_assert(sizeof(STEREO_CAMERA_SETTINGS) == 0x20, "STEREO_CAMERA_SETTINGS must be exactly 0x20 bytes"); @@ -110,8 +111,9 @@ static const u32 CONFIG_SAVEFILE_SIZE = 0x8000; static std::array cfg_config_file_buffer; static Service::FS::ArchiveHandle cfg_system_save_data_archive; -static const std::vector cfg_system_savedata_id = {0x00, 0x00, 0x00, 0x00, - 0x17, 0x00, 0x01, 0x00}; +static const std::vector cfg_system_savedata_id = { + 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x01, 0x00, +}; void GetCountryCodeString(Service::Interface* self) { u32* cmd_buff = Kernel::GetCommandBuffer(); @@ -528,8 +530,7 @@ void Init() { LoadConfigNANDSaveFile(); } -void Shutdown() { -} +void Shutdown() {} void SetUsername(const std::u16string& name) { ASSERT(name.size() <= 10); diff --git a/src/core/hle/service/cfg/cfg.h b/src/core/hle/service/cfg/cfg.h index 8cb231d72..c7c2ab41d 100644 --- a/src/core/hle/service/cfg/cfg.h +++ b/src/core/hle/service/cfg/cfg.h @@ -79,7 +79,7 @@ static const std::array country_codes = {{ C("CN"), 0, 0, 0, 0, 0, 0, 0, // 160-167 C("AE"), C("IN"), C("EG"), C("OM"), C("QA"), C("KW"), C("SA"), C("SY"), // 168-175 C("BH"), C("JO"), 0, 0, 0, 0, 0, 0, // 176-183 - C("SM"), C("VA"), C("BM") // 184-186 + C("SM"), C("VA"), C("BM"), // 184-186 }}; /** @@ -218,8 +218,9 @@ void FormatConfig(Service::Interface* self); /** * Reads a block with the specified id and flag from the Config savegame buffer - * and writes the output to output. - * The input size must match exactly the size of the requested block + * and writes the output to output. The input size must match exactly the size of the requested + * block. + * * @param block_id The id of the block we want to read * @param size The size of the block we want to read * @param flag The requested block must have this flag set @@ -230,8 +231,8 @@ ResultCode GetConfigInfoBlock(u32 block_id, u32 size, u32 flag, void* output); /** * Reads data from input and writes to a block with the specified id and flag - * in the Config savegame buffer. - * The input size must match exactly the size of the target block + * in the Config savegame buffer. The input size must match exactly the size of the target block. + * * @param block_id The id of the block we want to write * @param size The size of the block we want to write * @param flag The target block must have this flag set @@ -242,8 +243,8 @@ ResultCode SetConfigInfoBlock(u32 block_id, u32 size, u32 flag, const void* inpu /** * Creates a block with the specified id and writes the input data to the cfg savegame buffer in - * memory. - * The config savegame file in the filesystem is not updated. + * memory. The config savegame file in the filesystem is not updated. + * * @param block_id The id of the block we want to create * @param size The size of the block we want to create * @param flags The flags of the new block diff --git a/src/core/hle/service/cfg/cfg_i.cpp b/src/core/hle/service/cfg/cfg_i.cpp index 2ff52c8b8..ed0217e53 100644 --- a/src/core/hle/service/cfg/cfg_i.cpp +++ b/src/core/hle/service/cfg/cfg_i.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/cfg/cfg.h" #include "core/hle/service/cfg/cfg_i.h" +#include "core/hle/service/cfg/cfg.h" namespace Service { namespace CFG { diff --git a/src/core/hle/service/cfg/cfg_s.cpp b/src/core/hle/service/cfg/cfg_s.cpp index eed26dec7..51e7b9752 100644 --- a/src/core/hle/service/cfg/cfg_s.cpp +++ b/src/core/hle/service/cfg/cfg_s.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/cfg/cfg.h" #include "core/hle/service/cfg/cfg_s.h" +#include "core/hle/service/cfg/cfg.h" namespace Service { namespace CFG { diff --git a/src/core/hle/service/cfg/cfg_u.cpp b/src/core/hle/service/cfg/cfg_u.cpp index f28217134..3f812291b 100644 --- a/src/core/hle/service/cfg/cfg_u.cpp +++ b/src/core/hle/service/cfg/cfg_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/cfg/cfg.h" #include "core/hle/service/cfg/cfg_u.h" +#include "core/hle/service/cfg/cfg.h" namespace Service { namespace CFG { diff --git a/src/core/hle/service/dlp/dlp.cpp b/src/core/hle/service/dlp/dlp.cpp index fd124e819..8f4b67a5d 100644 --- a/src/core/hle/service/dlp/dlp.cpp +++ b/src/core/hle/service/dlp/dlp.cpp @@ -17,8 +17,7 @@ void Init() { AddService(new DLP_SRVR_Interface); } -void Shutdown() { -} +void Shutdown() {} } // namespace DLP } // namespace Service diff --git a/src/core/hle/service/err_f.cpp b/src/core/hle/service/err_f.cpp index 2cd8269de..a23f5896d 100644 --- a/src/core/hle/service/err_f.cpp +++ b/src/core/hle/service/err_f.cpp @@ -173,7 +173,9 @@ static void ThrowFatalError(Service::Interface* self) { cmd_buff[1] = 0; // No error } -const Interface::FunctionInfo FunctionTable[] = {{0x00010800, ThrowFatalError, "ThrowFatalError"}}; +const Interface::FunctionInfo FunctionTable[] = { + {0x00010800, ThrowFatalError, "ThrowFatalError"}, +}; //////////////////////////////////////////////////////////////////////////////////////////////////// // Interface class diff --git a/src/core/hle/service/frd/frd.cpp b/src/core/hle/service/frd/frd.cpp index 1e9fe178f..050665b48 100644 --- a/src/core/hle/service/frd/frd.cpp +++ b/src/core/hle/service/frd/frd.cpp @@ -108,8 +108,7 @@ void Init() { AddService(new FRD_U_Interface); } -void Shutdown() { -} +void Shutdown() {} } // namespace FRD diff --git a/src/core/hle/service/frd/frd_u.cpp b/src/core/hle/service/frd/frd_u.cpp index bd1c9c16b..92b53f2ef 100644 --- a/src/core/hle/service/frd/frd_u.cpp +++ b/src/core/hle/service/frd/frd_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/frd/frd.h" #include "core/hle/service/frd/frd_u.h" +#include "core/hle/service/frd/frd.h" namespace Service { namespace FRD { diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index 1b851eade..77fe5ab6c 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -90,11 +90,9 @@ enum class DirectoryCommand : u32 { }; File::File(std::unique_ptr&& backend, const FileSys::Path& path) - : path(path), priority(0), backend(std::move(backend)) { -} + : path(path), priority(0), backend(std::move(backend)) {} -File::~File() { -} +File::~File() {} ResultVal File::SyncRequest() { u32* cmd_buff = Kernel::GetCommandBuffer(); @@ -205,11 +203,9 @@ ResultVal File::SyncRequest() { Directory::Directory(std::unique_ptr&& backend, const FileSys::Path& path) - : path(path), backend(std::move(backend)) { -} + : path(path), backend(std::move(backend)) {} -Directory::~Directory() { -} +Directory::~Directory() {} ResultVal Directory::SyncRequest() { u32* cmd_buff = Kernel::GetCommandBuffer(); diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index a0adad634..605832214 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp @@ -968,7 +968,8 @@ const Interface::FunctionInfo FunctionTable[] = { {0x086700C4, nullptr, "ControlSecureSave"}, {0x08680000, nullptr, "GetMediaType"}, {0x08690000, nullptr, "GetNandEraseCount"}, - {0x086A0082, nullptr, "ReadNandReport"}}; + {0x086A0082, nullptr, "ReadNandReport"}, +}; //////////////////////////////////////////////////////////////////////////////////////////////////// // Interface class diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp index b273aac47..2dff1e16c 100644 --- a/src/core/hle/service/gsp_gpu.cpp +++ b/src/core/hle/service/gsp_gpu.cpp @@ -29,10 +29,9 @@ const static u32 REGS_BEGIN = 0x1EB00000; namespace GSP_GPU { -const ResultCode - ERR_GSP_REGS_OUTOFRANGE_OR_MISALIGNED(ErrorDescription::OutofRangeOrMisalignedAddress, - ErrorModule::GX, ErrorSummary::InvalidArgument, - ErrorLevel::Usage); // 0xE0E02A01 +const ResultCode ERR_GSP_REGS_OUTOFRANGE_OR_MISALIGNED( + ErrorDescription::OutofRangeOrMisalignedAddress, ErrorModule::GX, ErrorSummary::InvalidArgument, + ErrorLevel::Usage); // 0xE0E02A01 const ResultCode ERR_GSP_REGS_MISALIGNED(ErrorDescription::MisalignedSize, ErrorModule::GX, ErrorSummary::InvalidArgument, ErrorLevel::Usage); // 0xE0E02BF2 diff --git a/src/core/hle/service/gsp_lcd.cpp b/src/core/hle/service/gsp_lcd.cpp index 3922cd197..b916dd759 100644 --- a/src/core/hle/service/gsp_lcd.cpp +++ b/src/core/hle/service/gsp_lcd.cpp @@ -9,11 +9,15 @@ namespace GSP_LCD { -const Interface::FunctionInfo FunctionTable[] = {{0x000F0000, nullptr, "PowerOnAllBacklights"}, - {0x00100000, nullptr, "PowerOffAllBacklights"}, - {0x00110040, nullptr, "PowerOnBacklight"}, - {0x00120040, nullptr, "PowerOffBacklight"}, - {0x00130040, nullptr, "SetLedForceOff"}}; +const Interface::FunctionInfo FunctionTable[] = { + // clang-format off + {0x000F0000, nullptr, "PowerOnAllBacklights"}, + {0x00100000, nullptr, "PowerOffAllBacklights"}, + {0x00110040, nullptr, "PowerOnBacklight"}, + {0x00120040, nullptr, "PowerOffBacklight"}, + {0x00130040, nullptr, "SetLedForceOff"}, + // clang-format on +}; //////////////////////////////////////////////////////////////////////////////////////////////////// // Interface class diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index d915a3105..5a2edd3c0 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -40,11 +40,10 @@ static int enable_accelerometer_count = 0; // positive means enabled static int enable_gyroscope_count = 0; // positive means enabled static PadState GetCirclePadDirectionState(s16 circle_pad_x, s16 circle_pad_y) { - constexpr float TAN30 = 0.577350269, - TAN60 = - 1 / TAN30; // 30 degree and 60 degree are angular thresholds for directions - constexpr int CIRCLE_PAD_THRESHOLD_SQUARE = - 40 * 40; // a circle pad radius greater than 40 will trigger circle pad direction + // 30 degree and 60 degree are angular thresholds for directions + constexpr float TAN30 = 0.577350269, TAN60 = 1 / TAN30; + // a circle pad radius greater than 40 will trigger circle pad direction + constexpr int CIRCLE_PAD_THRESHOLD_SQUARE = 40 * 40; PadState state; state.hex = 0; diff --git a/src/core/hle/service/hid/hid_spvr.cpp b/src/core/hle/service/hid/hid_spvr.cpp index 09007e304..00a0902c8 100644 --- a/src/core/hle/service/hid/hid_spvr.cpp +++ b/src/core/hle/service/hid/hid_spvr.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/hid/hid.h" #include "core/hle/service/hid/hid_spvr.h" +#include "core/hle/service/hid/hid.h" namespace Service { namespace HID { diff --git a/src/core/hle/service/hid/hid_user.cpp b/src/core/hle/service/hid/hid_user.cpp index 42591543c..433e175bb 100644 --- a/src/core/hle/service/hid/hid_user.cpp +++ b/src/core/hle/service/hid/hid_user.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/hid/hid.h" #include "core/hle/service/hid/hid_user.h" +#include "core/hle/service/hid/hid.h" namespace Service { namespace HID { diff --git a/src/core/hle/service/ir/ir_rst.cpp b/src/core/hle/service/ir/ir_rst.cpp index 1f10ebd3d..5e7a011ff 100644 --- a/src/core/hle/service/ir/ir_rst.cpp +++ b/src/core/hle/service/ir/ir_rst.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ir/ir.h" #include "core/hle/service/ir/ir_rst.h" +#include "core/hle/service/ir/ir.h" namespace Service { namespace IR { diff --git a/src/core/hle/service/ir/ir_u.cpp b/src/core/hle/service/ir/ir_u.cpp index be4049da9..429615f31 100644 --- a/src/core/hle/service/ir/ir_u.cpp +++ b/src/core/hle/service/ir/ir_u.cpp @@ -8,15 +8,26 @@ namespace Service { namespace IR { const Interface::FunctionInfo FunctionTable[] = { - {0x00010000, nullptr, "Initialize"}, {0x00020000, nullptr, "Shutdown"}, - {0x00030042, nullptr, "StartSendTransfer"}, {0x00040000, nullptr, "WaitSendTransfer"}, - {0x000500C2, nullptr, "StartRecvTransfer"}, {0x00060000, nullptr, "WaitRecvTransfer"}, - {0x00070080, nullptr, "GetRecvTransferCount"}, {0x00080000, nullptr, "GetSendState"}, - {0x00090040, nullptr, "SetBitRate"}, {0x000A0000, nullptr, "GetBitRate"}, - {0x000B0040, nullptr, "SetIRLEDState"}, {0x000C0000, nullptr, "GetIRLEDRecvState"}, - {0x000D0000, nullptr, "GetSendFinishedEvent"}, {0x000E0000, nullptr, "GetRecvFinishedEvent"}, - {0x000F0000, nullptr, "GetTransferState"}, {0x00100000, nullptr, "GetErrorStatus"}, - {0x00110040, nullptr, "SetSleepModeActive"}, {0x00120040, nullptr, "SetSleepModeState"}, + // clang-format off + {0x00010000, nullptr, "Initialize"}, + {0x00020000, nullptr, "Shutdown"}, + {0x00030042, nullptr, "StartSendTransfer"}, + {0x00040000, nullptr, "WaitSendTransfer"}, + {0x000500C2, nullptr, "StartRecvTransfer"}, + {0x00060000, nullptr, "WaitRecvTransfer"}, + {0x00070080, nullptr, "GetRecvTransferCount"}, + {0x00080000, nullptr, "GetSendState"}, + {0x00090040, nullptr, "SetBitRate"}, + {0x000A0000, nullptr, "GetBitRate"}, + {0x000B0040, nullptr, "SetIRLEDState"}, + {0x000C0000, nullptr, "GetIRLEDRecvState"}, + {0x000D0000, nullptr, "GetSendFinishedEvent"}, + {0x000E0000, nullptr, "GetRecvFinishedEvent"}, + {0x000F0000, nullptr, "GetTransferState"}, + {0x00100000, nullptr, "GetErrorStatus"}, + {0x00110040, nullptr, "SetSleepModeActive"}, + {0x00120040, nullptr, "SetSleepModeState"}, + // clang-format off }; IR_U_Interface::IR_U_Interface() { diff --git a/src/core/hle/service/ir/ir_user.cpp b/src/core/hle/service/ir/ir_user.cpp index 6cff1d544..cca71a0dd 100644 --- a/src/core/hle/service/ir/ir_user.cpp +++ b/src/core/hle/service/ir/ir_user.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ir/ir.h" #include "core/hle/service/ir/ir_user.h" +#include "core/hle/service/ir/ir.h" namespace Service { namespace IR { diff --git a/src/core/hle/service/ldr_ro/cro_helper.cpp b/src/core/hle/service/ldr_ro/cro_helper.cpp index 5757a4e64..b5da9a960 100644 --- a/src/core/hle/service/ldr_ro/cro_helper.cpp +++ b/src/core/hle/service/ldr_ro/cro_helper.cpp @@ -22,21 +22,23 @@ static ResultCode CROFormatError(u32 description) { ErrorSummary::WrongArgument, ErrorLevel::Permanent); } -const std::array CROHelper::ENTRY_SIZE{ - {1, // code - 1, // data - 1, // module name - sizeof(SegmentEntry), sizeof(ExportNamedSymbolEntry), sizeof(ExportIndexedSymbolEntry), - 1, // export strings - sizeof(ExportTreeEntry), sizeof(ImportModuleEntry), sizeof(ExternalRelocationEntry), - sizeof(ImportNamedSymbolEntry), sizeof(ImportIndexedSymbolEntry), - sizeof(ImportAnonymousSymbolEntry), - 1, // import strings - sizeof(StaticAnonymousSymbolEntry), sizeof(InternalRelocationEntry), - sizeof(StaticRelocationEntry)}}; - -const std::array CROHelper::FIX_BARRIERS{ - {Fix0Barrier, Fix1Barrier, Fix2Barrier, Fix3Barrier}}; +const std::array CROHelper::ENTRY_SIZE{{ + 1, // code + 1, // data + 1, // module name + sizeof(SegmentEntry), sizeof(ExportNamedSymbolEntry), sizeof(ExportIndexedSymbolEntry), + 1, // export strings + sizeof(ExportTreeEntry), sizeof(ImportModuleEntry), sizeof(ExternalRelocationEntry), + sizeof(ImportNamedSymbolEntry), sizeof(ImportIndexedSymbolEntry), + sizeof(ImportAnonymousSymbolEntry), + 1, // import strings + sizeof(StaticAnonymousSymbolEntry), sizeof(InternalRelocationEntry), + sizeof(StaticRelocationEntry), +}}; + +const std::array CROHelper::FIX_BARRIERS{{ + Fix0Barrier, Fix1Barrier, Fix2Barrier, Fix3Barrier, +}}; VAddr CROHelper::SegmentTagToAddress(SegmentTag segment_tag) const { u32 segment_num = GetField(SegmentNum); @@ -204,13 +206,14 @@ ResultCode CROHelper::RebaseHeader(u32 cro_size) { return error; // verifies that all offsets are in the correct order - constexpr std::array OFFSET_ORDER = { - {CodeOffset, ModuleNameOffset, SegmentTableOffset, ExportNamedSymbolTableOffset, - ExportTreeTableOffset, ExportIndexedSymbolTableOffset, ExportStringsOffset, - ImportModuleTableOffset, ExternalRelocationTableOffset, ImportNamedSymbolTableOffset, - ImportIndexedSymbolTableOffset, ImportAnonymousSymbolTableOffset, ImportStringsOffset, - StaticAnonymousSymbolTableOffset, InternalRelocationTableOffset, - StaticRelocationTableOffset, DataOffset, FileSize}}; + constexpr std::array OFFSET_ORDER = {{ + CodeOffset, ModuleNameOffset, SegmentTableOffset, ExportNamedSymbolTableOffset, + ExportTreeTableOffset, ExportIndexedSymbolTableOffset, ExportStringsOffset, + ImportModuleTableOffset, ExternalRelocationTableOffset, ImportNamedSymbolTableOffset, + ImportIndexedSymbolTableOffset, ImportAnonymousSymbolTableOffset, ImportStringsOffset, + StaticAnonymousSymbolTableOffset, InternalRelocationTableOffset, + StaticRelocationTableOffset, DataOffset, FileSize, + }}; u32 prev_offset = GetField(OFFSET_ORDER[0]); u32 cur_offset; diff --git a/src/core/hle/service/ldr_ro/cro_helper.h b/src/core/hle/service/ldr_ro/cro_helper.h index e4457d4be..e1b8221bd 100644 --- a/src/core/hle/service/ldr_ro/cro_helper.h +++ b/src/core/hle/service/ldr_ro/cro_helper.h @@ -40,8 +40,7 @@ static constexpr u32 CRO_HASH_SIZE = 0x80; /// Represents a loaded module (CRO) with interfaces manipulating it. class CROHelper final { public: - explicit CROHelper(VAddr cro_address) : module_address(cro_address) { - } + explicit CROHelper(VAddr cro_address) : module_address(cro_address) {} std::string ModuleName() const { return Memory::ReadCString(GetField(ModuleNameOffset), GetField(ModuleNameSize)); @@ -152,8 +151,7 @@ private: /** * Each item in this enum represents a u32 field in the header begin from address+0x80, - * successively. - * We don't directly use a struct here, to avoid GetPointer, reinterpret_cast, or + * successively. We don't directly use a struct here, to avoid GetPointer, reinterpret_cast, or * Read/WriteBlock repeatedly. */ enum HeaderField { @@ -234,8 +232,7 @@ private: BitField<4, 28, u32_le> offset_into_segment; SegmentTag() = default; - explicit SegmentTag(u32 raw_) : raw(raw_) { - } + explicit SegmentTag(u32 raw_) : raw(raw_) {} }; /// Information of a segment in this module. diff --git a/src/core/hle/service/ldr_ro/ldr_ro.cpp b/src/core/hle/service/ldr_ro/ldr_ro.cpp index ae5d3921f..a8fc2c015 100644 --- a/src/core/hle/service/ldr_ro/ldr_ro.cpp +++ b/src/core/hle/service/ldr_ro/ldr_ro.cpp @@ -750,11 +750,17 @@ static void Shutdown(Service::Interface* self) { } const Interface::FunctionInfo FunctionTable[] = { - {0x000100C2, Initialize, "Initialize"}, {0x00020082, LoadCRR, "LoadCRR"}, - {0x00030042, UnloadCRR, "UnloadCRR"}, {0x000402C2, LoadCRO, "LoadCRO"}, - {0x000500C2, UnloadCRO, "UnloadCRO"}, {0x00060042, LinkCRO, "LinkCRO"}, - {0x00070042, UnlinkCRO, "UnlinkCRO"}, {0x00080042, Shutdown, "Shutdown"}, + // clang-format off + {0x000100C2, Initialize, "Initialize"}, + {0x00020082, LoadCRR, "LoadCRR"}, + {0x00030042, UnloadCRR, "UnloadCRR"}, + {0x000402C2, LoadCRO, "LoadCRO"}, + {0x000500C2, UnloadCRO, "UnloadCRO"}, + {0x00060042, LinkCRO, "LinkCRO"}, + {0x00070042, UnlinkCRO, "UnlinkCRO"}, + {0x00080042, Shutdown, "Shutdown"}, {0x000902C2, LoadCRO, "LoadCRO_New"}, + // clang-format on }; //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/ndm/ndm.cpp b/src/core/hle/service/ndm/ndm.cpp index 9f1536aef..fcfa4b336 100644 --- a/src/core/hle/service/ndm/ndm.cpp +++ b/src/core/hle/service/ndm/ndm.cpp @@ -11,12 +11,16 @@ namespace Service { namespace NDM { -enum : u32 { DEFAULT_RETRY_INTERVAL = 10, DEFAULT_SCAN_INTERVAL = 30 }; +enum : u32 { + DEFAULT_RETRY_INTERVAL = 10, + DEFAULT_SCAN_INTERVAL = 30, +}; static DaemonMask daemon_bit_mask = DaemonMask::Default; static DaemonMask default_daemon_bit_mask = DaemonMask::Default; -static std::array daemon_status = {DaemonStatus::Idle, DaemonStatus::Idle, - DaemonStatus::Idle, DaemonStatus::Idle}; +static std::array daemon_status = { + DaemonStatus::Idle, DaemonStatus::Idle, DaemonStatus::Idle, DaemonStatus::Idle, +}; static ExclusiveState exclusive_state = ExclusiveState::None; static u32 scan_interval = DEFAULT_SCAN_INTERVAL; static u32 retry_interval = DEFAULT_RETRY_INTERVAL; @@ -227,8 +231,7 @@ void Init() { AddService(new NDM_U_Interface); } -void Shutdown() { -} +void Shutdown() {} } // namespace NDM } // namespace Service diff --git a/src/core/hle/service/ndm/ndm.h b/src/core/hle/service/ndm/ndm.h index fb574541d..979e7fcf1 100644 --- a/src/core/hle/service/ndm/ndm.h +++ b/src/core/hle/service/ndm/ndm.h @@ -12,7 +12,12 @@ class Interface; namespace NDM { -enum class Daemon : u32 { Cec = 0, Boss = 1, Nim = 2, Friend = 3 }; +enum class Daemon : u32 { + Cec = 0, + Boss = 1, + Nim = 2, + Friend = 3, +}; enum class DaemonMask : u32 { None = 0, @@ -21,7 +26,7 @@ enum class DaemonMask : u32 { Nim = (1 << static_cast(Daemon::Nim)), Friend = (1 << static_cast(Daemon::Friend)), Default = Cec | Friend, - All = Cec | Boss | Nim | Friend + All = Cec | Boss | Nim | Friend, }; enum class DaemonStatus : u32 { Busy = 0, Idle = 1, Suspending = 2, Suspended = 3 }; diff --git a/src/core/hle/service/ndm/ndm_u.cpp b/src/core/hle/service/ndm/ndm_u.cpp index f5c7a341a..4fc93850d 100644 --- a/src/core/hle/service/ndm/ndm_u.cpp +++ b/src/core/hle/service/ndm/ndm_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ndm/ndm.h" #include "core/hle/service/ndm/ndm_u.h" +#include "core/hle/service/ndm/ndm.h" namespace Service { namespace NDM { diff --git a/src/core/hle/service/news/news.cpp b/src/core/hle/service/news/news.cpp index 983e0777c..e09ea5681 100644 --- a/src/core/hle/service/news/news.cpp +++ b/src/core/hle/service/news/news.cpp @@ -19,8 +19,7 @@ void Init() { AddService(new NEWS_U_Interface); } -void Shutdown() { -} +void Shutdown() {} } // namespace NEWS diff --git a/src/core/hle/service/news/news_s.cpp b/src/core/hle/service/news/news_s.cpp index dda3d0f6a..0e4b650f3 100644 --- a/src/core/hle/service/news/news_s.cpp +++ b/src/core/hle/service/news/news_s.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/news/news.h" #include "core/hle/service/news/news_s.h" +#include "core/hle/service/news/news.h" namespace Service { namespace NEWS { diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp index f3c01d6e6..a7b76ed67 100644 --- a/src/core/hle/service/nim/nim.cpp +++ b/src/core/hle/service/nim/nim.cpp @@ -31,8 +31,7 @@ void Init() { AddService(new NIM_U_Interface); } -void Shutdown() { -} +void Shutdown() {} } // namespace NIM diff --git a/src/core/hle/service/nim/nim_u.cpp b/src/core/hle/service/nim/nim_u.cpp index 7e07d02e8..a4fd9781f 100644 --- a/src/core/hle/service/nim/nim_u.cpp +++ b/src/core/hle/service/nim/nim_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/nim/nim.h" #include "core/hle/service/nim/nim_u.h" +#include "core/hle/service/nim/nim.h" namespace Service { namespace NIM { diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index 80fa09f5f..29b9071c8 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp @@ -144,8 +144,7 @@ void Init() { } } -void Shutdown() { -} +void Shutdown() {} } // namespace PTM } // namespace Service diff --git a/src/core/hle/service/ptm/ptm_sysm.cpp b/src/core/hle/service/ptm/ptm_sysm.cpp index 693158dbf..590660f60 100644 --- a/src/core/hle/service/ptm/ptm_sysm.cpp +++ b/src/core/hle/service/ptm/ptm_sysm.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ptm/ptm.h" #include "core/hle/service/ptm/ptm_sysm.h" +#include "core/hle/service/ptm/ptm.h" namespace Service { namespace PTM { diff --git a/src/core/hle/service/ptm/ptm_u.cpp b/src/core/hle/service/ptm/ptm_u.cpp index 65e868393..155e10df1 100644 --- a/src/core/hle/service/ptm/ptm_u.cpp +++ b/src/core/hle/service/ptm/ptm_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ptm/ptm.h" #include "core/hle/service/ptm/ptm_u.h" +#include "core/hle/service/ptm/ptm.h" namespace Service { namespace PTM { diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp index 695b286c0..302ab55b7 100644 --- a/src/core/hle/service/soc_u.cpp +++ b/src/core/hle/service/soc_u.cpp @@ -63,82 +63,84 @@ static const s32 SOCKET_ERROR_VALUE = -1; namespace SOC_U { /// Holds the translation from system network errors to 3DS network errors -static const std::unordered_map error_map = {{{E2BIG, 1}, - {ERRNO(EACCES), 2}, - {ERRNO(EADDRINUSE), 3}, - {ERRNO(EADDRNOTAVAIL), 4}, - {ERRNO(EAFNOSUPPORT), 5}, - {ERRNO(EAGAIN), 6}, - {ERRNO(EALREADY), 7}, - {ERRNO(EBADF), 8}, - {EBADMSG, 9}, - {EBUSY, 10}, - {ECANCELED, 11}, - {ECHILD, 12}, - {ERRNO(ECONNABORTED), 13}, - {ERRNO(ECONNREFUSED), 14}, - {ERRNO(ECONNRESET), 15}, - {EDEADLK, 16}, - {ERRNO(EDESTADDRREQ), 17}, - {EDOM, 18}, - {ERRNO(EDQUOT), 19}, - {EEXIST, 20}, - {ERRNO(EFAULT), 21}, - {EFBIG, 22}, - {ERRNO(EHOSTUNREACH), 23}, - {EIDRM, 24}, - {EILSEQ, 25}, - {ERRNO(EINPROGRESS), 26}, - {ERRNO(EINTR), 27}, - {ERRNO(EINVAL), 28}, - {EIO, 29}, - {ERRNO(EISCONN), 30}, - {EISDIR, 31}, - {ERRNO(ELOOP), 32}, - {ERRNO(EMFILE), 33}, - {EMLINK, 34}, - {ERRNO(EMSGSIZE), 35}, - {ERRNO(EMULTIHOP), 36}, - {ERRNO(ENAMETOOLONG), 37}, - {ERRNO(ENETDOWN), 38}, - {ERRNO(ENETRESET), 39}, - {ERRNO(ENETUNREACH), 40}, - {ENFILE, 41}, - {ERRNO(ENOBUFS), 42}, - {ENODATA, 43}, - {ENODEV, 44}, - {ENOENT, 45}, - {ENOEXEC, 46}, - {ENOLCK, 47}, - {ENOLINK, 48}, - {ENOMEM, 49}, - {ENOMSG, 50}, - {ERRNO(ENOPROTOOPT), 51}, - {ENOSPC, 52}, - {ENOSR, 53}, - {ENOSTR, 54}, - {ENOSYS, 55}, - {ERRNO(ENOTCONN), 56}, - {ENOTDIR, 57}, - {ERRNO(ENOTEMPTY), 58}, - {ERRNO(ENOTSOCK), 59}, - {ENOTSUP, 60}, - {ENOTTY, 61}, - {ENXIO, 62}, - {ERRNO(EOPNOTSUPP), 63}, - {EOVERFLOW, 64}, - {EPERM, 65}, - {EPIPE, 66}, - {EPROTO, 67}, - {ERRNO(EPROTONOSUPPORT), 68}, - {ERRNO(EPROTOTYPE), 69}, - {ERANGE, 70}, - {EROFS, 71}, - {ESPIPE, 72}, - {ESRCH, 73}, - {ERRNO(ESTALE), 74}, - {ETIME, 75}, - {ERRNO(ETIMEDOUT), 76}}}; +static const std::unordered_map error_map = {{ + {E2BIG, 1}, + {ERRNO(EACCES), 2}, + {ERRNO(EADDRINUSE), 3}, + {ERRNO(EADDRNOTAVAIL), 4}, + {ERRNO(EAFNOSUPPORT), 5}, + {ERRNO(EAGAIN), 6}, + {ERRNO(EALREADY), 7}, + {ERRNO(EBADF), 8}, + {EBADMSG, 9}, + {EBUSY, 10}, + {ECANCELED, 11}, + {ECHILD, 12}, + {ERRNO(ECONNABORTED), 13}, + {ERRNO(ECONNREFUSED), 14}, + {ERRNO(ECONNRESET), 15}, + {EDEADLK, 16}, + {ERRNO(EDESTADDRREQ), 17}, + {EDOM, 18}, + {ERRNO(EDQUOT), 19}, + {EEXIST, 20}, + {ERRNO(EFAULT), 21}, + {EFBIG, 22}, + {ERRNO(EHOSTUNREACH), 23}, + {EIDRM, 24}, + {EILSEQ, 25}, + {ERRNO(EINPROGRESS), 26}, + {ERRNO(EINTR), 27}, + {ERRNO(EINVAL), 28}, + {EIO, 29}, + {ERRNO(EISCONN), 30}, + {EISDIR, 31}, + {ERRNO(ELOOP), 32}, + {ERRNO(EMFILE), 33}, + {EMLINK, 34}, + {ERRNO(EMSGSIZE), 35}, + {ERRNO(EMULTIHOP), 36}, + {ERRNO(ENAMETOOLONG), 37}, + {ERRNO(ENETDOWN), 38}, + {ERRNO(ENETRESET), 39}, + {ERRNO(ENETUNREACH), 40}, + {ENFILE, 41}, + {ERRNO(ENOBUFS), 42}, + {ENODATA, 43}, + {ENODEV, 44}, + {ENOENT, 45}, + {ENOEXEC, 46}, + {ENOLCK, 47}, + {ENOLINK, 48}, + {ENOMEM, 49}, + {ENOMSG, 50}, + {ERRNO(ENOPROTOOPT), 51}, + {ENOSPC, 52}, + {ENOSR, 53}, + {ENOSTR, 54}, + {ENOSYS, 55}, + {ERRNO(ENOTCONN), 56}, + {ENOTDIR, 57}, + {ERRNO(ENOTEMPTY), 58}, + {ERRNO(ENOTSOCK), 59}, + {ENOTSUP, 60}, + {ENOTTY, 61}, + {ENXIO, 62}, + {ERRNO(EOPNOTSUPP), 63}, + {EOVERFLOW, 64}, + {EPERM, 65}, + {EPIPE, 66}, + {EPROTO, 67}, + {ERRNO(EPROTONOSUPPORT), 68}, + {ERRNO(EPROTOTYPE), 69}, + {ERANGE, 70}, + {EROFS, 71}, + {ESPIPE, 72}, + {ESRCH, 73}, + {ERRNO(ESTALE), 74}, + {ETIME, 75}, + {ERRNO(ETIMEDOUT), 76}, +}}; /// Converts a network error from platform-specific to 3ds-specific static int TranslateError(int error) { diff --git a/src/core/hle/service/ssl_c.cpp b/src/core/hle/service/ssl_c.cpp index 47c4a8cb0..78ab922ca 100644 --- a/src/core/hle/service/ssl_c.cpp +++ b/src/core/hle/service/ssl_c.cpp @@ -79,7 +79,8 @@ const Interface::FunctionInfo FunctionTable[] = { {0x00190080, nullptr, "ContextSetClientCert"}, {0x001B0080, nullptr, "ContextClearOpt"}, {0x001E0040, nullptr, "DestroyContext"}, - {0x001F0082, nullptr, "ContextInitSharedmem"}}; + {0x001F0082, nullptr, "ContextInitSharedmem"}, +}; //////////////////////////////////////////////////////////////////////////////////////////////////// // Interface class diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp index 278548e0e..d3c6d073e 100644 --- a/src/core/hle/service/y2r_u.cpp +++ b/src/core/hle/service/y2r_u.cpp @@ -73,8 +73,8 @@ ResultCode ConversionConfiguration::SetInputLines(u16 lines) { return RESULT_SUCCESS; } -ResultCode -ConversionConfiguration::SetStandardCoefficient(StandardCoefficient standard_coefficient) { +ResultCode ConversionConfiguration::SetStandardCoefficient( + StandardCoefficient standard_coefficient) { size_t index = static_cast(standard_coefficient); if (index >= ARRAY_SIZE(standard_coefficients)) { return ResultCode(ErrorDescription::InvalidEnumValue, ErrorModule::CAM, diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp index db224c9aa..71f44cbc4 100644 --- a/src/core/hw/hw.cpp +++ b/src/core/hw/hw.cpp @@ -82,8 +82,7 @@ template void Write(u32 addr, const u16 data); template void Write(u32 addr, const u8 data); /// Update hardware -void Update() { -} +void Update() {} /// Initialize hardware void Init() { diff --git a/src/core/hw/y2r.cpp b/src/core/hw/y2r.cpp index 5a68d7e65..838b14163 100644 --- a/src/core/hw/y2r.cpp +++ b/src/core/hw/y2r.cpp @@ -61,7 +61,7 @@ static void ConvertYUVToRGB(InputFormat input_format, const u8* input_Y, const u s32 cY = c[0] * Y; s32 r = cY + c[1] * V; - s32 g = cY - c[3] * U - c[2] * V; + s32 g = cY - c[2] * V - c[3] * U; s32 b = cY + c[4] * U; const s32 rounding_offset = 0x18; @@ -144,16 +144,30 @@ static void SendData(const u32* input, ConversionBuffer& buf, int amount_of_data } } -static const u8 linear_lut[64] = { - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, +static const u8 linear_lut[TILE_SIZE] = { + // clang-format off + 0, 1, 2, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, + // clang-format on }; -static const u8 morton_lut[64] = { - 0, 1, 4, 5, 16, 17, 20, 21, 2, 3, 6, 7, 18, 19, 22, 23, 8, 9, 12, 13, 24, 25, - 28, 29, 10, 11, 14, 15, 26, 27, 30, 31, 32, 33, 36, 37, 48, 49, 52, 53, 34, 35, 38, 39, - 50, 51, 54, 55, 40, 41, 44, 45, 56, 57, 60, 61, 42, 43, 46, 47, 58, 59, 62, 63, +static const u8 morton_lut[TILE_SIZE] = { + // clang-format off + 0, 1, 4, 5, 16, 17, 20, 21, + 2, 3, 6, 7, 18, 19, 22, 23, + 8, 9, 12, 13, 24, 25, 28, 29, + 10, 11, 14, 15, 26, 27, 30, 31, + 32, 33, 36, 37, 48, 49, 52, 53, + 34, 35, 38, 39, 50, 51, 54, 55, + 40, 41, 44, 45, 56, 57, 60, 61, + 42, 43, 46, 47, 58, 59, 62, 63, + // clang-format on }; static void RotateTile0(const ImageTile& input, ImageTile& output, int height, diff --git a/src/core/loader/3dsx.h b/src/core/loader/3dsx.h index 09a788a1c..8d15ba555 100644 --- a/src/core/loader/3dsx.h +++ b/src/core/loader/3dsx.h @@ -19,8 +19,7 @@ class AppLoader_THREEDSX final : public AppLoader { public: AppLoader_THREEDSX(FileUtil::IOFile&& file, const std::string& filename, const std::string& filepath) - : AppLoader(std::move(file)), filename(std::move(filename)), filepath(filepath) { - } + : AppLoader(std::move(file)), filename(std::move(filename)), filepath(filepath) {} /** * Returns the type of the file diff --git a/src/core/loader/elf.h b/src/core/loader/elf.h index 0b1456c64..04a9b482d 100644 --- a/src/core/loader/elf.h +++ b/src/core/loader/elf.h @@ -18,8 +18,7 @@ namespace Loader { class AppLoader_ELF final : public AppLoader { public: AppLoader_ELF(FileUtil::IOFile&& file, std::string filename) - : AppLoader(std::move(file)), filename(std::move(filename)) { - } + : AppLoader(std::move(file)), filename(std::move(filename)) {} /** * Returns the type of the file diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index 5f48d2ffe..fdfee835c 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h @@ -81,10 +81,8 @@ constexpr u32 MakeMagic(char a, char b, char c, char d) { /// Interface for loading an application class AppLoader : NonCopyable { public: - AppLoader(FileUtil::IOFile&& file) : file(std::move(file)) { - } - virtual ~AppLoader() { - } + AppLoader(FileUtil::IOFile&& file) : file(std::move(file)) {} + virtual ~AppLoader() {} /** * Returns the type of this file diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h index 0cd70f70c..f53f8100e 100644 --- a/src/core/loader/ncch.h +++ b/src/core/loader/ncch.h @@ -164,8 +164,7 @@ namespace Loader { class AppLoader_NCCH final : public AppLoader { public: AppLoader_NCCH(FileUtil::IOFile&& file, const std::string& filepath) - : AppLoader(std::move(file)), filepath(filepath) { - } + : AppLoader(std::move(file)), filepath(filepath) {} /** * Returns the type of the file diff --git a/src/core/tracer/citrace.h b/src/core/tracer/citrace.h index ac26e872b..215f86359 100644 --- a/src/core/tracer/citrace.h +++ b/src/core/tracer/citrace.h @@ -76,7 +76,12 @@ struct CTMemoryLoad { struct CTRegisterWrite { u32 physical_address; - enum : u32 { SIZE_8 = 0xD1, SIZE_16 = 0xD2, SIZE_32 = 0xD3, SIZE_64 = 0xD4 } size; + enum : u32 { + SIZE_8 = 0xD1, + SIZE_16 = 0xD2, + SIZE_32 = 0xD3, + SIZE_64 = 0xD4, + } size; // TODO: Make it clearer which bits of this member are used for sizes other than 32 bits u64 value; diff --git a/src/core/tracer/recorder.cpp b/src/core/tracer/recorder.cpp index 8fd0018c4..11a289b2c 100644 --- a/src/core/tracer/recorder.cpp +++ b/src/core/tracer/recorder.cpp @@ -12,8 +12,7 @@ namespace CiTrace { -Recorder::Recorder(const InitialState& initial_state) : initial_state(initial_state) { -} +Recorder::Recorder(const InitialState& initial_state) : initial_state(initial_state) {} void Recorder::Finish(const std::string& filename) { // Setup CiTrace header diff --git a/src/video_core/clipper.cpp b/src/video_core/clipper.cpp index 747285866..82178d249 100644 --- a/src/video_core/clipper.cpp +++ b/src/video_core/clipper.cpp @@ -30,8 +30,7 @@ public: ClippingEdge(Math::Vec4 coeffs, Math::Vec4 bias = Math::Vec4( float24::FromFloat32(0), float24::FromFloat32(0), float24::FromFloat32(0), float24::FromFloat32(0))) - : coeffs(coeffs), bias(bias) { - } + : coeffs(coeffs), bias(bias) {} bool IsInside(const OutputVertex& vertex) const { return Math::Dot(vertex.pos + bias, coeffs) <= float24::FromFloat32(0); diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index 415b5f74c..04a4ee3a2 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp @@ -44,7 +44,8 @@ static u32 default_attr_write_buffer[3]; // Expand a 4-bit mask to 4-byte mask, e.g. 0b0101 -> 0x00FF00FF static const u32 expand_bits_to_bytes[] = { 0x00000000, 0x000000ff, 0x0000ff00, 0x0000ffff, 0x00ff0000, 0x00ff00ff, 0x00ffff00, 0x00ffffff, - 0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff, 0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff}; + 0xff000000, 0xff0000ff, 0xff00ff00, 0xff00ffff, 0xffff0000, 0xffff00ff, 0xffffff00, 0xffffffff, +}; MICROPROFILE_DEFINE(GPU_Drawing, "GPU", "Drawing", MP_RGB(50, 50, 240)); diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index 1cb868ead..194e5833c 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp @@ -155,7 +155,8 @@ void DumpShader(const std::string& filename, const Regs::ShaderConfig& config, {OutputAttributes::TEXCOORD2_V, {OutputRegisterInfo::TEXCOORD2, 2}}, {OutputAttributes::VIEW_X, {OutputRegisterInfo::VIEW, 1}}, {OutputAttributes::VIEW_Y, {OutputRegisterInfo::VIEW, 2}}, - {OutputAttributes::VIEW_Z, {OutputRegisterInfo::VIEW, 4}}}; + {OutputAttributes::VIEW_Z, {OutputRegisterInfo::VIEW, 4}}, + }; for (const auto& semantic : std::vector{ output_attributes[i].map_x, output_attributes[i].map_y, output_attributes[i].map_z, @@ -529,14 +530,16 @@ const Math::Vec4 LookupTexture(const u8* source, int x, int y, const Texture unsigned table_index = static_cast((x < 2) ? table_index_1.Value() : table_index_2.Value()); - static const std::array, 8> etc1_modifier_table = {{{{2, 8}}, - {{5, 17}}, - {{9, 29}}, - {{13, 42}}, - {{18, 60}}, - {{24, 80}}, - {{33, 106}}, - {{47, 183}}}}; + static const std::array, 8> etc1_modifier_table = {{ + {{2, 8}}, + {{5, 17}}, + {{9, 29}}, + {{13, 42}}, + {{18, 60}}, + {{24, 80}}, + {{33, 106}}, + {{47, 183}}, + }}; int modifier = etc1_modifier_table.at(table_index).at(GetTableSubIndex(texel)); if (GetNegationFlag(texel)) @@ -713,9 +716,9 @@ static std::string GetTevStageConfigSourceString(const Pica::Regs::TevStageConfi return src_it->second; } -static std::string -GetTevStageConfigColorSourceString(const Pica::Regs::TevStageConfig::Source& source, - const Pica::Regs::TevStageConfig::ColorModifier modifier) { +static std::string GetTevStageConfigColorSourceString( + const Pica::Regs::TevStageConfig::Source& source, + const Pica::Regs::TevStageConfig::ColorModifier modifier) { using ColorModifier = Pica::Regs::TevStageConfig::ColorModifier; static const std::map color_modifier_map = { {ColorModifier::SourceColor, "%source.rgb"}, @@ -739,9 +742,9 @@ GetTevStageConfigColorSourceString(const Pica::Regs::TevStageConfig::Source& sou return ReplacePattern(modifier_str, "%source", src_str); } -static std::string -GetTevStageConfigAlphaSourceString(const Pica::Regs::TevStageConfig::Source& source, - const Pica::Regs::TevStageConfig::AlphaModifier modifier) { +static std::string GetTevStageConfigAlphaSourceString( + const Pica::Regs::TevStageConfig::Source& source, + const Pica::Regs::TevStageConfig::AlphaModifier modifier) { using AlphaModifier = Pica::Regs::TevStageConfig::AlphaModifier; static const std::map alpha_modifier_map = { {AlphaModifier::SourceAlpha, "%source.a"}, @@ -763,8 +766,8 @@ GetTevStageConfigAlphaSourceString(const Pica::Regs::TevStageConfig::Source& sou return ReplacePattern(modifier_str, "%source", src_str); } -static std::string -GetTevStageConfigOperationString(const Pica::Regs::TevStageConfig::Operation& operation) { +static std::string GetTevStageConfigOperationString( + const Pica::Regs::TevStageConfig::Operation& operation) { using Operation = Pica::Regs::TevStageConfig::Operation; static const std::map combiner_map = { {Operation::Replace, "%source1"}, diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h index 1a58f40ff..fe3ed247d 100644 --- a/src/video_core/debug_utils/debug_utils.h +++ b/src/video_core/debug_utils/debug_utils.h @@ -87,15 +87,13 @@ public: * @param data Optional data pointer (if unused, this is a nullptr) * @note This function will perform nothing unless it is overridden in the child class. */ - virtual void OnPicaBreakPointHit(Event, void*) { - } + virtual void OnPicaBreakPointHit(Event, void*) {} /** * Action to perform when emulation is resumed from a breakpoint. * @note This function will perform nothing unless it is overridden in the child class. */ - virtual void OnPicaResume() { - } + virtual void OnPicaResume() {} protected: /** diff --git a/src/video_core/gpu_debugger.h b/src/video_core/gpu_debugger.h index e3ba80d8f..aea391619 100644 --- a/src/video_core/gpu_debugger.h +++ b/src/video_core/gpu_debugger.h @@ -15,8 +15,7 @@ public: // Base class for all objects which need to be notified about GPU events class DebuggerObserver { public: - DebuggerObserver() : observed(nullptr) { - } + DebuggerObserver() : observed(nullptr) {} virtual ~DebuggerObserver() { if (observed) diff --git a/src/video_core/pica.h b/src/video_core/pica.h index 1d1a686e0..b2db609ec 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -176,7 +176,10 @@ struct Regs { MirroredRepeat = 3, }; - enum TextureFilter : u32 { Nearest = 0, Linear = 1 }; + enum TextureFilter : u32 { + Nearest = 0, + Linear = 1, + }; union { u32 raw; @@ -300,9 +303,11 @@ struct Regs { const TextureFormat format; }; const std::array GetTextures() const { - return {{{texture0_enable.ToBool(), texture0, texture0_format}, - {texture1_enable.ToBool(), texture1, texture1_format}, - {texture2_enable.ToBool(), texture2, texture2_format}}}; + return {{ + {texture0_enable.ToBool(), texture0, texture0_format}, + {texture1_enable.ToBool(), texture1, texture1_format}, + {texture2_enable.ToBool(), texture2, texture2_format}, + }}; } // 0xc0-0xff: Texture Combiner (akin to glTexEnv) @@ -523,7 +528,7 @@ struct Regs { Decrement = 4, Invert = 5, IncrementWrap = 6, - DecrementWrap = 7 + DecrementWrap = 7, }; struct { @@ -1173,7 +1178,10 @@ struct Regs { INSERT_PADDING_WORDS(0x07); - enum class GPUMode : u32 { Drawing = 0, Configuring = 1 }; + enum class GPUMode : u32 { + Drawing = 0, + Configuring = 1, + }; GPUMode gpu_mode; @@ -1249,7 +1257,10 @@ struct Regs { INSERT_PADDING_WORDS(0x2); struct { - enum Format : u32 { FLOAT24 = 0, FLOAT32 = 1 }; + enum Format : u32 { + FLOAT24 = 0, + FLOAT32 = 1, + }; bool IsFloat32() const { return format == FLOAT32; diff --git a/src/video_core/primitive_assembly.cpp b/src/video_core/primitive_assembly.cpp index 343edb191..901cca26b 100644 --- a/src/video_core/primitive_assembly.cpp +++ b/src/video_core/primitive_assembly.cpp @@ -12,8 +12,7 @@ namespace Pica { template PrimitiveAssembler::PrimitiveAssembler(Regs::TriangleTopology topology) - : topology(topology), buffer_index(0) { -} + : topology(topology), buffer_index(0) {} template void PrimitiveAssembler::SubmitVertex(VertexType& vtx, diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index dbdc37ce6..f815d6cf0 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp @@ -268,10 +268,8 @@ static u8 PerformStencilAction(Regs::StencilAction action, u8 old_stencil, u8 re // NOTE: Assuming that rasterizer coordinates are 12.4 fixed-point values struct Fix12P4 { - Fix12P4() { - } - Fix12P4(u16 val) : val(val) { - } + Fix12P4() {} + Fix12P4(u16 val) : val(val) {} static u16 FracMask() { return 0xF; @@ -491,7 +489,8 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader 255), (u8)( GetInterpolatedAttribute(v0.color.a(), v1.color.a(), v2.color.a()).ToFloat32() * - 255)}; + 255), + }; Math::Vec2 uv[3]; uv[0].u() = GetInterpolatedAttribute(v0.tc0.u(), v1.tc0.u(), v2.tc0.u()); @@ -604,7 +603,8 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader Math::Vec4 combiner_buffer = {0, 0, 0, 0}; Math::Vec4 next_combiner_buffer = { regs.tev_combiner_buffer_color.r, regs.tev_combiner_buffer_color.g, - regs.tev_combiner_buffer_color.b, regs.tev_combiner_buffer_color.a}; + regs.tev_combiner_buffer_color.b, regs.tev_combiner_buffer_color.a, + }; for (unsigned tev_stage_index = 0; tev_stage_index < tev_stages.size(); ++tev_stage_index) { @@ -841,18 +841,16 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader Math::Vec3 color_result[3] = { GetColorModifier(tev_stage.color_modifier1, GetSource(tev_stage.color_source1)), GetColorModifier(tev_stage.color_modifier2, GetSource(tev_stage.color_source2)), - GetColorModifier(tev_stage.color_modifier3, - GetSource(tev_stage.color_source3))}; + GetColorModifier(tev_stage.color_modifier3, GetSource(tev_stage.color_source3)), + }; auto color_output = ColorCombine(tev_stage.color_op, color_result); // alpha combiner - std::array alpha_result = { - {GetAlphaModifier(tev_stage.alpha_modifier1, - GetSource(tev_stage.alpha_source1)), - GetAlphaModifier(tev_stage.alpha_modifier2, - GetSource(tev_stage.alpha_source2)), - GetAlphaModifier(tev_stage.alpha_modifier3, - GetSource(tev_stage.alpha_source3))}}; + std::array alpha_result = {{ + GetAlphaModifier(tev_stage.alpha_modifier1, GetSource(tev_stage.alpha_source1)), + GetAlphaModifier(tev_stage.alpha_modifier2, GetSource(tev_stage.alpha_source2)), + GetAlphaModifier(tev_stage.alpha_modifier3, GetSource(tev_stage.alpha_source3)), + }}; auto alpha_output = AlphaCombine(tev_stage.alpha_op, alpha_result); combiner_output[0] = @@ -1083,7 +1081,8 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader static_cast(output_merger.blend_const.r), static_cast(output_merger.blend_const.g), static_cast(output_merger.blend_const.b), - static_cast(output_merger.blend_const.a)}; + static_cast(output_merger.blend_const.a), + }; switch (factor) { case Regs::BlendFactor::Zero: @@ -1267,11 +1266,12 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, const Shader LogicOp(combiner_output.a(), dest.a(), output_merger.logic_op)); } - const Math::Vec4 result = {output_merger.red_enable ? blend_output.r() : dest.r(), - output_merger.green_enable ? blend_output.g() : dest.g(), - output_merger.blue_enable ? blend_output.b() : dest.b(), - output_merger.alpha_enable ? blend_output.a() - : dest.a()}; + const Math::Vec4 result = { + output_merger.red_enable ? blend_output.r() : dest.r(), + output_merger.green_enable ? blend_output.g() : dest.g(), + output_merger.blue_enable ? blend_output.b() : dest.b(), + output_merger.alpha_enable ? blend_output.a() : dest.a(), + }; if (regs.framebuffer.allow_color_write != 0) DrawPixel(x >> 4, y >> 4, result); diff --git a/src/video_core/rasterizer_interface.h b/src/video_core/rasterizer_interface.h index ce834bd30..c7bd29f12 100644 --- a/src/video_core/rasterizer_interface.h +++ b/src/video_core/rasterizer_interface.h @@ -20,8 +20,7 @@ namespace VideoCore { class RasterizerInterface { public: - virtual ~RasterizerInterface() { - } + virtual ~RasterizerInterface() {} /// Queues the primitive formed by the given vertices for rendering virtual void AddTriangle(const Pica::Shader::OutputVertex& v0, diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h index 22e2f9815..daacdb167 100644 --- a/src/video_core/renderer_base.h +++ b/src/video_core/renderer_base.h @@ -17,8 +17,7 @@ public: /// Used to reference a framebuffer enum kFramebuffer { kFramebuffer_VirtualXFB = 0, kFramebuffer_EFB, kFramebuffer_Texture }; - virtual ~RendererBase() { - } + virtual ~RendererBase() {} /// Swap buffers (render frame) virtual void SwapBuffers() = 0; diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 5021f48bc..37977464d 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -136,8 +136,7 @@ RasterizerOpenGL::RasterizerOpenGL() : shader_dirty(true) { SyncDepthWriteMask(); } -RasterizerOpenGL::~RasterizerOpenGL() { -} +RasterizerOpenGL::~RasterizerOpenGL() {} /** * This is a helper function to resolve an issue with opposite quaternions being interpolated by @@ -1156,9 +1155,10 @@ void RasterizerOpenGL::SyncBlendColor() { void RasterizerOpenGL::SyncFogColor() { const auto& regs = Pica::g_state.regs; - uniform_block_data.data.fog_color = {regs.fog_color.r.Value() / 255.0f, - regs.fog_color.g.Value() / 255.0f, - regs.fog_color.b.Value() / 255.0f}; + uniform_block_data.data.fog_color = { + regs.fog_color.r.Value() / 255.0f, regs.fog_color.g.Value() / 255.0f, + regs.fog_color.b.Value() / 255.0f, + }; uniform_block_data.dirty = true; } diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 70e9e64ef..60d70539c 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -41,12 +41,9 @@ struct ScreenInfo; * two separate shaders sharing the same key. * * We use a union because "implicitly-defined copy/move constructor for a union X copies the object - * representation of X." - * and "implicitly-defined copy assignment operator for a union X copies the object representation - * (3.9) of X." - * = Bytewise copy instead of memberwise copy. - * This is important because the padding bytes are included in the hash and comparison between - * objects. + * representation of X." and "implicitly-defined copy assignment operator for a union X copies the + * object representation (3.9) of X." = Bytewise copy instead of memberwise copy. This is important + * because the padding bytes are included in the hash and comparison between objects. */ union PicaShaderConfig { diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index 8f1477bcd..ec3300ca6 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -522,8 +522,8 @@ CachedSurface* RasterizerCacheOpenGL::GetSurfaceRect(const CachedSurface& params return GetSurface(params, match_res_scale, load_if_create); } -CachedSurface* -RasterizerCacheOpenGL::GetTextureSurface(const Pica::Regs::FullTextureConfig& config) { +CachedSurface* RasterizerCacheOpenGL::GetTextureSurface( + const Pica::Regs::FullTextureConfig& config) { Pica::DebugUtils::TextureInfo info = Pica::DebugUtils::TextureInfo::FromPicaRegister(config.config, config.format); diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index db5b649da..b2272bda8 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h @@ -212,8 +212,8 @@ public: /// Gets the color and depth surfaces and rect (resolution scaled) based on the framebuffer /// configuration - std::tuple> - GetFramebufferSurfaces(const Pica::Regs::FramebufferConfig& config); + std::tuple> GetFramebufferSurfaces( + const Pica::Regs::FramebufferConfig& config); /// Attempt to get a surface that exactly matches the fill region and format CachedSurface* TryGetFillSurface(const GPU::Regs::MemoryFillConfig& config); diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index f86cffee5..9392c67b8 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -293,9 +293,7 @@ static void AppendAlphaTestCondition(std::string& out, Regs::CompareFunc func) { case CompareFunc::LessThanOrEqual: case CompareFunc::GreaterThan: case CompareFunc::GreaterThanOrEqual: { - static const char* op[] = { - "!=", "==", ">=", ">", "<=", "<", - }; + static const char* op[] = {"!=", "==", ">=", ">", "<=", "<"}; unsigned index = (unsigned)func - (unsigned)CompareFunc::Equal; out += "int(last_tex_env_out.a * 255.0f) " + std::string(op[index]) + " alphatest_ref"; break; diff --git a/src/video_core/renderer_opengl/pica_to_gl.h b/src/video_core/renderer_opengl/pica_to_gl.h index a604e94d4..415358b6c 100644 --- a/src/video_core/renderer_opengl/pica_to_gl.h +++ b/src/video_core/renderer_opengl/pica_to_gl.h @@ -26,7 +26,7 @@ namespace PicaToGL { inline GLenum TextureFilterMode(Pica::Regs::TextureConfig::TextureFilter mode) { static const GLenum filter_mode_table[] = { GL_NEAREST, // TextureFilter::Nearest - GL_LINEAR // TextureFilter::Linear + GL_LINEAR, // TextureFilter::Linear }; // Range check table for input @@ -55,7 +55,7 @@ inline GLenum WrapMode(Pica::Regs::TextureConfig::WrapMode mode) { GL_CLAMP_TO_EDGE, // WrapMode::ClampToEdge GL_CLAMP_TO_BORDER, // WrapMode::ClampToBorder GL_REPEAT, // WrapMode::Repeat - GL_MIRRORED_REPEAT // WrapMode::MirroredRepeat + GL_MIRRORED_REPEAT, // WrapMode::MirroredRepeat }; // Range check table for input @@ -192,7 +192,7 @@ inline GLenum StencilOp(Pica::Regs::StencilAction action) { GL_DECR, // StencilAction::Decrement GL_INVERT, // StencilAction::Invert GL_INCR_WRAP, // StencilAction::IncrementWrap - GL_DECR_WRAP // StencilAction::DecrementWrap + GL_DECR_WRAP, // StencilAction::DecrementWrap }; // Range check table for input @@ -207,12 +207,16 @@ inline GLenum StencilOp(Pica::Regs::StencilAction action) { } inline GLvec4 ColorRGBA8(const u32 color) { - return {{(color >> 0 & 0xFF) / 255.0f, (color >> 8 & 0xFF) / 255.0f, - (color >> 16 & 0xFF) / 255.0f, (color >> 24 & 0xFF) / 255.0f}}; + return {{ + (color >> 0 & 0xFF) / 255.0f, (color >> 8 & 0xFF) / 255.0f, (color >> 16 & 0xFF) / 255.0f, + (color >> 24 & 0xFF) / 255.0f, + }}; } inline std::array LightColor(const Pica::Regs::LightColor& color) { - return {{color.r / 255.0f, color.g / 255.0f, color.b / 255.0f}}; + return {{ + color.r / 255.0f, color.g / 255.0f, color.b / 255.0f, + }}; } } // namespace diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 3cabda8f9..a1d08e04d 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -87,15 +87,13 @@ struct ScreenRectVertex { * by a 3x2 matrix. */ static std::array MakeOrthographicMatrix(const float width, const float height) { - std::array matrix; - - matrix[0] = 2.f / width; - matrix[2] = 0.f; - matrix[4] = -1.f; - matrix[1] = 0.f; - matrix[3] = -2.f / height; - matrix[5] = 1.f; + std::array matrix; // Laid out in column-major order + + // clang-format off + matrix[0] = 2.f / width; matrix[2] = 0.f; matrix[4] = -1.f; + matrix[1] = 0.f; matrix[3] = -2.f / height; matrix[5] = 1.f; // Last matrix row is implicitly assumed to be [0, 0, 1]. + // clang-format on return matrix; } @@ -107,8 +105,7 @@ RendererOpenGL::RendererOpenGL() { } /// RendererOpenGL destructor -RendererOpenGL::~RendererOpenGL() { -} +RendererOpenGL::~RendererOpenGL() {} /// Swap buffers (render frame) void RendererOpenGL::SwapBuffers() { @@ -215,8 +212,7 @@ void RendererOpenGL::LoadFBToScreenInfo(const GPU::Regs::FramebufferConfig& fram // Update existing texture // TODO: Test what happens on hardware when you change the framebuffer dimensions so that - // they - // differ from the LCD resolution. + // they differ from the LCD resolution. // TODO: Applications could theoretically crash Citra here by specifying too large // framebuffer sizes. We should make sure that this cannot happen. glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, framebuffer.width, framebuffer.height, @@ -231,10 +227,8 @@ void RendererOpenGL::LoadFBToScreenInfo(const GPU::Regs::FramebufferConfig& fram } /** - * Fills active OpenGL texture with the given RGB color. - * Since the color is solid, the texture can be 1x1 but will stretch across whatever it's rendered - * on. - * This has the added benefit of being *really fast*. + * Fills active OpenGL texture with the given RGB color. Since the color is solid, the texture can + * be 1x1 but will stretch across whatever it's rendered on. */ void RendererOpenGL::LoadColorToActiveGLTexture(u8 color_r, u8 color_g, u8 color_b, const TextureInfo& texture) { @@ -424,8 +418,7 @@ void RendererOpenGL::DrawScreens() { } /// Updates the framerate -void RendererOpenGL::UpdateFramerate() { -} +void RendererOpenGL::UpdateFramerate() {} /** * Set the emulator window to use for renderer @@ -513,5 +506,4 @@ bool RendererOpenGL::Init() { } /// Shutdown the renderer -void RendererOpenGL::ShutDown() { -} +void RendererOpenGL::ShutDown() {} diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index faeb519ec..762b790c1 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -81,11 +81,14 @@ private: OGLVertexArray vertex_array; OGLBuffer vertex_buffer; OGLShader shader; - std::array - screen_infos; ///< Display information for top and bottom screens respectively + + /// Display information for top and bottom screens respectively + std::array screen_infos; + // Shader uniform location indices GLuint uniform_modelview_matrix; GLuint uniform_color_texture; + // Shader attribute input indices GLuint attrib_position; GLuint attrib_tex_coord; diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp index 852c5a9a0..c38bdcc3c 100644 --- a/src/video_core/shader/shader.cpp +++ b/src/video_core/shader/shader.cpp @@ -96,8 +96,8 @@ void ShaderSetup::Setup() { #ifdef ARCHITECTURE_x86_64 if (VideoCore::g_shader_jit_enabled) { u64 cache_key = - (Common::ComputeHash64(&g_state.vs.program_code, sizeof(g_state.vs.program_code)) ^ - Common::ComputeHash64(&g_state.vs.swizzle_data, sizeof(g_state.vs.swizzle_data))); + Common::ComputeHash64(&g_state.vs.program_code, sizeof(g_state.vs.program_code)) ^ + Common::ComputeHash64(&g_state.vs.swizzle_data, sizeof(g_state.vs.swizzle_data)); auto iter = shader_map.find(cache_key); if (iter != shader_map.end()) { diff --git a/src/video_core/shader/shader.h b/src/video_core/shader/shader.h index 830d933a8..79c716b6e 100644 --- a/src/video_core/shader/shader.h +++ b/src/video_core/shader/shader.h @@ -358,8 +358,7 @@ struct ShaderSetup { /** * Performs any shader unit setup that only needs to happen once per shader (as opposed to once - * per - * vertex, which would happen within the `Run` function). + * per vertex, which would happen within the `Run` function). */ void Setup(); diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp index 681ff9728..41df8a2fd 100644 --- a/src/video_core/shader/shader_interpreter.cpp +++ b/src/video_core/shader/shader_interpreter.cpp @@ -80,9 +80,8 @@ void RunInterpreter(const ShaderSetup& setup, UnitState& state, unsigned auto call = [&program_counter, &call_stack](UnitState& state, u32 offset, u32 num_instructions, u32 return_offset, u8 repeat_count, u8 loop_increment) { - program_counter = - offset - - 1; // -1 to make sure when incrementing the PC we end up at the correct offset + // -1 to make sure when incrementing the PC we end up at the correct offset + program_counter = offset - 1; ASSERT(call_stack.size() < call_stack.capacity()); call_stack.push_back( {offset + num_instructions, return_offset, repeat_count, loop_increment, offset}); diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp index 04e04ba1a..d1b2ce8d5 100644 --- a/src/video_core/shader/shader_jit_x64.cpp +++ b/src/video_core/shader/shader_jit_x64.cpp @@ -590,8 +590,7 @@ void JitShader::Compile_RSQ(Instruction instr) { Compile_DestEnable(instr, SRC1); } -void JitShader::Compile_NOP(Instruction instr) { -} +void JitShader::Compile_NOP(Instruction instr) {} void JitShader::Compile_END(Instruction instr) { ABI_PopRegistersAndAdjustStack(ABI_ALL_CALLEE_SAVED, 8); diff --git a/src/video_core/swrasterizer.h b/src/video_core/swrasterizer.h index bca9780e5..12dc56bef 100644 --- a/src/video_core/swrasterizer.h +++ b/src/video_core/swrasterizer.h @@ -19,15 +19,10 @@ namespace VideoCore { class SWRasterizer : public RasterizerInterface { void AddTriangle(const Pica::Shader::OutputVertex& v0, const Pica::Shader::OutputVertex& v1, const Pica::Shader::OutputVertex& v2) override; - void DrawTriangles() override { - } - void NotifyPicaRegisterChanged(u32 id) override { - } - void FlushAll() override { - } - void FlushRegion(PAddr addr, u32 size) override { - } - void FlushAndInvalidateRegion(PAddr addr, u32 size) override { - } + void DrawTriangles() override {} + void NotifyPicaRegisterChanged(u32 id) override {} + void FlushAll() override {} + void FlushRegion(PAddr addr, u32 size) override {} + void FlushAndInvalidateRegion(PAddr addr, u32 size) override {} }; } -- cgit v1.2.3 From ebdae19fd226104baec712b9da9939ff82ef3c3a Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Wed, 21 Sep 2016 00:21:23 +0900 Subject: Remove empty newlines in #include blocks. This makes clang-format useful on those. Also add a bunch of forgotten transitive includes, which otherwise prevented compilation. --- src/.clang-format | 2 ++ src/audio_core/audio_core.cpp | 4 +-- src/audio_core/codec.cpp | 4 +-- src/audio_core/codec.h | 1 - src/audio_core/hle/common.h | 1 - src/audio_core/hle/dsp.cpp | 3 +- src/audio_core/hle/dsp.h | 2 -- src/audio_core/hle/filter.cpp | 4 +-- src/audio_core/hle/filter.h | 2 -- src/audio_core/hle/mixers.cpp | 1 - src/audio_core/hle/mixers.h | 1 - src/audio_core/hle/pipe.cpp | 5 +--- src/audio_core/hle/pipe.h | 1 - src/audio_core/hle/source.cpp | 5 +--- src/audio_core/hle/source.h | 2 -- src/audio_core/interpolate.cpp | 1 - src/audio_core/interpolate.h | 1 - src/audio_core/null_sink.h | 1 - src/audio_core/sdl2_sink.cpp | 7 ++--- src/audio_core/sdl2_sink.h | 1 - src/audio_core/sink.h | 1 - src/audio_core/sink_details.cpp | 4 +-- src/audio_core/time_stretch.cpp | 5 +--- src/audio_core/time_stretch.h | 1 - src/citra/citra.cpp | 7 ++--- src/citra/config.cpp | 10 ++----- src/citra/config.h | 1 - src/citra/emu_window/emu_window_sdl2.cpp | 8 +----- src/citra/emu_window/emu_window_sdl2.h | 1 - src/citra_qt/bootmanager.cpp | 3 -- src/citra_qt/bootmanager.h | 2 -- src/citra_qt/config.cpp | 4 +-- src/citra_qt/config.h | 3 +- src/citra_qt/configure_audio.cpp | 6 ++-- src/citra_qt/configure_audio.h | 2 +- src/citra_qt/configure_debug.cpp | 3 +- src/citra_qt/configure_debug.h | 2 +- src/citra_qt/configure_dialog.cpp | 3 +- src/citra_qt/configure_dialog.h | 2 +- src/citra_qt/configure_general.cpp | 3 +- src/citra_qt/configure_general.h | 2 +- src/citra_qt/configure_graphics.cpp | 3 +- src/citra_qt/configure_graphics.h | 2 +- src/citra_qt/configure_input.cpp | 5 ++-- src/citra_qt/configure_input.h | 2 +- src/citra_qt/configure_system.cpp | 3 +- src/citra_qt/configure_system.h | 2 +- src/citra_qt/debugger/callstack.cpp | 5 +--- src/citra_qt/debugger/disassembler.cpp | 5 +--- src/citra_qt/debugger/disassembler.h | 4 +-- src/citra_qt/debugger/graphics.cpp | 3 +- src/citra_qt/debugger/graphics.h | 1 - .../debugger/graphics_breakpoint_observer.cpp | 3 +- .../debugger/graphics_breakpoint_observer.h | 1 - src/citra_qt/debugger/graphics_breakpoints.cpp | 4 +-- src/citra_qt/debugger/graphics_breakpoints.h | 2 -- src/citra_qt/debugger/graphics_breakpoints_p.h | 2 -- src/citra_qt/debugger/graphics_cmdlists.cpp | 5 +--- src/citra_qt/debugger/graphics_cmdlists.h | 1 - src/citra_qt/debugger/graphics_surface.cpp | 6 +--- src/citra_qt/debugger/graphics_surface.h | 3 +- src/citra_qt/debugger/graphics_tracing.cpp | 11 ++------ src/citra_qt/debugger/graphics_vertex_shader.cpp | 5 +--- src/citra_qt/debugger/graphics_vertex_shader.h | 4 +-- src/citra_qt/debugger/profiler.cpp | 4 +-- src/citra_qt/debugger/profiler.h | 4 +-- src/citra_qt/debugger/registers.cpp | 4 +-- src/citra_qt/debugger/registers.h | 3 +- src/citra_qt/game_list.cpp | 11 +++----- src/citra_qt/game_list_p.h | 4 --- src/citra_qt/hotkeys.cpp | 4 +-- src/citra_qt/main.cpp | 18 ++++-------- src/citra_qt/main.h | 3 +- src/citra_qt/ui_settings.h | 3 +- src/citra_qt/util/spinbox.cpp | 5 ++-- src/citra_qt/util/util.cpp | 3 +- src/common/assert.h | 3 +- src/common/bit_field.h | 1 - src/common/break_points.cpp | 3 +- src/common/break_points.h | 1 - src/common/chunk_file.h | 1 - src/common/code_block.h | 1 - src/common/common_funcs.h | 1 - src/common/emu_window.cpp | 4 +-- src/common/emu_window.h | 2 -- src/common/file_util.cpp | 1 - src/common/file_util.h | 2 -- src/common/hash.cpp | 1 - src/common/key_map.cpp | 3 +- src/common/logging/backend.cpp | 3 +- src/common/logging/backend.h | 1 - src/common/logging/filter.cpp | 3 +- src/common/logging/filter.h | 1 - src/common/logging/text_formatter.cpp | 5 ++-- src/common/misc.cpp | 1 - src/common/profiler.cpp | 1 - src/common/profiler_reporting.h | 1 - src/common/string_util.cpp | 4 +-- src/common/string_util.h | 1 - src/common/swap.h | 2 -- src/common/symbols.h | 1 - src/common/thread.cpp | 2 -- src/common/thread.h | 1 - src/common/thread_queue_list.h | 1 - src/common/timer.cpp | 2 -- src/common/x64/cpu_detect.cpp | 4 +-- src/common/x64/emitter.cpp | 8 ++---- src/common/x64/emitter.h | 1 - src/core/arm/disassembler/arm_disasm.cpp | 4 +-- src/core/arm/disassembler/arm_disasm.h | 1 - src/core/arm/disassembler/load_symbol_map.cpp | 4 +-- src/core/arm/dynarmic/arm_dynarmic.cpp | 6 ++-- src/core/arm/dynarmic/arm_dynarmic.h | 3 -- src/core/arm/dyncom/arm_dyncom.cpp | 11 +++----- src/core/arm/dyncom/arm_dyncom.h | 2 -- src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 7 ++--- src/core/arm/dyncom/arm_dyncom_trans.cpp | 4 +-- src/core/arm/dyncom/arm_dyncom_trans.h | 3 ++ src/core/arm/skyeye_common/armstate.h | 1 - src/core/arm/skyeye_common/armsupp.cpp | 3 +- src/core/arm/skyeye_common/vfp/vfp.cpp | 3 +- src/core/arm/skyeye_common/vfp/vfpdouble.cpp | 2 +- src/core/arm/skyeye_common/vfp/vfpsingle.cpp | 4 +-- src/core/core.cpp | 4 +-- src/core/core_timing.cpp | 4 +-- src/core/core_timing.h | 6 ++-- src/core/file_sys/archive_backend.cpp | 4 +-- src/core/file_sys/archive_backend.h | 2 -- src/core/file_sys/archive_extsavedata.cpp | 4 +-- src/core/file_sys/archive_extsavedata.h | 2 -- src/core/file_sys/archive_romfs.cpp | 4 +-- src/core/file_sys/archive_romfs.h | 2 -- src/core/file_sys/archive_savedata.cpp | 4 +-- src/core/file_sys/archive_savedata.h | 1 - src/core/file_sys/archive_savedatacheck.cpp | 4 +-- src/core/file_sys/archive_savedatacheck.h | 1 - src/core/file_sys/archive_sdmc.cpp | 4 +-- src/core/file_sys/archive_sdmc.h | 1 - src/core/file_sys/archive_systemsavedata.cpp | 4 +-- src/core/file_sys/archive_systemsavedata.h | 2 -- src/core/file_sys/directory_backend.h | 1 - src/core/file_sys/disk_archive.cpp | 4 +-- src/core/file_sys/disk_archive.h | 2 -- src/core/file_sys/file_backend.h | 1 - src/core/file_sys/ivfc_archive.cpp | 4 +-- src/core/file_sys/ivfc_archive.h | 2 -- src/core/gdbstub/gdbstub.h | 1 - src/core/hle/applets/applet.cpp | 4 +-- src/core/hle/applets/applet.h | 1 - src/core/hle/applets/erreula.cpp | 3 +- src/core/hle/applets/mii_selector.cpp | 5 +--- src/core/hle/applets/mii_selector.h | 1 - src/core/hle/applets/swkbd.cpp | 5 +--- src/core/hle/applets/swkbd.h | 1 - src/core/hle/config_mem.h | 1 - src/core/hle/function_wrappers.h | 2 +- src/core/hle/hle.cpp | 3 +- src/core/hle/kernel/address_arbiter.cpp | 6 ++-- src/core/hle/kernel/address_arbiter.h | 1 - src/core/hle/kernel/client_port.cpp | 3 +- src/core/hle/kernel/client_port.h | 2 -- src/core/hle/kernel/event.cpp | 4 +-- src/core/hle/kernel/event.h | 1 - src/core/hle/kernel/kernel.cpp | 4 +-- src/core/hle/kernel/kernel.h | 5 +--- src/core/hle/kernel/memory.cpp | 5 +--- src/core/hle/kernel/memory.h | 2 -- src/core/hle/kernel/mutex.cpp | 5 +--- src/core/hle/kernel/mutex.h | 2 -- src/core/hle/kernel/process.cpp | 4 +-- src/core/hle/kernel/process.h | 3 -- src/core/hle/kernel/resource_limit.cpp | 4 +-- src/core/hle/kernel/resource_limit.h | 1 - src/core/hle/kernel/semaphore.cpp | 3 +- src/core/hle/kernel/semaphore.h | 2 -- src/core/hle/kernel/server_port.cpp | 4 +-- src/core/hle/kernel/server_port.h | 2 -- src/core/hle/kernel/session.h | 2 -- src/core/hle/kernel/shared_memory.cpp | 4 +-- src/core/hle/kernel/shared_memory.h | 2 -- src/core/hle/kernel/thread.cpp | 4 +-- src/core/hle/kernel/thread.h | 4 --- src/core/hle/kernel/timer.cpp | 4 +-- src/core/hle/kernel/timer.h | 1 - src/core/hle/kernel/vm_manager.cpp | 4 +-- src/core/hle/kernel/vm_manager.h | 2 -- src/core/hle/result.h | 1 - src/core/hle/service/ac_u.cpp | 3 +- src/core/hle/service/am/am.cpp | 4 +-- src/core/hle/service/apt/apt.cpp | 12 ++++---- src/core/hle/service/apt/apt.h | 1 - src/core/hle/service/apt/bcfnt/bcfnt.h | 1 - src/core/hle/service/cam/cam.cpp | 3 +- src/core/hle/service/cam/cam.h | 1 - src/core/hle/service/cecd/cecd.cpp | 3 +- src/core/hle/service/cfg/cfg.cpp | 4 +-- src/core/hle/service/cfg/cfg.h | 1 - src/core/hle/service/dsp_dsp.cpp | 5 +--- src/core/hle/service/dsp_dsp.h | 1 - src/core/hle/service/err_f.cpp | 3 +- src/core/hle/service/frd/frd.cpp | 3 +- src/core/hle/service/fs/archive.cpp | 5 +--- src/core/hle/service/fs/archive.h | 2 -- src/core/hle/service/fs/fs_user.cpp | 3 +- src/core/hle/service/gsp_gpu.cpp | 5 +--- src/core/hle/service/gsp_gpu.h | 2 -- src/core/hle/service/hid/hid.cpp | 12 +++----- src/core/hle/service/hid/hid.h | 1 - src/core/hle/service/ir/ir.cpp | 3 +- src/core/hle/service/ldr_ro/cro_helper.cpp | 3 +- src/core/hle/service/ldr_ro/cro_helper.h | 2 -- src/core/hle/service/ldr_ro/ldr_ro.cpp | 3 +- .../hle/service/ldr_ro/memory_synchronizer.cpp | 4 +-- src/core/hle/service/ldr_ro/memory_synchronizer.h | 1 - src/core/hle/service/news/news.cpp | 3 +- src/core/hle/service/nim/nim.cpp | 3 +- src/core/hle/service/nim/nim_u.h | 2 +- src/core/hle/service/nwm_uds.cpp | 3 +- src/core/hle/service/service.cpp | 32 ++++++++++------------ src/core/hle/service/service.h | 3 -- src/core/hle/service/soc_u.cpp | 4 +-- src/core/hle/service/soc_u.h | 1 - src/core/hle/service/srv.cpp | 3 +- src/core/hle/service/ssl_c.cpp | 3 +- src/core/hle/service/y2r_u.cpp | 4 +-- src/core/hle/service/y2r_u.h | 2 -- src/core/hle/shared_page.cpp | 3 +- src/core/hle/shared_page.h | 1 - src/core/hle/svc.cpp | 6 +--- src/core/hw/gpu.cpp | 15 +++------- src/core/hw/gpu.h | 1 - src/core/hw/hw.cpp | 3 +- src/core/hw/lcd.cpp | 5 +--- src/core/hw/lcd.h | 1 - src/core/hw/y2r.cpp | 4 +-- src/core/loader/3dsx.cpp | 4 +-- src/core/loader/3dsx.h | 1 - src/core/loader/elf.cpp | 4 +-- src/core/loader/elf.h | 1 - src/core/loader/loader.cpp | 2 -- src/core/loader/loader.h | 1 - src/core/loader/ncch.cpp | 4 +-- src/core/loader/ncch.h | 2 -- src/core/loader/smdh.cpp | 5 +--- src/core/loader/smdh.h | 1 - src/core/memory.cpp | 5 +--- src/core/memory.h | 1 - src/core/memory_setup.h | 1 - src/core/mmio.h | 1 - src/core/settings.cpp | 3 -- src/core/settings.h | 1 - src/core/system.cpp | 4 +-- src/core/tracer/recorder.cpp | 4 +-- src/core/tracer/recorder.h | 5 +--- src/video_core/clipper.cpp | 5 +--- src/video_core/command_processor.cpp | 5 +--- src/video_core/command_processor.h | 1 - src/video_core/debug_utils/debug_utils.cpp | 2 -- src/video_core/debug_utils/debug_utils.h | 2 -- src/video_core/gpu_debugger.h | 1 - src/video_core/pica.cpp | 3 +- src/video_core/pica_state.h | 2 -- src/video_core/pica_types.h | 1 - src/video_core/primitive_assembly.cpp | 3 +- src/video_core/primitive_assembly.h | 1 - src/video_core/rasterizer.cpp | 5 +--- src/video_core/rasterizer_interface.h | 1 - src/video_core/renderer_base.cpp | 3 +- src/video_core/renderer_base.h | 2 -- src/video_core/renderer_opengl/gl_rasterizer.cpp | 6 +--- src/video_core/renderer_opengl/gl_rasterizer.h | 4 --- .../renderer_opengl/gl_rasterizer_cache.cpp | 6 +--- .../renderer_opengl/gl_rasterizer_cache.h | 4 --- .../renderer_opengl/gl_resource_manager.h | 3 -- src/video_core/renderer_opengl/gl_shader_gen.cpp | 4 +-- src/video_core/renderer_opengl/gl_shader_util.cpp | 4 +-- src/video_core/renderer_opengl/gl_state.cpp | 4 +-- src/video_core/renderer_opengl/pica_to_gl.h | 3 -- src/video_core/renderer_opengl/renderer_opengl.cpp | 6 +--- src/video_core/renderer_opengl/renderer_opengl.h | 4 --- src/video_core/shader/shader.cpp | 7 +---- src/video_core/shader/shader.h | 4 --- src/video_core/shader/shader_interpreter.cpp | 5 +--- src/video_core/shader/shader_jit_x64.cpp | 6 +--- src/video_core/shader/shader_jit_x64.h | 3 -- src/video_core/swrasterizer.h | 1 - src/video_core/vertex_loader.cpp | 6 +--- src/video_core/vertex_loader.h | 1 - src/video_core/video_core.cpp | 4 +-- 289 files changed, 214 insertions(+), 731 deletions(-) (limited to 'src/core/hle/service') diff --git a/src/.clang-format b/src/.clang-format index f9a5d1378..fc1bbb297 100644 --- a/src/.clang-format +++ b/src/.clang-format @@ -50,6 +50,8 @@ IncludeCategories: Priority: 1 - Regex: '^\<(boost|catch|dynarmic|glad|inih|nihstro)/' Priority: 3 + - Regex: '^\<(SDL|SoundTouch|Q)' + Priority: 3 - Regex: '^\<' Priority: 2 IndentCaseLabels: false diff --git a/src/audio_core/audio_core.cpp b/src/audio_core/audio_core.cpp index 0b36dbb03..c54a4b99a 100644 --- a/src/audio_core/audio_core.cpp +++ b/src/audio_core/audio_core.cpp @@ -2,16 +2,14 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "audio_core/audio_core.h" #include #include - -#include "audio_core/audio_core.h" #include "audio_core/hle/dsp.h" #include "audio_core/hle/pipe.h" #include "audio_core/null_sink.h" #include "audio_core/sink.h" #include "audio_core/sink_details.h" - #include "core/core_timing.h" #include "core/hle/kernel/vm_manager.h" #include "core/hle/service/dsp_dsp.h" diff --git a/src/audio_core/codec.cpp b/src/audio_core/codec.cpp index 4edfe9be0..fd189a176 100644 --- a/src/audio_core/codec.cpp +++ b/src/audio_core/codec.cpp @@ -2,13 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "audio_core/codec.h" #include #include #include #include - -#include "audio_core/codec.h" - #include "common/assert.h" #include "common/common_types.h" #include "common/math_util.h" diff --git a/src/audio_core/codec.h b/src/audio_core/codec.h index 77bbf98b5..2b0c395e6 100644 --- a/src/audio_core/codec.h +++ b/src/audio_core/codec.h @@ -6,7 +6,6 @@ #include #include - #include "common/common_types.h" namespace Codec { diff --git a/src/audio_core/hle/common.h b/src/audio_core/hle/common.h index 8e7e5c3cd..7fbc3ad9a 100644 --- a/src/audio_core/hle/common.h +++ b/src/audio_core/hle/common.h @@ -6,7 +6,6 @@ #include #include - #include "common/common_types.h" namespace DSP { diff --git a/src/audio_core/hle/dsp.cpp b/src/audio_core/hle/dsp.cpp index aaa3a280f..aa64dae97 100644 --- a/src/audio_core/hle/dsp.cpp +++ b/src/audio_core/hle/dsp.cpp @@ -2,10 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "audio_core/hle/dsp.h" #include #include - -#include "audio_core/hle/dsp.h" #include "audio_core/hle/mixers.h" #include "audio_core/hle/pipe.h" #include "audio_core/hle/source.h" diff --git a/src/audio_core/hle/dsp.h b/src/audio_core/hle/dsp.h index f4c4b01e2..0a0f60ac1 100644 --- a/src/audio_core/hle/dsp.h +++ b/src/audio_core/hle/dsp.h @@ -8,9 +8,7 @@ #include #include #include - #include "audio_core/hle/common.h" - #include "common/bit_field.h" #include "common/common_funcs.h" #include "common/common_types.h" diff --git a/src/audio_core/hle/filter.cpp b/src/audio_core/hle/filter.cpp index da2a4684e..edf95f686 100644 --- a/src/audio_core/hle/filter.cpp +++ b/src/audio_core/hle/filter.cpp @@ -2,13 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "audio_core/hle/filter.h" #include #include - #include "audio_core/hle/common.h" #include "audio_core/hle/dsp.h" -#include "audio_core/hle/filter.h" - #include "common/common_types.h" #include "common/math_util.h" diff --git a/src/audio_core/hle/filter.h b/src/audio_core/hle/filter.h index 73d5ce670..4281a5898 100644 --- a/src/audio_core/hle/filter.h +++ b/src/audio_core/hle/filter.h @@ -5,10 +5,8 @@ #pragma once #include - #include "audio_core/hle/common.h" #include "audio_core/hle/dsp.h" - #include "common/common_types.h" namespace DSP { diff --git a/src/audio_core/hle/mixers.cpp b/src/audio_core/hle/mixers.cpp index 126f328bc..6cc81dfca 100644 --- a/src/audio_core/hle/mixers.cpp +++ b/src/audio_core/hle/mixers.cpp @@ -7,7 +7,6 @@ #include "audio_core/hle/common.h" #include "audio_core/hle/dsp.h" #include "audio_core/hle/mixers.h" - #include "common/assert.h" #include "common/logging/log.h" #include "common/math_util.h" diff --git a/src/audio_core/hle/mixers.h b/src/audio_core/hle/mixers.h index 537c3a3b9..bf4e865ae 100644 --- a/src/audio_core/hle/mixers.h +++ b/src/audio_core/hle/mixers.h @@ -5,7 +5,6 @@ #pragma once #include - #include "audio_core/hle/common.h" #include "audio_core/hle/dsp.h" diff --git a/src/audio_core/hle/pipe.cpp b/src/audio_core/hle/pipe.cpp index f2b6d6552..cab30c8aa 100644 --- a/src/audio_core/hle/pipe.cpp +++ b/src/audio_core/hle/pipe.cpp @@ -2,16 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "audio_core/hle/pipe.h" #include #include - #include "audio_core/hle/dsp.h" -#include "audio_core/hle/pipe.h" - #include "common/assert.h" #include "common/common_types.h" #include "common/logging/log.h" - #include "core/hle/service/dsp_dsp.h" namespace DSP { diff --git a/src/audio_core/hle/pipe.h b/src/audio_core/hle/pipe.h index 6d7fd92ab..ac053c029 100644 --- a/src/audio_core/hle/pipe.h +++ b/src/audio_core/hle/pipe.h @@ -6,7 +6,6 @@ #include #include - #include "common/common_types.h" namespace DSP { diff --git a/src/audio_core/hle/source.cpp b/src/audio_core/hle/source.cpp index 249acc449..9e6b36fcd 100644 --- a/src/audio_core/hle/source.cpp +++ b/src/audio_core/hle/source.cpp @@ -2,17 +2,14 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "audio_core/hle/source.h" #include #include - #include "audio_core/codec.h" #include "audio_core/hle/common.h" -#include "audio_core/hle/source.h" #include "audio_core/interpolate.h" - #include "common/assert.h" #include "common/logging/log.h" - #include "core/memory.h" namespace DSP { diff --git a/src/audio_core/hle/source.h b/src/audio_core/hle/source.h index a1ab15520..3d725f2a3 100644 --- a/src/audio_core/hle/source.h +++ b/src/audio_core/hle/source.h @@ -7,13 +7,11 @@ #include #include #include - #include "audio_core/codec.h" #include "audio_core/hle/common.h" #include "audio_core/hle/dsp.h" #include "audio_core/hle/filter.h" #include "audio_core/interpolate.h" - #include "common/common_types.h" namespace DSP { diff --git a/src/audio_core/interpolate.cpp b/src/audio_core/interpolate.cpp index cb1c58a67..8a5d4181a 100644 --- a/src/audio_core/interpolate.cpp +++ b/src/audio_core/interpolate.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. #include "audio_core/interpolate.h" - #include "common/assert.h" #include "common/math_util.h" diff --git a/src/audio_core/interpolate.h b/src/audio_core/interpolate.h index 2d2e60311..dd06fdda9 100644 --- a/src/audio_core/interpolate.h +++ b/src/audio_core/interpolate.h @@ -6,7 +6,6 @@ #include #include - #include "common/common_types.h" namespace AudioInterp { diff --git a/src/audio_core/null_sink.h b/src/audio_core/null_sink.h index 9931c4778..e7668438c 100644 --- a/src/audio_core/null_sink.h +++ b/src/audio_core/null_sink.h @@ -5,7 +5,6 @@ #pragma once #include - #include "audio_core/audio_core.h" #include "audio_core/sink.h" diff --git a/src/audio_core/sdl2_sink.cpp b/src/audio_core/sdl2_sink.cpp index 65aac877a..2520796cb 100644 --- a/src/audio_core/sdl2_sink.cpp +++ b/src/audio_core/sdl2_sink.cpp @@ -2,15 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "audio_core/sdl2_sink.h" #include +#include #include - #include - #include "audio_core/audio_core.h" -#include "audio_core/sdl2_sink.h" - -#include #include "common/assert.h" #include "common/logging/log.h" diff --git a/src/audio_core/sdl2_sink.h b/src/audio_core/sdl2_sink.h index b13827214..ccd0f7c7e 100644 --- a/src/audio_core/sdl2_sink.h +++ b/src/audio_core/sdl2_sink.h @@ -6,7 +6,6 @@ #include #include - #include "audio_core/sink.h" namespace AudioCore { diff --git a/src/audio_core/sink.h b/src/audio_core/sink.h index f5ce55a6b..08f3bab5b 100644 --- a/src/audio_core/sink.h +++ b/src/audio_core/sink.h @@ -5,7 +5,6 @@ #pragma once #include - #include "common/common_types.h" namespace AudioCore { diff --git a/src/audio_core/sink_details.cpp b/src/audio_core/sink_details.cpp index ff529f4cf..1dc5e862e 100644 --- a/src/audio_core/sink_details.cpp +++ b/src/audio_core/sink_details.cpp @@ -2,12 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "audio_core/sink_details.h" #include #include - #include "audio_core/null_sink.h" -#include "audio_core/sink_details.h" - #ifdef HAVE_SDL2 #include "audio_core/sdl2_sink.h" #endif diff --git a/src/audio_core/time_stretch.cpp b/src/audio_core/time_stretch.cpp index f44807c84..26059f503 100644 --- a/src/audio_core/time_stretch.cpp +++ b/src/audio_core/time_stretch.cpp @@ -2,15 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "audio_core/time_stretch.h" #include #include #include - #include - #include "audio_core/audio_core.h" -#include "audio_core/time_stretch.h" - #include "common/common_types.h" #include "common/logging/log.h" #include "common/math_util.h" diff --git a/src/audio_core/time_stretch.h b/src/audio_core/time_stretch.h index 42a213679..fa81718ed 100644 --- a/src/audio_core/time_stretch.h +++ b/src/audio_core/time_stretch.h @@ -5,7 +5,6 @@ #include #include #include - #include "common/common_types.h" namespace AudioCore { diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp index 1b8f8cffe..e47375f88 100644 --- a/src/citra/citra.cpp +++ b/src/citra/citra.cpp @@ -21,22 +21,19 @@ #include #endif +#include "citra/config.h" +#include "citra/emu_window/emu_window_sdl2.h" #include "common/logging/backend.h" #include "common/logging/filter.h" #include "common/logging/log.h" #include "common/scm_rev.h" #include "common/scope_exit.h" #include "common/string_util.h" - #include "core/core.h" #include "core/gdbstub/gdbstub.h" #include "core/loader/loader.h" #include "core/settings.h" #include "core/system.h" - -#include "citra/config.h" -#include "citra/emu_window/emu_window_sdl2.h" - #include "video_core/video_core.h" static void PrintHelp(const char* argv0) { diff --git a/src/citra/config.cpp b/src/citra/config.cpp index 77679bd88..58aef7a9a 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -2,21 +2,15 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "config.h" #include - -#include - #include - +#include #include "citra/default_ini.h" - #include "common/file_util.h" #include "common/logging/log.h" - #include "core/settings.h" -#include "config.h" - Config::Config() { // TODO: Don't hardcode the path; let the frontend decide where to put the config files. sdl2_config_loc = FileUtil::GetUserPath(D_CONFIG_IDX) + "sdl2-config.ini"; diff --git a/src/citra/config.h b/src/citra/config.h index 8bd2b294b..b1c31f59c 100644 --- a/src/citra/config.h +++ b/src/citra/config.h @@ -6,7 +6,6 @@ #include #include - #include class Config { diff --git a/src/citra/emu_window/emu_window_sdl2.cpp b/src/citra/emu_window/emu_window_sdl2.cpp index 42f2a7553..7df054208 100644 --- a/src/citra/emu_window/emu_window_sdl2.cpp +++ b/src/citra/emu_window/emu_window_sdl2.cpp @@ -5,22 +5,16 @@ #include #include #include - #define SDL_MAIN_HANDLED #include - #include - +#include "citra/emu_window/emu_window_sdl2.h" #include "common/key_map.h" #include "common/logging/log.h" #include "common/scm_rev.h" #include "common/string_util.h" - #include "core/hle/service/hid/hid.h" #include "core/settings.h" - -#include "citra/emu_window/emu_window_sdl2.h" - #include "video_core/video_core.h" void EmuWindow_SDL2::OnMouseMotion(s32 x, s32 y) { diff --git a/src/citra/emu_window/emu_window_sdl2.h b/src/citra/emu_window/emu_window_sdl2.h index d4d86821d..e4d14ef12 100644 --- a/src/citra/emu_window/emu_window_sdl2.h +++ b/src/citra/emu_window/emu_window_sdl2.h @@ -5,7 +5,6 @@ #pragma once #include - #include "common/emu_window.h" struct SDL_Window; diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 53d035b32..0abae86c3 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp @@ -9,16 +9,13 @@ #endif #include "citra_qt/bootmanager.h" - #include "common/key_map.h" #include "common/microprofile.h" #include "common/scm_rev.h" #include "common/string_util.h" - #include "core/core.h" #include "core/settings.h" #include "core/system.h" - #include "video_core/debug_utils/debug_utils.h" #include "video_core/video_core.h" diff --git a/src/citra_qt/bootmanager.h b/src/citra_qt/bootmanager.h index 59241684d..67228b94f 100644 --- a/src/citra_qt/bootmanager.h +++ b/src/citra_qt/bootmanager.h @@ -5,10 +5,8 @@ #include #include #include - #include #include - #include "common/emu_window.h" #include "common/thread.h" diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index d25bdcf9f..e3648572f 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp @@ -2,11 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include - #include "citra_qt/config.h" +#include #include "citra_qt/ui_settings.h" - #include "common/file_util.h" Config::Config() { diff --git a/src/citra_qt/config.h b/src/citra_qt/config.h index db76fa870..79c901804 100644 --- a/src/citra_qt/config.h +++ b/src/citra_qt/config.h @@ -4,9 +4,8 @@ #pragma once -#include #include - +#include #include "core/settings.h" class QSettings; diff --git a/src/citra_qt/configure_audio.cpp b/src/citra_qt/configure_audio.cpp index 944047d05..ba976252e 100644 --- a/src/citra_qt/configure_audio.cpp +++ b/src/citra_qt/configure_audio.cpp @@ -2,12 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "audio_core/sink_details.h" - #include "citra_qt/configure_audio.h" -#include "ui_configure_audio.h" - +#include "audio_core/sink_details.h" #include "core/settings.h" +#include "ui_configure_audio.h" ConfigureAudio::ConfigureAudio(QWidget* parent) : QWidget(parent), ui(std::make_unique()) { diff --git a/src/citra_qt/configure_audio.h b/src/citra_qt/configure_audio.h index e836910aa..51df2e27b 100644 --- a/src/citra_qt/configure_audio.h +++ b/src/citra_qt/configure_audio.h @@ -4,8 +4,8 @@ #pragma once -#include #include +#include namespace Ui { class ConfigureAudio; diff --git a/src/citra_qt/configure_debug.cpp b/src/citra_qt/configure_debug.cpp index dde8d670e..dcc398eee 100644 --- a/src/citra_qt/configure_debug.cpp +++ b/src/citra_qt/configure_debug.cpp @@ -3,9 +3,8 @@ // Refer to the license.txt file included. #include "citra_qt/configure_debug.h" -#include "ui_configure_debug.h" - #include "core/settings.h" +#include "ui_configure_debug.h" ConfigureDebug::ConfigureDebug(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureDebug) { ui->setupUi(this); diff --git a/src/citra_qt/configure_debug.h b/src/citra_qt/configure_debug.h index e9c6960e2..d167eb996 100644 --- a/src/citra_qt/configure_debug.h +++ b/src/citra_qt/configure_debug.h @@ -4,8 +4,8 @@ #pragma once -#include #include +#include namespace Ui { class ConfigureDebug; diff --git a/src/citra_qt/configure_dialog.cpp b/src/citra_qt/configure_dialog.cpp index c33c95540..d6a4e8af1 100644 --- a/src/citra_qt/configure_dialog.cpp +++ b/src/citra_qt/configure_dialog.cpp @@ -4,9 +4,8 @@ #include "citra_qt/configure_dialog.h" #include "citra_qt/config.h" -#include "ui_configure.h" - #include "core/settings.h" +#include "ui_configure.h" ConfigureDialog::ConfigureDialog(QWidget* parent) : QDialog(parent), ui(new Ui::ConfigureDialog) { ui->setupUi(this); diff --git a/src/citra_qt/configure_dialog.h b/src/citra_qt/configure_dialog.h index e4e450691..21fa1f501 100644 --- a/src/citra_qt/configure_dialog.h +++ b/src/citra_qt/configure_dialog.h @@ -4,8 +4,8 @@ #pragma once -#include #include +#include namespace Ui { class ConfigureDialog; diff --git a/src/citra_qt/configure_general.cpp b/src/citra_qt/configure_general.cpp index 3e6f76bfe..27139fb30 100644 --- a/src/citra_qt/configure_general.cpp +++ b/src/citra_qt/configure_general.cpp @@ -4,10 +4,9 @@ #include "citra_qt/configure_general.h" #include "citra_qt/ui_settings.h" -#include "ui_configure_general.h" - #include "core/settings.h" #include "core/system.h" +#include "ui_configure_general.h" ConfigureGeneral::ConfigureGeneral(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureGeneral) { diff --git a/src/citra_qt/configure_general.h b/src/citra_qt/configure_general.h index 196474ae3..447552d8c 100644 --- a/src/citra_qt/configure_general.h +++ b/src/citra_qt/configure_general.h @@ -4,8 +4,8 @@ #pragma once -#include #include +#include namespace Ui { class ConfigureGeneral; diff --git a/src/citra_qt/configure_graphics.cpp b/src/citra_qt/configure_graphics.cpp index bde6727cc..19c1f75c2 100644 --- a/src/citra_qt/configure_graphics.cpp +++ b/src/citra_qt/configure_graphics.cpp @@ -3,10 +3,9 @@ // Refer to the license.txt file included. #include "citra_qt/configure_graphics.h" -#include "ui_configure_graphics.h" - #include "core/settings.h" #include "core/system.h" +#include "ui_configure_graphics.h" ConfigureGraphics::ConfigureGraphics(QWidget* parent) : QWidget(parent), ui(new Ui::ConfigureGraphics) { diff --git a/src/citra_qt/configure_graphics.h b/src/citra_qt/configure_graphics.h index 906d534a6..5497a55f7 100644 --- a/src/citra_qt/configure_graphics.h +++ b/src/citra_qt/configure_graphics.h @@ -4,8 +4,8 @@ #pragma once -#include #include +#include namespace Ui { class ConfigureGraphics; diff --git a/src/citra_qt/configure_input.cpp b/src/citra_qt/configure_input.cpp index 7900134ca..7039301e3 100644 --- a/src/citra_qt/configure_input.cpp +++ b/src/citra_qt/configure_input.cpp @@ -2,11 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include +#include "citra_qt/configure_input.h" #include #include - -#include "citra_qt/configure_input.h" +#include ConfigureInput::ConfigureInput(QWidget* parent) : QWidget(parent), ui(std::make_unique()) { diff --git a/src/citra_qt/configure_input.h b/src/citra_qt/configure_input.h index 5d9624bb0..5183b904d 100644 --- a/src/citra_qt/configure_input.h +++ b/src/citra_qt/configure_input.h @@ -4,9 +4,9 @@ #pragma once +#include #include #include - #include "citra_qt/config.h" #include "core/settings.h" #include "ui_configure_input.h" diff --git a/src/citra_qt/configure_system.cpp b/src/citra_qt/configure_system.cpp index 732e15dda..873d314ec 100644 --- a/src/citra_qt/configure_system.cpp +++ b/src/citra_qt/configure_system.cpp @@ -4,11 +4,10 @@ #include "citra_qt/configure_system.h" #include "citra_qt/ui_settings.h" -#include "ui_configure_system.h" - #include "core/hle/service/cfg/cfg.h" #include "core/hle/service/fs/archive.h" #include "core/system.h" +#include "ui_configure_system.h" static const std::array days_in_month = {{ 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, diff --git a/src/citra_qt/configure_system.h b/src/citra_qt/configure_system.h index 3a0754bb5..db0ead13c 100644 --- a/src/citra_qt/configure_system.h +++ b/src/citra_qt/configure_system.h @@ -4,8 +4,8 @@ #pragma once -#include #include +#include namespace Ui { class ConfigureSystem; diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp index db266b506..14bd1c77c 100644 --- a/src/citra_qt/debugger/callstack.cpp +++ b/src/citra_qt/debugger/callstack.cpp @@ -2,13 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include - #include "citra_qt/debugger/callstack.h" - +#include #include "common/common_types.h" #include "common/symbols.h" - #include "core/arm/arm_interface.h" #include "core/arm/disassembler/arm_disasm.h" #include "core/core.h" diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp index 803e8b172..7a5d3e2f1 100644 --- a/src/citra_qt/debugger/disassembler.cpp +++ b/src/citra_qt/debugger/disassembler.cpp @@ -2,16 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "citra_qt/debugger/disassembler.h" #include - #include "citra_qt/bootmanager.h" -#include "citra_qt/debugger/disassembler.h" #include "citra_qt/hotkeys.h" #include "citra_qt/util/util.h" - #include "common/break_points.h" #include "common/symbols.h" - #include "core/arm/arm_interface.h" #include "core/arm/disassembler/arm_disasm.h" #include "core/core.h" diff --git a/src/citra_qt/debugger/disassembler.h b/src/citra_qt/debugger/disassembler.h index 1f5607788..2ca6c2bd4 100644 --- a/src/citra_qt/debugger/disassembler.h +++ b/src/citra_qt/debugger/disassembler.h @@ -6,11 +6,9 @@ #include #include - -#include "ui_disassembler.h" - #include "common/break_points.h" #include "common/common_types.h" +#include "ui_disassembler.h" class QAction; class EmuThread; diff --git a/src/citra_qt/debugger/graphics.cpp b/src/citra_qt/debugger/graphics.cpp index b79c063db..31b54e855 100644 --- a/src/citra_qt/debugger/graphics.cpp +++ b/src/citra_qt/debugger/graphics.cpp @@ -2,9 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include - #include "citra_qt/debugger/graphics.h" +#include #include "citra_qt/util/util.h" extern GraphicsDebugger g_debugger; diff --git a/src/citra_qt/debugger/graphics.h b/src/citra_qt/debugger/graphics.h index 7d681b97d..bedf3e596 100644 --- a/src/citra_qt/debugger/graphics.h +++ b/src/citra_qt/debugger/graphics.h @@ -6,7 +6,6 @@ #include #include - #include "video_core/gpu_debugger.h" class GPUCommandStreamItemModel : public QAbstractListModel, diff --git a/src/citra_qt/debugger/graphics_breakpoint_observer.cpp b/src/citra_qt/debugger/graphics_breakpoint_observer.cpp index 25a398ece..ad11552d7 100644 --- a/src/citra_qt/debugger/graphics_breakpoint_observer.cpp +++ b/src/citra_qt/debugger/graphics_breakpoint_observer.cpp @@ -2,9 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include - #include "citra_qt/debugger/graphics_breakpoint_observer.h" +#include BreakPointObserverDock::BreakPointObserverDock(std::shared_ptr debug_context, const QString& title, QWidget* parent) diff --git a/src/citra_qt/debugger/graphics_breakpoint_observer.h b/src/citra_qt/debugger/graphics_breakpoint_observer.h index 8d0871f27..e77df4f5b 100644 --- a/src/citra_qt/debugger/graphics_breakpoint_observer.h +++ b/src/citra_qt/debugger/graphics_breakpoint_observer.h @@ -5,7 +5,6 @@ #pragma once #include - #include "video_core/debug_utils/debug_utils.h" /** diff --git a/src/citra_qt/debugger/graphics_breakpoints.cpp b/src/citra_qt/debugger/graphics_breakpoints.cpp index b31eba533..e1d1b4911 100644 --- a/src/citra_qt/debugger/graphics_breakpoints.cpp +++ b/src/citra_qt/debugger/graphics_breakpoints.cpp @@ -2,15 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "citra_qt/debugger/graphics_breakpoints.h" #include #include #include #include #include - -#include "citra_qt/debugger/graphics_breakpoints.h" #include "citra_qt/debugger/graphics_breakpoints_p.h" - #include "common/assert.h" BreakPointModel::BreakPointModel(std::shared_ptr debug_context, QObject* parent) diff --git a/src/citra_qt/debugger/graphics_breakpoints.h b/src/citra_qt/debugger/graphics_breakpoints.h index 2371b0e39..5fc40c916 100644 --- a/src/citra_qt/debugger/graphics_breakpoints.h +++ b/src/citra_qt/debugger/graphics_breakpoints.h @@ -5,9 +5,7 @@ #pragma once #include - #include - #include "video_core/debug_utils/debug_utils.h" class QLabel; diff --git a/src/citra_qt/debugger/graphics_breakpoints_p.h b/src/citra_qt/debugger/graphics_breakpoints_p.h index 5f321ede2..dc64706bd 100644 --- a/src/citra_qt/debugger/graphics_breakpoints_p.h +++ b/src/citra_qt/debugger/graphics_breakpoints_p.h @@ -5,9 +5,7 @@ #pragma once #include - #include - #include "video_core/debug_utils/debug_utils.h" class BreakPointModel : public QAbstractListModel { diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index b088ad29d..35be9b9bd 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "citra_qt/debugger/graphics_cmdlists.h" #include #include #include @@ -13,13 +14,9 @@ #include #include #include - -#include "citra_qt/debugger/graphics_cmdlists.h" #include "citra_qt/util/spinbox.h" #include "citra_qt/util/util.h" - #include "common/vector_math.h" - #include "video_core/debug_utils/debug_utils.h" #include "video_core/pica.h" #include "video_core/pica_state.h" diff --git a/src/citra_qt/debugger/graphics_cmdlists.h b/src/citra_qt/debugger/graphics_cmdlists.h index b2242eca4..fa2b9122b 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.h +++ b/src/citra_qt/debugger/graphics_cmdlists.h @@ -6,7 +6,6 @@ #include #include - #include "video_core/debug_utils/debug_utils.h" #include "video_core/gpu_debugger.h" diff --git a/src/citra_qt/debugger/graphics_surface.cpp b/src/citra_qt/debugger/graphics_surface.cpp index bb998acc4..496fce59d 100644 --- a/src/citra_qt/debugger/graphics_surface.cpp +++ b/src/citra_qt/debugger/graphics_surface.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "citra_qt/debugger/graphics_surface.h" #include #include #include @@ -11,15 +12,10 @@ #include #include #include - -#include "citra_qt/debugger/graphics_surface.h" #include "citra_qt/util/spinbox.h" - #include "common/color.h" - #include "core/hw/gpu.h" #include "core/memory.h" - #include "video_core/pica.h" #include "video_core/pica_state.h" #include "video_core/utils.h" diff --git a/src/citra_qt/debugger/graphics_surface.h b/src/citra_qt/debugger/graphics_surface.h index 5881ae60a..21e6b5b8b 100644 --- a/src/citra_qt/debugger/graphics_surface.h +++ b/src/citra_qt/debugger/graphics_surface.h @@ -4,10 +4,9 @@ #pragma once -#include "citra_qt/debugger/graphics_breakpoint_observer.h" - #include #include +#include "citra_qt/debugger/graphics_breakpoint_observer.h" class QComboBox; class QSpinBox; diff --git a/src/citra_qt/debugger/graphics_tracing.cpp b/src/citra_qt/debugger/graphics_tracing.cpp index b6f638b60..944150b8e 100644 --- a/src/citra_qt/debugger/graphics_tracing.cpp +++ b/src/citra_qt/debugger/graphics_tracing.cpp @@ -2,29 +2,22 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "citra_qt/debugger/graphics_tracing.h" #include #include #include #include - -#include - #include #include #include #include #include - -#include "citra_qt/debugger/graphics_tracing.h" - +#include #include "common/common_types.h" - #include "core/hw/gpu.h" #include "core/hw/lcd.h" #include "core/tracer/recorder.h" - #include "nihstro/float24.h" - #include "video_core/pica.h" #include "video_core/pica_state.h" diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics_vertex_shader.cpp index 0f02bc3da..3b3ffe5c6 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics_vertex_shader.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "citra_qt/debugger/graphics_vertex_shader.h" #include #include - #include #include #include @@ -15,10 +15,7 @@ #include #include #include - -#include "citra_qt/debugger/graphics_vertex_shader.h" #include "citra_qt/util/util.h" - #include "video_core/pica.h" #include "video_core/pica_state.h" #include "video_core/shader/shader.h" diff --git a/src/citra_qt/debugger/graphics_vertex_shader.h b/src/citra_qt/debugger/graphics_vertex_shader.h index 96692d82c..ec42f24bb 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.h +++ b/src/citra_qt/debugger/graphics_vertex_shader.h @@ -5,11 +5,9 @@ #pragma once #include - +#include #include "citra_qt/debugger/graphics_breakpoint_observer.h" - #include "nihstro/parser_shbin.h" - #include "video_core/shader/shader.h" class QLabel; diff --git a/src/citra_qt/debugger/profiler.cpp b/src/citra_qt/debugger/profiler.cpp index 97a377513..39d2d6e39 100644 --- a/src/citra_qt/debugger/profiler.cpp +++ b/src/citra_qt/debugger/profiler.cpp @@ -2,13 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "citra_qt/debugger/profiler.h" #include #include #include - -#include "citra_qt/debugger/profiler.h" #include "citra_qt/util/util.h" - #include "common/common_types.h" #include "common/microprofile.h" #include "common/profiler_reporting.h" diff --git a/src/citra_qt/debugger/profiler.h b/src/citra_qt/debugger/profiler.h index d0a90fdee..d8c6487aa 100644 --- a/src/citra_qt/debugger/profiler.h +++ b/src/citra_qt/debugger/profiler.h @@ -7,11 +7,9 @@ #include #include #include - -#include "ui_profiler.h" - #include "common/microprofile.h" #include "common/profiler_reporting.h" +#include "ui_profiler.h" class ProfilerModel : public QAbstractItemModel { Q_OBJECT diff --git a/src/citra_qt/debugger/registers.cpp b/src/citra_qt/debugger/registers.cpp index 87c8c3418..13842dac3 100644 --- a/src/citra_qt/debugger/registers.cpp +++ b/src/citra_qt/debugger/registers.cpp @@ -2,11 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include - #include "citra_qt/debugger/registers.h" +#include #include "citra_qt/util/util.h" - #include "core/arm/arm_interface.h" #include "core/core.h" diff --git a/src/citra_qt/debugger/registers.h b/src/citra_qt/debugger/registers.h index cba601731..54c9a8155 100644 --- a/src/citra_qt/debugger/registers.h +++ b/src/citra_qt/debugger/registers.h @@ -2,9 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "ui_registers.h" - #include +#include "ui_registers.h" class QTreeWidget; class QTreeWidgetItem; diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp index 9f9c22a44..16d31be77 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp @@ -2,19 +2,16 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "game_list.h" #include #include #include - -#include "game_list.h" -#include "game_list_p.h" -#include "ui_settings.h" - -#include "core/loader/loader.h" - #include "common/common_paths.h" #include "common/logging/log.h" #include "common/string_util.h" +#include "core/loader/loader.h" +#include "game_list_p.h" +#include "ui_settings.h" GameList::GameList(QWidget* parent) { QVBoxLayout* layout = new QVBoxLayout; diff --git a/src/citra_qt/game_list_p.h b/src/citra_qt/game_list_p.h index c8a9ee5db..60ab4cf02 100644 --- a/src/citra_qt/game_list_p.h +++ b/src/citra_qt/game_list_p.h @@ -5,18 +5,14 @@ #pragma once #include - #include #include #include #include - #include "citra_qt/util/util.h" #include "common/color.h" #include "common/string_util.h" - #include "core/loader/smdh.h" - #include "video_core/utils.h" /** diff --git a/src/citra_qt/hotkeys.cpp b/src/citra_qt/hotkeys.cpp index 3e38223ee..9037f20f2 100644 --- a/src/citra_qt/hotkeys.cpp +++ b/src/citra_qt/hotkeys.cpp @@ -2,13 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "citra_qt/hotkeys.h" #include - #include #include #include - -#include "citra_qt/hotkeys.h" #include "citra_qt/ui_settings.h" struct Hotkey { diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index e10314856..82667446b 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -5,25 +5,15 @@ #include #include #include - #include - #define QT_NO_OPENGL #include #include #include #include -#include "qhexedit.h" - #include "citra_qt/bootmanager.h" #include "citra_qt/config.h" #include "citra_qt/configure_dialog.h" -#include "citra_qt/game_list.h" -#include "citra_qt/hotkeys.h" -#include "citra_qt/main.h" -#include "citra_qt/ui_settings.h" - -// Debugger #include "citra_qt/debugger/callstack.h" #include "citra_qt/debugger/disassembler.h" #include "citra_qt/debugger/graphics.h" @@ -35,7 +25,10 @@ #include "citra_qt/debugger/profiler.h" #include "citra_qt/debugger/ramview.h" #include "citra_qt/debugger/registers.h" - +#include "citra_qt/game_list.h" +#include "citra_qt/hotkeys.h" +#include "citra_qt/main.h" +#include "citra_qt/ui_settings.h" #include "common/logging/backend.h" #include "common/logging/filter.h" #include "common/logging/log.h" @@ -45,14 +38,13 @@ #include "common/scm_rev.h" #include "common/scope_exit.h" #include "common/string_util.h" - #include "core/arm/disassembler/load_symbol_map.h" #include "core/core.h" #include "core/gdbstub/gdbstub.h" #include "core/loader/loader.h" #include "core/settings.h" #include "core/system.h" - +#include "qhexedit.h" #include "video_core/video_core.h" GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) { diff --git a/src/citra_qt/main.h b/src/citra_qt/main.h index 10157310e..c4349513f 100644 --- a/src/citra_qt/main.h +++ b/src/citra_qt/main.h @@ -5,9 +5,8 @@ #ifndef _CITRA_QT_MAIN_HXX_ #define _CITRA_QT_MAIN_HXX_ -#include #include - +#include #include "ui_main.h" class Config; diff --git a/src/citra_qt/ui_settings.h b/src/citra_qt/ui_settings.h index 30f031831..ed7fdff7e 100644 --- a/src/citra_qt/ui_settings.h +++ b/src/citra_qt/ui_settings.h @@ -4,12 +4,11 @@ #pragma once +#include #include #include #include -#include - namespace UISettings { using ContextualShortcut = std::pair; diff --git a/src/citra_qt/util/spinbox.cpp b/src/citra_qt/util/spinbox.cpp index 5868f3b91..0bda21502 100644 --- a/src/citra_qt/util/spinbox.cpp +++ b/src/citra_qt/util/spinbox.cpp @@ -28,11 +28,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#include "citra_qt/util/spinbox.h" +#include #include #include -#include - -#include "citra_qt/util/spinbox.h" #include "common/assert.h" CSpinBox::CSpinBox(QWidget* parent) diff --git a/src/citra_qt/util/util.cpp b/src/citra_qt/util/util.cpp index bf44d78ff..e77d3796c 100644 --- a/src/citra_qt/util/util.cpp +++ b/src/citra_qt/util/util.cpp @@ -2,11 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "citra_qt/util/util.h" #include #include -#include "citra_qt/util/util.h" - QFont GetMonospaceFont() { QFont font("monospace"); // Automatic fallback to a monospace font on on platforms without a font called "monospace" diff --git a/src/common/assert.h b/src/common/assert.h index 70214efae..04e80c87a 100644 --- a/src/common/assert.h +++ b/src/common/assert.h @@ -5,7 +5,6 @@ #pragma once #include - #include "common/common_funcs.h" #include "common/logging/log.h" @@ -54,4 +53,4 @@ __declspec(noinline, noreturn) #endif #define UNIMPLEMENTED() DEBUG_ASSERT_MSG(false, "Unimplemented code!") -#define UNIMPLEMENTED_MSG(_a_, ...) ASSERT_MSG(false, _a_, __VA_ARGS__) \ No newline at end of file +#define UNIMPLEMENTED_MSG(_a_, ...) ASSERT_MSG(false, _a_, __VA_ARGS__) diff --git a/src/common/bit_field.h b/src/common/bit_field.h index 8d45743e2..030f7caeb 100644 --- a/src/common/bit_field.h +++ b/src/common/bit_field.h @@ -33,7 +33,6 @@ #include #include #include - #include "common/common_funcs.h" /* diff --git a/src/common/break_points.cpp b/src/common/break_points.cpp index 3218db314..4b64a6c7b 100644 --- a/src/common/break_points.cpp +++ b/src/common/break_points.cpp @@ -3,10 +3,9 @@ // Refer to the license.txt file included. #include "common/break_points.h" -#include "common/logging/log.h" - #include #include +#include "common/logging/log.h" bool BreakPoints::IsAddressBreakPoint(u32 iAddress) const { auto cond = [&iAddress](const TBreakPoint& bp) { return bp.iAddress == iAddress; }; diff --git a/src/common/break_points.h b/src/common/break_points.h index 1a5b7d296..e15b9f842 100644 --- a/src/common/break_points.h +++ b/src/common/break_points.h @@ -6,7 +6,6 @@ #include #include - #include "common/common_types.h" class DebugInterface; diff --git a/src/common/chunk_file.h b/src/common/chunk_file.h index 2bf3c774b..5145a3657 100644 --- a/src/common/chunk_file.h +++ b/src/common/chunk_file.h @@ -35,7 +35,6 @@ #include #include #include - #include "common/assert.h" #include "common/common_types.h" #include "common/logging/log.h" diff --git a/src/common/code_block.h b/src/common/code_block.h index 099088925..6a55a8e30 100644 --- a/src/common/code_block.h +++ b/src/common/code_block.h @@ -5,7 +5,6 @@ #pragma once #include - #include "common/common_types.h" #include "common/memory_util.h" diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h index 7032c2117..b141e79ed 100644 --- a/src/common/common_funcs.h +++ b/src/common/common_funcs.h @@ -7,7 +7,6 @@ #if !defined(ARCHITECTURE_x86_64) && !defined(_M_ARM) #include // for exit #endif - #include "common_types.h" #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0])) diff --git a/src/common/emu_window.cpp b/src/common/emu_window.cpp index c86f663a8..6fd6f1987 100644 --- a/src/common/emu_window.cpp +++ b/src/common/emu_window.cpp @@ -2,13 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "emu_window.h" #include #include - #include "common/assert.h" #include "common/key_map.h" - -#include "emu_window.h" #include "video_core/video_core.h" void EmuWindow::ButtonPressed(Service::HID::PadState pad) { diff --git a/src/common/emu_window.h b/src/common/emu_window.h index 20131300d..67df63e06 100644 --- a/src/common/emu_window.h +++ b/src/common/emu_window.h @@ -6,10 +6,8 @@ #include #include - #include "common/common_types.h" #include "common/math_util.h" - #include "core/hle/service/hid/hid.h" /** diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 96afe2ca0..a0cae11e3 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -16,7 +16,6 @@ #include #include // for SHGetFolderPath #include - #include "common/string_util.h" // 64 bit offsets for windows diff --git a/src/common/file_util.h b/src/common/file_util.h index b15021a63..204b06f14 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h @@ -11,9 +11,7 @@ #include #include #include - #include "common/common_types.h" - #ifdef _MSC_VER #include "common/string_util.h" #endif diff --git a/src/common/hash.cpp b/src/common/hash.cpp index a46c92553..5aa5118eb 100644 --- a/src/common/hash.cpp +++ b/src/common/hash.cpp @@ -5,7 +5,6 @@ #if defined(_MSC_VER) #include #endif - #include "common_funcs.h" #include "common_types.h" #include "hash.h" diff --git a/src/common/key_map.cpp b/src/common/key_map.cpp index e882f5f52..8380ce489 100644 --- a/src/common/key_map.cpp +++ b/src/common/key_map.cpp @@ -2,10 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/key_map.h" #include - #include "common/emu_window.h" -#include "common/key_map.h" namespace KeyMap { diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index b3d6598e4..b4a312948 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -2,13 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/logging/backend.h" #include #include #include - #include "common/assert.h" #include "common/common_funcs.h" // snprintf compatibility define -#include "common/logging/backend.h" #include "common/logging/filter.h" #include "common/logging/log.h" #include "common/logging/text_formatter.h" diff --git a/src/common/logging/backend.h b/src/common/logging/backend.h index 3fe88e4f6..c4fe2acbf 100644 --- a/src/common/logging/backend.h +++ b/src/common/logging/backend.h @@ -8,7 +8,6 @@ #include #include #include - #include "common/logging/log.h" namespace Log { diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index 186e0b621..9aa72cecc 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp @@ -2,10 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/logging/filter.h" #include - #include "common/logging/backend.h" -#include "common/logging/filter.h" #include "common/string_util.h" namespace Log { diff --git a/src/common/logging/filter.h b/src/common/logging/filter.h index db526fead..b51df61de 100644 --- a/src/common/logging/filter.h +++ b/src/common/logging/filter.h @@ -7,7 +7,6 @@ #include #include #include - #include "common/logging/log.h" namespace Log { diff --git a/src/common/logging/text_formatter.cpp b/src/common/logging/text_formatter.cpp index 955358553..d61c1696b 100644 --- a/src/common/logging/text_formatter.cpp +++ b/src/common/logging/text_formatter.cpp @@ -10,12 +10,11 @@ #include #endif +#include "common/assert.h" +#include "common/common_funcs.h" #include "common/logging/backend.h" #include "common/logging/log.h" #include "common/logging/text_formatter.h" - -#include "common/assert.h" -#include "common/common_funcs.h" #include "common/string_util.h" namespace Log { diff --git a/src/common/misc.cpp b/src/common/misc.cpp index 5938e6289..7be2235b0 100644 --- a/src/common/misc.cpp +++ b/src/common/misc.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. #include - #ifdef _WIN32 #include #else diff --git a/src/common/profiler.cpp b/src/common/profiler.cpp index 231a0afc1..b40e7205d 100644 --- a/src/common/profiler.cpp +++ b/src/common/profiler.cpp @@ -5,7 +5,6 @@ #include #include #include - #include "common/assert.h" #include "common/profiler_reporting.h" #include "common/synchronized_wrapper.h" diff --git a/src/common/profiler_reporting.h b/src/common/profiler_reporting.h index fa1ac883f..e9ce6d41c 100644 --- a/src/common/profiler_reporting.h +++ b/src/common/profiler_reporting.h @@ -7,7 +7,6 @@ #include #include #include - #include "common/synchronized_wrapper.h" namespace Common { diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index 9ccd6f135..968854bae 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -2,17 +2,15 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "common/string_util.h" #include #include #include #include #include #include - #include "common/common_paths.h" #include "common/logging/log.h" -#include "common/string_util.h" - #ifdef _MSC_VER #include #include diff --git a/src/common/string_util.h b/src/common/string_util.h index 6ffd735f4..075bf4ecb 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h @@ -10,7 +10,6 @@ #include #include #include - #include "common/common_types.h" namespace Common { diff --git a/src/common/swap.h b/src/common/swap.h index 72c50d789..e241c9f73 100644 --- a/src/common/swap.h +++ b/src/common/swap.h @@ -24,9 +24,7 @@ #elif defined(__FreeBSD__) #include #endif - #include - #include "common/common_types.h" // GCC 4.6+ diff --git a/src/common/symbols.h b/src/common/symbols.h index 6044c9db6..f5a48e05a 100644 --- a/src/common/symbols.h +++ b/src/common/symbols.h @@ -7,7 +7,6 @@ #include #include #include - #include "common/common_types.h" struct TSymbol { diff --git a/src/common/thread.cpp b/src/common/thread.cpp index bee607ce9..6e7b39b9a 100644 --- a/src/common/thread.cpp +++ b/src/common/thread.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. #include "common/thread.h" - #ifdef __APPLE__ #include #elif defined(_WIN32) @@ -16,7 +15,6 @@ #endif #include #endif - #ifndef _WIN32 #include #endif diff --git a/src/common/thread.h b/src/common/thread.h index 499c151c2..9c08be7e3 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -8,7 +8,6 @@ #include #include #include - #include "common/common_types.h" // Support for C++11's thread_local keyword was surprisingly spotty in compilers until very diff --git a/src/common/thread_queue_list.h b/src/common/thread_queue_list.h index 0dcf785b6..edd0e4a3f 100644 --- a/src/common/thread_queue_list.h +++ b/src/common/thread_queue_list.h @@ -6,7 +6,6 @@ #include #include - #include namespace Common { diff --git a/src/common/timer.cpp b/src/common/timer.cpp index 27560eb0b..e843cbd9c 100644 --- a/src/common/timer.cpp +++ b/src/common/timer.cpp @@ -3,7 +3,6 @@ // Refer to the license.txt file included. #include - #ifdef _WIN32 #include #include @@ -11,7 +10,6 @@ #else #include #endif - #include "common/common_types.h" #include "common/string_util.h" #include "common/timer.h" diff --git a/src/common/x64/cpu_detect.cpp b/src/common/x64/cpu_detect.cpp index 19f1a4030..ac37c42bc 100644 --- a/src/common/x64/cpu_detect.cpp +++ b/src/common/x64/cpu_detect.cpp @@ -2,14 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "cpu_detect.h" #include #include #include - #include "common/common_types.h" -#include "cpu_detect.h" - namespace Common { #ifndef _MSC_VER diff --git a/src/common/x64/emitter.cpp b/src/common/x64/emitter.cpp index 7cf350b4a..b69e4bd5e 100644 --- a/src/common/x64/emitter.cpp +++ b/src/common/x64/emitter.cpp @@ -15,16 +15,14 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ +#include "emitter.h" #include #include - +#include "abi.h" #include "common/assert.h" #include "common/logging/log.h" #include "common/memory_util.h" - -#include "abi.h" #include "cpu_detect.h" -#include "emitter.h" namespace Gen { @@ -222,7 +220,7 @@ void OpArg::WriteVex(XEmitter* emit, X64Reg regOp1, X64Reg regOp2, int L, int pp void OpArg::WriteRest(XEmitter* emit, int extraBytes, X64Reg _operandReg, bool warn_64bit_offset) const { if (_operandReg == INVALID_REG) - _operandReg = (X64Reg)this->operandReg; + _operandReg = (X64Reg) this->operandReg; int mod = 0; int ireg = indexReg; bool SIB = false; diff --git a/src/common/x64/emitter.h b/src/common/x64/emitter.h index 6c9dc3d6b..7d7cdde16 100644 --- a/src/common/x64/emitter.h +++ b/src/common/x64/emitter.h @@ -18,7 +18,6 @@ #pragma once #include - #include "common/assert.h" #include "common/bit_set.h" #include "common/code_block.h" diff --git a/src/core/arm/disassembler/arm_disasm.cpp b/src/core/arm/disassembler/arm_disasm.cpp index b3b9971e8..068f395ac 100644 --- a/src/core/arm/disassembler/arm_disasm.cpp +++ b/src/core/arm/disassembler/arm_disasm.cpp @@ -1,12 +1,10 @@ // Copyright 2006 The Android Open Source Project +#include "core/arm/disassembler/arm_disasm.h" #include #include - #include "common/common_types.h" #include "common/string_util.h" - -#include "core/arm/disassembler/arm_disasm.h" #include "core/arm/skyeye_common/armsupp.h" static const char* cond_names[] = {"eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc", diff --git a/src/core/arm/disassembler/arm_disasm.h b/src/core/arm/disassembler/arm_disasm.h index 031f973d6..300e228ed 100644 --- a/src/core/arm/disassembler/arm_disasm.h +++ b/src/core/arm/disassembler/arm_disasm.h @@ -3,7 +3,6 @@ #pragma once #include - #include "common/common_types.h" // Note: this list of opcodes must match the list used to initialize diff --git a/src/core/arm/disassembler/load_symbol_map.cpp b/src/core/arm/disassembler/load_symbol_map.cpp index 58e8e6fa1..e602d4511 100644 --- a/src/core/arm/disassembler/load_symbol_map.cpp +++ b/src/core/arm/disassembler/load_symbol_map.cpp @@ -2,15 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/arm/disassembler/load_symbol_map.h" #include #include #include - #include "common/file_util.h" #include "common/symbols.h" -#include "core/arm/disassembler/load_symbol_map.h" - /* * Loads a symbol map file for use with the disassembler * @param filename String filename path of symbol map file diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp index a521aec7c..b57d9e65b 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic.cpp @@ -2,12 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/arm/dynarmic/arm_dynarmic.h" +#include #include "common/assert.h" #include "common/microprofile.h" - -#include - -#include "core/arm/dynarmic/arm_dynarmic.h" #include "core/arm/dyncom/arm_dyncom_interpreter.h" #include "core/core.h" #include "core/core_timing.h" diff --git a/src/core/arm/dynarmic/arm_dynarmic.h b/src/core/arm/dynarmic/arm_dynarmic.h index d493cabd5..ced86d29b 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.h +++ b/src/core/arm/dynarmic/arm_dynarmic.h @@ -5,11 +5,8 @@ #pragma once #include - #include - #include "common/common_types.h" - #include "core/arm/arm_interface.h" #include "core/arm/skyeye_common/armstate.h" diff --git a/src/core/arm/dyncom/arm_dyncom.cpp b/src/core/arm/dyncom/arm_dyncom.cpp index 912560402..bc9ba2941 100644 --- a/src/core/arm/dyncom/arm_dyncom.cpp +++ b/src/core/arm/dyncom/arm_dyncom.cpp @@ -2,18 +2,15 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/arm/dyncom/arm_dyncom.h" #include #include - -#include "core/arm/skyeye_common/armstate.h" -#include "core/arm/skyeye_common/armsupp.h" -#include "core/arm/skyeye_common/vfp/vfp.h" - -#include "core/arm/dyncom/arm_dyncom.h" #include "core/arm/dyncom/arm_dyncom_interpreter.h" #include "core/arm/dyncom/arm_dyncom_run.h" #include "core/arm/dyncom/arm_dyncom_trans.h" - +#include "core/arm/skyeye_common/armstate.h" +#include "core/arm/skyeye_common/armsupp.h" +#include "core/arm/skyeye_common/vfp/vfp.h" #include "core/core.h" #include "core/core_timing.h" diff --git a/src/core/arm/dyncom/arm_dyncom.h b/src/core/arm/dyncom/arm_dyncom.h index 70f71a828..65db1f0f9 100644 --- a/src/core/arm/dyncom/arm_dyncom.h +++ b/src/core/arm/dyncom/arm_dyncom.h @@ -5,9 +5,7 @@ #pragma once #include - #include "common/common_types.h" - #include "core/arm/arm_interface.h" #include "core/arm/skyeye_common/arm_regformat.h" #include "core/arm/skyeye_common/armstate.h" diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index 211d49edb..4f83d8332 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp @@ -4,27 +4,24 @@ #define CITRA_IGNORE_EXIT(x) +#include "core/arm/dyncom/arm_dyncom_interpreter.h" #include #include - #include "common/common_types.h" #include "common/logging/log.h" #include "common/microprofile.h" - #include "core/arm/disassembler/arm_disasm.h" #include "core/arm/dyncom/arm_dyncom_dec.h" -#include "core/arm/dyncom/arm_dyncom_interpreter.h" #include "core/arm/dyncom/arm_dyncom_run.h" #include "core/arm/dyncom/arm_dyncom_thumb.h" #include "core/arm/dyncom/arm_dyncom_trans.h" #include "core/arm/skyeye_common/armstate.h" #include "core/arm/skyeye_common/armsupp.h" #include "core/arm/skyeye_common/vfp/vfp.h" +#include "core/gdbstub/gdbstub.h" #include "core/hle/svc.h" #include "core/memory.h" -#include "core/gdbstub/gdbstub.h" - #define RM BITS(sht_oper, 0, 3) #define RS BITS(sht_oper, 8, 11) diff --git a/src/core/arm/dyncom/arm_dyncom_trans.cpp b/src/core/arm/dyncom/arm_dyncom_trans.cpp index 526cf28f3..5f3644c28 100644 --- a/src/core/arm/dyncom/arm_dyncom_trans.cpp +++ b/src/core/arm/dyncom/arm_dyncom_trans.cpp @@ -1,10 +1,8 @@ +#include "core/arm/dyncom/arm_dyncom_trans.h" #include - #include "common/assert.h" #include "common/common_types.h" - #include "core/arm/dyncom/arm_dyncom_interpreter.h" -#include "core/arm/dyncom/arm_dyncom_trans.h" #include "core/arm/skyeye_common/armstate.h" #include "core/arm/skyeye_common/armsupp.h" #include "core/arm/skyeye_common/vfp/vfp.h" diff --git a/src/core/arm/dyncom/arm_dyncom_trans.h b/src/core/arm/dyncom/arm_dyncom_trans.h index 6fdb3d248..b1ec90662 100644 --- a/src/core/arm/dyncom/arm_dyncom_trans.h +++ b/src/core/arm/dyncom/arm_dyncom_trans.h @@ -1,3 +1,6 @@ +#include +#include "common/common_types.h" + struct ARMul_State; typedef unsigned int (*shtop_fp_t)(ARMul_State* cpu, unsigned int sht_oper); diff --git a/src/core/arm/skyeye_common/armstate.h b/src/core/arm/skyeye_common/armstate.h index f31fb207c..1a707ff7e 100644 --- a/src/core/arm/skyeye_common/armstate.h +++ b/src/core/arm/skyeye_common/armstate.h @@ -19,7 +19,6 @@ #include #include - #include "common/common_types.h" #include "core/arm/skyeye_common/arm_regformat.h" diff --git a/src/core/arm/skyeye_common/armsupp.cpp b/src/core/arm/skyeye_common/armsupp.cpp index e70be29a7..b76942e47 100644 --- a/src/core/arm/skyeye_common/armsupp.cpp +++ b/src/core/arm/skyeye_common/armsupp.cpp @@ -15,11 +15,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "core/arm/skyeye_common/armsupp.h" #include "common/logging/log.h" - #include "core/arm/skyeye_common/arm_regformat.h" #include "core/arm/skyeye_common/armstate.h" -#include "core/arm/skyeye_common/armsupp.h" // Unsigned sum of absolute difference u8 ARMul_UnsignedAbsoluteDifference(u8 left, u8 right) { diff --git a/src/core/arm/skyeye_common/vfp/vfp.cpp b/src/core/arm/skyeye_common/vfp/vfp.cpp index 859937645..8ac1fb95e 100644 --- a/src/core/arm/skyeye_common/vfp/vfp.cpp +++ b/src/core/arm/skyeye_common/vfp/vfp.cpp @@ -20,13 +20,12 @@ /* Note: this file handles interface with arm core and vfp registers */ +#include "core/arm/skyeye_common/vfp/vfp.h" #include "common/common_funcs.h" #include "common/common_types.h" #include "common/logging/log.h" - #include "core/arm/skyeye_common/armstate.h" #include "core/arm/skyeye_common/vfp/asm_vfp.h" -#include "core/arm/skyeye_common/vfp/vfp.h" void VFPInit(ARMul_State* state) { state->VFP[VFP_FPSID] = VFP_FPSID_IMPLMEN << 24 | VFP_FPSID_SW << 23 | VFP_FPSID_SUBARCH << 16 | diff --git a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp index 2886f351f..4d89743e7 100644 --- a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp @@ -51,10 +51,10 @@ * =========================================================================== */ +#include "core/arm/skyeye_common/vfp/vfp.h" #include #include "common/logging/log.h" #include "core/arm/skyeye_common/vfp/asm_vfp.h" -#include "core/arm/skyeye_common/vfp/vfp.h" #include "core/arm/skyeye_common/vfp/vfp_helper.h" static struct vfp_double vfp_double_default_qnan = { diff --git a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp index bf157e2c3..35f9d84d5 100644 --- a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp @@ -51,15 +51,13 @@ * =========================================================================== */ +#include "core/arm/skyeye_common/vfp/vfp.h" #include #include - #include "common/common_funcs.h" #include "common/common_types.h" #include "common/logging/log.h" - #include "core/arm/skyeye_common/vfp/asm_vfp.h" -#include "core/arm/skyeye_common/vfp/vfp.h" #include "core/arm/skyeye_common/vfp/vfp_helper.h" static struct vfp_single vfp_single_default_qnan = { diff --git a/src/core/core.cpp b/src/core/core.cpp index 71a13dd33..346b6a0ae 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -2,14 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/core.h" #include - #include "common/logging/log.h" - #include "core/arm/arm_interface.h" #include "core/arm/dynarmic/arm_dynarmic.h" #include "core/arm/dyncom/arm_dyncom.h" -#include "core/core.h" #include "core/core_timing.h" #include "core/gdbstub/gdbstub.h" #include "core/hle/hle.h" diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index fb88ecaf2..4f38403e3 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -2,17 +2,15 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/core.h" #include #include #include #include - #include "common/chunk_file.h" #include "common/logging/log.h" #include "common/string_util.h" - #include "core/arm/arm_interface.h" -#include "core/core.h" #include "core/core_timing.h" int g_clock_rate_arm11 = 268123480; diff --git a/src/core/core_timing.h b/src/core/core_timing.h index 64fd8dcd0..b72a1b500 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h @@ -4,7 +4,9 @@ #pragma once +#include #include +#include "common/common_types.h" // This is a system to schedule events into the emulated machine's future. Time is measured // in main CPU clock cycles. @@ -19,10 +21,6 @@ // inside callback: // ScheduleEvent(periodInCycles - cycles_late, callback, "whatever") -#include - -#include "common/common_types.h" - extern int g_clock_rate_arm11; inline s64 msToCycles(int ms) { diff --git a/src/core/file_sys/archive_backend.cpp b/src/core/file_sys/archive_backend.cpp index 6ea920ec1..5c02fb748 100644 --- a/src/core/file_sys/archive_backend.cpp +++ b/src/core/file_sys/archive_backend.cpp @@ -2,14 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/file_sys/archive_backend.h" #include #include #include - #include "common/logging/log.h" #include "common/string_util.h" - -#include "core/file_sys/archive_backend.h" #include "core/memory.h" namespace FileSys { diff --git a/src/core/file_sys/archive_backend.h b/src/core/file_sys/archive_backend.h index 7f64fe4e2..d69c3c785 100644 --- a/src/core/file_sys/archive_backend.h +++ b/src/core/file_sys/archive_backend.h @@ -8,11 +8,9 @@ #include #include #include - #include "common/bit_field.h" #include "common/common_types.h" #include "common/swap.h" - #include "core/hle/result.h" namespace FileSys { diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp index 6b4af28bf..ed9fecd64 100644 --- a/src/core/file_sys/archive_extsavedata.cpp +++ b/src/core/file_sys/archive_extsavedata.cpp @@ -2,16 +2,14 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/file_sys/archive_extsavedata.h" #include #include #include - #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" #include "common/string_util.h" - -#include "core/file_sys/archive_extsavedata.h" #include "core/file_sys/disk_archive.h" #include "core/hle/service/fs/archive.h" diff --git a/src/core/file_sys/archive_extsavedata.h b/src/core/file_sys/archive_extsavedata.h index 2b942817e..6a3431e94 100644 --- a/src/core/file_sys/archive_extsavedata.h +++ b/src/core/file_sys/archive_extsavedata.h @@ -6,9 +6,7 @@ #include #include - #include "common/common_types.h" - #include "core/file_sys/archive_backend.h" #include "core/hle/result.h" diff --git a/src/core/file_sys/archive_romfs.cpp b/src/core/file_sys/archive_romfs.cpp index 87455eb95..7c0e1da21 100644 --- a/src/core/file_sys/archive_romfs.cpp +++ b/src/core/file_sys/archive_romfs.cpp @@ -2,13 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/file_sys/archive_romfs.h" #include #include - #include "common/common_types.h" #include "common/logging/log.h" - -#include "core/file_sys/archive_romfs.h" #include "core/file_sys/ivfc_archive.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/file_sys/archive_romfs.h b/src/core/file_sys/archive_romfs.h index 3c68a6b1c..8a8082a05 100644 --- a/src/core/file_sys/archive_romfs.h +++ b/src/core/file_sys/archive_romfs.h @@ -7,9 +7,7 @@ #include #include #include - #include "common/common_types.h" - #include "core/file_sys/archive_backend.h" #include "core/hle/result.h" #include "core/loader/loader.h" diff --git a/src/core/file_sys/archive_savedata.cpp b/src/core/file_sys/archive_savedata.cpp index 860f2fca8..829f97743 100644 --- a/src/core/file_sys/archive_savedata.cpp +++ b/src/core/file_sys/archive_savedata.cpp @@ -2,15 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/file_sys/archive_savedata.h" #include #include - #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" #include "common/string_util.h" - -#include "core/file_sys/archive_savedata.h" #include "core/file_sys/disk_archive.h" #include "core/hle/kernel/process.h" #include "core/hle/service/fs/archive.h" diff --git a/src/core/file_sys/archive_savedata.h b/src/core/file_sys/archive_savedata.h index 4ac324985..6a372865a 100644 --- a/src/core/file_sys/archive_savedata.h +++ b/src/core/file_sys/archive_savedata.h @@ -6,7 +6,6 @@ #include #include - #include "core/file_sys/archive_backend.h" #include "core/hle/result.h" diff --git a/src/core/file_sys/archive_savedatacheck.cpp b/src/core/file_sys/archive_savedatacheck.cpp index 50fe004fe..8bdf24b1f 100644 --- a/src/core/file_sys/archive_savedatacheck.cpp +++ b/src/core/file_sys/archive_savedatacheck.cpp @@ -2,16 +2,14 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/file_sys/archive_savedatacheck.h" #include #include #include - #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" #include "common/string_util.h" - -#include "core/file_sys/archive_savedatacheck.h" #include "core/file_sys/ivfc_archive.h" #include "core/hle/service/fs/archive.h" diff --git a/src/core/file_sys/archive_savedatacheck.h b/src/core/file_sys/archive_savedatacheck.h index 4a4259260..e9cafbed9 100644 --- a/src/core/file_sys/archive_savedatacheck.h +++ b/src/core/file_sys/archive_savedatacheck.h @@ -6,7 +6,6 @@ #include #include - #include "core/file_sys/archive_backend.h" #include "core/hle/result.h" diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp index c1a28df6c..887cfbb0f 100644 --- a/src/core/file_sys/archive_sdmc.cpp +++ b/src/core/file_sys/archive_sdmc.cpp @@ -2,13 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/file_sys/archive_sdmc.h" #include #include - #include "common/file_util.h" #include "common/logging/log.h" - -#include "core/file_sys/archive_sdmc.h" #include "core/file_sys/disk_archive.h" #include "core/settings.h" diff --git a/src/core/file_sys/archive_sdmc.h b/src/core/file_sys/archive_sdmc.h index 2523c3979..88e855351 100644 --- a/src/core/file_sys/archive_sdmc.h +++ b/src/core/file_sys/archive_sdmc.h @@ -6,7 +6,6 @@ #include #include - #include "core/file_sys/archive_backend.h" #include "core/hle/result.h" diff --git a/src/core/file_sys/archive_systemsavedata.cpp b/src/core/file_sys/archive_systemsavedata.cpp index 0261ab547..b3dfcf897 100644 --- a/src/core/file_sys/archive_systemsavedata.cpp +++ b/src/core/file_sys/archive_systemsavedata.cpp @@ -2,15 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/file_sys/archive_systemsavedata.h" #include #include #include - #include "common/common_types.h" #include "common/file_util.h" #include "common/string_util.h" - -#include "core/file_sys/archive_systemsavedata.h" #include "core/file_sys/disk_archive.h" #include "core/hle/service/fs/archive.h" diff --git a/src/core/file_sys/archive_systemsavedata.h b/src/core/file_sys/archive_systemsavedata.h index 61a002a7d..a24b89f2b 100644 --- a/src/core/file_sys/archive_systemsavedata.h +++ b/src/core/file_sys/archive_systemsavedata.h @@ -6,9 +6,7 @@ #include #include - #include "common/common_types.h" - #include "core/file_sys/archive_backend.h" #include "core/hle/result.h" diff --git a/src/core/file_sys/directory_backend.h b/src/core/file_sys/directory_backend.h index 9706e909b..b55e382ef 100644 --- a/src/core/file_sys/directory_backend.h +++ b/src/core/file_sys/directory_backend.h @@ -6,7 +6,6 @@ #include #include - #include "common/common_types.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp index c084303c1..7e88473bd 100644 --- a/src/core/file_sys/disk_archive.cpp +++ b/src/core/file_sys/disk_archive.cpp @@ -2,16 +2,14 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/file_sys/disk_archive.h" #include #include #include - #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" -#include "core/file_sys/disk_archive.h" - //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/disk_archive.h b/src/core/file_sys/disk_archive.h index 64e36f5ea..2165f27f9 100644 --- a/src/core/file_sys/disk_archive.h +++ b/src/core/file_sys/disk_archive.h @@ -8,10 +8,8 @@ #include #include #include - #include "common/common_types.h" #include "common/file_util.h" - #include "core/file_sys/archive_backend.h" #include "core/file_sys/directory_backend.h" #include "core/file_sys/file_backend.h" diff --git a/src/core/file_sys/file_backend.h b/src/core/file_sys/file_backend.h index 3496facd4..ed997537f 100644 --- a/src/core/file_sys/file_backend.h +++ b/src/core/file_sys/file_backend.h @@ -5,7 +5,6 @@ #pragma once #include - #include "common/common_types.h" #include "core/hle/result.h" diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp index 235a962e9..5add3254b 100644 --- a/src/core/file_sys/ivfc_archive.cpp +++ b/src/core/file_sys/ivfc_archive.cpp @@ -2,14 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/file_sys/ivfc_archive.h" #include #include - #include "common/common_types.h" #include "common/logging/log.h" -#include "core/file_sys/ivfc_archive.h" - //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/ivfc_archive.h b/src/core/file_sys/ivfc_archive.h index 0d15550da..0df6cf83a 100644 --- a/src/core/file_sys/ivfc_archive.h +++ b/src/core/file_sys/ivfc_archive.h @@ -8,10 +8,8 @@ #include #include #include - #include "common/common_types.h" #include "common/file_util.h" - #include "core/file_sys/archive_backend.h" #include "core/file_sys/directory_backend.h" #include "core/file_sys/file_backend.h" diff --git a/src/core/gdbstub/gdbstub.h b/src/core/gdbstub/gdbstub.h index fddc27a3e..a7483bb10 100644 --- a/src/core/gdbstub/gdbstub.h +++ b/src/core/gdbstub/gdbstub.h @@ -6,7 +6,6 @@ #pragma once #include - #include "common/common_types.h" namespace GDBStub { diff --git a/src/core/hle/applets/applet.cpp b/src/core/hle/applets/applet.cpp index 2b4bd939d..35e683cb3 100644 --- a/src/core/hle/applets/applet.cpp +++ b/src/core/hle/applets/applet.cpp @@ -2,16 +2,14 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/applets/applet.h" #include #include #include #include - #include "common/assert.h" #include "common/common_types.h" - #include "core/core_timing.h" -#include "core/hle/applets/applet.h" #include "core/hle/applets/erreula.h" #include "core/hle/applets/mii_selector.h" #include "core/hle/applets/swkbd.h" diff --git a/src/core/hle/applets/applet.h b/src/core/hle/applets/applet.h index 1850ad261..bfdcad126 100644 --- a/src/core/hle/applets/applet.h +++ b/src/core/hle/applets/applet.h @@ -5,7 +5,6 @@ #pragma once #include - #include "core/hle/result.h" #include "core/hle/service/apt/apt.h" diff --git a/src/core/hle/applets/erreula.cpp b/src/core/hle/applets/erreula.cpp index 457cbb1bd..9ad77994c 100644 --- a/src/core/hle/applets/erreula.cpp +++ b/src/core/hle/applets/erreula.cpp @@ -2,9 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/string_util.h" - #include "core/hle/applets/erreula.h" +#include "common/string_util.h" #include "core/hle/service/apt/apt.h" namespace HLE { diff --git a/src/core/hle/applets/mii_selector.cpp b/src/core/hle/applets/mii_selector.cpp index 79264d349..53d5b4ab4 100644 --- a/src/core/hle/applets/mii_selector.cpp +++ b/src/core/hle/applets/mii_selector.cpp @@ -2,18 +2,15 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/applets/mii_selector.h" #include #include - #include "common/assert.h" #include "common/logging/log.h" #include "common/string_util.h" - -#include "core/hle/applets/mii_selector.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/shared_memory.h" #include "core/hle/result.h" - #include "video_core/video_core.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/applets/mii_selector.h b/src/core/hle/applets/mii_selector.h index 26966a271..e3ab9f0cd 100644 --- a/src/core/hle/applets/mii_selector.h +++ b/src/core/hle/applets/mii_selector.h @@ -6,7 +6,6 @@ #include "common/common_funcs.h" #include "common/common_types.h" - #include "core/hle/applets/applet.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/shared_memory.h" diff --git a/src/core/hle/applets/swkbd.cpp b/src/core/hle/applets/swkbd.cpp index cf2775968..b26107332 100644 --- a/src/core/hle/applets/swkbd.cpp +++ b/src/core/hle/applets/swkbd.cpp @@ -2,21 +2,18 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/applets/swkbd.h" #include #include - #include "common/assert.h" #include "common/logging/log.h" #include "common/string_util.h" - -#include "core/hle/applets/swkbd.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/shared_memory.h" #include "core/hle/result.h" #include "core/hle/service/gsp_gpu.h" #include "core/hle/service/hid/hid.h" #include "core/memory.h" - #include "video_core/video_core.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/applets/swkbd.h b/src/core/hle/applets/swkbd.h index 4e2f9de62..ea0b1fba9 100644 --- a/src/core/hle/applets/swkbd.h +++ b/src/core/hle/applets/swkbd.h @@ -6,7 +6,6 @@ #include "common/common_funcs.h" #include "common/common_types.h" - #include "core/hle/applets/applet.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/shared_memory.h" diff --git a/src/core/hle/config_mem.h b/src/core/hle/config_mem.h index 50664dac6..42fa6d789 100644 --- a/src/core/hle/config_mem.h +++ b/src/core/hle/config_mem.h @@ -12,7 +12,6 @@ #include "common/common_funcs.h" #include "common/common_types.h" #include "common/swap.h" - #include "core/memory.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/function_wrappers.h b/src/core/hle/function_wrappers.h index d5d989c29..8ce0f6d2b 100644 --- a/src/core/hle/function_wrappers.h +++ b/src/core/hle/function_wrappers.h @@ -5,8 +5,8 @@ #pragma once #include "common/common_types.h" - #include "core/arm/arm_interface.h" +#include "core/core.h" #include "core/hle/hle.h" #include "core/hle/result.h" #include "core/hle/svc.h" diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp index 480a73e80..5749068d6 100644 --- a/src/core/hle/hle.cpp +++ b/src/core/hle/hle.cpp @@ -2,12 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/hle.h" #include "common/assert.h" #include "common/logging/log.h" - #include "core/arm/arm_interface.h" #include "core/core.h" -#include "core/hle/hle.h" #include "core/hle/service/service.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index 3506c2d48..bcb4ee46f 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp @@ -2,14 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/kernel/address_arbiter.h" #include "common/common_types.h" #include "common/logging/log.h" - -#include "core/memory.h" - #include "core/hle/hle.h" -#include "core/hle/kernel/address_arbiter.h" #include "core/hle/kernel/thread.h" +#include "core/memory.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Kernel namespace diff --git a/src/core/hle/kernel/address_arbiter.h b/src/core/hle/kernel/address_arbiter.h index 1a03993b2..6a7af93a9 100644 --- a/src/core/hle/kernel/address_arbiter.h +++ b/src/core/hle/kernel/address_arbiter.h @@ -5,7 +5,6 @@ #pragma once #include "common/common_types.h" - #include "core/hle/kernel/kernel.h" // Address arbiters are an underlying kernel synchronization object that can be created/used via diff --git a/src/core/hle/kernel/client_port.cpp b/src/core/hle/kernel/client_port.cpp index 444ce8d45..eed333995 100644 --- a/src/core/hle/kernel/client_port.cpp +++ b/src/core/hle/kernel/client_port.cpp @@ -2,9 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/assert.h" - #include "core/hle/kernel/client_port.h" +#include "common/assert.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/server_port.h" diff --git a/src/core/hle/kernel/client_port.h b/src/core/hle/kernel/client_port.h index 70e0d56cc..d28147718 100644 --- a/src/core/hle/kernel/client_port.h +++ b/src/core/hle/kernel/client_port.h @@ -5,9 +5,7 @@ #pragma once #include - #include "common/common_types.h" - #include "core/hle/kernel/kernel.h" namespace Kernel { diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index f056eb7c3..cf8e6fa17 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp @@ -2,13 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/kernel/event.h" #include #include #include - #include "common/assert.h" - -#include "core/hle/kernel/event.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/thread.h" diff --git a/src/core/hle/kernel/event.h b/src/core/hle/kernel/event.h index e333a46ce..6fe74065d 100644 --- a/src/core/hle/kernel/event.h +++ b/src/core/hle/kernel/event.h @@ -5,7 +5,6 @@ #pragma once #include "common/common_types.h" - #include "core/hle/kernel/kernel.h" namespace Kernel { diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 1fd7c0326..49bf95618 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -2,13 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/kernel/kernel.h" #include - #include "common/assert.h" #include "common/logging/log.h" - #include "core/hle/config_mem.h" -#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/memory.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/resource_limit.h" diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index c683fcb80..0e95f7ff0 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -4,16 +4,13 @@ #pragma once -#include - #include #include #include #include #include - +#include #include "common/common_types.h" - #include "core/hle/hle.h" #include "core/hle/result.h" diff --git a/src/core/hle/kernel/memory.cpp b/src/core/hle/kernel/memory.cpp index 89a72808a..d13bc74c6 100644 --- a/src/core/hle/kernel/memory.cpp +++ b/src/core/hle/kernel/memory.cpp @@ -2,18 +2,15 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/kernel/memory.h" #include #include #include #include - #include "audio_core/audio_core.h" - #include "common/common_types.h" #include "common/logging/log.h" - #include "core/hle/config_mem.h" -#include "core/hle/kernel/memory.h" #include "core/hle/kernel/vm_manager.h" #include "core/hle/result.h" #include "core/hle/shared_page.h" diff --git a/src/core/hle/kernel/memory.h b/src/core/hle/kernel/memory.h index b941c24b6..4e1856a41 100644 --- a/src/core/hle/kernel/memory.h +++ b/src/core/hle/kernel/memory.h @@ -5,9 +5,7 @@ #pragma once #include - #include "common/common_types.h" - #include "core/hle/kernel/process.h" namespace Kernel { diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index edb97d324..4cd237b44 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp @@ -2,15 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/kernel/mutex.h" #include #include - #include - #include "common/assert.h" - #include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/mutex.h" #include "core/hle/kernel/thread.h" namespace Kernel { diff --git a/src/core/hle/kernel/mutex.h b/src/core/hle/kernel/mutex.h index cf6a51fdf..53c3dc1f1 100644 --- a/src/core/hle/kernel/mutex.h +++ b/src/core/hle/kernel/mutex.h @@ -5,9 +5,7 @@ #pragma once #include - #include "common/common_types.h" - #include "core/hle/kernel/kernel.h" namespace Kernel { diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index b764f750f..a94d74263 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -2,14 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/kernel/process.h" #include - #include "common/assert.h" #include "common/common_funcs.h" #include "common/logging/log.h" - #include "core/hle/kernel/memory.h" -#include "core/hle/kernel/process.h" #include "core/hle/kernel/resource_limit.h" #include "core/hle/kernel/thread.h" #include "core/hle/kernel/vm_manager.h" diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 070b2b558..b566950b0 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h @@ -8,12 +8,9 @@ #include #include #include - #include - #include "common/bit_field.h" #include "common/common_types.h" - #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/vm_manager.h" diff --git a/src/core/hle/kernel/resource_limit.cpp b/src/core/hle/kernel/resource_limit.cpp index bb0baed6f..64c91cc62 100644 --- a/src/core/hle/kernel/resource_limit.cpp +++ b/src/core/hle/kernel/resource_limit.cpp @@ -2,12 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/kernel/resource_limit.h" #include - #include "common/logging/log.h" -#include "core/hle/kernel/resource_limit.h" - namespace Kernel { static SharedPtr resource_limits[4]; diff --git a/src/core/hle/kernel/resource_limit.h b/src/core/hle/kernel/resource_limit.h index 5d8b31a2d..6cdfbcf8d 100644 --- a/src/core/hle/kernel/resource_limit.h +++ b/src/core/hle/kernel/resource_limit.h @@ -5,7 +5,6 @@ #pragma once #include "common/common_types.h" - #include "core/hle/kernel/kernel.h" namespace Kernel { diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp index 16ac22f1d..2a9ced5b9 100644 --- a/src/core/hle/kernel/semaphore.cpp +++ b/src/core/hle/kernel/semaphore.cpp @@ -2,10 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/kernel/semaphore.h" #include "common/assert.h" - #include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/semaphore.h" #include "core/hle/kernel/thread.h" namespace Kernel { diff --git a/src/core/hle/kernel/semaphore.h b/src/core/hle/kernel/semaphore.h index ed7d9a85c..e01908a25 100644 --- a/src/core/hle/kernel/semaphore.h +++ b/src/core/hle/kernel/semaphore.h @@ -6,9 +6,7 @@ #include #include - #include "common/common_types.h" - #include "core/hle/kernel/kernel.h" namespace Kernel { diff --git a/src/core/hle/kernel/server_port.cpp b/src/core/hle/kernel/server_port.cpp index 57e93cad4..12a709cee 100644 --- a/src/core/hle/kernel/server_port.cpp +++ b/src/core/hle/kernel/server_port.cpp @@ -2,13 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/kernel/server_port.h" #include - #include "common/assert.h" - #include "core/hle/kernel/client_port.h" #include "core/hle/kernel/kernel.h" -#include "core/hle/kernel/server_port.h" #include "core/hle/kernel/thread.h" namespace Kernel { diff --git a/src/core/hle/kernel/server_port.h b/src/core/hle/kernel/server_port.h index c3f2ae177..fa9448ca0 100644 --- a/src/core/hle/kernel/server_port.h +++ b/src/core/hle/kernel/server_port.h @@ -6,9 +6,7 @@ #include #include - #include "common/common_types.h" - #include "core/hle/kernel/kernel.h" namespace Kernel { diff --git a/src/core/hle/kernel/session.h b/src/core/hle/kernel/session.h index 8e4e010b8..ec025f732 100644 --- a/src/core/hle/kernel/session.h +++ b/src/core/hle/kernel/session.h @@ -5,10 +5,8 @@ #pragma once #include - #include "common/assert.h" #include "common/common_types.h" - #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/thread.h" #include "core/hle/result.h" diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index bf511a338..8ab916e5b 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp @@ -2,12 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/kernel/shared_memory.h" #include - #include "common/logging/log.h" - #include "core/hle/kernel/memory.h" -#include "core/hle/kernel/shared_memory.h" #include "core/memory.h" namespace Kernel { diff --git a/src/core/hle/kernel/shared_memory.h b/src/core/hle/kernel/shared_memory.h index afb142380..94b335ed1 100644 --- a/src/core/hle/kernel/shared_memory.h +++ b/src/core/hle/kernel/shared_memory.h @@ -5,9 +5,7 @@ #pragma once #include - #include "common/common_types.h" - #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/process.h" #include "core/hle/result.h" diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 0df03c9d5..0185c3ae3 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -2,16 +2,15 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/kernel/thread.h" #include #include #include - #include "common/assert.h" #include "common/common_types.h" #include "common/logging/log.h" #include "common/math_util.h" #include "common/thread_queue_list.h" - #include "core/arm/arm_interface.h" #include "core/arm/skyeye_common/armstate.h" #include "core/core.h" @@ -21,7 +20,6 @@ #include "core/hle/kernel/memory.h" #include "core/hle/kernel/mutex.h" #include "core/hle/kernel/process.h" -#include "core/hle/kernel/thread.h" #include "core/hle/result.h" #include "core/memory.h" diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index 2ed5cf74e..f63131716 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h @@ -6,13 +6,9 @@ #include #include - #include - #include "common/common_types.h" - #include "core/core.h" - #include "core/hle/hle.h" #include "core/hle/kernel/kernel.h" #include "core/hle/result.h" diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index 427a81923..7432f3567 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp @@ -2,15 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/kernel/timer.h" #include - #include "common/assert.h" #include "common/logging/log.h" - #include "core/core_timing.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/thread.h" -#include "core/hle/kernel/timer.h" namespace Kernel { diff --git a/src/core/hle/kernel/timer.h b/src/core/hle/kernel/timer.h index 97cd0d63c..59a77aad3 100644 --- a/src/core/hle/kernel/timer.h +++ b/src/core/hle/kernel/timer.h @@ -5,7 +5,6 @@ #pragma once #include "common/common_types.h" - #include "core/hle/kernel/event.h" #include "core/hle/kernel/kernel.h" diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index 4ad86cf48..488898641 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -2,11 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/kernel/vm_manager.h" #include - #include "common/assert.h" - -#include "core/hle/kernel/vm_manager.h" #include "core/memory.h" #include "core/memory_setup.h" #include "core/mmio.h" diff --git a/src/core/hle/kernel/vm_manager.h b/src/core/hle/kernel/vm_manager.h index fbcd9870f..9055664b2 100644 --- a/src/core/hle/kernel/vm_manager.h +++ b/src/core/hle/kernel/vm_manager.h @@ -7,9 +7,7 @@ #include #include #include - #include "common/common_types.h" - #include "core/hle/result.h" #include "core/mmio.h" diff --git a/src/core/hle/result.h b/src/core/hle/result.h index 492c1ffa6..7f8d8e00d 100644 --- a/src/core/hle/result.h +++ b/src/core/hle/result.h @@ -6,7 +6,6 @@ #include #include - #include "common/assert.h" #include "common/bit_field.h" #include "common/common_funcs.h" diff --git a/src/core/hle/service/ac_u.cpp b/src/core/hle/service/ac_u.cpp index 887b57529..0b61bfae8 100644 --- a/src/core/hle/service/ac_u.cpp +++ b/src/core/hle/service/ac_u.cpp @@ -2,10 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/ac_u.h" #include "common/logging/log.h" - #include "core/hle/kernel/event.h" -#include "core/hle/service/ac_u.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace AC_U diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index 528bb1848..e9adfaa1b 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -2,11 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/am/am.h" #include - #include "common/logging/log.h" - -#include "core/hle/service/am/am.h" #include "core/hle/service/am/am_app.h" #include "core/hle/service/am/am_net.h" #include "core/hle/service/am/am_sys.h" diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index dfc1e9c08..6240286bb 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -2,12 +2,15 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/apt/apt.h" #include "common/common_paths.h" #include "common/file_util.h" #include "common/logging/log.h" - #include "core/hle/applets/applet.h" -#include "core/hle/service/apt/apt.h" +#include "core/hle/kernel/event.h" +#include "core/hle/kernel/mutex.h" +#include "core/hle/kernel/process.h" +#include "core/hle/kernel/shared_memory.h" #include "core/hle/service/apt/apt_a.h" #include "core/hle/service/apt/apt_s.h" #include "core/hle/service/apt/apt_u.h" @@ -16,11 +19,6 @@ #include "core/hle/service/ptm/ptm.h" #include "core/hle/service/service.h" -#include "core/hle/kernel/event.h" -#include "core/hle/kernel/mutex.h" -#include "core/hle/kernel/process.h" -#include "core/hle/kernel/shared_memory.h" - namespace Service { namespace APT { diff --git a/src/core/hle/service/apt/apt.h b/src/core/hle/service/apt/apt.h index 7597b0d3e..a118cda1f 100644 --- a/src/core/hle/service/apt/apt.h +++ b/src/core/hle/service/apt/apt.h @@ -6,7 +6,6 @@ #include "common/common_types.h" #include "common/swap.h" - #include "core/hle/kernel/kernel.h" namespace Service { diff --git a/src/core/hle/service/apt/bcfnt/bcfnt.h b/src/core/hle/service/apt/bcfnt/bcfnt.h index 8936dcf63..453bf7606 100644 --- a/src/core/hle/service/apt/bcfnt/bcfnt.h +++ b/src/core/hle/service/apt/bcfnt/bcfnt.h @@ -5,7 +5,6 @@ #pragma once #include "common/swap.h" - #include "core/hle/kernel/shared_memory.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/cam/cam.cpp b/src/core/hle/service/cam/cam.cpp index ec1f9c749..be2e42963 100644 --- a/src/core/hle/service/cam/cam.cpp +++ b/src/core/hle/service/cam/cam.cpp @@ -2,10 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/cam/cam.h" #include "common/logging/log.h" - #include "core/hle/kernel/event.h" -#include "core/hle/service/cam/cam.h" #include "core/hle/service/cam/cam_c.h" #include "core/hle/service/cam/cam_q.h" #include "core/hle/service/cam/cam_s.h" diff --git a/src/core/hle/service/cam/cam.h b/src/core/hle/service/cam/cam.h index ec9b835f1..c9b6f8acf 100644 --- a/src/core/hle/service/cam/cam.h +++ b/src/core/hle/service/cam/cam.h @@ -7,7 +7,6 @@ #include "common/common_funcs.h" #include "common/common_types.h" #include "common/swap.h" - #include "core/hle/kernel/kernel.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/cecd/cecd.cpp b/src/core/hle/service/cecd/cecd.cpp index 65a1d850b..4d8916bdf 100644 --- a/src/core/hle/service/cecd/cecd.cpp +++ b/src/core/hle/service/cecd/cecd.cpp @@ -2,10 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/cecd/cecd.h" #include "common/logging/log.h" - #include "core/hle/kernel/event.h" -#include "core/hle/service/cecd/cecd.h" #include "core/hle/service/cecd/cecd_s.h" #include "core/hle/service/cecd/cecd_u.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index aff033bde..1f706751f 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp @@ -2,17 +2,15 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/cfg/cfg.h" #include - #include "common/file_util.h" #include "common/logging/log.h" #include "common/string_util.h" #include "common/swap.h" - #include "core/file_sys/archive_systemsavedata.h" #include "core/file_sys/file_backend.h" #include "core/hle/result.h" -#include "core/hle/service/cfg/cfg.h" #include "core/hle/service/cfg/cfg_i.h" #include "core/hle/service/cfg/cfg_s.h" #include "core/hle/service/cfg/cfg_u.h" diff --git a/src/core/hle/service/cfg/cfg.h b/src/core/hle/service/cfg/cfg.h index c7c2ab41d..fb47c2aa5 100644 --- a/src/core/hle/service/cfg/cfg.h +++ b/src/core/hle/service/cfg/cfg.h @@ -6,7 +6,6 @@ #include #include - #include "common/common_types.h" union ResultCode; diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp index 70e92c30c..3f2f09f60 100644 --- a/src/core/hle/service/dsp_dsp.cpp +++ b/src/core/hle/service/dsp_dsp.cpp @@ -2,16 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/dsp_dsp.h" #include #include - #include "audio_core/hle/pipe.h" - #include "common/hash.h" #include "common/logging/log.h" - #include "core/hle/kernel/event.h" -#include "core/hle/service/dsp_dsp.h" using DspPipe = DSP::HLE::DspPipe; diff --git a/src/core/hle/service/dsp_dsp.h b/src/core/hle/service/dsp_dsp.h index 22f6687cc..3e97da6eb 100644 --- a/src/core/hle/service/dsp_dsp.h +++ b/src/core/hle/service/dsp_dsp.h @@ -5,7 +5,6 @@ #pragma once #include - #include "core/hle/service/service.h" namespace DSP { diff --git a/src/core/hle/service/err_f.cpp b/src/core/hle/service/err_f.cpp index a23f5896d..ff606d883 100644 --- a/src/core/hle/service/err_f.cpp +++ b/src/core/hle/service/err_f.cpp @@ -2,12 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/err_f.h" #include "common/bit_field.h" #include "common/common_types.h" #include "common/logging/log.h" -#include "core/hle/service/err_f.h" - //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace ERR_F diff --git a/src/core/hle/service/frd/frd.cpp b/src/core/hle/service/frd/frd.cpp index 050665b48..bd89b522b 100644 --- a/src/core/hle/service/frd/frd.cpp +++ b/src/core/hle/service/frd/frd.cpp @@ -2,9 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/string_util.h" - #include "core/hle/service/frd/frd.h" +#include "common/string_util.h" #include "core/hle/service/frd/frd_a.h" #include "core/hle/service/frd/frd_u.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index 77fe5ab6c..b945b255e 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -2,20 +2,18 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/fs/archive.h" #include #include #include #include #include #include - #include - #include "common/assert.h" #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" - #include "core/file_sys/archive_backend.h" #include "core/file_sys/archive_extsavedata.h" #include "core/file_sys/archive_savedata.h" @@ -26,7 +24,6 @@ #include "core/file_sys/file_backend.h" #include "core/hle/hle.h" #include "core/hle/result.h" -#include "core/hle/service/fs/archive.h" #include "core/hle/service/fs/fs_user.h" #include "core/hle/service/service.h" #include "core/memory.h" diff --git a/src/core/hle/service/fs/archive.h b/src/core/hle/service/fs/archive.h index aad540ff9..533be34a4 100644 --- a/src/core/hle/service/fs/archive.h +++ b/src/core/hle/service/fs/archive.h @@ -6,9 +6,7 @@ #include #include - #include "common/common_types.h" - #include "core/file_sys/archive_backend.h" #include "core/hle/kernel/session.h" #include "core/hle/result.h" diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index 605832214..92578270b 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp @@ -2,16 +2,15 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/fs/fs_user.h" #include "common/assert.h" #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" #include "common/scope_exit.h" #include "common/string_util.h" - #include "core/hle/result.h" #include "core/hle/service/fs/archive.h" -#include "core/hle/service/fs/fs_user.h" #include "core/settings.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp index 2dff1e16c..ba148eaf1 100644 --- a/src/core/hle/service/gsp_gpu.cpp +++ b/src/core/hle/service/gsp_gpu.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "gsp_gpu.h" #include "common/bit_field.h" #include "common/microprofile.h" - #include "core/hle/kernel/event.h" #include "core/hle/kernel/shared_memory.h" #include "core/hle/result.h" @@ -12,12 +12,9 @@ #include "core/hw/hw.h" #include "core/hw/lcd.h" #include "core/memory.h" - #include "video_core/debug_utils/debug_utils.h" #include "video_core/gpu_debugger.h" -#include "gsp_gpu.h" - // Main graphics debugger object - TODO: Here is probably not the best place for this GraphicsDebugger g_debugger; diff --git a/src/core/hle/service/gsp_gpu.h b/src/core/hle/service/gsp_gpu.h index e028123f3..79a72f77d 100644 --- a/src/core/hle/service/gsp_gpu.h +++ b/src/core/hle/service/gsp_gpu.h @@ -6,10 +6,8 @@ #include #include - #include "common/bit_field.h" #include "common/common_types.h" - #include "core/hle/result.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index 5a2edd3c0..a050e81f7 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -2,20 +2,16 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/hid/hid.h" #include - #include "common/emu_window.h" #include "common/logging/log.h" - -#include "core/hle/service/hid/hid.h" -#include "core/hle/service/hid/hid_spvr.h" -#include "core/hle/service/hid/hid_user.h" -#include "core/hle/service/service.h" - #include "core/core_timing.h" #include "core/hle/kernel/event.h" #include "core/hle/kernel/shared_memory.h" - +#include "core/hle/service/hid/hid_spvr.h" +#include "core/hle/service/hid/hid_user.h" +#include "core/hle/service/service.h" #include "video_core/video_core.h" namespace Service { diff --git a/src/core/hle/service/hid/hid.h b/src/core/hle/service/hid/hid.h index f54ffd8be..7904e7355 100644 --- a/src/core/hle/service/hid/hid.h +++ b/src/core/hle/service/hid/hid.h @@ -5,7 +5,6 @@ #pragma once #include - #ifndef _MSC_VER #include #endif diff --git a/src/core/hle/service/ir/ir.cpp b/src/core/hle/service/ir/ir.cpp index fc048ae88..459fe0691 100644 --- a/src/core/hle/service/ir/ir.cpp +++ b/src/core/hle/service/ir/ir.cpp @@ -2,10 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/ir/ir.h" #include "core/hle/kernel/event.h" #include "core/hle/kernel/shared_memory.h" - -#include "core/hle/service/ir/ir.h" #include "core/hle/service/ir/ir_rst.h" #include "core/hle/service/ir/ir_u.h" #include "core/hle/service/ir/ir_user.h" diff --git a/src/core/hle/service/ldr_ro/cro_helper.cpp b/src/core/hle/service/ldr_ro/cro_helper.cpp index b5da9a960..f583f5c31 100644 --- a/src/core/hle/service/ldr_ro/cro_helper.cpp +++ b/src/core/hle/service/ldr_ro/cro_helper.cpp @@ -2,12 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/ldr_ro/cro_helper.h" #include "common/alignment.h" #include "common/logging/log.h" #include "common/scope_exit.h" -#include "core/hle/service/ldr_ro/cro_helper.h" - //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace LDR_RO diff --git a/src/core/hle/service/ldr_ro/cro_helper.h b/src/core/hle/service/ldr_ro/cro_helper.h index e1b8221bd..6a0d0d3bf 100644 --- a/src/core/hle/service/ldr_ro/cro_helper.h +++ b/src/core/hle/service/ldr_ro/cro_helper.h @@ -6,10 +6,8 @@ #include #include - #include "common/common_types.h" #include "common/swap.h" - #include "core/hle/result.h" #include "core/memory.h" diff --git a/src/core/hle/service/ldr_ro/ldr_ro.cpp b/src/core/hle/service/ldr_ro/ldr_ro.cpp index a8fc2c015..3faa2e5d7 100644 --- a/src/core/hle/service/ldr_ro/ldr_ro.cpp +++ b/src/core/hle/service/ldr_ro/ldr_ro.cpp @@ -2,15 +2,14 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/ldr_ro/ldr_ro.h" #include "common/alignment.h" #include "common/common_types.h" #include "common/logging/log.h" - #include "core/arm/arm_interface.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/vm_manager.h" #include "core/hle/service/ldr_ro/cro_helper.h" -#include "core/hle/service/ldr_ro/ldr_ro.h" #include "core/hle/service/ldr_ro/memory_synchronizer.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/ldr_ro/memory_synchronizer.cpp b/src/core/hle/service/ldr_ro/memory_synchronizer.cpp index aed6d3365..a3e590dfd 100644 --- a/src/core/hle/service/ldr_ro/memory_synchronizer.cpp +++ b/src/core/hle/service/ldr_ro/memory_synchronizer.cpp @@ -2,12 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/ldr_ro/memory_synchronizer.h" #include - #include "common/assert.h" -#include "core/hle/service/ldr_ro/memory_synchronizer.h" - //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace LDR_RO diff --git a/src/core/hle/service/ldr_ro/memory_synchronizer.h b/src/core/hle/service/ldr_ro/memory_synchronizer.h index 92f267912..883ee4acf 100644 --- a/src/core/hle/service/ldr_ro/memory_synchronizer.h +++ b/src/core/hle/service/ldr_ro/memory_synchronizer.h @@ -5,7 +5,6 @@ #pragma once #include - #include "core/memory.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/news/news.cpp b/src/core/hle/service/news/news.cpp index e09ea5681..f22c49f52 100644 --- a/src/core/hle/service/news/news.cpp +++ b/src/core/hle/service/news/news.cpp @@ -2,9 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/logging/log.h" - #include "core/hle/service/news/news.h" +#include "common/logging/log.h" #include "core/hle/service/news/news_s.h" #include "core/hle/service/news/news_u.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp index a7b76ed67..60505545c 100644 --- a/src/core/hle/service/nim/nim.cpp +++ b/src/core/hle/service/nim/nim.cpp @@ -2,10 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/nim/nim.h" #include "common/common_types.h" #include "common/logging/log.h" - -#include "core/hle/service/nim/nim.h" #include "core/hle/service/nim/nim_aoc.h" #include "core/hle/service/nim/nim_s.h" #include "core/hle/service/nim/nim_u.h" diff --git a/src/core/hle/service/nim/nim_u.h b/src/core/hle/service/nim/nim_u.h index bc89dc0f3..c4b74985a 100644 --- a/src/core/hle/service/nim/nim_u.h +++ b/src/core/hle/service/nim/nim_u.h @@ -1,6 +1,6 @@ // Copyright 2015 Citra Emulator Project // Licensed under GPLv2 or any later version -// Refer to the license.txt file included.. +// Refer to the license.txt file included. #pragma once diff --git a/src/core/hle/service/nwm_uds.cpp b/src/core/hle/service/nwm_uds.cpp index ed417fa9a..3b608dcbb 100644 --- a/src/core/hle/service/nwm_uds.cpp +++ b/src/core/hle/service/nwm_uds.cpp @@ -2,11 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/nwm_uds.h" #include "common/common_types.h" #include "common/logging/log.h" - #include "core/hle/kernel/event.h" -#include "core/hle/service/nwm_uds.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace NWM_UDS diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index a531aad87..eff51af04 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -2,44 +2,42 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/service.h" #include "common/logging/log.h" #include "common/string_util.h" - #include "core/hle/service/ac_u.h" #include "core/hle/service/act_a.h" #include "core/hle/service/act_u.h" -#include "core/hle/service/csnd_snd.h" -#include "core/hle/service/dsp_dsp.h" -#include "core/hle/service/err_f.h" -#include "core/hle/service/gsp_gpu.h" -#include "core/hle/service/gsp_lcd.h" -#include "core/hle/service/http_c.h" -#include "core/hle/service/mic_u.h" -#include "core/hle/service/ns_s.h" -#include "core/hle/service/nwm_uds.h" -#include "core/hle/service/pm_app.h" -#include "core/hle/service/service.h" -#include "core/hle/service/soc_u.h" -#include "core/hle/service/srv.h" -#include "core/hle/service/ssl_c.h" -#include "core/hle/service/y2r_u.h" - #include "core/hle/service/am/am.h" #include "core/hle/service/apt/apt.h" #include "core/hle/service/boss/boss.h" #include "core/hle/service/cam/cam.h" #include "core/hle/service/cecd/cecd.h" #include "core/hle/service/cfg/cfg.h" +#include "core/hle/service/csnd_snd.h" #include "core/hle/service/dlp/dlp.h" +#include "core/hle/service/dsp_dsp.h" +#include "core/hle/service/err_f.h" #include "core/hle/service/frd/frd.h" #include "core/hle/service/fs/archive.h" +#include "core/hle/service/gsp_gpu.h" +#include "core/hle/service/gsp_lcd.h" #include "core/hle/service/hid/hid.h" +#include "core/hle/service/http_c.h" #include "core/hle/service/ir/ir.h" #include "core/hle/service/ldr_ro/ldr_ro.h" +#include "core/hle/service/mic_u.h" #include "core/hle/service/ndm/ndm.h" #include "core/hle/service/news/news.h" #include "core/hle/service/nim/nim.h" +#include "core/hle/service/ns_s.h" +#include "core/hle/service/nwm_uds.h" +#include "core/hle/service/pm_app.h" #include "core/hle/service/ptm/ptm.h" +#include "core/hle/service/soc_u.h" +#include "core/hle/service/srv.h" +#include "core/hle/service/ssl_c.h" +#include "core/hle/service/y2r_u.h" namespace Service { diff --git a/src/core/hle/service/service.h b/src/core/hle/service/service.h index cd216f27e..39b5ffaae 100644 --- a/src/core/hle/service/service.h +++ b/src/core/hle/service/service.h @@ -7,11 +7,8 @@ #include #include #include - #include - #include "common/common_types.h" - #include "core/hle/kernel/session.h" #include "core/hle/result.h" diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp index 302ab55b7..1eab61e52 100644 --- a/src/core/hle/service/soc_u.cpp +++ b/src/core/hle/service/soc_u.cpp @@ -2,20 +2,18 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/soc_u.h" #include #include #include #include - #include "common/assert.h" #include "common/bit_field.h" #include "common/common_types.h" #include "common/logging/log.h" #include "common/scope_exit.h" - #include "core/hle/kernel/session.h" #include "core/hle/result.h" -#include "core/hle/service/soc_u.h" #include "core/memory.h" #ifdef _WIN32 diff --git a/src/core/hle/service/soc_u.h b/src/core/hle/service/soc_u.h index a091f597c..8d02ed30f 100644 --- a/src/core/hle/service/soc_u.h +++ b/src/core/hle/service/soc_u.h @@ -5,7 +5,6 @@ #pragma once #include - #include "core/hle/service/service.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index fda9d8acf..241a5da94 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp @@ -2,11 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/srv.h" #include "common/common_types.h" #include "common/logging/log.h" - #include "core/hle/kernel/event.h" -#include "core/hle/service/srv.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace SRV diff --git a/src/core/hle/service/ssl_c.cpp b/src/core/hle/service/ssl_c.cpp index 78ab922ca..16ec3d116 100644 --- a/src/core/hle/service/ssl_c.cpp +++ b/src/core/hle/service/ssl_c.cpp @@ -2,10 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/ssl_c.h" #include - #include "common/common_types.h" -#include "core/hle/service/ssl_c.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace SSL_C diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp index d3c6d073e..38e15b5d0 100644 --- a/src/core/hle/service/y2r_u.cpp +++ b/src/core/hle/service/y2r_u.cpp @@ -2,15 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/service/y2r_u.h" #include - #include "common/common_funcs.h" #include "common/common_types.h" #include "common/logging/log.h" - #include "core/hle/kernel/event.h" #include "core/hle/kernel/kernel.h" -#include "core/hle/service/y2r_u.h" #include "core/hw/y2r.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/y2r_u.h b/src/core/hle/service/y2r_u.h index 95fa2fdb7..1b47b5322 100644 --- a/src/core/hle/service/y2r_u.h +++ b/src/core/hle/service/y2r_u.h @@ -6,9 +6,7 @@ #include #include - #include "common/common_types.h" - #include "core/hle/result.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/shared_page.cpp b/src/core/hle/shared_page.cpp index 453fcf7ec..74a9031c5 100644 --- a/src/core/hle/shared_page.cpp +++ b/src/core/hle/shared_page.cpp @@ -2,12 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hle/shared_page.h" #include #include #include - #include "core/core_timing.h" -#include "core/hle/shared_page.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/shared_page.h b/src/core/hle/shared_page.h index b3b10be31..106e47efc 100644 --- a/src/core/hle/shared_page.h +++ b/src/core/hle/shared_page.h @@ -13,7 +13,6 @@ #include "common/common_funcs.h" #include "common/common_types.h" #include "common/swap.h" - #include "core/memory.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp index 9d0a9c54c..02b397eba 100644 --- a/src/core/hle/svc.cpp +++ b/src/core/hle/svc.cpp @@ -3,16 +3,14 @@ // Refer to the license.txt file included. #include - #include "common/logging/log.h" #include "common/microprofile.h" #include "common/scope_exit.h" #include "common/string_util.h" #include "common/symbols.h" - #include "core/arm/arm_interface.h" #include "core/core_timing.h" - +#include "core/hle/function_wrappers.h" #include "core/hle/kernel/address_arbiter.h" #include "core/hle/kernel/client_port.h" #include "core/hle/kernel/event.h" @@ -26,8 +24,6 @@ #include "core/hle/kernel/thread.h" #include "core/hle/kernel/timer.h" #include "core/hle/kernel/vm_manager.h" - -#include "core/hle/function_wrappers.h" #include "core/hle/result.h" #include "core/hle/service/service.h" diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index bf2c066f4..776c8fef7 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp @@ -2,36 +2,29 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hw/gpu.h" #include #include #include - #include "common/color.h" #include "common/common_types.h" #include "common/logging/log.h" #include "common/microprofile.h" #include "common/vector_math.h" - #include "core/core_timing.h" -#include "core/memory.h" -#include "core/settings.h" - #include "core/hle/service/gsp_gpu.h" #include "core/hle/service/hid/hid.h" - -#include "core/hw/gpu.h" #include "core/hw/hw.h" - +#include "core/memory.h" +#include "core/settings.h" #include "core/tracer/recorder.h" - #include "video_core/command_processor.h" +#include "video_core/debug_utils/debug_utils.h" #include "video_core/rasterizer_interface.h" #include "video_core/renderer_base.h" #include "video_core/utils.h" #include "video_core/video_core.h" -#include "video_core/debug_utils/debug_utils.h" - namespace GPU { Regs g_regs; diff --git a/src/core/hw/gpu.h b/src/core/hw/gpu.h index 077b6255f..32ddc5697 100644 --- a/src/core/hw/gpu.h +++ b/src/core/hw/gpu.h @@ -6,7 +6,6 @@ #include #include - #include "common/assert.h" #include "common/bit_field.h" #include "common/common_funcs.h" diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp index 71f44cbc4..0f84d5adb 100644 --- a/src/core/hw/hw.cpp +++ b/src/core/hw/hw.cpp @@ -2,11 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hw/hw.h" #include "common/common_types.h" #include "common/logging/log.h" - #include "core/hw/gpu.h" -#include "core/hw/hw.h" #include "core/hw/lcd.h" namespace HW { diff --git a/src/core/hw/lcd.cpp b/src/core/hw/lcd.cpp index 0e3aa7cfd..5231e4cc5 100644 --- a/src/core/hw/lcd.cpp +++ b/src/core/hw/lcd.cpp @@ -2,14 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hw/lcd.h" #include - #include "common/common_types.h" #include "common/logging/log.h" - #include "core/hw/hw.h" -#include "core/hw/lcd.h" - #include "core/tracer/recorder.h" #include "video_core/debug_utils/debug_utils.h" diff --git a/src/core/hw/lcd.h b/src/core/hw/lcd.h index 404833165..191fd44af 100644 --- a/src/core/hw/lcd.h +++ b/src/core/hw/lcd.h @@ -6,7 +6,6 @@ #include #include - #include "common/bit_field.h" #include "common/common_funcs.h" #include "common/common_types.h" diff --git a/src/core/hw/y2r.cpp b/src/core/hw/y2r.cpp index 838b14163..0e13420d7 100644 --- a/src/core/hw/y2r.cpp +++ b/src/core/hw/y2r.cpp @@ -2,19 +2,17 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/hw/y2r.h" #include #include #include #include - #include "common/assert.h" #include "common/color.h" #include "common/common_types.h" #include "common/math_util.h" #include "common/vector_math.h" - #include "core/hle/service/y2r_u.h" -#include "core/hw/y2r.h" #include "core/memory.h" namespace HW { diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp index c2e87f592..212772c5d 100644 --- a/src/core/loader/3dsx.cpp +++ b/src/core/loader/3dsx.cpp @@ -2,16 +2,14 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/loader/3dsx.h" #include #include - #include "common/logging/log.h" - #include "core/file_sys/archive_romfs.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/resource_limit.h" #include "core/hle/service/fs/archive.h" -#include "core/loader/3dsx.h" #include "core/memory.h" namespace Loader { diff --git a/src/core/loader/3dsx.h b/src/core/loader/3dsx.h index 8d15ba555..cfcc21cc4 100644 --- a/src/core/loader/3dsx.h +++ b/src/core/loader/3dsx.h @@ -5,7 +5,6 @@ #pragma once #include - #include "common/common_types.h" #include "core/loader/loader.h" diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index 53c10a456..0f4148a59 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -2,18 +2,16 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/loader/elf.h" #include #include #include - #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" #include "common/symbols.h" - #include "core/hle/kernel/process.h" #include "core/hle/kernel/resource_limit.h" -#include "core/loader/elf.h" #include "core/memory.h" using Kernel::SharedPtr; diff --git a/src/core/loader/elf.h b/src/core/loader/elf.h index 04a9b482d..584bf6e27 100644 --- a/src/core/loader/elf.h +++ b/src/core/loader/elf.h @@ -5,7 +5,6 @@ #pragma once #include - #include "common/common_types.h" #include "core/loader/loader.h" diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp index b392bf544..147bf8591 100644 --- a/src/core/loader/loader.cpp +++ b/src/core/loader/loader.cpp @@ -4,10 +4,8 @@ #include #include - #include "common/logging/log.h" #include "common/string_util.h" - #include "core/hle/kernel/process.h" #include "core/loader/3dsx.h" #include "core/loader/elf.h" diff --git a/src/core/loader/loader.h b/src/core/loader/loader.h index fdfee835c..9652d7ac5 100644 --- a/src/core/loader/loader.h +++ b/src/core/loader/loader.h @@ -9,7 +9,6 @@ #include #include #include - #include "common/common_types.h" #include "common/file_util.h" diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index 5b996d671..64c8fef07 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp @@ -2,19 +2,17 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/loader/ncch.h" #include #include #include - #include "common/logging/log.h" #include "common/string_util.h" #include "common/swap.h" - #include "core/file_sys/archive_romfs.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/resource_limit.h" #include "core/hle/service/fs/archive.h" -#include "core/loader/ncch.h" #include "core/memory.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h index f53f8100e..04350d006 100644 --- a/src/core/loader/ncch.h +++ b/src/core/loader/ncch.h @@ -5,11 +5,9 @@ #pragma once #include - #include "common/bit_field.h" #include "common/common_types.h" #include "common/swap.h" - #include "core/loader/loader.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/loader/smdh.cpp b/src/core/loader/smdh.cpp index 2d014054a..7c875131f 100644 --- a/src/core/loader/smdh.cpp +++ b/src/core/loader/smdh.cpp @@ -2,14 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/loader/smdh.h" #include #include - #include "common/common_types.h" - #include "core/loader/loader.h" -#include "core/loader/smdh.h" - #include "video_core/utils.h" namespace Loader { diff --git a/src/core/loader/smdh.h b/src/core/loader/smdh.h index ab665ea82..ac7726c8f 100644 --- a/src/core/loader/smdh.h +++ b/src/core/loader/smdh.h @@ -6,7 +6,6 @@ #include #include - #include "common/common_funcs.h" #include "common/common_types.h" #include "common/swap.h" diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 4de510fe5..c702fa311 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -2,19 +2,16 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/memory.h" #include #include - #include "common/assert.h" #include "common/common_types.h" #include "common/logging/log.h" #include "common/swap.h" - #include "core/hle/kernel/process.h" -#include "core/memory.h" #include "core/memory_setup.h" #include "core/mmio.h" - #include "video_core/renderer_base.h" #include "video_core/video_core.h" diff --git a/src/core/memory.h b/src/core/memory.h index 7d60ccdf1..8fd3080ff 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -6,7 +6,6 @@ #include #include - #include "common/common_types.h" namespace Memory { diff --git a/src/core/memory_setup.h b/src/core/memory_setup.h index 23c36d019..3fdf3a87d 100644 --- a/src/core/memory_setup.h +++ b/src/core/memory_setup.h @@ -5,7 +5,6 @@ #pragma once #include "common/common_types.h" - #include "core/mmio.h" namespace Memory { diff --git a/src/core/mmio.h b/src/core/mmio.h index 9aa59212b..f45126da8 100644 --- a/src/core/mmio.h +++ b/src/core/mmio.h @@ -5,7 +5,6 @@ #pragma once #include - #include "common/common_types.h" namespace Memory { diff --git a/src/core/settings.cpp b/src/core/settings.cpp index 09194fe1f..f2d1b5e74 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -3,11 +3,8 @@ // Refer to the license.txt file included. #include "settings.h" - #include "audio_core/audio_core.h" - #include "core/gdbstub/gdbstub.h" - #include "video_core/video_core.h" namespace Settings { diff --git a/src/core/settings.h b/src/core/settings.h index adb2fd538..5a64f8018 100644 --- a/src/core/settings.h +++ b/src/core/settings.h @@ -6,7 +6,6 @@ #include #include - #include "common/common_types.h" namespace Settings { diff --git a/src/core/system.cpp b/src/core/system.cpp index f2bf648bd..ef190203c 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/system.h" #include "audio_core/audio_core.h" - #include "core/core.h" #include "core/core_timing.h" #include "core/gdbstub/gdbstub.h" @@ -11,8 +11,6 @@ #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/memory.h" #include "core/hw/hw.h" -#include "core/system.h" - #include "video_core/video_core.h" namespace System { diff --git a/src/core/tracer/recorder.cpp b/src/core/tracer/recorder.cpp index 11a289b2c..ba4362484 100644 --- a/src/core/tracer/recorder.cpp +++ b/src/core/tracer/recorder.cpp @@ -2,14 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "recorder.h" #include - #include "common/assert.h" #include "common/file_util.h" #include "common/logging/log.h" -#include "recorder.h" - namespace CiTrace { Recorder::Recorder(const InitialState& initial_state) : initial_state(initial_state) {} diff --git a/src/core/tracer/recorder.h b/src/core/tracer/recorder.h index 6f5354f84..aea363b95 100644 --- a/src/core/tracer/recorder.h +++ b/src/core/tracer/recorder.h @@ -7,12 +7,9 @@ #include #include #include - #include - -#include "common/common_types.h" - #include "citrace.h" +#include "common/common_types.h" namespace CiTrace { diff --git a/src/video_core/clipper.cpp b/src/video_core/clipper.cpp index 82178d249..5aad47418 100644 --- a/src/video_core/clipper.cpp +++ b/src/video_core/clipper.cpp @@ -2,19 +2,16 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/clipper.h" #include #include #include - #include #include - #include "common/bit_field.h" #include "common/common_types.h" #include "common/logging/log.h" #include "common/vector_math.h" - -#include "video_core/clipper.h" #include "video_core/pica.h" #include "video_core/pica_state.h" #include "video_core/pica_types.h" diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index 04a4ee3a2..5c74b68e9 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp @@ -2,22 +2,19 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/command_processor.h" #include #include #include #include - #include "common/assert.h" #include "common/logging/log.h" #include "common/microprofile.h" #include "common/vector_math.h" - #include "core/hle/service/gsp_gpu.h" #include "core/hw/gpu.h" #include "core/memory.h" #include "core/tracer/recorder.h" - -#include "video_core/command_processor.h" #include "video_core/debug_utils/debug_utils.h" #include "video_core/pica.h" #include "video_core/pica_state.h" diff --git a/src/video_core/command_processor.h b/src/video_core/command_processor.h index b8dad8e7b..62ad2d3f3 100644 --- a/src/video_core/command_processor.h +++ b/src/video_core/command_processor.h @@ -5,7 +5,6 @@ #pragma once #include - #include "common/bit_field.h" #include "common/common_types.h" diff --git a/src/video_core/debug_utils/debug_utils.cpp b/src/video_core/debug_utils/debug_utils.cpp index 194e5833c..8806464d9 100644 --- a/src/video_core/debug_utils/debug_utils.cpp +++ b/src/video_core/debug_utils/debug_utils.cpp @@ -20,7 +20,6 @@ #include #include #include - #include "common/assert.h" #include "common/bit_field.h" #include "common/color.h" @@ -29,7 +28,6 @@ #include "common/logging/log.h" #include "common/math_util.h" #include "common/vector_math.h" - #include "video_core/debug_utils/debug_utils.h" #include "video_core/pica.h" #include "video_core/pica_state.h" diff --git a/src/video_core/debug_utils/debug_utils.h b/src/video_core/debug_utils/debug_utils.h index fe3ed247d..189c93abb 100644 --- a/src/video_core/debug_utils/debug_utils.h +++ b/src/video_core/debug_utils/debug_utils.h @@ -15,10 +15,8 @@ #include #include #include - #include "common/common_types.h" #include "common/vector_math.h" - #include "video_core/pica.h" namespace CiTrace { diff --git a/src/video_core/gpu_debugger.h b/src/video_core/gpu_debugger.h index aea391619..3c6636d66 100644 --- a/src/video_core/gpu_debugger.h +++ b/src/video_core/gpu_debugger.h @@ -7,7 +7,6 @@ #include #include #include - #include "core/hle/service/gsp_gpu.h" class GraphicsDebugger { diff --git a/src/video_core/pica.cpp b/src/video_core/pica.cpp index ffd13e717..771e83fe7 100644 --- a/src/video_core/pica.cpp +++ b/src/video_core/pica.cpp @@ -2,12 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/pica.h" #include #include #include #include - -#include "video_core/pica.h" #include "video_core/pica_state.h" #include "video_core/primitive_assembly.h" #include "video_core/shader/shader.h" diff --git a/src/video_core/pica_state.h b/src/video_core/pica_state.h index 2dbd6413f..e4f2e6d5d 100644 --- a/src/video_core/pica_state.h +++ b/src/video_core/pica_state.h @@ -5,10 +5,8 @@ #pragma once #include - #include "common/bit_field.h" #include "common/common_types.h" - #include "video_core/pica.h" #include "video_core/primitive_assembly.h" #include "video_core/shader/shader.h" diff --git a/src/video_core/pica_types.h b/src/video_core/pica_types.h index 20f648b03..5d7e10066 100644 --- a/src/video_core/pica_types.h +++ b/src/video_core/pica_types.h @@ -6,7 +6,6 @@ #include #include - #include "common/common_types.h" namespace Pica { diff --git a/src/video_core/primitive_assembly.cpp b/src/video_core/primitive_assembly.cpp index 901cca26b..670ffb67d 100644 --- a/src/video_core/primitive_assembly.cpp +++ b/src/video_core/primitive_assembly.cpp @@ -2,10 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/primitive_assembly.h" #include "common/logging/log.h" - #include "video_core/pica.h" -#include "video_core/primitive_assembly.h" #include "video_core/shader/shader.h" namespace Pica { diff --git a/src/video_core/primitive_assembly.h b/src/video_core/primitive_assembly.h index 2ad15a858..0384d5984 100644 --- a/src/video_core/primitive_assembly.h +++ b/src/video_core/primitive_assembly.h @@ -5,7 +5,6 @@ #pragma once #include - #include "video_core/pica.h" namespace Pica { diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index f815d6cf0..c179573d6 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/rasterizer.h" #include #include #include - #include "common/assert.h" #include "common/bit_field.h" #include "common/color.h" @@ -14,15 +14,12 @@ #include "common/math_util.h" #include "common/microprofile.h" #include "common/vector_math.h" - #include "core/hw/gpu.h" #include "core/memory.h" - #include "video_core/debug_utils/debug_utils.h" #include "video_core/pica.h" #include "video_core/pica_state.h" #include "video_core/pica_types.h" -#include "video_core/rasterizer.h" #include "video_core/shader/shader.h" #include "video_core/utils.h" diff --git a/src/video_core/rasterizer_interface.h b/src/video_core/rasterizer_interface.h index c7bd29f12..71df233b5 100644 --- a/src/video_core/rasterizer_interface.h +++ b/src/video_core/rasterizer_interface.h @@ -5,7 +5,6 @@ #pragma once #include "common/common_types.h" - #include "core/hw/gpu.h" struct ScreenInfo; diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp index 090683276..91347dea8 100644 --- a/src/video_core/renderer_base.cpp +++ b/src/video_core/renderer_base.cpp @@ -2,10 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/renderer_base.h" #include #include - -#include "video_core/renderer_base.h" #include "video_core/renderer_opengl/gl_rasterizer.h" #include "video_core/swrasterizer.h" #include "video_core/video_core.h" diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h index daacdb167..589aca857 100644 --- a/src/video_core/renderer_base.h +++ b/src/video_core/renderer_base.h @@ -5,9 +5,7 @@ #pragma once #include - #include "common/common_types.h" - #include "video_core/rasterizer_interface.h" class EmuWindow; diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 37977464d..45a4dc97d 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -2,24 +2,20 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/renderer_opengl/gl_rasterizer.h" #include #include #include #include - #include - #include "common/assert.h" #include "common/color.h" #include "common/logging/log.h" #include "common/math_util.h" #include "common/vector_math.h" - #include "core/hw/gpu.h" - #include "video_core/pica.h" #include "video_core/pica_state.h" -#include "video_core/renderer_opengl/gl_rasterizer.h" #include "video_core/renderer_opengl/gl_shader_gen.h" #include "video_core/renderer_opengl/gl_shader_util.h" #include "video_core/renderer_opengl/pica_to_gl.h" diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h index 60d70539c..24fefed1b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.h +++ b/src/video_core/renderer_opengl/gl_rasterizer.h @@ -10,16 +10,12 @@ #include #include #include - #include - #include "common/bit_field.h" #include "common/common_types.h" #include "common/hash.h" #include "common/vector_math.h" - #include "core/hw/gpu.h" - #include "video_core/pica.h" #include "video_core/pica_state.h" #include "video_core/pica_types.h" diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index ec3300ca6..ce9a193bd 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/renderer_opengl/gl_rasterizer_cache.h" #include #include #include @@ -9,21 +10,16 @@ #include #include #include - #include - #include "common/bit_field.h" #include "common/emu_window.h" #include "common/logging/log.h" #include "common/math_util.h" #include "common/microprofile.h" #include "common/vector_math.h" - #include "core/memory.h" - #include "video_core/debug_utils/debug_utils.h" #include "video_core/pica_state.h" -#include "video_core/renderer_opengl/gl_rasterizer_cache.h" #include "video_core/renderer_opengl/gl_state.h" #include "video_core/utils.h" #include "video_core/video_core.h" diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.h b/src/video_core/renderer_opengl/gl_rasterizer_cache.h index b2272bda8..849530d86 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.h +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.h @@ -8,16 +8,12 @@ #include #include #include - #include #include - #include "common/assert.h" #include "common/common_funcs.h" #include "common/common_types.h" - #include "core/hw/gpu.h" - #include "video_core/pica.h" #include "video_core/renderer_opengl/gl_resource_manager.h" diff --git a/src/video_core/renderer_opengl/gl_resource_manager.h b/src/video_core/renderer_opengl/gl_resource_manager.h index 2f40eb646..13301ec9f 100644 --- a/src/video_core/renderer_opengl/gl_resource_manager.h +++ b/src/video_core/renderer_opengl/gl_resource_manager.h @@ -5,11 +5,8 @@ #pragma once #include - #include - #include "common/common_types.h" - #include "video_core/renderer_opengl/gl_shader_util.h" #include "video_core/renderer_opengl/gl_state.h" diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index 9392c67b8..52cee2ee2 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -2,16 +2,14 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/renderer_opengl/gl_shader_gen.h" #include #include - #include "common/assert.h" #include "common/bit_field.h" #include "common/logging/log.h" - #include "video_core/pica.h" #include "video_core/renderer_opengl/gl_rasterizer.h" -#include "video_core/renderer_opengl/gl_shader_gen.h" #include "video_core/renderer_opengl/gl_shader_util.h" using Pica::Regs; diff --git a/src/video_core/renderer_opengl/gl_shader_util.cpp b/src/video_core/renderer_opengl/gl_shader_util.cpp index 7d90ec6a3..c8ba3b92d 100644 --- a/src/video_core/renderer_opengl/gl_shader_util.cpp +++ b/src/video_core/renderer_opengl/gl_shader_util.cpp @@ -2,12 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/renderer_opengl/gl_shader_util.h" #include - #include - #include "common/logging/log.h" -#include "video_core/renderer_opengl/gl_shader_util.h" namespace GLShader { diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index a97269d44..96af8469d 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -2,13 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/renderer_opengl/gl_state.h" #include - #include "common/common_funcs.h" #include "common/logging/log.h" -#include "video_core/renderer_opengl/gl_state.h" - OpenGLState OpenGLState::cur_state; OpenGLState::OpenGLState() { diff --git a/src/video_core/renderer_opengl/pica_to_gl.h b/src/video_core/renderer_opengl/pica_to_gl.h index 415358b6c..cc49867c8 100644 --- a/src/video_core/renderer_opengl/pica_to_gl.h +++ b/src/video_core/renderer_opengl/pica_to_gl.h @@ -6,15 +6,12 @@ #include #include - #include - #include "common/assert.h" #include "common/bit_field.h" #include "common/common_funcs.h" #include "common/common_types.h" #include "common/logging/log.h" - #include "video_core/pica.h" using GLvec2 = std::array; diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index a1d08e04d..962785bdd 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -2,30 +2,26 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/renderer_opengl/renderer_opengl.h" #include #include #include #include - #include - #include "common/assert.h" #include "common/bit_field.h" #include "common/emu_window.h" #include "common/logging/log.h" #include "common/profiler_reporting.h" #include "common/synchronized_wrapper.h" - #include "core/hw/gpu.h" #include "core/hw/hw.h" #include "core/hw/lcd.h" #include "core/memory.h" #include "core/settings.h" #include "core/tracer/recorder.h" - #include "video_core/debug_utils/debug_utils.h" #include "video_core/rasterizer_interface.h" -#include "video_core/renderer_opengl/renderer_opengl.h" #include "video_core/video_core.h" static const char vertex_shader[] = R"( diff --git a/src/video_core/renderer_opengl/renderer_opengl.h b/src/video_core/renderer_opengl/renderer_opengl.h index 762b790c1..87c556cff 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.h +++ b/src/video_core/renderer_opengl/renderer_opengl.h @@ -5,14 +5,10 @@ #pragma once #include - #include - #include "common/common_types.h" #include "common/math_util.h" - #include "core/hw/gpu.h" - #include "video_core/renderer_base.h" #include "video_core/renderer_opengl/gl_resource_manager.h" #include "video_core/renderer_opengl/gl_state.h" diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp index c38bdcc3c..53e91df03 100644 --- a/src/video_core/shader/shader.cpp +++ b/src/video_core/shader/shader.cpp @@ -2,28 +2,23 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/shader/shader.h" #include #include #include #include #include - #include - #include "common/bit_field.h" #include "common/hash.h" #include "common/logging/log.h" #include "common/microprofile.h" - #include "video_core/pica.h" #include "video_core/pica_state.h" -#include "video_core/shader/shader.h" #include "video_core/shader/shader_interpreter.h" - #ifdef ARCHITECTURE_x86_64 #include "video_core/shader/shader_jit_x64.h" #endif // ARCHITECTURE_x86_64 - #include "video_core/video_core.h" namespace Pica { diff --git a/src/video_core/shader/shader.h b/src/video_core/shader/shader.h index 79c716b6e..8858d67f8 100644 --- a/src/video_core/shader/shader.h +++ b/src/video_core/shader/shader.h @@ -9,16 +9,12 @@ #include #include #include - #include - #include - #include "common/assert.h" #include "common/common_funcs.h" #include "common/common_types.h" #include "common/vector_math.h" - #include "video_core/pica.h" #include "video_core/pica_types.h" diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp index 41df8a2fd..5df3c4e86 100644 --- a/src/video_core/shader/shader_interpreter.cpp +++ b/src/video_core/shader/shader_interpreter.cpp @@ -2,21 +2,18 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/shader/shader.h" #include #include #include #include - #include - #include "common/assert.h" #include "common/common_types.h" #include "common/logging/log.h" #include "common/vector_math.h" - #include "video_core/pica_state.h" #include "video_core/pica_types.h" -#include "video_core/shader/shader.h" #include "video_core/shader/shader_interpreter.h" using nihstro::OpCode; diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp index d1b2ce8d5..5f1323799 100644 --- a/src/video_core/shader/shader_jit_x64.cpp +++ b/src/video_core/shader/shader_jit_x64.cpp @@ -2,23 +2,19 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "shader.h" #include #include #include #include - #include - #include "common/assert.h" #include "common/logging/log.h" #include "common/vector_math.h" #include "common/x64/abi.h" #include "common/x64/cpu_detect.h" #include "common/x64/emitter.h" - -#include "shader.h" #include "shader_jit_x64.h" - #include "video_core/pica_state.h" #include "video_core/pica_types.h" diff --git a/src/video_core/shader/shader_jit_x64.h b/src/video_core/shader/shader_jit_x64.h index 2f37ef8bf..98de5ecef 100644 --- a/src/video_core/shader/shader_jit_x64.h +++ b/src/video_core/shader/shader_jit_x64.h @@ -8,13 +8,10 @@ #include #include #include - #include - #include "common/bit_set.h" #include "common/common_types.h" #include "common/x64/emitter.h" - #include "video_core/shader/shader.h" using nihstro::Instruction; diff --git a/src/video_core/swrasterizer.h b/src/video_core/swrasterizer.h index 12dc56bef..6d42d7409 100644 --- a/src/video_core/swrasterizer.h +++ b/src/video_core/swrasterizer.h @@ -5,7 +5,6 @@ #pragma once #include "common/common_types.h" - #include "video_core/rasterizer_interface.h" namespace Pica { diff --git a/src/video_core/vertex_loader.cpp b/src/video_core/vertex_loader.cpp index 9dcd9d748..5704e9fea 100644 --- a/src/video_core/vertex_loader.cpp +++ b/src/video_core/vertex_loader.cpp @@ -1,22 +1,18 @@ +#include "video_core/vertex_loader.h" #include - #include - #include "common/alignment.h" #include "common/assert.h" #include "common/bit_field.h" #include "common/common_types.h" #include "common/logging/log.h" #include "common/vector_math.h" - #include "core/memory.h" - #include "video_core/debug_utils/debug_utils.h" #include "video_core/pica.h" #include "video_core/pica_state.h" #include "video_core/pica_types.h" #include "video_core/shader/shader.h" -#include "video_core/vertex_loader.h" namespace Pica { diff --git a/src/video_core/vertex_loader.h b/src/video_core/vertex_loader.h index 4f8d79f14..9f2098bb2 100644 --- a/src/video_core/vertex_loader.h +++ b/src/video_core/vertex_loader.h @@ -1,7 +1,6 @@ #pragma once #include - #include "common/common_types.h" #include "video_core/pica.h" diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index 880f4990d..b06a88b78 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -2,14 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "video_core/video_core.h" #include - #include "common/logging/log.h" - #include "video_core/pica.h" #include "video_core/renderer_base.h" #include "video_core/renderer_opengl/renderer_opengl.h" -#include "video_core/video_core.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Video Core namespace -- cgit v1.2.3 From 84fbbe26297652d994d203bde543ec252c2d801a Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Tue, 20 Sep 2016 23:52:38 -0700 Subject: Use negative priorities to avoid special-casing the self-include --- src/.clang-format | 10 ++++++---- src/audio_core/audio_core.cpp | 2 +- src/audio_core/codec.cpp | 2 +- src/audio_core/hle/dsp.cpp | 2 +- src/audio_core/hle/filter.cpp | 2 +- src/audio_core/hle/pipe.cpp | 2 +- src/audio_core/hle/source.cpp | 2 +- src/audio_core/sdl2_sink.cpp | 2 +- src/audio_core/sink_details.cpp | 2 +- src/audio_core/time_stretch.cpp | 2 +- src/citra/config.cpp | 2 +- src/citra_qt/config.cpp | 2 +- src/citra_qt/configure_audio.cpp | 2 +- src/citra_qt/configure_dialog.cpp | 2 +- src/citra_qt/configure_input.cpp | 2 +- src/citra_qt/debugger/callstack.cpp | 2 +- src/citra_qt/debugger/disassembler.cpp | 2 +- src/citra_qt/debugger/graphics.cpp | 2 +- src/citra_qt/debugger/graphics_breakpoint_observer.cpp | 2 +- src/citra_qt/debugger/graphics_breakpoints.cpp | 2 +- src/citra_qt/debugger/graphics_cmdlists.cpp | 2 +- src/citra_qt/debugger/graphics_surface.cpp | 2 +- src/citra_qt/debugger/graphics_tracing.cpp | 2 +- src/citra_qt/debugger/graphics_vertex_shader.cpp | 2 +- src/citra_qt/debugger/profiler.cpp | 2 +- src/citra_qt/debugger/registers.cpp | 2 +- src/citra_qt/game_list.cpp | 2 +- src/citra_qt/hotkeys.cpp | 2 +- src/citra_qt/util/spinbox.cpp | 2 +- src/citra_qt/util/util.cpp | 2 +- src/common/break_points.cpp | 2 +- src/common/emu_window.cpp | 2 +- src/common/file_util.cpp | 2 +- src/common/key_map.cpp | 2 +- src/common/logging/backend.cpp | 2 +- src/common/logging/filter.cpp | 2 +- src/common/memory_util.cpp | 2 +- src/common/string_util.cpp | 2 +- src/common/x64/cpu_detect.cpp | 2 +- src/common/x64/emitter.cpp | 4 ++-- src/core/arm/disassembler/arm_disasm.cpp | 2 +- src/core/arm/disassembler/load_symbol_map.cpp | 2 +- src/core/arm/dynarmic/arm_dynarmic.cpp | 2 +- src/core/arm/dyncom/arm_dyncom.cpp | 2 +- src/core/arm/dyncom/arm_dyncom_interpreter.cpp | 2 +- src/core/arm/dyncom/arm_dyncom_trans.cpp | 2 +- src/core/arm/skyeye_common/armstate.cpp | 2 +- src/core/arm/skyeye_common/armsupp.cpp | 2 +- src/core/arm/skyeye_common/vfp/vfp.cpp | 2 +- src/core/arm/skyeye_common/vfp/vfpdouble.cpp | 2 +- src/core/arm/skyeye_common/vfp/vfpsingle.cpp | 2 +- src/core/core.cpp | 2 +- src/core/core_timing.cpp | 2 +- src/core/file_sys/archive_backend.cpp | 2 +- src/core/file_sys/archive_extsavedata.cpp | 2 +- src/core/file_sys/archive_romfs.cpp | 2 +- src/core/file_sys/archive_savedata.cpp | 2 +- src/core/file_sys/archive_savedatacheck.cpp | 2 +- src/core/file_sys/archive_sdmc.cpp | 2 +- src/core/file_sys/archive_systemsavedata.cpp | 2 +- src/core/file_sys/disk_archive.cpp | 2 +- src/core/file_sys/ivfc_archive.cpp | 2 +- src/core/hle/applets/applet.cpp | 2 +- src/core/hle/applets/erreula.cpp | 2 +- src/core/hle/applets/mii_selector.cpp | 2 +- src/core/hle/applets/swkbd.cpp | 2 +- src/core/hle/config_mem.cpp | 2 +- src/core/hle/hle.cpp | 2 +- src/core/hle/kernel/address_arbiter.cpp | 2 +- src/core/hle/kernel/client_port.cpp | 2 +- src/core/hle/kernel/event.cpp | 2 +- src/core/hle/kernel/kernel.cpp | 2 +- src/core/hle/kernel/memory.cpp | 2 +- src/core/hle/kernel/mutex.cpp | 2 +- src/core/hle/kernel/process.cpp | 2 +- src/core/hle/kernel/resource_limit.cpp | 2 +- src/core/hle/kernel/semaphore.cpp | 2 +- src/core/hle/kernel/server_port.cpp | 2 +- src/core/hle/kernel/shared_memory.cpp | 2 +- src/core/hle/kernel/thread.cpp | 2 +- src/core/hle/kernel/timer.cpp | 2 +- src/core/hle/kernel/vm_manager.cpp | 2 +- src/core/hle/service/ac_u.cpp | 2 +- src/core/hle/service/am/am.cpp | 2 +- src/core/hle/service/am/am_app.cpp | 2 +- src/core/hle/service/am/am_net.cpp | 2 +- src/core/hle/service/am/am_sys.cpp | 2 +- src/core/hle/service/am/am_u.cpp | 2 +- src/core/hle/service/apt/apt.cpp | 2 +- src/core/hle/service/apt/apt_a.cpp | 2 +- src/core/hle/service/apt/apt_s.cpp | 2 +- src/core/hle/service/apt/apt_u.cpp | 2 +- src/core/hle/service/cam/cam.cpp | 2 +- src/core/hle/service/cam/cam_u.cpp | 2 +- src/core/hle/service/cecd/cecd.cpp | 2 +- src/core/hle/service/cecd/cecd_u.cpp | 2 +- src/core/hle/service/cfg/cfg.cpp | 2 +- src/core/hle/service/cfg/cfg_i.cpp | 2 +- src/core/hle/service/cfg/cfg_s.cpp | 2 +- src/core/hle/service/cfg/cfg_u.cpp | 2 +- src/core/hle/service/csnd_snd.cpp | 2 +- src/core/hle/service/dlp/dlp_srvr.cpp | 2 +- src/core/hle/service/dsp_dsp.cpp | 2 +- src/core/hle/service/err_f.cpp | 2 +- src/core/hle/service/frd/frd.cpp | 2 +- src/core/hle/service/frd/frd_u.cpp | 2 +- src/core/hle/service/fs/archive.cpp | 2 +- src/core/hle/service/fs/fs_user.cpp | 2 +- src/core/hle/service/gsp_gpu.cpp | 2 +- src/core/hle/service/hid/hid.cpp | 2 +- src/core/hle/service/hid/hid_spvr.cpp | 2 +- src/core/hle/service/hid/hid_user.cpp | 2 +- src/core/hle/service/ir/ir.cpp | 2 +- src/core/hle/service/ir/ir_rst.cpp | 2 +- src/core/hle/service/ir/ir_user.cpp | 2 +- src/core/hle/service/ldr_ro/cro_helper.cpp | 2 +- src/core/hle/service/ldr_ro/ldr_ro.cpp | 2 +- src/core/hle/service/ldr_ro/memory_synchronizer.cpp | 2 +- src/core/hle/service/ndm/ndm.cpp | 2 +- src/core/hle/service/ndm/ndm_u.cpp | 2 +- src/core/hle/service/news/news.cpp | 2 +- src/core/hle/service/news/news_s.cpp | 2 +- src/core/hle/service/nim/nim.cpp | 2 +- src/core/hle/service/nim/nim_u.cpp | 2 +- src/core/hle/service/nwm_uds.cpp | 2 +- src/core/hle/service/ptm/ptm.cpp | 2 +- src/core/hle/service/ptm/ptm_sysm.cpp | 2 +- src/core/hle/service/ptm/ptm_u.cpp | 2 +- src/core/hle/service/service.cpp | 2 +- src/core/hle/service/soc_u.cpp | 2 +- src/core/hle/service/srv.cpp | 2 +- src/core/hle/service/ssl_c.cpp | 2 +- src/core/hle/service/y2r_u.cpp | 2 +- src/core/hle/shared_page.cpp | 2 +- src/core/hw/gpu.cpp | 2 +- src/core/hw/hw.cpp | 2 +- src/core/hw/lcd.cpp | 2 +- src/core/hw/y2r.cpp | 2 +- src/core/loader/3dsx.cpp | 2 +- src/core/loader/elf.cpp | 2 +- src/core/loader/ncch.cpp | 2 +- src/core/loader/smdh.cpp | 2 +- src/core/memory.cpp | 2 +- src/core/settings.cpp | 2 +- src/core/system.cpp | 2 +- src/core/tracer/recorder.cpp | 2 +- src/video_core/clipper.cpp | 2 +- src/video_core/command_processor.cpp | 2 +- src/video_core/pica.cpp | 2 +- src/video_core/primitive_assembly.cpp | 2 +- src/video_core/rasterizer.cpp | 2 +- src/video_core/renderer_base.cpp | 2 +- src/video_core/renderer_opengl/gl_rasterizer.cpp | 2 +- src/video_core/renderer_opengl/gl_rasterizer_cache.cpp | 2 +- src/video_core/renderer_opengl/gl_shader_gen.cpp | 2 +- src/video_core/renderer_opengl/gl_shader_util.cpp | 2 +- src/video_core/renderer_opengl/gl_state.cpp | 2 +- src/video_core/renderer_opengl/renderer_opengl.cpp | 2 +- src/video_core/shader/shader.cpp | 2 +- src/video_core/shader/shader_interpreter.cpp | 2 +- src/video_core/shader/shader_jit_x64.cpp | 2 +- src/video_core/swrasterizer.cpp | 2 +- src/video_core/vertex_loader.cpp | 2 +- src/video_core/video_core.cpp | 2 +- 164 files changed, 170 insertions(+), 168 deletions(-) (limited to 'src/core/hle/service') diff --git a/src/.clang-format b/src/.clang-format index fc1bbb297..e4f5d6d7e 100644 --- a/src/.clang-format +++ b/src/.clang-format @@ -47,13 +47,15 @@ DisableFormat: false ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] IncludeCategories: - Regex: '^\<[wW]indows.h\>' - Priority: 1 + Priority: -3 - Regex: '^\<(boost|catch|dynarmic|glad|inih|nihstro)/' - Priority: 3 + Priority: -1 - Regex: '^\<(SDL|SoundTouch|Q)' - Priority: 3 + Priority: -1 - Regex: '^\<' - Priority: 2 + Priority: -2 + - Regex: '^\"' + Priority: 0 IndentCaseLabels: false IndentWidth: 4 IndentWrappedFunctionNames: false diff --git a/src/audio_core/audio_core.cpp b/src/audio_core/audio_core.cpp index c54a4b99a..49260de7c 100644 --- a/src/audio_core/audio_core.cpp +++ b/src/audio_core/audio_core.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "audio_core/audio_core.h" #include #include +#include "audio_core/audio_core.h" #include "audio_core/hle/dsp.h" #include "audio_core/hle/pipe.h" #include "audio_core/null_sink.h" diff --git a/src/audio_core/codec.cpp b/src/audio_core/codec.cpp index fd189a176..7a3bd7eb3 100644 --- a/src/audio_core/codec.cpp +++ b/src/audio_core/codec.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "audio_core/codec.h" #include #include #include #include +#include "audio_core/codec.h" #include "common/assert.h" #include "common/common_types.h" #include "common/math_util.h" diff --git a/src/audio_core/hle/dsp.cpp b/src/audio_core/hle/dsp.cpp index aa64dae97..58690970a 100644 --- a/src/audio_core/hle/dsp.cpp +++ b/src/audio_core/hle/dsp.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "audio_core/hle/dsp.h" #include #include +#include "audio_core/hle/dsp.h" #include "audio_core/hle/mixers.h" #include "audio_core/hle/pipe.h" #include "audio_core/hle/source.h" diff --git a/src/audio_core/hle/filter.cpp b/src/audio_core/hle/filter.cpp index edf95f686..b24a79b89 100644 --- a/src/audio_core/hle/filter.cpp +++ b/src/audio_core/hle/filter.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "audio_core/hle/filter.h" #include #include #include "audio_core/hle/common.h" #include "audio_core/hle/dsp.h" +#include "audio_core/hle/filter.h" #include "common/common_types.h" #include "common/math_util.h" diff --git a/src/audio_core/hle/pipe.cpp b/src/audio_core/hle/pipe.cpp index cab30c8aa..b472c81d8 100644 --- a/src/audio_core/hle/pipe.cpp +++ b/src/audio_core/hle/pipe.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "audio_core/hle/pipe.h" #include #include #include "audio_core/hle/dsp.h" +#include "audio_core/hle/pipe.h" #include "common/assert.h" #include "common/common_types.h" #include "common/logging/log.h" diff --git a/src/audio_core/hle/source.cpp b/src/audio_core/hle/source.cpp index 9e6b36fcd..2bbf7146e 100644 --- a/src/audio_core/hle/source.cpp +++ b/src/audio_core/hle/source.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "audio_core/hle/source.h" #include #include #include "audio_core/codec.h" #include "audio_core/hle/common.h" +#include "audio_core/hle/source.h" #include "audio_core/interpolate.h" #include "common/assert.h" #include "common/logging/log.h" diff --git a/src/audio_core/sdl2_sink.cpp b/src/audio_core/sdl2_sink.cpp index 2520796cb..75cc0d6dd 100644 --- a/src/audio_core/sdl2_sink.cpp +++ b/src/audio_core/sdl2_sink.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "audio_core/sdl2_sink.h" #include #include #include #include #include "audio_core/audio_core.h" +#include "audio_core/sdl2_sink.h" #include "common/assert.h" #include "common/logging/log.h" diff --git a/src/audio_core/sink_details.cpp b/src/audio_core/sink_details.cpp index 1dc5e862e..95ccc9e9d 100644 --- a/src/audio_core/sink_details.cpp +++ b/src/audio_core/sink_details.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "audio_core/sink_details.h" #include #include #include "audio_core/null_sink.h" +#include "audio_core/sink_details.h" #ifdef HAVE_SDL2 #include "audio_core/sdl2_sink.h" #endif diff --git a/src/audio_core/time_stretch.cpp b/src/audio_core/time_stretch.cpp index 26059f503..53cb64655 100644 --- a/src/audio_core/time_stretch.cpp +++ b/src/audio_core/time_stretch.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "audio_core/time_stretch.h" #include #include #include #include #include "audio_core/audio_core.h" +#include "audio_core/time_stretch.h" #include "common/common_types.h" #include "common/logging/log.h" #include "common/math_util.h" diff --git a/src/citra/config.cpp b/src/citra/config.cpp index 58aef7a9a..05eabfa3d 100644 --- a/src/citra/config.cpp +++ b/src/citra/config.cpp @@ -2,13 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "config.h" #include #include #include #include "citra/default_ini.h" #include "common/file_util.h" #include "common/logging/log.h" +#include "config.h" #include "core/settings.h" Config::Config() { diff --git a/src/citra_qt/config.cpp b/src/citra_qt/config.cpp index e3648572f..0b46ca6bb 100644 --- a/src/citra_qt/config.cpp +++ b/src/citra_qt/config.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/config.h" #include +#include "citra_qt/config.h" #include "citra_qt/ui_settings.h" #include "common/file_util.h" diff --git a/src/citra_qt/configure_audio.cpp b/src/citra_qt/configure_audio.cpp index ba976252e..3cdd4c780 100644 --- a/src/citra_qt/configure_audio.cpp +++ b/src/citra_qt/configure_audio.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/configure_audio.h" #include "audio_core/sink_details.h" +#include "citra_qt/configure_audio.h" #include "core/settings.h" #include "ui_configure_audio.h" diff --git a/src/citra_qt/configure_dialog.cpp b/src/citra_qt/configure_dialog.cpp index d6a4e8af1..446ad04a1 100644 --- a/src/citra_qt/configure_dialog.cpp +++ b/src/citra_qt/configure_dialog.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/configure_dialog.h" #include "citra_qt/config.h" +#include "citra_qt/configure_dialog.h" #include "core/settings.h" #include "ui_configure.h" diff --git a/src/citra_qt/configure_input.cpp b/src/citra_qt/configure_input.cpp index 7039301e3..d321db71f 100644 --- a/src/citra_qt/configure_input.cpp +++ b/src/citra_qt/configure_input.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/configure_input.h" #include #include #include +#include "citra_qt/configure_input.h" ConfigureInput::ConfigureInput(QWidget* parent) : QWidget(parent), ui(std::make_unique()) { diff --git a/src/citra_qt/debugger/callstack.cpp b/src/citra_qt/debugger/callstack.cpp index 14bd1c77c..c66f2b96a 100644 --- a/src/citra_qt/debugger/callstack.cpp +++ b/src/citra_qt/debugger/callstack.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/debugger/callstack.h" #include +#include "citra_qt/debugger/callstack.h" #include "common/common_types.h" #include "common/symbols.h" #include "core/arm/arm_interface.h" diff --git a/src/citra_qt/debugger/disassembler.cpp b/src/citra_qt/debugger/disassembler.cpp index 7a5d3e2f1..1ee6bbd6a 100644 --- a/src/citra_qt/debugger/disassembler.cpp +++ b/src/citra_qt/debugger/disassembler.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/debugger/disassembler.h" #include #include "citra_qt/bootmanager.h" +#include "citra_qt/debugger/disassembler.h" #include "citra_qt/hotkeys.h" #include "citra_qt/util/util.h" #include "common/break_points.h" diff --git a/src/citra_qt/debugger/graphics.cpp b/src/citra_qt/debugger/graphics.cpp index 31b54e855..ef6712bfa 100644 --- a/src/citra_qt/debugger/graphics.cpp +++ b/src/citra_qt/debugger/graphics.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/debugger/graphics.h" #include +#include "citra_qt/debugger/graphics.h" #include "citra_qt/util/util.h" extern GraphicsDebugger g_debugger; diff --git a/src/citra_qt/debugger/graphics_breakpoint_observer.cpp b/src/citra_qt/debugger/graphics_breakpoint_observer.cpp index ad11552d7..e01d3440e 100644 --- a/src/citra_qt/debugger/graphics_breakpoint_observer.cpp +++ b/src/citra_qt/debugger/graphics_breakpoint_observer.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/debugger/graphics_breakpoint_observer.h" #include +#include "citra_qt/debugger/graphics_breakpoint_observer.h" BreakPointObserverDock::BreakPointObserverDock(std::shared_ptr debug_context, const QString& title, QWidget* parent) diff --git a/src/citra_qt/debugger/graphics_breakpoints.cpp b/src/citra_qt/debugger/graphics_breakpoints.cpp index e1d1b4911..d2a036dfa 100644 --- a/src/citra_qt/debugger/graphics_breakpoints.cpp +++ b/src/citra_qt/debugger/graphics_breakpoints.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/debugger/graphics_breakpoints.h" #include #include #include #include #include +#include "citra_qt/debugger/graphics_breakpoints.h" #include "citra_qt/debugger/graphics_breakpoints_p.h" #include "common/assert.h" diff --git a/src/citra_qt/debugger/graphics_cmdlists.cpp b/src/citra_qt/debugger/graphics_cmdlists.cpp index 35be9b9bd..8a784d108 100644 --- a/src/citra_qt/debugger/graphics_cmdlists.cpp +++ b/src/citra_qt/debugger/graphics_cmdlists.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/debugger/graphics_cmdlists.h" #include #include #include @@ -14,6 +13,7 @@ #include #include #include +#include "citra_qt/debugger/graphics_cmdlists.h" #include "citra_qt/util/spinbox.h" #include "citra_qt/util/util.h" #include "common/vector_math.h" diff --git a/src/citra_qt/debugger/graphics_surface.cpp b/src/citra_qt/debugger/graphics_surface.cpp index 496fce59d..906daaa50 100644 --- a/src/citra_qt/debugger/graphics_surface.cpp +++ b/src/citra_qt/debugger/graphics_surface.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/debugger/graphics_surface.h" #include #include #include @@ -12,6 +11,7 @@ #include #include #include +#include "citra_qt/debugger/graphics_surface.h" #include "citra_qt/util/spinbox.h" #include "common/color.h" #include "core/hw/gpu.h" diff --git a/src/citra_qt/debugger/graphics_tracing.cpp b/src/citra_qt/debugger/graphics_tracing.cpp index 944150b8e..5c6b74034 100644 --- a/src/citra_qt/debugger/graphics_tracing.cpp +++ b/src/citra_qt/debugger/graphics_tracing.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/debugger/graphics_tracing.h" #include #include #include @@ -13,6 +12,7 @@ #include #include #include +#include "citra_qt/debugger/graphics_tracing.h" #include "common/common_types.h" #include "core/hw/gpu.h" #include "core/hw/lcd.h" diff --git a/src/citra_qt/debugger/graphics_vertex_shader.cpp b/src/citra_qt/debugger/graphics_vertex_shader.cpp index 3b3ffe5c6..0b4320da5 100644 --- a/src/citra_qt/debugger/graphics_vertex_shader.cpp +++ b/src/citra_qt/debugger/graphics_vertex_shader.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/debugger/graphics_vertex_shader.h" #include #include #include @@ -15,6 +14,7 @@ #include #include #include +#include "citra_qt/debugger/graphics_vertex_shader.h" #include "citra_qt/util/util.h" #include "video_core/pica.h" #include "video_core/pica_state.h" diff --git a/src/citra_qt/debugger/profiler.cpp b/src/citra_qt/debugger/profiler.cpp index 39d2d6e39..cee10403d 100644 --- a/src/citra_qt/debugger/profiler.cpp +++ b/src/citra_qt/debugger/profiler.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/debugger/profiler.h" #include #include #include +#include "citra_qt/debugger/profiler.h" #include "citra_qt/util/util.h" #include "common/common_types.h" #include "common/microprofile.h" diff --git a/src/citra_qt/debugger/registers.cpp b/src/citra_qt/debugger/registers.cpp index 13842dac3..0b644432f 100644 --- a/src/citra_qt/debugger/registers.cpp +++ b/src/citra_qt/debugger/registers.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/debugger/registers.h" #include +#include "citra_qt/debugger/registers.h" #include "citra_qt/util/util.h" #include "core/arm/arm_interface.h" #include "core/core.h" diff --git a/src/citra_qt/game_list.cpp b/src/citra_qt/game_list.cpp index 16d31be77..07bc35308 100644 --- a/src/citra_qt/game_list.cpp +++ b/src/citra_qt/game_list.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "game_list.h" #include #include #include @@ -10,6 +9,7 @@ #include "common/logging/log.h" #include "common/string_util.h" #include "core/loader/loader.h" +#include "game_list.h" #include "game_list_p.h" #include "ui_settings.h" diff --git a/src/citra_qt/hotkeys.cpp b/src/citra_qt/hotkeys.cpp index 9037f20f2..158ed506f 100644 --- a/src/citra_qt/hotkeys.cpp +++ b/src/citra_qt/hotkeys.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/hotkeys.h" #include #include #include #include +#include "citra_qt/hotkeys.h" #include "citra_qt/ui_settings.h" struct Hotkey { diff --git a/src/citra_qt/util/spinbox.cpp b/src/citra_qt/util/spinbox.cpp index 0bda21502..feb0ea1b3 100644 --- a/src/citra_qt/util/spinbox.cpp +++ b/src/citra_qt/util/spinbox.cpp @@ -28,10 +28,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#include "citra_qt/util/spinbox.h" #include #include #include +#include "citra_qt/util/spinbox.h" #include "common/assert.h" CSpinBox::CSpinBox(QWidget* parent) diff --git a/src/citra_qt/util/util.cpp b/src/citra_qt/util/util.cpp index e77d3796c..02be92bbd 100644 --- a/src/citra_qt/util/util.cpp +++ b/src/citra_qt/util/util.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "citra_qt/util/util.h" #include #include +#include "citra_qt/util/util.h" QFont GetMonospaceFont() { QFont font("monospace"); diff --git a/src/common/break_points.cpp b/src/common/break_points.cpp index 4b64a6c7b..03a19acba 100644 --- a/src/common/break_points.cpp +++ b/src/common/break_points.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/break_points.h" #include #include +#include "common/break_points.h" #include "common/logging/log.h" bool BreakPoints::IsAddressBreakPoint(u32 iAddress) const { diff --git a/src/common/emu_window.cpp b/src/common/emu_window.cpp index 6fd6f1987..122f1c212 100644 --- a/src/common/emu_window.cpp +++ b/src/common/emu_window.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "emu_window.h" #include #include #include "common/assert.h" #include "common/key_map.h" +#include "emu_window.h" #include "video_core/video_core.h" void EmuWindow::ButtonPressed(Service::HID::PadState pad) { diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index a0cae11e3..7a21962cc 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/file_util.h" #include "common/assert.h" #include "common/common_funcs.h" #include "common/common_paths.h" +#include "common/file_util.h" #include "common/logging/log.h" #ifdef _WIN32 diff --git a/src/common/key_map.cpp b/src/common/key_map.cpp index 8380ce489..79b3fcb18 100644 --- a/src/common/key_map.cpp +++ b/src/common/key_map.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/key_map.h" #include #include "common/emu_window.h" +#include "common/key_map.h" namespace KeyMap { diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp index b4a312948..9a13a9e90 100644 --- a/src/common/logging/backend.cpp +++ b/src/common/logging/backend.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/logging/backend.h" #include #include #include #include "common/assert.h" #include "common/common_funcs.h" // snprintf compatibility define +#include "common/logging/backend.h" #include "common/logging/filter.h" #include "common/logging/log.h" #include "common/logging/text_formatter.h" diff --git a/src/common/logging/filter.cpp b/src/common/logging/filter.cpp index 9aa72cecc..12e5bb45d 100644 --- a/src/common/logging/filter.cpp +++ b/src/common/logging/filter.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/logging/filter.h" #include #include "common/logging/backend.h" +#include "common/logging/filter.h" #include "common/string_util.h" namespace Log { diff --git a/src/common/memory_util.cpp b/src/common/memory_util.cpp index 7d352f00f..e19d7202a 100644 --- a/src/common/memory_util.cpp +++ b/src/common/memory_util.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/memory_util.h" #include "common/logging/log.h" +#include "common/memory_util.h" #ifdef _WIN32 #include diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index 968854bae..ca97e8ab4 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "common/string_util.h" #include #include #include @@ -11,6 +10,7 @@ #include #include "common/common_paths.h" #include "common/logging/log.h" +#include "common/string_util.h" #ifdef _MSC_VER #include #include diff --git a/src/common/x64/cpu_detect.cpp b/src/common/x64/cpu_detect.cpp index ac37c42bc..6ddf9b70c 100644 --- a/src/common/x64/cpu_detect.cpp +++ b/src/common/x64/cpu_detect.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "cpu_detect.h" #include #include #include #include "common/common_types.h" +#include "cpu_detect.h" namespace Common { diff --git a/src/common/x64/emitter.cpp b/src/common/x64/emitter.cpp index b69e4bd5e..f5930abec 100644 --- a/src/common/x64/emitter.cpp +++ b/src/common/x64/emitter.cpp @@ -15,7 +15,6 @@ // Official SVN repository and contact information can be found at // http://code.google.com/p/dolphin-emu/ -#include "emitter.h" #include #include #include "abi.h" @@ -23,6 +22,7 @@ #include "common/logging/log.h" #include "common/memory_util.h" #include "cpu_detect.h" +#include "emitter.h" namespace Gen { @@ -220,7 +220,7 @@ void OpArg::WriteVex(XEmitter* emit, X64Reg regOp1, X64Reg regOp2, int L, int pp void OpArg::WriteRest(XEmitter* emit, int extraBytes, X64Reg _operandReg, bool warn_64bit_offset) const { if (_operandReg == INVALID_REG) - _operandReg = (X64Reg) this->operandReg; + _operandReg = (X64Reg)this->operandReg; int mod = 0; int ireg = indexReg; bool SIB = false; diff --git a/src/core/arm/disassembler/arm_disasm.cpp b/src/core/arm/disassembler/arm_disasm.cpp index 068f395ac..05d6ed1fb 100644 --- a/src/core/arm/disassembler/arm_disasm.cpp +++ b/src/core/arm/disassembler/arm_disasm.cpp @@ -1,10 +1,10 @@ // Copyright 2006 The Android Open Source Project -#include "core/arm/disassembler/arm_disasm.h" #include #include #include "common/common_types.h" #include "common/string_util.h" +#include "core/arm/disassembler/arm_disasm.h" #include "core/arm/skyeye_common/armsupp.h" static const char* cond_names[] = {"eq", "ne", "cs", "cc", "mi", "pl", "vs", "vc", diff --git a/src/core/arm/disassembler/load_symbol_map.cpp b/src/core/arm/disassembler/load_symbol_map.cpp index e602d4511..6863c103a 100644 --- a/src/core/arm/disassembler/load_symbol_map.cpp +++ b/src/core/arm/disassembler/load_symbol_map.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/arm/disassembler/load_symbol_map.h" #include #include #include #include "common/file_util.h" #include "common/symbols.h" +#include "core/arm/disassembler/load_symbol_map.h" /* * Loads a symbol map file for use with the disassembler diff --git a/src/core/arm/dynarmic/arm_dynarmic.cpp b/src/core/arm/dynarmic/arm_dynarmic.cpp index b57d9e65b..b4444c869 100644 --- a/src/core/arm/dynarmic/arm_dynarmic.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/arm/dynarmic/arm_dynarmic.h" #include #include "common/assert.h" #include "common/microprofile.h" +#include "core/arm/dynarmic/arm_dynarmic.h" #include "core/arm/dyncom/arm_dyncom_interpreter.h" #include "core/core.h" #include "core/core_timing.h" diff --git a/src/core/arm/dyncom/arm_dyncom.cpp b/src/core/arm/dyncom/arm_dyncom.cpp index bc9ba2941..34c7f945e 100644 --- a/src/core/arm/dyncom/arm_dyncom.cpp +++ b/src/core/arm/dyncom/arm_dyncom.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/arm/dyncom/arm_dyncom.h" #include #include +#include "core/arm/dyncom/arm_dyncom.h" #include "core/arm/dyncom/arm_dyncom_interpreter.h" #include "core/arm/dyncom/arm_dyncom_run.h" #include "core/arm/dyncom/arm_dyncom_trans.h" diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp index 4f83d8332..7b8616702 100644 --- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp +++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp @@ -4,7 +4,6 @@ #define CITRA_IGNORE_EXIT(x) -#include "core/arm/dyncom/arm_dyncom_interpreter.h" #include #include #include "common/common_types.h" @@ -12,6 +11,7 @@ #include "common/microprofile.h" #include "core/arm/disassembler/arm_disasm.h" #include "core/arm/dyncom/arm_dyncom_dec.h" +#include "core/arm/dyncom/arm_dyncom_interpreter.h" #include "core/arm/dyncom/arm_dyncom_run.h" #include "core/arm/dyncom/arm_dyncom_thumb.h" #include "core/arm/dyncom/arm_dyncom_trans.h" diff --git a/src/core/arm/dyncom/arm_dyncom_trans.cpp b/src/core/arm/dyncom/arm_dyncom_trans.cpp index 5f3644c28..780638638 100644 --- a/src/core/arm/dyncom/arm_dyncom_trans.cpp +++ b/src/core/arm/dyncom/arm_dyncom_trans.cpp @@ -1,8 +1,8 @@ -#include "core/arm/dyncom/arm_dyncom_trans.h" #include #include "common/assert.h" #include "common/common_types.h" #include "core/arm/dyncom/arm_dyncom_interpreter.h" +#include "core/arm/dyncom/arm_dyncom_trans.h" #include "core/arm/skyeye_common/armstate.h" #include "core/arm/skyeye_common/armsupp.h" #include "core/arm/skyeye_common/vfp/vfp.h" diff --git a/src/core/arm/skyeye_common/armstate.cpp b/src/core/arm/skyeye_common/armstate.cpp index 59329c656..1465b074e 100644 --- a/src/core/arm/skyeye_common/armstate.cpp +++ b/src/core/arm/skyeye_common/armstate.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/arm/skyeye_common/armstate.h" #include #include "common/logging/log.h" #include "common/swap.h" +#include "core/arm/skyeye_common/armstate.h" #include "core/arm/skyeye_common/vfp/vfp.h" #include "core/gdbstub/gdbstub.h" #include "core/memory.h" diff --git a/src/core/arm/skyeye_common/armsupp.cpp b/src/core/arm/skyeye_common/armsupp.cpp index b76942e47..06aa1b075 100644 --- a/src/core/arm/skyeye_common/armsupp.cpp +++ b/src/core/arm/skyeye_common/armsupp.cpp @@ -15,10 +15,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "core/arm/skyeye_common/armsupp.h" #include "common/logging/log.h" #include "core/arm/skyeye_common/arm_regformat.h" #include "core/arm/skyeye_common/armstate.h" +#include "core/arm/skyeye_common/armsupp.h" // Unsigned sum of absolute difference u8 ARMul_UnsignedAbsoluteDifference(u8 left, u8 right) { diff --git a/src/core/arm/skyeye_common/vfp/vfp.cpp b/src/core/arm/skyeye_common/vfp/vfp.cpp index 8ac1fb95e..f36c75a07 100644 --- a/src/core/arm/skyeye_common/vfp/vfp.cpp +++ b/src/core/arm/skyeye_common/vfp/vfp.cpp @@ -20,12 +20,12 @@ /* Note: this file handles interface with arm core and vfp registers */ -#include "core/arm/skyeye_common/vfp/vfp.h" #include "common/common_funcs.h" #include "common/common_types.h" #include "common/logging/log.h" #include "core/arm/skyeye_common/armstate.h" #include "core/arm/skyeye_common/vfp/asm_vfp.h" +#include "core/arm/skyeye_common/vfp/vfp.h" void VFPInit(ARMul_State* state) { state->VFP[VFP_FPSID] = VFP_FPSID_IMPLMEN << 24 | VFP_FPSID_SW << 23 | VFP_FPSID_SUBARCH << 16 | diff --git a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp index 4d89743e7..2886f351f 100644 --- a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp @@ -51,10 +51,10 @@ * =========================================================================== */ -#include "core/arm/skyeye_common/vfp/vfp.h" #include #include "common/logging/log.h" #include "core/arm/skyeye_common/vfp/asm_vfp.h" +#include "core/arm/skyeye_common/vfp/vfp.h" #include "core/arm/skyeye_common/vfp/vfp_helper.h" static struct vfp_double vfp_double_default_qnan = { diff --git a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp index 35f9d84d5..1590d89a4 100644 --- a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp +++ b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp @@ -51,13 +51,13 @@ * =========================================================================== */ -#include "core/arm/skyeye_common/vfp/vfp.h" #include #include #include "common/common_funcs.h" #include "common/common_types.h" #include "common/logging/log.h" #include "core/arm/skyeye_common/vfp/asm_vfp.h" +#include "core/arm/skyeye_common/vfp/vfp.h" #include "core/arm/skyeye_common/vfp/vfp_helper.h" static struct vfp_single vfp_single_default_qnan = { diff --git a/src/core/core.cpp b/src/core/core.cpp index 346b6a0ae..49ac8be6e 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/core.h" #include #include "common/logging/log.h" #include "core/arm/arm_interface.h" #include "core/arm/dynarmic/arm_dynarmic.h" #include "core/arm/dyncom/arm_dyncom.h" +#include "core/core.h" #include "core/core_timing.h" #include "core/gdbstub/gdbstub.h" #include "core/hle/hle.h" diff --git a/src/core/core_timing.cpp b/src/core/core_timing.cpp index 4f38403e3..5220b55ea 100644 --- a/src/core/core_timing.cpp +++ b/src/core/core_timing.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/core.h" #include #include #include @@ -11,6 +10,7 @@ #include "common/logging/log.h" #include "common/string_util.h" #include "core/arm/arm_interface.h" +#include "core/core.h" #include "core/core_timing.h" int g_clock_rate_arm11 = 268123480; diff --git a/src/core/file_sys/archive_backend.cpp b/src/core/file_sys/archive_backend.cpp index 5c02fb748..1fae0ede0 100644 --- a/src/core/file_sys/archive_backend.cpp +++ b/src/core/file_sys/archive_backend.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/file_sys/archive_backend.h" #include #include #include #include "common/logging/log.h" #include "common/string_util.h" +#include "core/file_sys/archive_backend.h" #include "core/memory.h" namespace FileSys { diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp index ed9fecd64..e1d29efd3 100644 --- a/src/core/file_sys/archive_extsavedata.cpp +++ b/src/core/file_sys/archive_extsavedata.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/file_sys/archive_extsavedata.h" #include #include #include @@ -10,6 +9,7 @@ #include "common/file_util.h" #include "common/logging/log.h" #include "common/string_util.h" +#include "core/file_sys/archive_extsavedata.h" #include "core/file_sys/disk_archive.h" #include "core/hle/service/fs/archive.h" diff --git a/src/core/file_sys/archive_romfs.cpp b/src/core/file_sys/archive_romfs.cpp index 7c0e1da21..6c99ca5b4 100644 --- a/src/core/file_sys/archive_romfs.cpp +++ b/src/core/file_sys/archive_romfs.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/file_sys/archive_romfs.h" #include #include #include "common/common_types.h" #include "common/logging/log.h" +#include "core/file_sys/archive_romfs.h" #include "core/file_sys/ivfc_archive.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/file_sys/archive_savedata.cpp b/src/core/file_sys/archive_savedata.cpp index 829f97743..6711035ec 100644 --- a/src/core/file_sys/archive_savedata.cpp +++ b/src/core/file_sys/archive_savedata.cpp @@ -2,13 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/file_sys/archive_savedata.h" #include #include #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" #include "common/string_util.h" +#include "core/file_sys/archive_savedata.h" #include "core/file_sys/disk_archive.h" #include "core/hle/kernel/process.h" #include "core/hle/service/fs/archive.h" diff --git a/src/core/file_sys/archive_savedatacheck.cpp b/src/core/file_sys/archive_savedatacheck.cpp index 8bdf24b1f..6c4542b7d 100644 --- a/src/core/file_sys/archive_savedatacheck.cpp +++ b/src/core/file_sys/archive_savedatacheck.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/file_sys/archive_savedatacheck.h" #include #include #include @@ -10,6 +9,7 @@ #include "common/file_util.h" #include "common/logging/log.h" #include "common/string_util.h" +#include "core/file_sys/archive_savedatacheck.h" #include "core/file_sys/ivfc_archive.h" #include "core/hle/service/fs/archive.h" diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp index 887cfbb0f..bcb03ed36 100644 --- a/src/core/file_sys/archive_sdmc.cpp +++ b/src/core/file_sys/archive_sdmc.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/file_sys/archive_sdmc.h" #include #include #include "common/file_util.h" #include "common/logging/log.h" +#include "core/file_sys/archive_sdmc.h" #include "core/file_sys/disk_archive.h" #include "core/settings.h" diff --git a/src/core/file_sys/archive_systemsavedata.cpp b/src/core/file_sys/archive_systemsavedata.cpp index b3dfcf897..48ebc0ed4 100644 --- a/src/core/file_sys/archive_systemsavedata.cpp +++ b/src/core/file_sys/archive_systemsavedata.cpp @@ -2,13 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/file_sys/archive_systemsavedata.h" #include #include #include #include "common/common_types.h" #include "common/file_util.h" #include "common/string_util.h" +#include "core/file_sys/archive_systemsavedata.h" #include "core/file_sys/disk_archive.h" #include "core/hle/service/fs/archive.h" diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp index 7e88473bd..0f66998e1 100644 --- a/src/core/file_sys/disk_archive.cpp +++ b/src/core/file_sys/disk_archive.cpp @@ -2,13 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/file_sys/disk_archive.h" #include #include #include #include "common/common_types.h" #include "common/file_util.h" #include "common/logging/log.h" +#include "core/file_sys/disk_archive.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/file_sys/ivfc_archive.cpp b/src/core/file_sys/ivfc_archive.cpp index 5add3254b..49cc1de10 100644 --- a/src/core/file_sys/ivfc_archive.cpp +++ b/src/core/file_sys/ivfc_archive.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/file_sys/ivfc_archive.h" #include #include #include "common/common_types.h" #include "common/logging/log.h" +#include "core/file_sys/ivfc_archive.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // FileSys namespace diff --git a/src/core/hle/applets/applet.cpp b/src/core/hle/applets/applet.cpp index 35e683cb3..4311d9897 100644 --- a/src/core/hle/applets/applet.cpp +++ b/src/core/hle/applets/applet.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/applets/applet.h" #include #include #include @@ -10,6 +9,7 @@ #include "common/assert.h" #include "common/common_types.h" #include "core/core_timing.h" +#include "core/hle/applets/applet.h" #include "core/hle/applets/erreula.h" #include "core/hle/applets/mii_selector.h" #include "core/hle/applets/swkbd.h" diff --git a/src/core/hle/applets/erreula.cpp b/src/core/hle/applets/erreula.cpp index 9ad77994c..14964427b 100644 --- a/src/core/hle/applets/erreula.cpp +++ b/src/core/hle/applets/erreula.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/applets/erreula.h" #include "common/string_util.h" +#include "core/hle/applets/erreula.h" #include "core/hle/service/apt/apt.h" namespace HLE { diff --git a/src/core/hle/applets/mii_selector.cpp b/src/core/hle/applets/mii_selector.cpp index 53d5b4ab4..53a8683a4 100644 --- a/src/core/hle/applets/mii_selector.cpp +++ b/src/core/hle/applets/mii_selector.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/applets/mii_selector.h" #include #include #include "common/assert.h" #include "common/logging/log.h" #include "common/string_util.h" +#include "core/hle/applets/mii_selector.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/shared_memory.h" #include "core/hle/result.h" diff --git a/src/core/hle/applets/swkbd.cpp b/src/core/hle/applets/swkbd.cpp index b26107332..06ddf538b 100644 --- a/src/core/hle/applets/swkbd.cpp +++ b/src/core/hle/applets/swkbd.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/applets/swkbd.h" #include #include #include "common/assert.h" #include "common/logging/log.h" #include "common/string_util.h" +#include "core/hle/applets/swkbd.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/shared_memory.h" #include "core/hle/result.h" diff --git a/src/core/hle/config_mem.cpp b/src/core/hle/config_mem.cpp index 00efc179e..ccd73cfcb 100644 --- a/src/core/hle/config_mem.cpp +++ b/src/core/hle/config_mem.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/config_mem.h" #include +#include "core/hle/config_mem.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/hle.cpp b/src/core/hle/hle.cpp index 5749068d6..41b772163 100644 --- a/src/core/hle/hle.cpp +++ b/src/core/hle/hle.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/hle.h" #include "common/assert.h" #include "common/logging/log.h" #include "core/arm/arm_interface.h" #include "core/core.h" +#include "core/hle/hle.h" #include "core/hle/service/service.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp index bcb4ee46f..37eec4c84 100644 --- a/src/core/hle/kernel/address_arbiter.cpp +++ b/src/core/hle/kernel/address_arbiter.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/kernel/address_arbiter.h" #include "common/common_types.h" #include "common/logging/log.h" #include "core/hle/hle.h" +#include "core/hle/kernel/address_arbiter.h" #include "core/hle/kernel/thread.h" #include "core/memory.h" diff --git a/src/core/hle/kernel/client_port.cpp b/src/core/hle/kernel/client_port.cpp index eed333995..aedc6f989 100644 --- a/src/core/hle/kernel/client_port.cpp +++ b/src/core/hle/kernel/client_port.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/kernel/client_port.h" #include "common/assert.h" +#include "core/hle/kernel/client_port.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/server_port.h" diff --git a/src/core/hle/kernel/event.cpp b/src/core/hle/kernel/event.cpp index cf8e6fa17..1489c7002 100644 --- a/src/core/hle/kernel/event.cpp +++ b/src/core/hle/kernel/event.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/kernel/event.h" #include #include #include #include "common/assert.h" +#include "core/hle/kernel/event.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/thread.h" diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 49bf95618..9a2c8ce05 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/kernel/kernel.h" #include #include "common/assert.h" #include "common/logging/log.h" #include "core/hle/config_mem.h" +#include "core/hle/kernel/kernel.h" #include "core/hle/kernel/memory.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/resource_limit.h" diff --git a/src/core/hle/kernel/memory.cpp b/src/core/hle/kernel/memory.cpp index d13bc74c6..e65fd5c41 100644 --- a/src/core/hle/kernel/memory.cpp +++ b/src/core/hle/kernel/memory.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/kernel/memory.h" #include #include #include @@ -11,6 +10,7 @@ #include "common/common_types.h" #include "common/logging/log.h" #include "core/hle/config_mem.h" +#include "core/hle/kernel/memory.h" #include "core/hle/kernel/vm_manager.h" #include "core/hle/result.h" #include "core/hle/shared_page.h" diff --git a/src/core/hle/kernel/mutex.cpp b/src/core/hle/kernel/mutex.cpp index 4cd237b44..736944bae 100644 --- a/src/core/hle/kernel/mutex.cpp +++ b/src/core/hle/kernel/mutex.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/kernel/mutex.h" #include #include #include #include "common/assert.h" #include "core/hle/kernel/kernel.h" +#include "core/hle/kernel/mutex.h" #include "core/hle/kernel/thread.h" namespace Kernel { diff --git a/src/core/hle/kernel/process.cpp b/src/core/hle/kernel/process.cpp index a94d74263..ba80fe7f8 100644 --- a/src/core/hle/kernel/process.cpp +++ b/src/core/hle/kernel/process.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/kernel/process.h" #include #include "common/assert.h" #include "common/common_funcs.h" #include "common/logging/log.h" #include "core/hle/kernel/memory.h" +#include "core/hle/kernel/process.h" #include "core/hle/kernel/resource_limit.h" #include "core/hle/kernel/thread.h" #include "core/hle/kernel/vm_manager.h" diff --git a/src/core/hle/kernel/resource_limit.cpp b/src/core/hle/kernel/resource_limit.cpp index 64c91cc62..253ab7045 100644 --- a/src/core/hle/kernel/resource_limit.cpp +++ b/src/core/hle/kernel/resource_limit.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/kernel/resource_limit.h" #include #include "common/logging/log.h" +#include "core/hle/kernel/resource_limit.h" namespace Kernel { diff --git a/src/core/hle/kernel/semaphore.cpp b/src/core/hle/kernel/semaphore.cpp index 2a9ced5b9..bf7600780 100644 --- a/src/core/hle/kernel/semaphore.cpp +++ b/src/core/hle/kernel/semaphore.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/kernel/semaphore.h" #include "common/assert.h" #include "core/hle/kernel/kernel.h" +#include "core/hle/kernel/semaphore.h" #include "core/hle/kernel/thread.h" namespace Kernel { diff --git a/src/core/hle/kernel/server_port.cpp b/src/core/hle/kernel/server_port.cpp index 12a709cee..8e3ec8a14 100644 --- a/src/core/hle/kernel/server_port.cpp +++ b/src/core/hle/kernel/server_port.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/kernel/server_port.h" #include #include "common/assert.h" #include "core/hle/kernel/client_port.h" #include "core/hle/kernel/kernel.h" +#include "core/hle/kernel/server_port.h" #include "core/hle/kernel/thread.h" namespace Kernel { diff --git a/src/core/hle/kernel/shared_memory.cpp b/src/core/hle/kernel/shared_memory.cpp index 8ab916e5b..bc1560d12 100644 --- a/src/core/hle/kernel/shared_memory.cpp +++ b/src/core/hle/kernel/shared_memory.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/kernel/shared_memory.h" #include #include "common/logging/log.h" #include "core/hle/kernel/memory.h" +#include "core/hle/kernel/shared_memory.h" #include "core/memory.h" namespace Kernel { diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 0185c3ae3..4486a812c 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/kernel/thread.h" #include #include #include @@ -20,6 +19,7 @@ #include "core/hle/kernel/memory.h" #include "core/hle/kernel/mutex.h" #include "core/hle/kernel/process.h" +#include "core/hle/kernel/thread.h" #include "core/hle/result.h" #include "core/memory.h" diff --git a/src/core/hle/kernel/timer.cpp b/src/core/hle/kernel/timer.cpp index 7432f3567..a9f98223c 100644 --- a/src/core/hle/kernel/timer.cpp +++ b/src/core/hle/kernel/timer.cpp @@ -2,13 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/kernel/timer.h" #include #include "common/assert.h" #include "common/logging/log.h" #include "core/core_timing.h" #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/thread.h" +#include "core/hle/kernel/timer.h" namespace Kernel { diff --git a/src/core/hle/kernel/vm_manager.cpp b/src/core/hle/kernel/vm_manager.cpp index 488898641..6dd24f846 100644 --- a/src/core/hle/kernel/vm_manager.cpp +++ b/src/core/hle/kernel/vm_manager.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/kernel/vm_manager.h" #include #include "common/assert.h" +#include "core/hle/kernel/vm_manager.h" #include "core/memory.h" #include "core/memory_setup.h" #include "core/mmio.h" diff --git a/src/core/hle/service/ac_u.cpp b/src/core/hle/service/ac_u.cpp index 0b61bfae8..12d94f37a 100644 --- a/src/core/hle/service/ac_u.cpp +++ b/src/core/hle/service/ac_u.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ac_u.h" #include "common/logging/log.h" #include "core/hle/kernel/event.h" +#include "core/hle/service/ac_u.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace AC_U diff --git a/src/core/hle/service/am/am.cpp b/src/core/hle/service/am/am.cpp index e9adfaa1b..f7a990d69 100644 --- a/src/core/hle/service/am/am.cpp +++ b/src/core/hle/service/am/am.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/am/am.h" #include #include "common/logging/log.h" +#include "core/hle/service/am/am.h" #include "core/hle/service/am/am_app.h" #include "core/hle/service/am/am_net.h" #include "core/hle/service/am/am_sys.h" diff --git a/src/core/hle/service/am/am_app.cpp b/src/core/hle/service/am/am_app.cpp index 827e60335..bfc1ca6bd 100644 --- a/src/core/hle/service/am/am_app.cpp +++ b/src/core/hle/service/am/am_app.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/am/am_app.h" #include "core/hle/service/am/am.h" +#include "core/hle/service/am/am_app.h" namespace Service { namespace AM { diff --git a/src/core/hle/service/am/am_net.cpp b/src/core/hle/service/am/am_net.cpp index d9d9d78c8..3a597a34c 100644 --- a/src/core/hle/service/am/am_net.cpp +++ b/src/core/hle/service/am/am_net.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/am/am_net.h" #include "core/hle/service/am/am.h" +#include "core/hle/service/am/am_net.h" namespace Service { namespace AM { diff --git a/src/core/hle/service/am/am_sys.cpp b/src/core/hle/service/am/am_sys.cpp index 6f441f9e7..a2268303c 100644 --- a/src/core/hle/service/am/am_sys.cpp +++ b/src/core/hle/service/am/am_sys.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/am/am_sys.h" #include "core/hle/service/am/am.h" +#include "core/hle/service/am/am_sys.h" namespace Service { namespace AM { diff --git a/src/core/hle/service/am/am_u.cpp b/src/core/hle/service/am/am_u.cpp index c40e56205..151b5e42b 100644 --- a/src/core/hle/service/am/am_u.cpp +++ b/src/core/hle/service/am/am_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/am/am_u.h" #include "core/hle/service/am/am.h" +#include "core/hle/service/am/am_u.h" namespace Service { namespace AM { diff --git a/src/core/hle/service/apt/apt.cpp b/src/core/hle/service/apt/apt.cpp index 6240286bb..c4bd65986 100644 --- a/src/core/hle/service/apt/apt.cpp +++ b/src/core/hle/service/apt/apt.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/apt/apt.h" #include "common/common_paths.h" #include "common/file_util.h" #include "common/logging/log.h" @@ -11,6 +10,7 @@ #include "core/hle/kernel/mutex.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/shared_memory.h" +#include "core/hle/service/apt/apt.h" #include "core/hle/service/apt/apt_a.h" #include "core/hle/service/apt/apt_s.h" #include "core/hle/service/apt/apt_u.h" diff --git a/src/core/hle/service/apt/apt_a.cpp b/src/core/hle/service/apt/apt_a.cpp index 09198d52b..f27ad91b7 100644 --- a/src/core/hle/service/apt/apt_a.cpp +++ b/src/core/hle/service/apt/apt_a.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/apt/apt_a.h" #include "core/hle/service/apt/apt.h" +#include "core/hle/service/apt/apt_a.h" namespace Service { namespace APT { diff --git a/src/core/hle/service/apt/apt_s.cpp b/src/core/hle/service/apt/apt_s.cpp index f5afb78e8..c4556a5de 100644 --- a/src/core/hle/service/apt/apt_s.cpp +++ b/src/core/hle/service/apt/apt_s.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/apt/apt_s.h" #include "core/hle/service/apt/apt.h" +#include "core/hle/service/apt/apt_s.h" namespace Service { namespace APT { diff --git a/src/core/hle/service/apt/apt_u.cpp b/src/core/hle/service/apt/apt_u.cpp index 184534b01..d6ad42e21 100644 --- a/src/core/hle/service/apt/apt_u.cpp +++ b/src/core/hle/service/apt/apt_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/apt/apt_u.h" #include "core/hle/service/apt/apt.h" +#include "core/hle/service/apt/apt_u.h" namespace Service { namespace APT { diff --git a/src/core/hle/service/cam/cam.cpp b/src/core/hle/service/cam/cam.cpp index be2e42963..5594aedab 100644 --- a/src/core/hle/service/cam/cam.cpp +++ b/src/core/hle/service/cam/cam.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/cam/cam.h" #include "common/logging/log.h" #include "core/hle/kernel/event.h" +#include "core/hle/service/cam/cam.h" #include "core/hle/service/cam/cam_c.h" #include "core/hle/service/cam/cam_q.h" #include "core/hle/service/cam/cam_s.h" diff --git a/src/core/hle/service/cam/cam_u.cpp b/src/core/hle/service/cam/cam_u.cpp index 125aa7d1f..af2123e5b 100644 --- a/src/core/hle/service/cam/cam_u.cpp +++ b/src/core/hle/service/cam/cam_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/cam/cam_u.h" #include "core/hle/service/cam/cam.h" +#include "core/hle/service/cam/cam_u.h" namespace Service { namespace CAM { diff --git a/src/core/hle/service/cecd/cecd.cpp b/src/core/hle/service/cecd/cecd.cpp index 4d8916bdf..515b344e6 100644 --- a/src/core/hle/service/cecd/cecd.cpp +++ b/src/core/hle/service/cecd/cecd.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/cecd/cecd.h" #include "common/logging/log.h" #include "core/hle/kernel/event.h" +#include "core/hle/service/cecd/cecd.h" #include "core/hle/service/cecd/cecd_s.h" #include "core/hle/service/cecd/cecd_u.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/cecd/cecd_u.cpp b/src/core/hle/service/cecd/cecd_u.cpp index f220bba12..4b747de7b 100644 --- a/src/core/hle/service/cecd/cecd_u.cpp +++ b/src/core/hle/service/cecd/cecd_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/cecd/cecd_u.h" #include "core/hle/service/cecd/cecd.h" +#include "core/hle/service/cecd/cecd_u.h" namespace Service { namespace CECD { diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp index 1f706751f..24eee6903 100644 --- a/src/core/hle/service/cfg/cfg.cpp +++ b/src/core/hle/service/cfg/cfg.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/cfg/cfg.h" #include #include "common/file_util.h" #include "common/logging/log.h" @@ -11,6 +10,7 @@ #include "core/file_sys/archive_systemsavedata.h" #include "core/file_sys/file_backend.h" #include "core/hle/result.h" +#include "core/hle/service/cfg/cfg.h" #include "core/hle/service/cfg/cfg_i.h" #include "core/hle/service/cfg/cfg_s.h" #include "core/hle/service/cfg/cfg_u.h" diff --git a/src/core/hle/service/cfg/cfg_i.cpp b/src/core/hle/service/cfg/cfg_i.cpp index ed0217e53..2ff52c8b8 100644 --- a/src/core/hle/service/cfg/cfg_i.cpp +++ b/src/core/hle/service/cfg/cfg_i.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/cfg/cfg_i.h" #include "core/hle/service/cfg/cfg.h" +#include "core/hle/service/cfg/cfg_i.h" namespace Service { namespace CFG { diff --git a/src/core/hle/service/cfg/cfg_s.cpp b/src/core/hle/service/cfg/cfg_s.cpp index 51e7b9752..eed26dec7 100644 --- a/src/core/hle/service/cfg/cfg_s.cpp +++ b/src/core/hle/service/cfg/cfg_s.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/cfg/cfg_s.h" #include "core/hle/service/cfg/cfg.h" +#include "core/hle/service/cfg/cfg_s.h" namespace Service { namespace CFG { diff --git a/src/core/hle/service/cfg/cfg_u.cpp b/src/core/hle/service/cfg/cfg_u.cpp index 3f812291b..f28217134 100644 --- a/src/core/hle/service/cfg/cfg_u.cpp +++ b/src/core/hle/service/cfg/cfg_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/cfg/cfg_u.h" #include "core/hle/service/cfg/cfg.h" +#include "core/hle/service/cfg/cfg_u.h" namespace Service { namespace CFG { diff --git a/src/core/hle/service/csnd_snd.cpp b/src/core/hle/service/csnd_snd.cpp index e777ea9d6..20c759ad7 100644 --- a/src/core/hle/service/csnd_snd.cpp +++ b/src/core/hle/service/csnd_snd.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/csnd_snd.h" #include #include "common/alignment.h" #include "core/hle/hle.h" #include "core/hle/kernel/mutex.h" #include "core/hle/kernel/shared_memory.h" +#include "core/hle/service/csnd_snd.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace CSND_SND diff --git a/src/core/hle/service/dlp/dlp_srvr.cpp b/src/core/hle/service/dlp/dlp_srvr.cpp index 113f6a79f..49d5b8d1c 100644 --- a/src/core/hle/service/dlp/dlp_srvr.cpp +++ b/src/core/hle/service/dlp/dlp_srvr.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/dlp/dlp_srvr.h" #include "common/common_types.h" #include "common/logging/log.h" #include "core/hle/result.h" +#include "core/hle/service/dlp/dlp_srvr.h" namespace Service { namespace DLP { diff --git a/src/core/hle/service/dsp_dsp.cpp b/src/core/hle/service/dsp_dsp.cpp index 3f2f09f60..a15aa3696 100644 --- a/src/core/hle/service/dsp_dsp.cpp +++ b/src/core/hle/service/dsp_dsp.cpp @@ -2,13 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/dsp_dsp.h" #include #include #include "audio_core/hle/pipe.h" #include "common/hash.h" #include "common/logging/log.h" #include "core/hle/kernel/event.h" +#include "core/hle/service/dsp_dsp.h" using DspPipe = DSP::HLE::DspPipe; diff --git a/src/core/hle/service/err_f.cpp b/src/core/hle/service/err_f.cpp index ff606d883..3ca4f98de 100644 --- a/src/core/hle/service/err_f.cpp +++ b/src/core/hle/service/err_f.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/err_f.h" #include "common/bit_field.h" #include "common/common_types.h" #include "common/logging/log.h" +#include "core/hle/service/err_f.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace ERR_F diff --git a/src/core/hle/service/frd/frd.cpp b/src/core/hle/service/frd/frd.cpp index bd89b522b..fa5080535 100644 --- a/src/core/hle/service/frd/frd.cpp +++ b/src/core/hle/service/frd/frd.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/frd/frd.h" #include "common/string_util.h" +#include "core/hle/service/frd/frd.h" #include "core/hle/service/frd/frd_a.h" #include "core/hle/service/frd/frd_u.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/frd/frd_u.cpp b/src/core/hle/service/frd/frd_u.cpp index 92b53f2ef..bd1c9c16b 100644 --- a/src/core/hle/service/frd/frd_u.cpp +++ b/src/core/hle/service/frd/frd_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/frd/frd_u.h" #include "core/hle/service/frd/frd.h" +#include "core/hle/service/frd/frd_u.h" namespace Service { namespace FRD { diff --git a/src/core/hle/service/fs/archive.cpp b/src/core/hle/service/fs/archive.cpp index b945b255e..4dc7e1e3c 100644 --- a/src/core/hle/service/fs/archive.cpp +++ b/src/core/hle/service/fs/archive.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/fs/archive.h" #include #include #include @@ -24,6 +23,7 @@ #include "core/file_sys/file_backend.h" #include "core/hle/hle.h" #include "core/hle/result.h" +#include "core/hle/service/fs/archive.h" #include "core/hle/service/fs/fs_user.h" #include "core/hle/service/service.h" #include "core/memory.h" diff --git a/src/core/hle/service/fs/fs_user.cpp b/src/core/hle/service/fs/fs_user.cpp index 92578270b..94f053dc2 100644 --- a/src/core/hle/service/fs/fs_user.cpp +++ b/src/core/hle/service/fs/fs_user.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/fs/fs_user.h" #include "common/assert.h" #include "common/common_types.h" #include "common/file_util.h" @@ -11,6 +10,7 @@ #include "common/string_util.h" #include "core/hle/result.h" #include "core/hle/service/fs/archive.h" +#include "core/hle/service/fs/fs_user.h" #include "core/settings.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/gsp_gpu.cpp b/src/core/hle/service/gsp_gpu.cpp index ba148eaf1..710e0e485 100644 --- a/src/core/hle/service/gsp_gpu.cpp +++ b/src/core/hle/service/gsp_gpu.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "gsp_gpu.h" #include "common/bit_field.h" #include "common/microprofile.h" #include "core/hle/kernel/event.h" @@ -12,6 +11,7 @@ #include "core/hw/hw.h" #include "core/hw/lcd.h" #include "core/memory.h" +#include "gsp_gpu.h" #include "video_core/debug_utils/debug_utils.h" #include "video_core/gpu_debugger.h" diff --git a/src/core/hle/service/hid/hid.cpp b/src/core/hle/service/hid/hid.cpp index a050e81f7..99baded11 100644 --- a/src/core/hle/service/hid/hid.cpp +++ b/src/core/hle/service/hid/hid.cpp @@ -2,13 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/hid/hid.h" #include #include "common/emu_window.h" #include "common/logging/log.h" #include "core/core_timing.h" #include "core/hle/kernel/event.h" #include "core/hle/kernel/shared_memory.h" +#include "core/hle/service/hid/hid.h" #include "core/hle/service/hid/hid_spvr.h" #include "core/hle/service/hid/hid_user.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/hid/hid_spvr.cpp b/src/core/hle/service/hid/hid_spvr.cpp index 00a0902c8..09007e304 100644 --- a/src/core/hle/service/hid/hid_spvr.cpp +++ b/src/core/hle/service/hid/hid_spvr.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/hid/hid_spvr.h" #include "core/hle/service/hid/hid.h" +#include "core/hle/service/hid/hid_spvr.h" namespace Service { namespace HID { diff --git a/src/core/hle/service/hid/hid_user.cpp b/src/core/hle/service/hid/hid_user.cpp index 433e175bb..42591543c 100644 --- a/src/core/hle/service/hid/hid_user.cpp +++ b/src/core/hle/service/hid/hid_user.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/hid/hid_user.h" #include "core/hle/service/hid/hid.h" +#include "core/hle/service/hid/hid_user.h" namespace Service { namespace HID { diff --git a/src/core/hle/service/ir/ir.cpp b/src/core/hle/service/ir/ir.cpp index 459fe0691..4d6639ded 100644 --- a/src/core/hle/service/ir/ir.cpp +++ b/src/core/hle/service/ir/ir.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ir/ir.h" #include "core/hle/kernel/event.h" #include "core/hle/kernel/shared_memory.h" +#include "core/hle/service/ir/ir.h" #include "core/hle/service/ir/ir_rst.h" #include "core/hle/service/ir/ir_u.h" #include "core/hle/service/ir/ir_user.h" diff --git a/src/core/hle/service/ir/ir_rst.cpp b/src/core/hle/service/ir/ir_rst.cpp index 5e7a011ff..1f10ebd3d 100644 --- a/src/core/hle/service/ir/ir_rst.cpp +++ b/src/core/hle/service/ir/ir_rst.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ir/ir_rst.h" #include "core/hle/service/ir/ir.h" +#include "core/hle/service/ir/ir_rst.h" namespace Service { namespace IR { diff --git a/src/core/hle/service/ir/ir_user.cpp b/src/core/hle/service/ir/ir_user.cpp index cca71a0dd..6cff1d544 100644 --- a/src/core/hle/service/ir/ir_user.cpp +++ b/src/core/hle/service/ir/ir_user.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ir/ir_user.h" #include "core/hle/service/ir/ir.h" +#include "core/hle/service/ir/ir_user.h" namespace Service { namespace IR { diff --git a/src/core/hle/service/ldr_ro/cro_helper.cpp b/src/core/hle/service/ldr_ro/cro_helper.cpp index f583f5c31..b7d250312 100644 --- a/src/core/hle/service/ldr_ro/cro_helper.cpp +++ b/src/core/hle/service/ldr_ro/cro_helper.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ldr_ro/cro_helper.h" #include "common/alignment.h" #include "common/logging/log.h" #include "common/scope_exit.h" +#include "core/hle/service/ldr_ro/cro_helper.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace LDR_RO diff --git a/src/core/hle/service/ldr_ro/ldr_ro.cpp b/src/core/hle/service/ldr_ro/ldr_ro.cpp index 3faa2e5d7..ec183d1f5 100644 --- a/src/core/hle/service/ldr_ro/ldr_ro.cpp +++ b/src/core/hle/service/ldr_ro/ldr_ro.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ldr_ro/ldr_ro.h" #include "common/alignment.h" #include "common/common_types.h" #include "common/logging/log.h" @@ -10,6 +9,7 @@ #include "core/hle/kernel/process.h" #include "core/hle/kernel/vm_manager.h" #include "core/hle/service/ldr_ro/cro_helper.h" +#include "core/hle/service/ldr_ro/ldr_ro.h" #include "core/hle/service/ldr_ro/memory_synchronizer.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/service/ldr_ro/memory_synchronizer.cpp b/src/core/hle/service/ldr_ro/memory_synchronizer.cpp index a3e590dfd..989887264 100644 --- a/src/core/hle/service/ldr_ro/memory_synchronizer.cpp +++ b/src/core/hle/service/ldr_ro/memory_synchronizer.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ldr_ro/memory_synchronizer.h" #include #include "common/assert.h" +#include "core/hle/service/ldr_ro/memory_synchronizer.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace LDR_RO diff --git a/src/core/hle/service/ndm/ndm.cpp b/src/core/hle/service/ndm/ndm.cpp index fcfa4b336..5eb97f0d3 100644 --- a/src/core/hle/service/ndm/ndm.cpp +++ b/src/core/hle/service/ndm/ndm.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ndm/ndm.h" #include "common/common_types.h" #include "common/logging/log.h" +#include "core/hle/service/ndm/ndm.h" #include "core/hle/service/ndm/ndm_u.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/ndm/ndm_u.cpp b/src/core/hle/service/ndm/ndm_u.cpp index 4fc93850d..f5c7a341a 100644 --- a/src/core/hle/service/ndm/ndm_u.cpp +++ b/src/core/hle/service/ndm/ndm_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ndm/ndm_u.h" #include "core/hle/service/ndm/ndm.h" +#include "core/hle/service/ndm/ndm_u.h" namespace Service { namespace NDM { diff --git a/src/core/hle/service/news/news.cpp b/src/core/hle/service/news/news.cpp index f22c49f52..8b70ec45b 100644 --- a/src/core/hle/service/news/news.cpp +++ b/src/core/hle/service/news/news.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/news/news.h" #include "common/logging/log.h" +#include "core/hle/service/news/news.h" #include "core/hle/service/news/news_s.h" #include "core/hle/service/news/news_u.h" #include "core/hle/service/service.h" diff --git a/src/core/hle/service/news/news_s.cpp b/src/core/hle/service/news/news_s.cpp index 0e4b650f3..dda3d0f6a 100644 --- a/src/core/hle/service/news/news_s.cpp +++ b/src/core/hle/service/news/news_s.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/news/news_s.h" #include "core/hle/service/news/news.h" +#include "core/hle/service/news/news_s.h" namespace Service { namespace NEWS { diff --git a/src/core/hle/service/nim/nim.cpp b/src/core/hle/service/nim/nim.cpp index 60505545c..0be94322c 100644 --- a/src/core/hle/service/nim/nim.cpp +++ b/src/core/hle/service/nim/nim.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/nim/nim.h" #include "common/common_types.h" #include "common/logging/log.h" +#include "core/hle/service/nim/nim.h" #include "core/hle/service/nim/nim_aoc.h" #include "core/hle/service/nim/nim_s.h" #include "core/hle/service/nim/nim_u.h" diff --git a/src/core/hle/service/nim/nim_u.cpp b/src/core/hle/service/nim/nim_u.cpp index a4fd9781f..7e07d02e8 100644 --- a/src/core/hle/service/nim/nim_u.cpp +++ b/src/core/hle/service/nim/nim_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/nim/nim_u.h" #include "core/hle/service/nim/nim.h" +#include "core/hle/service/nim/nim_u.h" namespace Service { namespace NIM { diff --git a/src/core/hle/service/nwm_uds.cpp b/src/core/hle/service/nwm_uds.cpp index 3b608dcbb..27e829209 100644 --- a/src/core/hle/service/nwm_uds.cpp +++ b/src/core/hle/service/nwm_uds.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/nwm_uds.h" #include "common/common_types.h" #include "common/logging/log.h" #include "core/hle/kernel/event.h" +#include "core/hle/service/nwm_uds.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace NWM_UDS diff --git a/src/core/hle/service/ptm/ptm.cpp b/src/core/hle/service/ptm/ptm.cpp index 29b9071c8..6e6b63329 100644 --- a/src/core/hle/service/ptm/ptm.cpp +++ b/src/core/hle/service/ptm/ptm.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ptm/ptm.h" #include "common/logging/log.h" #include "core/file_sys/file_backend.h" #include "core/hle/service/fs/archive.h" +#include "core/hle/service/ptm/ptm.h" #include "core/hle/service/ptm/ptm_play.h" #include "core/hle/service/ptm/ptm_sysm.h" #include "core/hle/service/ptm/ptm_u.h" diff --git a/src/core/hle/service/ptm/ptm_sysm.cpp b/src/core/hle/service/ptm/ptm_sysm.cpp index 590660f60..693158dbf 100644 --- a/src/core/hle/service/ptm/ptm_sysm.cpp +++ b/src/core/hle/service/ptm/ptm_sysm.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ptm/ptm_sysm.h" #include "core/hle/service/ptm/ptm.h" +#include "core/hle/service/ptm/ptm_sysm.h" namespace Service { namespace PTM { diff --git a/src/core/hle/service/ptm/ptm_u.cpp b/src/core/hle/service/ptm/ptm_u.cpp index 155e10df1..65e868393 100644 --- a/src/core/hle/service/ptm/ptm_u.cpp +++ b/src/core/hle/service/ptm/ptm_u.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ptm/ptm_u.h" #include "core/hle/service/ptm/ptm.h" +#include "core/hle/service/ptm/ptm_u.h" namespace Service { namespace PTM { diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp index eff51af04..ca7eeac8a 100644 --- a/src/core/hle/service/service.cpp +++ b/src/core/hle/service/service.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/service.h" #include "common/logging/log.h" #include "common/string_util.h" #include "core/hle/service/ac_u.h" @@ -34,6 +33,7 @@ #include "core/hle/service/nwm_uds.h" #include "core/hle/service/pm_app.h" #include "core/hle/service/ptm/ptm.h" +#include "core/hle/service/service.h" #include "core/hle/service/soc_u.h" #include "core/hle/service/srv.h" #include "core/hle/service/ssl_c.h" diff --git a/src/core/hle/service/soc_u.cpp b/src/core/hle/service/soc_u.cpp index 1eab61e52..4279b67fb 100644 --- a/src/core/hle/service/soc_u.cpp +++ b/src/core/hle/service/soc_u.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/soc_u.h" #include #include #include @@ -14,6 +13,7 @@ #include "common/scope_exit.h" #include "core/hle/kernel/session.h" #include "core/hle/result.h" +#include "core/hle/service/soc_u.h" #include "core/memory.h" #ifdef _WIN32 diff --git a/src/core/hle/service/srv.cpp b/src/core/hle/service/srv.cpp index 241a5da94..b25be413a 100644 --- a/src/core/hle/service/srv.cpp +++ b/src/core/hle/service/srv.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/srv.h" #include "common/common_types.h" #include "common/logging/log.h" #include "core/hle/kernel/event.h" +#include "core/hle/service/srv.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace SRV diff --git a/src/core/hle/service/ssl_c.cpp b/src/core/hle/service/ssl_c.cpp index 16ec3d116..abab1d271 100644 --- a/src/core/hle/service/ssl_c.cpp +++ b/src/core/hle/service/ssl_c.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/ssl_c.h" #include #include "common/common_types.h" +#include "core/hle/service/ssl_c.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Namespace SSL_C diff --git a/src/core/hle/service/y2r_u.cpp b/src/core/hle/service/y2r_u.cpp index 38e15b5d0..097e09d28 100644 --- a/src/core/hle/service/y2r_u.cpp +++ b/src/core/hle/service/y2r_u.cpp @@ -2,13 +2,13 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/service/y2r_u.h" #include #include "common/common_funcs.h" #include "common/common_types.h" #include "common/logging/log.h" #include "core/hle/kernel/event.h" #include "core/hle/kernel/kernel.h" +#include "core/hle/service/y2r_u.h" #include "core/hw/y2r.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hle/shared_page.cpp b/src/core/hle/shared_page.cpp index 74a9031c5..d0d92487d 100644 --- a/src/core/hle/shared_page.cpp +++ b/src/core/hle/shared_page.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hle/shared_page.h" #include #include #include #include "core/core_timing.h" +#include "core/hle/shared_page.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/hw/gpu.cpp b/src/core/hw/gpu.cpp index 776c8fef7..0e6b91e3a 100644 --- a/src/core/hw/gpu.cpp +++ b/src/core/hw/gpu.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hw/gpu.h" #include #include #include @@ -14,6 +13,7 @@ #include "core/core_timing.h" #include "core/hle/service/gsp_gpu.h" #include "core/hle/service/hid/hid.h" +#include "core/hw/gpu.h" #include "core/hw/hw.h" #include "core/memory.h" #include "core/settings.h" diff --git a/src/core/hw/hw.cpp b/src/core/hw/hw.cpp index 0f84d5adb..9ff8825b2 100644 --- a/src/core/hw/hw.cpp +++ b/src/core/hw/hw.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hw/hw.h" #include "common/common_types.h" #include "common/logging/log.h" #include "core/hw/gpu.h" +#include "core/hw/hw.h" #include "core/hw/lcd.h" namespace HW { diff --git a/src/core/hw/lcd.cpp b/src/core/hw/lcd.cpp index 5231e4cc5..2aa89de18 100644 --- a/src/core/hw/lcd.cpp +++ b/src/core/hw/lcd.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hw/lcd.h" #include #include "common/common_types.h" #include "common/logging/log.h" #include "core/hw/hw.h" +#include "core/hw/lcd.h" #include "core/tracer/recorder.h" #include "video_core/debug_utils/debug_utils.h" diff --git a/src/core/hw/y2r.cpp b/src/core/hw/y2r.cpp index 0e13420d7..6a6c707a2 100644 --- a/src/core/hw/y2r.cpp +++ b/src/core/hw/y2r.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/hw/y2r.h" #include #include #include @@ -13,6 +12,7 @@ #include "common/math_util.h" #include "common/vector_math.h" #include "core/hle/service/y2r_u.h" +#include "core/hw/y2r.h" #include "core/memory.h" namespace HW { diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp index 212772c5d..1c10740a0 100644 --- a/src/core/loader/3dsx.cpp +++ b/src/core/loader/3dsx.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/loader/3dsx.h" #include #include #include "common/logging/log.h" @@ -10,6 +9,7 @@ #include "core/hle/kernel/process.h" #include "core/hle/kernel/resource_limit.h" #include "core/hle/service/fs/archive.h" +#include "core/loader/3dsx.h" #include "core/memory.h" namespace Loader { diff --git a/src/core/loader/elf.cpp b/src/core/loader/elf.cpp index 0f4148a59..8eb5200ab 100644 --- a/src/core/loader/elf.cpp +++ b/src/core/loader/elf.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/loader/elf.h" #include #include #include @@ -12,6 +11,7 @@ #include "common/symbols.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/resource_limit.h" +#include "core/loader/elf.h" #include "core/memory.h" using Kernel::SharedPtr; diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp index 64c8fef07..2e4510857 100644 --- a/src/core/loader/ncch.cpp +++ b/src/core/loader/ncch.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/loader/ncch.h" #include #include #include @@ -13,6 +12,7 @@ #include "core/hle/kernel/process.h" #include "core/hle/kernel/resource_limit.h" #include "core/hle/service/fs/archive.h" +#include "core/loader/ncch.h" #include "core/memory.h" //////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/core/loader/smdh.cpp b/src/core/loader/smdh.cpp index 7c875131f..ccbeb7961 100644 --- a/src/core/loader/smdh.cpp +++ b/src/core/loader/smdh.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/loader/smdh.h" #include #include #include "common/common_types.h" #include "core/loader/loader.h" +#include "core/loader/smdh.h" #include "video_core/utils.h" namespace Loader { diff --git a/src/core/memory.cpp b/src/core/memory.cpp index c702fa311..df029d655 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/memory.h" #include #include #include "common/assert.h" @@ -10,6 +9,7 @@ #include "common/logging/log.h" #include "common/swap.h" #include "core/hle/kernel/process.h" +#include "core/memory.h" #include "core/memory_setup.h" #include "core/mmio.h" #include "video_core/renderer_base.h" diff --git a/src/core/settings.cpp b/src/core/settings.cpp index f2d1b5e74..4a0969b00 100644 --- a/src/core/settings.cpp +++ b/src/core/settings.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "settings.h" #include "audio_core/audio_core.h" #include "core/gdbstub/gdbstub.h" +#include "settings.h" #include "video_core/video_core.h" namespace Settings { diff --git a/src/core/system.cpp b/src/core/system.cpp index ef190203c..7d54811a0 100644 --- a/src/core/system.cpp +++ b/src/core/system.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "core/system.h" #include "audio_core/audio_core.h" #include "core/core.h" #include "core/core_timing.h" @@ -11,6 +10,7 @@ #include "core/hle/kernel/kernel.h" #include "core/hle/kernel/memory.h" #include "core/hw/hw.h" +#include "core/system.h" #include "video_core/video_core.h" namespace System { diff --git a/src/core/tracer/recorder.cpp b/src/core/tracer/recorder.cpp index ba4362484..276a5b288 100644 --- a/src/core/tracer/recorder.cpp +++ b/src/core/tracer/recorder.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "recorder.h" #include #include "common/assert.h" #include "common/file_util.h" #include "common/logging/log.h" +#include "recorder.h" namespace CiTrace { diff --git a/src/video_core/clipper.cpp b/src/video_core/clipper.cpp index 5aad47418..05b5cea73 100644 --- a/src/video_core/clipper.cpp +++ b/src/video_core/clipper.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/clipper.h" #include #include #include @@ -12,6 +11,7 @@ #include "common/common_types.h" #include "common/logging/log.h" #include "common/vector_math.h" +#include "video_core/clipper.h" #include "video_core/pica.h" #include "video_core/pica_state.h" #include "video_core/pica_types.h" diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index 5c74b68e9..bb618cacd 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/command_processor.h" #include #include #include @@ -15,6 +14,7 @@ #include "core/hw/gpu.h" #include "core/memory.h" #include "core/tracer/recorder.h" +#include "video_core/command_processor.h" #include "video_core/debug_utils/debug_utils.h" #include "video_core/pica.h" #include "video_core/pica_state.h" diff --git a/src/video_core/pica.cpp b/src/video_core/pica.cpp index 771e83fe7..ce2bd455e 100644 --- a/src/video_core/pica.cpp +++ b/src/video_core/pica.cpp @@ -2,11 +2,11 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/pica.h" #include #include #include #include +#include "video_core/pica.h" #include "video_core/pica_state.h" #include "video_core/primitive_assembly.h" #include "video_core/shader/shader.h" diff --git a/src/video_core/primitive_assembly.cpp b/src/video_core/primitive_assembly.cpp index 670ffb67d..be7377290 100644 --- a/src/video_core/primitive_assembly.cpp +++ b/src/video_core/primitive_assembly.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/primitive_assembly.h" #include "common/logging/log.h" #include "video_core/pica.h" +#include "video_core/primitive_assembly.h" #include "video_core/shader/shader.h" namespace Pica { diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index c179573d6..6c4bbed33 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/rasterizer.h" #include #include #include @@ -20,6 +19,7 @@ #include "video_core/pica.h" #include "video_core/pica_state.h" #include "video_core/pica_types.h" +#include "video_core/rasterizer.h" #include "video_core/shader/shader.h" #include "video_core/utils.h" diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp index 91347dea8..fd38175b3 100644 --- a/src/video_core/renderer_base.cpp +++ b/src/video_core/renderer_base.cpp @@ -2,9 +2,9 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/renderer_base.h" #include #include +#include "video_core/renderer_base.h" #include "video_core/renderer_opengl/gl_rasterizer.h" #include "video_core/swrasterizer.h" #include "video_core/video_core.h" diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 45a4dc97d..60c9d9180 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/renderer_opengl/gl_rasterizer.h" #include #include #include @@ -16,6 +15,7 @@ #include "core/hw/gpu.h" #include "video_core/pica.h" #include "video_core/pica_state.h" +#include "video_core/renderer_opengl/gl_rasterizer.h" #include "video_core/renderer_opengl/gl_shader_gen.h" #include "video_core/renderer_opengl/gl_shader_util.h" #include "video_core/renderer_opengl/pica_to_gl.h" diff --git a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp index ce9a193bd..5cbad9b43 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer_cache.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/renderer_opengl/gl_rasterizer_cache.h" #include #include #include @@ -20,6 +19,7 @@ #include "core/memory.h" #include "video_core/debug_utils/debug_utils.h" #include "video_core/pica_state.h" +#include "video_core/renderer_opengl/gl_rasterizer_cache.h" #include "video_core/renderer_opengl/gl_state.h" #include "video_core/utils.h" #include "video_core/video_core.h" diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index 52cee2ee2..1808ee0a9 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/renderer_opengl/gl_shader_gen.h" #include #include #include "common/assert.h" @@ -10,6 +9,7 @@ #include "common/logging/log.h" #include "video_core/pica.h" #include "video_core/renderer_opengl/gl_rasterizer.h" +#include "video_core/renderer_opengl/gl_shader_gen.h" #include "video_core/renderer_opengl/gl_shader_util.h" using Pica::Regs; diff --git a/src/video_core/renderer_opengl/gl_shader_util.cpp b/src/video_core/renderer_opengl/gl_shader_util.cpp index c8ba3b92d..fe07aa6eb 100644 --- a/src/video_core/renderer_opengl/gl_shader_util.cpp +++ b/src/video_core/renderer_opengl/gl_shader_util.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/renderer_opengl/gl_shader_util.h" #include #include #include "common/logging/log.h" +#include "video_core/renderer_opengl/gl_shader_util.h" namespace GLShader { diff --git a/src/video_core/renderer_opengl/gl_state.cpp b/src/video_core/renderer_opengl/gl_state.cpp index 96af8469d..ed84cadea 100644 --- a/src/video_core/renderer_opengl/gl_state.cpp +++ b/src/video_core/renderer_opengl/gl_state.cpp @@ -2,10 +2,10 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/renderer_opengl/gl_state.h" #include #include "common/common_funcs.h" #include "common/logging/log.h" +#include "video_core/renderer_opengl/gl_state.h" OpenGLState OpenGLState::cur_state; diff --git a/src/video_core/renderer_opengl/renderer_opengl.cpp b/src/video_core/renderer_opengl/renderer_opengl.cpp index 962785bdd..03a588364 100644 --- a/src/video_core/renderer_opengl/renderer_opengl.cpp +++ b/src/video_core/renderer_opengl/renderer_opengl.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/renderer_opengl/renderer_opengl.h" #include #include #include @@ -22,6 +21,7 @@ #include "core/tracer/recorder.h" #include "video_core/debug_utils/debug_utils.h" #include "video_core/rasterizer_interface.h" +#include "video_core/renderer_opengl/renderer_opengl.h" #include "video_core/video_core.h" static const char vertex_shader[] = R"( diff --git a/src/video_core/shader/shader.cpp b/src/video_core/shader/shader.cpp index 53e91df03..272f3ffe1 100644 --- a/src/video_core/shader/shader.cpp +++ b/src/video_core/shader/shader.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/shader/shader.h" #include #include #include @@ -15,6 +14,7 @@ #include "common/microprofile.h" #include "video_core/pica.h" #include "video_core/pica_state.h" +#include "video_core/shader/shader.h" #include "video_core/shader/shader_interpreter.h" #ifdef ARCHITECTURE_x86_64 #include "video_core/shader/shader_jit_x64.h" diff --git a/src/video_core/shader/shader_interpreter.cpp b/src/video_core/shader/shader_interpreter.cpp index 5df3c4e86..501d00b6b 100644 --- a/src/video_core/shader/shader_interpreter.cpp +++ b/src/video_core/shader/shader_interpreter.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/shader/shader.h" #include #include #include @@ -14,6 +13,7 @@ #include "common/vector_math.h" #include "video_core/pica_state.h" #include "video_core/pica_types.h" +#include "video_core/shader/shader.h" #include "video_core/shader/shader_interpreter.h" using nihstro::OpCode; diff --git a/src/video_core/shader/shader_jit_x64.cpp b/src/video_core/shader/shader_jit_x64.cpp index 5f1323799..4d788755b 100644 --- a/src/video_core/shader/shader_jit_x64.cpp +++ b/src/video_core/shader/shader_jit_x64.cpp @@ -2,7 +2,6 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "shader.h" #include #include #include @@ -14,6 +13,7 @@ #include "common/x64/abi.h" #include "common/x64/cpu_detect.h" #include "common/x64/emitter.h" +#include "shader.h" #include "shader_jit_x64.h" #include "video_core/pica_state.h" #include "video_core/pica_types.h" diff --git a/src/video_core/swrasterizer.cpp b/src/video_core/swrasterizer.cpp index ba458746c..9cd21f72b 100644 --- a/src/video_core/swrasterizer.cpp +++ b/src/video_core/swrasterizer.cpp @@ -2,8 +2,8 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/swrasterizer.h" #include "video_core/clipper.h" +#include "video_core/swrasterizer.h" namespace VideoCore { diff --git a/src/video_core/vertex_loader.cpp b/src/video_core/vertex_loader.cpp index 5704e9fea..2b8ef7018 100644 --- a/src/video_core/vertex_loader.cpp +++ b/src/video_core/vertex_loader.cpp @@ -1,4 +1,3 @@ -#include "video_core/vertex_loader.h" #include #include #include "common/alignment.h" @@ -13,6 +12,7 @@ #include "video_core/pica_state.h" #include "video_core/pica_types.h" #include "video_core/shader/shader.h" +#include "video_core/vertex_loader.h" namespace Pica { diff --git a/src/video_core/video_core.cpp b/src/video_core/video_core.cpp index b06a88b78..83e33dfc2 100644 --- a/src/video_core/video_core.cpp +++ b/src/video_core/video_core.cpp @@ -2,12 +2,12 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. -#include "video_core/video_core.h" #include #include "common/logging/log.h" #include "video_core/pica.h" #include "video_core/renderer_base.h" #include "video_core/renderer_opengl/renderer_opengl.h" +#include "video_core/video_core.h" //////////////////////////////////////////////////////////////////////////////////////////////////// // Video Core namespace -- cgit v1.2.3