service/apt: Add and implement more service commands. (#6721)

* service/apt: Add and implement more service commands.

* service/apt: Implement power button.

* Address review comments and fix GetApplicationRunningMode bug.
This commit is contained in:
Steveice10
2023-07-29 00:26:16 -07:00
committed by GitHub
parent 51996c54f0
commit bb364d9bc0
31 changed files with 939 additions and 221 deletions

View File

@ -23,13 +23,15 @@ namespace Kernel {
/// Initialize the kernel
KernelSystem::KernelSystem(Memory::MemorySystem& memory, Core::Timing& timing,
std::function<void()> prepare_reschedule_callback, u32 system_mode,
u32 num_cores, u8 n3ds_mode)
std::function<void()> prepare_reschedule_callback,
MemoryMode memory_mode, u32 num_cores,
const New3dsHwCapabilities& n3ds_hw_caps)
: memory(memory), timing(timing),
prepare_reschedule_callback(std::move(prepare_reschedule_callback)) {
prepare_reschedule_callback(std::move(prepare_reschedule_callback)), memory_mode(memory_mode),
n3ds_hw_caps(n3ds_hw_caps) {
std::generate(memory_regions.begin(), memory_regions.end(),
[] { return std::make_shared<MemoryRegionInfo>(); });
MemoryInit(system_mode, n3ds_mode);
MemoryInit(memory_mode, n3ds_hw_caps.memory_mode);
resource_limits = std::make_unique<ResourceLimitList>(*this);
for (u32 core_id = 0; core_id < num_cores; ++core_id) {
@ -176,6 +178,8 @@ void KernelSystem::serialize(Archive& ar, const unsigned int file_version) {
ar& shared_page_handler;
ar& stored_processes;
ar& next_thread_id;
ar& memory_mode;
ar& n3ds_hw_caps;
// Deliberately don't include debugger info to allow debugging through loads
if (Archive::is_loading::value) {