[Kernel/APT] Stub some APT and threading stuff to make OoT go further

This commit is contained in:
wheremyfoodat 2022-10-09 18:59:54 +03:00
parent df4cd0642d
commit cd13ba6271
7 changed files with 44 additions and 2 deletions

View file

@ -58,4 +58,18 @@ void Kernel::waitSynchronization1() {
logSVC("WaitSynchronization1(handle = %X, ns = %lld) (STUBBED)\n", handle, ns);
regs[0] = SVCResult::Success;
}
// Result WaitSynchronizationN(s32* out, Handle* handles, s32 handlecount, bool waitAll, s64 timeout_nanoseconds)
void Kernel::waitSynchronizationN() {
// TODO: Are these arguments even correct?
u32 ns1 = regs[0];
u32 handles = regs[1];
u32 handleCount = regs[2];
bool waitAll = regs[3] != 0;
u32 ns2 = regs[4];
u32 out = regs[5];
logSVC("WaitSynchronizationN (STUBBED)\n");
regs[0] = SVCResult::Success;
}

View file

@ -22,6 +22,7 @@ void Kernel::serviceSVC(u32 svc) {
case 0x01: controlMemory(); break;
case 0x02: queryMemory(); break;
case 0x08: createThread(); break;
case 0x14: releaseMutex(); break;
case 0x17: createEvent(); break;
case 0x19: clearEvent(); break;
case 0x1F: mapMemoryBlock(); break;
@ -29,6 +30,7 @@ void Kernel::serviceSVC(u32 svc) {
case 0x22: arbitrateAddress(); break;
case 0x23: svcCloseHandle(); break;
case 0x24: waitSynchronization1(); break;
case 0x25: waitSynchronizationN(); break;
case 0x27: duplicateHandle(); break;
case 0x28: getSystemTick(); break;
case 0x2B: getProcessInfo(); break;

View file

@ -115,4 +115,11 @@ void Kernel::getThreadID() {
regs[0] = SVCResult::Success;
regs[1] = thread->getData<Thread>()->index;
}
void Kernel::releaseMutex() {
const Handle handle = regs[0];
logSVC("ReleaseMutex (handle = %x) (STUBBED)\n", handle);
regs[0] = SVCResult::Success;
}