diff options
| author | 2020-04-20 18:15:52 -0400 | |
|---|---|---|
| committer | 2020-04-20 18:19:45 -0400 | |
| commit | f0a7f050705734561311180adf1876ab392db61a (patch) | |
| tree | a7a7e8cbacdf3b50690d34e426f77075cdedbfe8 | |
| parent | Merge pull request #3739 from MerryMage/disable_cpu_opt (diff) | |
| download | yuzu-f0a7f050705734561311180adf1876ab392db61a.tar.gz yuzu-f0a7f050705734561311180adf1876ab392db61a.tar.xz yuzu-f0a7f050705734561311180adf1876ab392db61a.zip | |
file_sys: program_metadata: Add a helper function for generating reasonable default metadata.
- We need this for homebrew process initialization.
Diffstat (limited to '')
| -rw-r--r-- | src/core/file_sys/program_metadata.cpp | 11 | ||||
| -rw-r--r-- | src/core/file_sys/program_metadata.h | 6 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/core/file_sys/program_metadata.cpp b/src/core/file_sys/program_metadata.cpp index 1d6c30962..43169bf9f 100644 --- a/src/core/file_sys/program_metadata.cpp +++ b/src/core/file_sys/program_metadata.cpp | |||
| @@ -51,6 +51,17 @@ Loader::ResultStatus ProgramMetadata::Load(VirtualFile file) { | |||
| 51 | return Loader::ResultStatus::Success; | 51 | return Loader::ResultStatus::Success; |
| 52 | } | 52 | } |
| 53 | 53 | ||
| 54 | /*static*/ ProgramMetadata ProgramMetadata::GetDefault() { | ||
| 55 | ProgramMetadata result; | ||
| 56 | |||
| 57 | result.LoadManual( | ||
| 58 | true /*is_64_bit*/, FileSys::ProgramAddressSpaceType::Is39Bit /*address_space*/, | ||
| 59 | 0x2c /*main_thread_prio*/, 0 /*main_thread_core*/, 0x00100000 /*main_thread_stack_size*/, | ||
| 60 | {}, 0xFFFFFFFFFFFFFFFF /*filesystem_permissions*/, {} /*capabilities*/); | ||
| 61 | |||
| 62 | return result; | ||
| 63 | } | ||
| 64 | |||
| 54 | void ProgramMetadata::LoadManual(bool is_64_bit, ProgramAddressSpaceType address_space, | 65 | void ProgramMetadata::LoadManual(bool is_64_bit, ProgramAddressSpaceType address_space, |
| 55 | s32 main_thread_prio, u32 main_thread_core, | 66 | s32 main_thread_prio, u32 main_thread_core, |
| 56 | u32 main_thread_stack_size, u64 title_id, | 67 | u32 main_thread_stack_size, u64 title_id, |
diff --git a/src/core/file_sys/program_metadata.h b/src/core/file_sys/program_metadata.h index f8759a396..35069972b 100644 --- a/src/core/file_sys/program_metadata.h +++ b/src/core/file_sys/program_metadata.h | |||
| @@ -44,9 +44,13 @@ public: | |||
| 44 | ProgramMetadata(); | 44 | ProgramMetadata(); |
| 45 | ~ProgramMetadata(); | 45 | ~ProgramMetadata(); |
| 46 | 46 | ||
| 47 | /// Gets a default ProgramMetadata configuration, should only be used for homebrew formats where | ||
| 48 | /// we do not have an NPDM file | ||
| 49 | static ProgramMetadata GetDefault(); | ||
| 50 | |||
| 47 | Loader::ResultStatus Load(VirtualFile file); | 51 | Loader::ResultStatus Load(VirtualFile file); |
| 48 | 52 | ||
| 49 | // Load from parameters instead of NPDM file, used for KIP | 53 | /// Load from parameters instead of NPDM file, used for KIP |
| 50 | void LoadManual(bool is_64_bit, ProgramAddressSpaceType address_space, s32 main_thread_prio, | 54 | void LoadManual(bool is_64_bit, ProgramAddressSpaceType address_space, s32 main_thread_prio, |
| 51 | u32 main_thread_core, u32 main_thread_stack_size, u64 title_id, | 55 | u32 main_thread_core, u32 main_thread_stack_size, u64 title_id, |
| 52 | u64 filesystem_permissions, KernelCapabilityDescriptors capabilities); | 56 | u64 filesystem_permissions, KernelCapabilityDescriptors capabilities); |