mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-08 12:01:39 +12:00
[DSP] Add event stubs to fix games locking up
This commit is contained in:
parent
2ebbb08766
commit
908e1fc4fd
7 changed files with 94 additions and 27 deletions
|
@ -25,6 +25,7 @@ Handle Kernel::makeArbiter() {
|
|||
|
||||
// Result CreateAddressArbiter(Handle* arbiter)
|
||||
void Kernel::createAddressArbiter() {
|
||||
logSVC("CreateAddressArbiter\n");
|
||||
regs[0] = SVCResult::Success;
|
||||
regs[1] = makeArbiter();
|
||||
}
|
||||
|
|
|
@ -28,8 +28,8 @@ bool Kernel::signalEvent(Handle handle) {
|
|||
Event* event = object->getData<Event>();
|
||||
event->fired = true;
|
||||
|
||||
// One shot events go back to being not fired once they wake up one or more thread
|
||||
if (event->waitlist != 0 && event->resetType == ResetType::OneShot) {
|
||||
// One shot events go back to being not fired once they are signaled
|
||||
if (event->resetType == ResetType::Pulse) {
|
||||
event->fired = false;
|
||||
}
|
||||
|
||||
|
@ -165,9 +165,6 @@ void Kernel::waitSynchronizationN() {
|
|||
|
||||
logSVC("WaitSynchronizationN (handle pointer: %08X, count: %d, timeout = %lld)\n", handles, handleCount, ns);
|
||||
|
||||
if (waitAll && handleCount > 1)
|
||||
Helpers::panic("Trying to wait on more than 1 object");
|
||||
|
||||
if (handleCount < 0)
|
||||
Helpers::panic("WaitSyncN: Invalid handle count");
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue