From e2888d839afb9f11bd9415f07a5affac4462468a Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Thu, 14 Sep 2023 23:26:06 +0300 Subject: [PATCH] Don't die on ns:s, add wifi level config mem address --- include/kernel/config_mem.hpp | 1 + include/kernel/handles.hpp | 1 + src/core/memory.cpp | 1 + src/core/services/service_manager.cpp | 2 ++ 4 files changed, 5 insertions(+) diff --git a/include/kernel/config_mem.hpp b/include/kernel/config_mem.hpp index 71f46390c..81f0fef10 100644 --- a/include/kernel/config_mem.hpp +++ b/include/kernel/config_mem.hpp @@ -19,6 +19,7 @@ namespace ConfigMem { HardwareType = 0x1FF81004, Datetime0 = 0x1FF81020, WifiMac = 0x1FF81060, + WifiLevel = 0x1FF81066, NetworkState = 0x1FF81067, SliderState3D = 0x1FF81080, LedState3D = 0x1FF81084, diff --git a/include/kernel/handles.hpp b/include/kernel/handles.hpp index 28d88c375..7b0c479ae 100644 --- a/include/kernel/handles.hpp +++ b/include/kernel/handles.hpp @@ -36,6 +36,7 @@ namespace KernelHandles { NFC, // NFC (Duh), used for Amiibo NIM, // Updates, DLC, etc NDM, // ????? + NS_S, // Nintendo Shell service NWM_UDS, // Local multiplayer NEWS_U, // This service literally has 1 command (AddNotification) and I don't even understand what it does PTM_U, // PTM service (Used for accessing various console info, such as battery, shell and pedometer state) diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 5bf0f79bc..f03e80f77 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp @@ -120,6 +120,7 @@ u8 Memory::read8(u32 vaddr) { case ConfigMem::FirmRevision: return firm.revision; case ConfigMem::FirmVersionMinor: return firm.minor; case ConfigMem::FirmVersionMajor: return firm.major; + case ConfigMem::WifiLevel: return 0; // No wifi :( default: Helpers::panic("Unimplemented 8-bit read, addr: %08X", vaddr); } diff --git a/src/core/services/service_manager.cpp b/src/core/services/service_manager.cpp index 1685aee13..114a0fbc0 100644 --- a/src/core/services/service_manager.cpp +++ b/src/core/services/service_manager.cpp @@ -123,6 +123,7 @@ static std::map serviceMap = { { "ndm:u", KernelHandles::NDM }, { "news:u", KernelHandles::NEWS_U }, { "nfc:u", KernelHandles::NFC }, + { "ns:s", KernelHandles::NS_S }, { "nwm::UDS", KernelHandles::NWM_UDS }, { "nim:aoc", KernelHandles::NIM }, { "ptm:u", KernelHandles::PTM_U }, // TODO: ptm:u and ptm:sysm have very different command sets @@ -224,6 +225,7 @@ void ServiceManager::sendCommandToService(u32 messagePointer, Handle handle) { case KernelHandles::NIM: nim.handleSyncRequest(messagePointer); break; case KernelHandles::NDM: ndm.handleSyncRequest(messagePointer); break; case KernelHandles::NEWS_U: news_u.handleSyncRequest(messagePointer); break; + case KernelHandles::NS_S: Helpers::panic("Unimplemented SendSyncRequest to ns:s"); break; case KernelHandles::NWM_UDS: nwm_uds.handleSyncRequest(messagePointer); break; case KernelHandles::PTM_PLAY: ptm.handleSyncRequest(messagePointer, PTMService::Type::PLAY); break; case KernelHandles::PTM_SYSM: ptm.handleSyncRequest(messagePointer, PTMService::Type::SYSM); break;