Initial impl for createEvent SVC

This commit is contained in:
wheremyfoodat 2022-09-18 18:17:41 +03:00
parent 68698ae7a7
commit a91035abf4
6 changed files with 28 additions and 2 deletions

View file

@ -0,0 +1,21 @@
#include "kernel.hpp"
// TODO: What the fuck is resetType meant to be?
Handle Kernel::makeEvent(u32 resetType) {
Handle ret = makeObject(KernelObjectType::Event);
return ret;
}
// Result CreateEvent(Handle* event, ResetType resetType)
// TODO: Just like getResourceLimit this seems to output the handle in r1 even though 3dbrew doesn't mention this
// Should the handle be written both in memory and r1, or just r1?
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);
regs[0] = SVCResult::Success;
regs[1] = handle;
mem.write32(outPointer, handle);
}