mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-22 03:25:46 +00:00
program_metadata: Add function to load meta from raw parameters
Needed for KIP loading as KIPs do not have an NPDM but do have the essential parts of the data within.
This commit is contained in:
parent
8662c6d579
commit
04a69eb6c7
2 changed files with 20 additions and 0 deletions
|
@ -51,6 +51,21 @@ Loader::ResultStatus ProgramMetadata::Load(VirtualFile file) {
|
||||||
return Loader::ResultStatus::Success;
|
return Loader::ResultStatus::Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProgramMetadata::LoadManual(bool is_64_bit, ProgramAddressSpaceType address_space,
|
||||||
|
u8 main_thread_prio, u8 main_thread_core,
|
||||||
|
u32 main_thread_stack_size, u64 title_id,
|
||||||
|
u64 filesystem_permissions,
|
||||||
|
KernelCapabilityDescriptors capabilities) {
|
||||||
|
npdm_header.has_64_bit_instructions.Assign(is_64_bit);
|
||||||
|
npdm_header.address_space_type.Assign(address_space);
|
||||||
|
npdm_header.main_thread_priority = main_thread_prio;
|
||||||
|
npdm_header.main_thread_cpu = main_thread_core;
|
||||||
|
npdm_header.main_stack_size = main_thread_stack_size;
|
||||||
|
aci_header.title_id = title_id;
|
||||||
|
aci_file_access.permissions = filesystem_permissions;
|
||||||
|
aci_kernel_capabilities = std ::move(capabilities);
|
||||||
|
}
|
||||||
|
|
||||||
bool ProgramMetadata::Is64BitProgram() const {
|
bool ProgramMetadata::Is64BitProgram() const {
|
||||||
return npdm_header.has_64_bit_instructions;
|
return npdm_header.has_64_bit_instructions;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,11 @@ public:
|
||||||
|
|
||||||
Loader::ResultStatus Load(VirtualFile file);
|
Loader::ResultStatus Load(VirtualFile file);
|
||||||
|
|
||||||
|
// Load from parameters instead of NPDM file, used for KIP
|
||||||
|
void LoadManual(bool is_64_bit, ProgramAddressSpaceType address_space, u8 main_thread_prio,
|
||||||
|
u8 main_thread_core, u32 main_thread_stack_size, u64 title_id,
|
||||||
|
u64 filesystem_permissions, KernelCapabilityDescriptors capabilities);
|
||||||
|
|
||||||
bool Is64BitProgram() const;
|
bool Is64BitProgram() const;
|
||||||
ProgramAddressSpaceType GetAddressSpaceType() const;
|
ProgramAddressSpaceType GetAddressSpaceType() const;
|
||||||
u8 GetMainThreadPriority() const;
|
u8 GetMainThreadPriority() const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue