Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cfg:s #286

Merged
merged 1 commit into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading