Skip to content

Commit

Permalink
Merge pull request #286 from wheremyfoodat/system-appz
Browse files Browse the repository at this point in the history
Add cfg:s
  • Loading branch information
wheremyfoodat authored Sep 24, 2023
2 parents 3cf917f + 7c8d730 commit e2c88d7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/kernel/handles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace KernelHandles {
CECD, // More Streetpass stuff?
CFG_U, // CFG service (Console & region info)
CFG_I,
CFG_S, // Used by most system apps in lieu of cfg:u
CSND, // Plays audio directly from PCM samples
DLP_SRVR, // Download Play: Server. Used for network play.
DSP, // DSP service (Used for audio decoding and output)
Expand Down
16 changes: 15 additions & 1 deletion src/core/services/cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,21 @@ void CFGService::handleSyncRequest(u32 messagePointer, CFGService::Type type) {
case CFGCommands::GetSystemModel: getSystemModel(messagePointer); break;
case CFGCommands::GenHashConsoleUnique: genUniqueConsoleHash(messagePointer); break;
case CFGCommands::SecureInfoGetRegion: secureInfoGetRegion(messagePointer); break;
default: Helpers::panic("CFG service requested. Command: %08X\n", command);

default:
if (type == Type::S) {
// cfg:s-only functions
switch (command) {
case CFGCommands::GetConfigInfoBlk8: getConfigInfoBlk8(messagePointer); break;
case CFGCommands::GetLocalFriendCodeSeed: getLocalFriendCodeSeed(messagePointer); break;
case CFGCommands::SecureInfoGetByte101: secureInfoGetByte101(messagePointer); break;
default: Helpers::panic("CFG:S service requested. Command: %08X\n", command);
}
} else {
Helpers::panic("CFG service requested. Command: %08X\n", command);
}

break;
}
}

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 @@ -106,6 +106,7 @@ static std::map<std::string, Handle> serviceMap = {
{ "cecd:u", KernelHandles::CECD },
{ "cfg:u", KernelHandles::CFG_U },
{ "cfg:i", KernelHandles::CFG_I },
{ "cfg:s", KernelHandles::CFG_S },
{ "csnd:SND", KernelHandles::CSND },
{ "dlp:SRVR", KernelHandles::DLP_SRVR },
{ "dsp::DSP", KernelHandles::DSP },
Expand Down Expand Up @@ -210,6 +211,7 @@ void ServiceManager::sendCommandToService(u32 messagePointer, Handle handle) {
case KernelHandles::CECD: cecd.handleSyncRequest(messagePointer); break;
case KernelHandles::CFG_U: cfg.handleSyncRequest(messagePointer, CFGService::Type::U); break;
case KernelHandles::CFG_I: cfg.handleSyncRequest(messagePointer, CFGService::Type::I); break;
case KernelHandles::CFG_S: cfg.handleSyncRequest(messagePointer, CFGService::Type::S); break;
case KernelHandles::CSND: csnd.handleSyncRequest(messagePointer); break;
case KernelHandles::DLP_SRVR: dlp_srvr.handleSyncRequest(messagePointer); break;
case KernelHandles::HID: hid.handleSyncRequest(messagePointer); break;
Expand Down

0 comments on commit e2c88d7

Please sign in to comment.