mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-19 20:19:13 +12:00
Fix GSP::GPU::RegisterInterruptRelayQueue and add ResetType defs
This commit is contained in:
parent
a91035abf4
commit
a5384095df
5 changed files with 55 additions and 7 deletions
|
@ -2,13 +2,15 @@
|
|||
|
||||
namespace GPUCommands {
|
||||
enum : u32 {
|
||||
AcquireRight = 0x00160042
|
||||
AcquireRight = 0x00160042,
|
||||
RegisterInterruptRelayQueue = 0x00130042
|
||||
};
|
||||
}
|
||||
|
||||
namespace Result {
|
||||
enum : u32 {
|
||||
Success = 0,
|
||||
SuccessRegisterIRQ = 0x2A07
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -20,6 +22,7 @@ void GPUService::handleSyncRequest(u32 messagePointer) {
|
|||
const u32 command = mem.read32(messagePointer);
|
||||
switch (command) {
|
||||
case GPUCommands::AcquireRight: acquireRight(messagePointer); break;
|
||||
case GPUCommands::RegisterInterruptRelayQueue: registerInterruptRelayQueue(messagePointer); break;
|
||||
; default: Helpers::panic("GPU service requested. Command: %08X\n", command);
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +30,7 @@ void GPUService::handleSyncRequest(u32 messagePointer) {
|
|||
void GPUService::acquireRight(u32 messagePointer) {
|
||||
const u32 flag = mem.read32(messagePointer + 4);
|
||||
const u32 pid = mem.read32(messagePointer + 12);
|
||||
printf("GSP::GPU::acquireRight (flag = %d, pid = %X)\n", flag, pid);
|
||||
printf("GSP::GPU::AcquireRight (flag = %X, pid = %X)\n", flag, pid);
|
||||
|
||||
if (flag != 0) {
|
||||
Helpers::panic("GSP::GPU::acquireRight with flag != 0 needs to perform additional initialization");
|
||||
|
@ -40,4 +43,18 @@ void GPUService::acquireRight(u32 messagePointer) {
|
|||
}
|
||||
|
||||
mem.write32(messagePointer + 4, Result::Success);
|
||||
}
|
||||
|
||||
// TODO: What is the flags field meant to be?
|
||||
// What is the "GSP module thread index" meant to be?
|
||||
// How does the shared memory handle thing work?
|
||||
void GPUService::registerInterruptRelayQueue(u32 messagePointer) {
|
||||
const u32 flags = mem.read32(messagePointer + 4);
|
||||
const u32 eventHandle = mem.read32(messagePointer + 12);
|
||||
printf("GSP::GPU::RegisterInterruptRelayQueue (flags = %X, event handle = %X)\n", flags, eventHandle);
|
||||
|
||||
mem.write32(messagePointer + 4, Result::SuccessRegisterIRQ);
|
||||
mem.write32(messagePointer + 8, 0); // TODO: GSP module thread index
|
||||
mem.write32(messagePointer + 12, 0); // Translation descriptor
|
||||
mem.write32(messagePointer + 16, 0); // TODO: shared memory handle
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue