diff options
| author | 2017-10-09 23:56:20 -0400 | |
|---|---|---|
| committer | 2017-10-09 23:56:20 -0400 | |
| commit | b1d5db1cf60344b6b081c9d03cb6ccc3264326cd (patch) | |
| tree | fde377c4ba3c0f92c032e6f5ec8627aae37270ef /src/core/loader/3dsx.cpp | |
| parent | loader: Various improvements for NSO/NRO loaders. (diff) | |
| parent | Merge pull request #2996 from MerryMage/split-travis (diff) | |
| download | yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.gz yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.xz yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.zip | |
Merge remote-tracking branch 'upstream/master' into nx
# Conflicts:
# src/core/CMakeLists.txt
# src/core/arm/dynarmic/arm_dynarmic.cpp
# src/core/arm/dyncom/arm_dyncom.cpp
# src/core/hle/kernel/process.cpp
# src/core/hle/kernel/thread.cpp
# src/core/hle/kernel/thread.h
# src/core/hle/kernel/vm_manager.cpp
# src/core/loader/3dsx.cpp
# src/core/loader/elf.cpp
# src/core/loader/ncch.cpp
# src/core/memory.cpp
# src/core/memory.h
# src/core/memory_setup.h
Diffstat (limited to 'src/core/loader/3dsx.cpp')
| -rw-r--r-- | src/core/loader/3dsx.cpp | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/core/loader/3dsx.cpp b/src/core/loader/3dsx.cpp index 209328347..7b0342cc9 100644 --- a/src/core/loader/3dsx.cpp +++ b/src/core/loader/3dsx.cpp | |||
| @@ -91,8 +91,8 @@ static u32 TranslateAddr(u32 addr, const THREEloadinfo* loadinfo, u32* offsets) | |||
| 91 | return loadinfo->seg_addrs[2] + addr - offsets[1]; | 91 | return loadinfo->seg_addrs[2] + addr - offsets[1]; |
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | using Kernel::SharedPtr; | ||
| 95 | using Kernel::CodeSet; | 94 | using Kernel::CodeSet; |
| 95 | using Kernel::SharedPtr; | ||
| 96 | 96 | ||
| 97 | static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr, | 97 | static THREEDSX_Error Load3DSXFile(FileUtil::IOFile& file, u32 base_addr, |
| 98 | SharedPtr<CodeSet>* out_codeset) { | 98 | SharedPtr<CodeSet>* out_codeset) { |
| @@ -255,7 +255,7 @@ FileType AppLoader_THREEDSX::IdentifyType(FileUtil::IOFile& file) { | |||
| 255 | return FileType::Error; | 255 | return FileType::Error; |
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | ResultStatus AppLoader_THREEDSX::Load() { | 258 | ResultStatus AppLoader_THREEDSX::Load(Kernel::SharedPtr<Kernel::Process>& process) { |
| 259 | if (is_loaded) | 259 | if (is_loaded) |
| 260 | return ResultStatus::ErrorAlreadyLoaded; | 260 | return ResultStatus::ErrorAlreadyLoaded; |
| 261 | 261 | ||
| @@ -267,19 +267,17 @@ ResultStatus AppLoader_THREEDSX::Load() { | |||
| 267 | return ResultStatus::Error; | 267 | return ResultStatus::Error; |
| 268 | codeset->name = filename; | 268 | codeset->name = filename; |
| 269 | 269 | ||
| 270 | Kernel::g_current_process = Kernel::Process::Create("main"); | 270 | process = Kernel::Process::Create("main"); |
| 271 | Kernel::g_current_process->LoadModule(codeset, codeset->entrypoint); | 271 | process->LoadModule(codeset, codeset->entrypoint); |
| 272 | Kernel::g_current_process->svc_access_mask.set(); | 272 | process->svc_access_mask.set(); |
| 273 | Kernel::g_current_process->address_mappings = default_address_mappings; | 273 | process->address_mappings = default_address_mappings; |
| 274 | 274 | ||
| 275 | // Attach the default resource limit (APPLICATION) to the process | 275 | // Attach the default resource limit (APPLICATION) to the process |
| 276 | Kernel::g_current_process->resource_limit = | 276 | process->resource_limit = |
| 277 | Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION); | 277 | Kernel::ResourceLimit::GetForCategory(Kernel::ResourceLimitCategory::APPLICATION); |
| 278 | process->Run(codeset->entrypoint, 48, Kernel::DEFAULT_STACK_SIZE); | ||
| 278 | 279 | ||
| 279 | Kernel::g_current_process->Run(codeset->entrypoint, 48, Kernel::DEFAULT_STACK_SIZE); | 280 | Service::FS::RegisterSelfNCCH(*this); |
| 280 | |||
| 281 | Service::FS::RegisterArchiveType(std::make_unique<FileSys::ArchiveFactory_SelfNCCH>(*this), | ||
| 282 | Service::FS::ArchiveIdCode::SelfNCCH); | ||
| 283 | 281 | ||
| 284 | is_loaded = true; | 282 | is_loaded = true; |
| 285 | return ResultStatus::Success; | 283 | return ResultStatus::Success; |