diff --git a/src/core/memory.cpp b/src/core/memory.cpp index bcf32afa..f1426a2e 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -130,7 +130,7 @@ u8 Memory::read8(u32 vaddr) { case ConfigMem::WifiMac + 4: case ConfigMem::WifiMac + 5: return MACAddress[vaddr - ConfigMem::WifiMac]; - default: Helpers::panic("Unimplemented 8-bit read, addr: %08X", vaddr); + default: return 0; Helpers::panic("Unimplemented 8-bit read, addr: %08X", vaddr); } } } @@ -145,7 +145,7 @@ u16 Memory::read16(u32 vaddr) { } else { switch (vaddr) { case ConfigMem::WifiMac + 4: return (MACAddress[5] << 8) | MACAddress[4]; // Wifi MAC: Last 2 bytes of MAC Address - default: Helpers::panic("Unimplemented 16-bit read, addr: %08X", vaddr); + default: return 0; Helpers::panic("Unimplemented 16-bit read, addr: %08X", vaddr); } } } @@ -196,6 +196,7 @@ u32 Memory::read32(u32 vaddr) { return *(u32*)&vram[vaddr - VirtualAddrs::VramStart]; } + return 0; Helpers::panic("Unimplemented 32-bit read, addr: %08X", vaddr); break; } diff --git a/src/core/services/ac.cpp b/src/core/services/ac.cpp index 16d0665d..b4b9730b 100644 --- a/src/core/services/ac.cpp +++ b/src/core/services/ac.cpp @@ -36,7 +36,10 @@ void ACService::handleSyncRequest(u32 messagePointer) { case ACCommands::IsConnected: isConnected(messagePointer); break; case ACCommands::RegisterDisconnectEvent: registerDisconnectEvent(messagePointer); break; case ACCommands::SetClientVersion: setClientVersion(messagePointer); break; - default: Helpers::panic("AC service requested. Command: %08X\n", command); + default: + mem.write32(messagePointer + 4, Result::Success); + Helpers::warn("AC service requested. Command: %08X\n", command); + break; } } diff --git a/src/core/services/boss.cpp b/src/core/services/boss.cpp index 6e797b2a..d8eed981 100644 --- a/src/core/services/boss.cpp +++ b/src/core/services/boss.cpp @@ -88,7 +88,10 @@ void BOSSService::handleSyncRequest(u32 messagePointer) { mem.write32(messagePointer + 4, Result::Success); break; - default: Helpers::panic("BOSS service requested. Command: %08X\n", command); + default: + mem.write32(messagePointer + 4, Result::Success); + Helpers::warn("BOSS service requested. Command: %08X\n", command); + break; } } diff --git a/src/core/services/cfg.cpp b/src/core/services/cfg.cpp index f4f5d1e4..906a7c24 100644 --- a/src/core/services/cfg.cpp +++ b/src/core/services/cfg.cpp @@ -176,6 +176,8 @@ void CFGService::getConfigInfo(u32 output, u32 blockID, u32 size, u32 permission } else if (size == 4 && blockID == 0x180000) { // Infrared LED related? mem.write32(output, 0); + } else if (size == 1 && blockID == 0xE0000) { + mem.write8(output, 0); } else { Helpers::panic("Unhandled GetConfigInfoBlk2 configuration. Size = %d, block = %X", size, blockID); } diff --git a/src/core/services/news_s.cpp b/src/core/services/news_s.cpp index a9bf4316..97968bb6 100644 --- a/src/core/services/news_s.cpp +++ b/src/core/services/news_s.cpp @@ -11,6 +11,9 @@ void NewsSService::reset() {} void NewsSService::handleSyncRequest(u32 messagePointer) { const u32 command = mem.read32(messagePointer); switch (command) { - default: Helpers::panic("news:s service requested. Command: %08X\n", command); + default: + mem.write32(messagePointer + 4, Result::Success); + Helpers::warn("news:s service requested. Command: %08X\n", command); + break; } } \ No newline at end of file diff --git a/src/core/services/nim.cpp b/src/core/services/nim.cpp index b15aba09..eb51a459 100644 --- a/src/core/services/nim.cpp +++ b/src/core/services/nim.cpp @@ -32,7 +32,10 @@ void NIMService::handleSyncRequest(u32 messagePointer, Type type) { case NIMCommands::GetTaskInfos: getTaskInfos(messagePointer); break; case NIMCommands::IsPendingAutoTitleDownloadTasks: isPendingAutoTitleDownloadTasks(messagePointer); break; - default: Helpers::panic("NIM U service requested. Command: %08X\n", command); + default: + mem.write32(messagePointer + 4, Result::Success); + Helpers::warn("NIM U service requested. Command: %08X\n", command); + break; } } else { Helpers::panic("NIM service requested. Command: %08X\n", command); diff --git a/src/core/services/ptm.cpp b/src/core/services/ptm.cpp index 496ae3a5..f5d02889 100644 --- a/src/core/services/ptm.cpp +++ b/src/core/services/ptm.cpp @@ -66,7 +66,10 @@ void PTMService::handleSyncRequest(u32 messagePointer, PTMService::Type type) { case PTMCommands::GetSoftwareClosedFlag: getSoftwareClosedFlag(messagePointer); break; case PTMCommands::ClearSoftwareClosedFlag: clearSoftwareClosedFlag(messagePointer); break; - default: Helpers::panic("PTM SYSM service requested. Command: %08X\n", command); break; + default: + mem.write32(messagePointer + 4, Result::Success); + Helpers::warn("PTM SYSM service requested. Command: %08X\n", command); + break; } } else { Helpers::panic("PTM service requested. Command: %08X\n", command); diff --git a/src/core/services/service_manager.cpp b/src/core/services/service_manager.cpp index e382def7..039bdd19 100644 --- a/src/core/services/service_manager.cpp +++ b/src/core/services/service_manager.cpp @@ -101,6 +101,7 @@ static std::map serviceMap = { { "act:a", KernelHandles::ACT }, { "act:u", KernelHandles::ACT }, { "am:app", KernelHandles::AM }, + { "am:sys", KernelHandles::AM }, { "APT:S", KernelHandles::APT }, // TODO: APT:A, APT:S and APT:U are slightly different { "APT:A", KernelHandles::APT }, { "APT:U", KernelHandles::APT }, @@ -236,6 +237,7 @@ void ServiceManager::sendCommandToService(u32 messagePointer, Handle handle) { case KernelHandles::NIM_AOC: nim.handleSyncRequest(messagePointer, NIMService::Type::AOC); break; case KernelHandles::NIM_U: nim.handleSyncRequest(messagePointer, NIMService::Type::U); break; case KernelHandles::NDM: ndm.handleSyncRequest(messagePointer); break; + case KernelHandles::NEWS_S: news_s.handleSyncRequest(messagePointer); break; case KernelHandles::NEWS_U: news_u.handleSyncRequest(messagePointer); break; case KernelHandles::NS_S: ns.handleSyncRequest(messagePointer, NSService::Type::S); break; case KernelHandles::NWM_UDS: nwm_uds.handleSyncRequest(messagePointer); break;