mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-03 12:27:21 +12:00
[DSP service] ReadPipeIfPossible
This commit is contained in:
parent
1bcdf7f18d
commit
a3431e7c9c
2 changed files with 143 additions and 1 deletions
|
@ -3,11 +3,60 @@
|
|||
#include "logger.hpp"
|
||||
#include "memory.hpp"
|
||||
|
||||
// Stub for DSP audio pipe
|
||||
class DSPPipe {
|
||||
// Hardcoded responses for now
|
||||
static constexpr std::array<u16, 16> pipeData = {
|
||||
0x000F, //Number of responses
|
||||
0xBFFF,
|
||||
0x9E8E,
|
||||
0x8680,
|
||||
0xA78E,
|
||||
0x9430,
|
||||
0x8400,
|
||||
0x8540,
|
||||
0x948E,
|
||||
0x8710,
|
||||
0x8410,
|
||||
0xA90E,
|
||||
0xAA0E,
|
||||
0xAACE,
|
||||
0xAC4E,
|
||||
0xAC58
|
||||
};
|
||||
uint index = 0;
|
||||
|
||||
public:
|
||||
void reset() {
|
||||
index = 0;
|
||||
}
|
||||
|
||||
// Read without checking if the pipe has overflowed
|
||||
u16 readUnchecked() {
|
||||
return pipeData[index++];
|
||||
}
|
||||
|
||||
bool empty() {
|
||||
return index >= pipeData.size();
|
||||
}
|
||||
};
|
||||
|
||||
class DSPService {
|
||||
Handle handle = KernelHandles::DSP;
|
||||
Memory& mem;
|
||||
MAKE_LOG_FUNCTION(log, dspServiceLogger)
|
||||
|
||||
DSPPipe audioPipe;
|
||||
|
||||
// Service functions
|
||||
void getSemaphoreHandle(u32 messagePointer);
|
||||
void loadComponent(u32 messagePointer);
|
||||
void readPipeIfPossible(u32 messagePointer);
|
||||
void registerInterruptEvents(u32 messagePointer);
|
||||
void setSemaphore(u32 messagePointer);
|
||||
void setSemaphoreMask(u32 messagePointer);
|
||||
void writeProcessPipe(u32 messagePointer);
|
||||
|
||||
public:
|
||||
DSPService(Memory& mem) : mem(mem) {}
|
||||
void reset();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue