summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/file_sys/archive_extsavedata.cpp2
-rw-r--r--src/core/file_sys/archive_sdmc.cpp2
-rw-r--r--src/core/file_sys/archive_sdmcwriteonly.cpp2
-rw-r--r--src/core/file_sys/archive_source_sd_savedata.cpp2
-rw-r--r--src/core/hle/service/cfg/cfg.cpp31
-rw-r--r--src/core/hle/svc.cpp20
-rw-r--r--src/core/loader/loader.cpp2
-rw-r--r--src/core/loader/ncch.cpp9
8 files changed, 50 insertions, 20 deletions
diff --git a/src/core/file_sys/archive_extsavedata.cpp b/src/core/file_sys/archive_extsavedata.cpp
index dd2fb167f..f454e7840 100644
--- a/src/core/file_sys/archive_extsavedata.cpp
+++ b/src/core/file_sys/archive_extsavedata.cpp
@@ -173,7 +173,7 @@ Path ConstructExtDataBinaryPath(u32 media_type, u32 high, u32 low) {
173ArchiveFactory_ExtSaveData::ArchiveFactory_ExtSaveData(const std::string& mount_location, 173ArchiveFactory_ExtSaveData::ArchiveFactory_ExtSaveData(const std::string& mount_location,
174 bool shared) 174 bool shared)
175 : shared(shared), mount_point(GetExtDataContainerPath(mount_location, shared)) { 175 : shared(shared), mount_point(GetExtDataContainerPath(mount_location, shared)) {
176 LOG_INFO(Service_FS, "Directory %s set as base for ExtSaveData.", mount_point.c_str()); 176 LOG_DEBUG(Service_FS, "Directory %s set as base for ExtSaveData.", mount_point.c_str());
177} 177}
178 178
179bool ArchiveFactory_ExtSaveData::Initialize() { 179bool ArchiveFactory_ExtSaveData::Initialize() {
diff --git a/src/core/file_sys/archive_sdmc.cpp b/src/core/file_sys/archive_sdmc.cpp
index 72ff05c65..679909d06 100644
--- a/src/core/file_sys/archive_sdmc.cpp
+++ b/src/core/file_sys/archive_sdmc.cpp
@@ -306,7 +306,7 @@ u64 SDMCArchive::GetFreeBytes() const {
306 306
307ArchiveFactory_SDMC::ArchiveFactory_SDMC(const std::string& sdmc_directory) 307ArchiveFactory_SDMC::ArchiveFactory_SDMC(const std::string& sdmc_directory)
308 : sdmc_directory(sdmc_directory) { 308 : sdmc_directory(sdmc_directory) {
309 LOG_INFO(Service_FS, "Directory %s set as SDMC.", sdmc_directory.c_str()); 309 LOG_DEBUG(Service_FS, "Directory %s set as SDMC.", sdmc_directory.c_str());
310} 310}
311 311
312bool ArchiveFactory_SDMC::Initialize() { 312bool ArchiveFactory_SDMC::Initialize() {
diff --git a/src/core/file_sys/archive_sdmcwriteonly.cpp b/src/core/file_sys/archive_sdmcwriteonly.cpp
index 2aafc9b1d..244aef48a 100644
--- a/src/core/file_sys/archive_sdmcwriteonly.cpp
+++ b/src/core/file_sys/archive_sdmcwriteonly.cpp
@@ -32,7 +32,7 @@ ResultVal<std::unique_ptr<DirectoryBackend>> SDMCWriteOnlyArchive::OpenDirectory
32 32
33ArchiveFactory_SDMCWriteOnly::ArchiveFactory_SDMCWriteOnly(const std::string& mount_point) 33ArchiveFactory_SDMCWriteOnly::ArchiveFactory_SDMCWriteOnly(const std::string& mount_point)
34 : sdmc_directory(mount_point) { 34 : sdmc_directory(mount_point) {
35 LOG_INFO(Service_FS, "Directory %s set as SDMCWriteOnly.", sdmc_directory.c_str()); 35 LOG_DEBUG(Service_FS, "Directory %s set as SDMCWriteOnly.", sdmc_directory.c_str());
36} 36}
37 37
38bool ArchiveFactory_SDMCWriteOnly::Initialize() { 38bool ArchiveFactory_SDMCWriteOnly::Initialize() {
diff --git a/src/core/file_sys/archive_source_sd_savedata.cpp b/src/core/file_sys/archive_source_sd_savedata.cpp
index e01357891..f31a68038 100644
--- a/src/core/file_sys/archive_source_sd_savedata.cpp
+++ b/src/core/file_sys/archive_source_sd_savedata.cpp
@@ -39,7 +39,7 @@ std::string GetSaveDataMetadataPath(const std::string& mount_location, u64 progr
39 39
40ArchiveSource_SDSaveData::ArchiveSource_SDSaveData(const std::string& sdmc_directory) 40ArchiveSource_SDSaveData::ArchiveSource_SDSaveData(const std::string& sdmc_directory)
41 : mount_point(GetSaveDataContainerPath(sdmc_directory)) { 41 : mount_point(GetSaveDataContainerPath(sdmc_directory)) {
42 LOG_INFO(Service_FS, "Directory %s set as SaveData.", mount_point.c_str()); 42 LOG_DEBUG(Service_FS, "Directory %s set as SaveData.", mount_point.c_str());
43} 43}
44 44
45ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveSource_SDSaveData::Open(u64 program_id) { 45ResultVal<std::unique_ptr<ArchiveBackend>> ArchiveSource_SDSaveData::Open(u64 program_id) {
diff --git a/src/core/hle/service/cfg/cfg.cpp b/src/core/hle/service/cfg/cfg.cpp
index 6f13cde27..4ddb1bc90 100644
--- a/src/core/hle/service/cfg/cfg.cpp
+++ b/src/core/hle/service/cfg/cfg.cpp
@@ -3,6 +3,8 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm> 5#include <algorithm>
6#include <array>
7#include <cryptopp/sha.h>
6#include "common/file_util.h" 8#include "common/file_util.h"
7#include "common/logging/log.h" 9#include "common/logging/log.h"
8#include "common/string_util.h" 10#include "common/string_util.h"
@@ -176,14 +178,29 @@ void SecureInfoGetRegion(Service::Interface* self) {
176} 178}
177 179
178void GenHashConsoleUnique(Service::Interface* self) { 180void GenHashConsoleUnique(Service::Interface* self) {
179 u32* cmd_buff = Kernel::GetCommandBuffer(); 181 IPC::RequestParser rp(Kernel::GetCommandBuffer(), 0x03, 1, 0);
180 u32 app_id_salt = cmd_buff[1]; 182 const u32 app_id_salt = rp.Pop<u32>() & 0x000FFFFF;
181 183
182 cmd_buff[1] = RESULT_SUCCESS.raw; 184 IPC::RequestBuilder rb = rp.MakeBuilder(3, 0);
183 cmd_buff[2] = 0x33646D6F ^ (app_id_salt & 0xFFFFF); // 3dmoo hash 185
184 cmd_buff[3] = 0x6F534841 ^ (app_id_salt & 0xFFFFF); 186 std::array<u8, 12> buffer;
187 const ResultCode result = GetConfigInfoBlock(ConsoleUniqueID2BlockID, 8, 2, buffer.data());
188 rb.Push(result);
189 if (result.IsSuccess()) {
190 std::memcpy(&buffer[8], &app_id_salt, sizeof(u32));
191 std::array<u8, CryptoPP::SHA256::DIGESTSIZE> hash;
192 CryptoPP::SHA256().CalculateDigest(hash.data(), buffer.data(), sizeof(buffer));
193 u32 low, high;
194 memcpy(&low, &hash[hash.size() - 8], sizeof(u32));
195 memcpy(&high, &hash[hash.size() - 4], sizeof(u32));
196 rb.Push(low);
197 rb.Push(high);
198 } else {
199 rb.Push<u32>(0);
200 rb.Push<u32>(0);
201 }
185 202
186 LOG_WARNING(Service_CFG, "(STUBBED) called app_id_salt=0x%X", app_id_salt); 203 LOG_DEBUG(Service_CFG, "called app_id_salt=0x%X", app_id_salt);
187} 204}
188 205
189void GetRegionCanadaUSA(Service::Interface* self) { 206void GetRegionCanadaUSA(Service::Interface* self) {
diff --git a/src/core/hle/svc.cpp b/src/core/hle/svc.cpp
index 1baa80671..4e0c3fb8b 100644
--- a/src/core/hle/svc.cpp
+++ b/src/core/hle/svc.cpp
@@ -556,11 +556,21 @@ static ResultCode CreateThread(Kernel::Handle* out_handle, s32 priority, u32 ent
556 break; 556 break;
557 } 557 }
558 558
559 if (processor_id == THREADPROCESSORID_1 || processor_id == THREADPROCESSORID_ALL || 559 if (processor_id == THREADPROCESSORID_ALL) {
560 (processor_id == THREADPROCESSORID_DEFAULT && 560 LOG_INFO(Kernel_SVC,
561 Kernel::g_current_process->ideal_processor == THREADPROCESSORID_1)) { 561 "Newly created thread is allowed to be run in any Core, unimplemented.");
562 LOG_WARNING(Kernel_SVC, 562 }
563 "Newly created thread is allowed to be run in the SysCore, unimplemented."); 563
564 if (processor_id == THREADPROCESSORID_DEFAULT &&
565 Kernel::g_current_process->ideal_processor == THREADPROCESSORID_1) {
566 LOG_WARNING(
567 Kernel_SVC,
568 "Newly created thread is allowed to be run in the SysCore (Core1), unimplemented.");
569 }
570
571 if (processor_id == THREADPROCESSORID_1) {
572 LOG_ERROR(Kernel_SVC,
573 "Newly created thread must run in the SysCore (Core1), unimplemented.");
564 } 574 }
565 575
566 CASCADE_RESULT(SharedPtr<Thread> thread, Kernel::Thread::Create(name, entry_point, priority, 576 CASCADE_RESULT(SharedPtr<Thread> thread, Kernel::Thread::Create(name, entry_point, priority,
diff --git a/src/core/loader/loader.cpp b/src/core/loader/loader.cpp
index 147bf8591..be719d74c 100644
--- a/src/core/loader/loader.cpp
+++ b/src/core/loader/loader.cpp
@@ -139,7 +139,7 @@ std::unique_ptr<AppLoader> GetLoader(const std::string& filename) {
139 type = filename_type; 139 type = filename_type;
140 } 140 }
141 141
142 LOG_INFO(Loader, "Loading file %s as %s...", filename.c_str(), GetFileTypeString(type)); 142 LOG_DEBUG(Loader, "Loading file %s as %s...", filename.c_str(), GetFileTypeString(type));
143 143
144 return GetFileLoader(std::move(file), type, filename_filename, filename); 144 return GetFileLoader(std::move(file), type, filename_filename, filename);
145} 145}
diff --git a/src/core/loader/ncch.cpp b/src/core/loader/ncch.cpp
index 98b8259d9..1a4e3efa8 100644
--- a/src/core/loader/ncch.cpp
+++ b/src/core/loader/ncch.cpp
@@ -3,6 +3,7 @@
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <algorithm> 5#include <algorithm>
6#include <cinttypes>
6#include <cstring> 7#include <cstring>
7#include <memory> 8#include <memory>
8#include "common/logging/log.h" 9#include "common/logging/log.h"
@@ -253,7 +254,7 @@ ResultStatus AppLoader_NCCH::LoadExeFS() {
253 254
254 // Skip NCSD header and load first NCCH (NCSD is just a container of NCCH files)... 255 // Skip NCSD header and load first NCCH (NCSD is just a container of NCCH files)...
255 if (MakeMagic('N', 'C', 'S', 'D') == ncch_header.magic) { 256 if (MakeMagic('N', 'C', 'S', 'D') == ncch_header.magic) {
256 LOG_WARNING(Loader, "Only loading the first (bootable) NCCH within the NCSD file!"); 257 LOG_DEBUG(Loader, "Only loading the first (bootable) NCCH within the NCSD file!");
257 ncch_offset = 0x4000; 258 ncch_offset = 0x4000;
258 file.Seek(ncch_offset, SEEK_SET); 259 file.Seek(ncch_offset, SEEK_SET);
259 file.ReadBytes(&ncch_header, sizeof(NCCH_Header)); 260 file.ReadBytes(&ncch_header, sizeof(NCCH_Header));
@@ -277,8 +278,8 @@ ResultStatus AppLoader_NCCH::LoadExeFS() {
277 priority = exheader_header.arm11_system_local_caps.priority; 278 priority = exheader_header.arm11_system_local_caps.priority;
278 resource_limit_category = exheader_header.arm11_system_local_caps.resource_limit_category; 279 resource_limit_category = exheader_header.arm11_system_local_caps.resource_limit_category;
279 280
280 LOG_INFO(Loader, "Name: %s", exheader_header.codeset_info.name); 281 LOG_DEBUG(Loader, "Name: %s", exheader_header.codeset_info.name);
281 LOG_INFO(Loader, "Program ID: %016llX", ncch_header.program_id); 282 LOG_DEBUG(Loader, "Program ID: %016" PRIX64, ncch_header.program_id);
282 LOG_DEBUG(Loader, "Code compressed: %s", is_compressed ? "yes" : "no"); 283 LOG_DEBUG(Loader, "Code compressed: %s", is_compressed ? "yes" : "no");
283 LOG_DEBUG(Loader, "Entry point: 0x%08X", entry_point); 284 LOG_DEBUG(Loader, "Entry point: 0x%08X", entry_point);
284 LOG_DEBUG(Loader, "Code size: 0x%08X", code_size); 285 LOG_DEBUG(Loader, "Code size: 0x%08X", code_size);
@@ -336,6 +337,8 @@ ResultStatus AppLoader_NCCH::Load() {
336 if (result != ResultStatus::Success) 337 if (result != ResultStatus::Success)
337 return result; 338 return result;
338 339
340 LOG_INFO(Loader, "Program ID: %016" PRIX64, ncch_header.program_id);
341
339 is_loaded = true; // Set state to loaded 342 is_loaded = true; // Set state to loaded
340 343
341 result = LoadExec(); // Load the executable into memory for booting 344 result = LoadExec(); // Load the executable into memory for booting