Merge pull request #216 from wheremyfoodat/services

Stub DLC::GetPatchTitleInfo to fail
This commit is contained in:
wheremyfoodat 2023-08-20 03:28:23 +03:00 committed by GitHub
commit 37667708e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 2 deletions

View file

@ -15,6 +15,7 @@ class ACService {
void closeAsync(u32 messagePointer);
void createDefaultConfig(u32 messagePointer);
void getLastErrorCode(u32 messagePointer);
void registerDisconnectEvent(u32 messagePointer);
void setClientVersion(u32 messagePointer);
public:

View file

@ -12,6 +12,7 @@ class AMService {
// Service commands
void getDLCTitleInfo(u32 messagePointer);
void getPatchTitleInfo(u32 messagePointer);
void listTitleInfo(u32 messagePointer);
public:

View file

@ -7,6 +7,7 @@ namespace ACCommands {
CancelConnectAsync = 0x00070002,
CloseAsync = 0x00080004,
GetLastErrorCode = 0x000A0000,
RegisterDisconnectEvent = 0x00300004,
SetClientVersion = 0x00400042,
};
}
@ -20,6 +21,7 @@ void ACService::handleSyncRequest(u32 messagePointer) {
case ACCommands::CloseAsync: closeAsync(messagePointer); break;
case ACCommands::CreateDefaultConfig: createDefaultConfig(messagePointer); break;
case ACCommands::GetLastErrorCode: getLastErrorCode(messagePointer); break;
case ACCommands::RegisterDisconnectEvent: registerDisconnectEvent(messagePointer); break;
case ACCommands::SetClientVersion: setClientVersion(messagePointer); break;
default: Helpers::panic("AC service requested. Command: %08X\n", command);
}
@ -63,4 +65,15 @@ void ACService::setClientVersion(u32 messagePointer) {
mem.write32(messagePointer, IPC::responseHeader(0x40, 1, 0));
mem.write32(messagePointer + 4, Result::Success);
}
void ACService::registerDisconnectEvent(u32 messagePointer) {
log("AC::RegisterDisconnectEvent (stubbed)\n");
const u32 pidHeader = mem.read32(messagePointer + 4);
const u32 copyHandleHeader = mem.read32(messagePointer + 12);
// Event signaled when disconnecting from AC
const Handle eventHandle = mem.read32(messagePointer + 16);
mem.write32(messagePointer, IPC::responseHeader(0x30, 1, 0));
mem.write32(messagePointer + 4, Result::Success);
}

View file

@ -4,7 +4,8 @@
namespace AMCommands {
enum : u32 {
GetDLCTitleInfo = 0x10050084,
ListTitleInfo = 0x10070102
ListTitleInfo = 0x10070102,
GetPatchTitleInfo = 0x100D0084,
};
}
@ -13,6 +14,7 @@ void AMService::reset() {}
void AMService::handleSyncRequest(u32 messagePointer) {
const u32 command = mem.read32(messagePointer);
switch (command) {
case AMCommands::GetPatchTitleInfo: getPatchTitleInfo(messagePointer); break;
case AMCommands::GetDLCTitleInfo: getDLCTitleInfo(messagePointer); break;
case AMCommands::ListTitleInfo: listTitleInfo(messagePointer); break;
default: Helpers::panic("AM service requested. Command: %08X\n", command);
@ -42,7 +44,16 @@ void AMService::listTitleInfo(u32 messagePointer) {
void AMService::getDLCTitleInfo(u32 messagePointer) {
log("AM::GetDLCTitleInfo (stubbed to fail)\n");
Helpers::warn("Unimplemented AM::GetDLCTitleInfo. Will need to be implemented to support DLC\n");
mem.write32(messagePointer, IPC::responseHeader(0x1005, 1, 4));
mem.write32(messagePointer + 4, -1);
mem.write32(messagePointer + 4, Result::FailurePlaceholder);
}
void AMService::getPatchTitleInfo(u32 messagePointer) {
log("AM::GetPatchTitleInfo (stubbed to fail)\n");
Helpers::warn("Unimplemented AM::GetDLCTitleInfo. Will need to be implemented to support updates\n");
mem.write32(messagePointer, IPC::responseHeader(0x100D, 1, 4));
mem.write32(messagePointer + 4, Result::FailurePlaceholder);
}