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
|
@ -1,8 +1,21 @@
|
|||
#include "kernel.hpp"
|
||||
|
||||
// TODO: What the fuck is resetType meant to be?
|
||||
Handle Kernel::makeEvent(u32 resetType) {
|
||||
const char* Kernel::resetTypeToString(u32 type) {
|
||||
switch (type) {
|
||||
case 0: return "RESET_ONESHOT";
|
||||
case 1: return "RESET_STICKY";
|
||||
case 2: return "RESET_PULSE";
|
||||
default: return "Invalid";
|
||||
}
|
||||
}
|
||||
|
||||
Handle Kernel::makeEvent(ResetType resetType) {
|
||||
Handle ret = makeObject(KernelObjectType::Event);
|
||||
objects[ret].data = new EventData();
|
||||
|
||||
auto eventData = static_cast<EventData*>(objects[ret].data);
|
||||
eventData->resetType = resetType;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -12,9 +25,13 @@ Handle Kernel::makeEvent(u32 resetType) {
|
|||
void Kernel::createEvent() {
|
||||
const u32 outPointer = regs[0];
|
||||
const u32 resetType = regs[1];
|
||||
printf("CreateEvent(handle pointer = %08X, resetType = %d)\n", outPointer, resetType);
|
||||
|
||||
Handle handle = makeEvent(resetType);
|
||||
if (resetType > 2)
|
||||
Helpers::panic("Invalid reset type for event %d", resetType);
|
||||
|
||||
printf("CreateEvent(handle pointer = %08X, resetType = %s)\n", outPointer, resetTypeToString(resetType));
|
||||
|
||||
Handle handle = makeEvent(static_cast<ResetType>(resetType));
|
||||
regs[0] = SVCResult::Success;
|
||||
regs[1] = handle;
|
||||
mem.write32(outPointer, handle);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue