[DSP] Add event stubs to fix games locking up

This commit is contained in:
wheremyfoodat 2023-04-22 20:59:34 +03:00
parent 2ebbb08766
commit 908e1fc4fd
7 changed files with 94 additions and 27 deletions
src/core/kernel

View file

@ -272,7 +272,7 @@ void Kernel::createThread() {
// void SleepThread(s64 nanoseconds)
void Kernel::svcSleepThread() {
const s64 ns = s64(u64(regs[0]) | (u64(regs[1]) << 32));
logSVC("SleepThread(ns = %lld)\n", ns);
//logSVC("SleepThread(ns = %lld)\n", ns);
regs[0] = SVCResult::Success;
sleepThread(ns);
@ -417,8 +417,8 @@ bool Kernel::shouldWaitOnObject(KernelObject* object) {
case KernelObjectType::Thread: // Waiting on a thread waits until it's dead. If it's dead then no need to wait
return object->getData<Thread>()->status != ThreadStatus::Dead;
case KernelObjectType::Semaphore:
Helpers::panic("No semaphore :(");
case KernelObjectType::Semaphore: // Wait if the semaphore count <= 0
return object->getData<Semaphore>()->availableCount <= 0;
default:
Helpers::panic("Not sure whether to wait on object (type: %s)", object->getTypeName());