Skip to content

Commit

Permalink
Merge pull request #276 from wheremyfoodat/download-play
Browse files Browse the repository at this point in the history
Don't die on ns:s, add wifi level config mem address
  • Loading branch information
wheremyfoodat authored Sep 14, 2023
2 parents fa6a257 + e2888d8 commit 011dd1b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/kernel/config_mem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace ConfigMem {
HardwareType = 0x1FF81004,
Datetime0 = 0x1FF81020,
WifiMac = 0x1FF81060,
WifiLevel = 0x1FF81066,
NetworkState = 0x1FF81067,
SliderState3D = 0x1FF81080,
LedState3D = 0x1FF81084,
Expand Down
1 change: 1 addition & 0 deletions include/kernel/handles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/core/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions src/core/services/service_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ static std::map<std::string, Handle> 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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 011dd1b

Please sign in to comment.