Stub LaunchTitle

This commit is contained in:
Nomi 2023-09-25 12:14:50 +02:00
commit ea3f9ef260
2 changed files with 14 additions and 1 deletions

View file

@ -10,6 +10,7 @@ class NSService {
MAKE_LOG_FUNCTION(log, nsLogger) MAKE_LOG_FUNCTION(log, nsLogger)
// Service commands // Service commands
void launchTitle(u32 messagePointer);
public: public:
enum class Type { enum class Type {

View file

@ -3,7 +3,7 @@
namespace NSCommands { namespace NSCommands {
enum : u32 { enum : u32 {
a, LaunchTitle = 0x000200C0,
}; };
} }
@ -14,6 +14,18 @@ void NSService::handleSyncRequest(u32 messagePointer, Type type) {
// ns:s commands // ns:s commands
switch (command) { switch (command) {
case NSCommands::LaunchTitle: launchTitle(messagePointer); break;
default: Helpers::panic("NS service requested. Command: %08X\n", command); default: Helpers::panic("NS service requested. Command: %08X\n", command);
} }
} }
void NSService::launchTitle(u32 messagePointer) {
const u64 titleID = mem.read64(messagePointer + 4);
const u32 launchFlags = mem.read32(messagePointer + 12);
log("NS::LaunchTitle (title ID = %llX, launch flags = %X) (stubbed)\n", titleID, launchFlags);
mem.write32(messagePointer, IPC::responseHeader(0x2, 2, 0));
mem.write32(messagePointer + 4, Result::Success);
mem.write32(messagePointer + 8, 0); // Process ID
}