mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +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
|
@ -1,4 +1,6 @@
|
|||
#pragma once
|
||||
#include <array>
|
||||
#include <optional>
|
||||
#include "helpers.hpp"
|
||||
#include "logger.hpp"
|
||||
#include "memory.hpp"
|
||||
|
@ -41,18 +43,38 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
// Circular dependencies!
|
||||
class Kernel;
|
||||
|
||||
class DSPService {
|
||||
Handle handle = KernelHandles::DSP;
|
||||
Memory& mem;
|
||||
Kernel& kernel;
|
||||
MAKE_LOG_FUNCTION(log, dspServiceLogger)
|
||||
|
||||
// Number of DSP pipes
|
||||
static constexpr size_t pipeCount = 8;
|
||||
DSPPipe audioPipe;
|
||||
|
||||
// DSP service event handles
|
||||
using DSPEvent = std::optional<Handle>;
|
||||
|
||||
DSPEvent semaphoreEvent;
|
||||
DSPEvent interrupt0;
|
||||
DSPEvent interrupt1;
|
||||
std::array<DSPEvent, pipeCount> pipeEvents;
|
||||
|
||||
DSPEvent& getEventRef(u32 type, u32 pipe);
|
||||
static constexpr size_t maxEventCount = 6;
|
||||
|
||||
// Total number of DSP service events registered with registerInterruptEvents
|
||||
size_t totalEventCount;
|
||||
|
||||
// Service functions
|
||||
void convertProcessAddressFromDspDram(u32 messagePointer); // Nice function name
|
||||
void flushDataCache(u32 messagePointer);
|
||||
void getHeadphoneStatus(u32 messagePointer);
|
||||
void getSemaphoreHandle(u32 messagePointer);
|
||||
void getSemaphoreEventHandle(u32 messagePointer);
|
||||
void invalidateDCache(u32 messagePointer);
|
||||
void loadComponent(u32 messagePointer);
|
||||
void readPipeIfPossible(u32 messagePointer);
|
||||
|
@ -62,7 +84,7 @@ class DSPService {
|
|||
void writeProcessPipe(u32 messagePointer);
|
||||
|
||||
public:
|
||||
DSPService(Memory& mem) : mem(mem) {}
|
||||
DSPService(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel) {}
|
||||
void reset();
|
||||
void handleSyncRequest(u32 messagePointer);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue