mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-05-16 16:53:57 +12:00
Hook DSP interface to DSP service HLE
Co-Authored-By: PSISP <12768103+psi-rockin@users.noreply.github.com>
This commit is contained in:
parent
0a51a80d91
commit
363c71e66c
6 changed files with 31 additions and 136 deletions
include/services
|
@ -1,17 +1,12 @@
|
|||
#pragma once
|
||||
#include <array>
|
||||
#include <optional>
|
||||
#include "audio/dsp_core.hpp"
|
||||
#include "helpers.hpp"
|
||||
#include "logger.hpp"
|
||||
#include "memory.hpp"
|
||||
#include "result/result.hpp"
|
||||
|
||||
namespace DSPPipeType {
|
||||
enum : u32 {
|
||||
Debug = 0, DMA = 1, Audio = 2, Binary = 3
|
||||
};
|
||||
}
|
||||
|
||||
// Circular dependencies!
|
||||
class Kernel;
|
||||
|
||||
|
@ -19,15 +14,11 @@ class DSPService {
|
|||
Handle handle = KernelHandles::DSP;
|
||||
Memory& mem;
|
||||
Kernel& kernel;
|
||||
Audio::DSPCore* dsp = nullptr;
|
||||
MAKE_LOG_FUNCTION(log, dspServiceLogger)
|
||||
|
||||
enum class DSPState : u32 {
|
||||
Off, On, Slep
|
||||
};
|
||||
|
||||
// Number of DSP pipes
|
||||
static constexpr size_t pipeCount = 8;
|
||||
DSPState dspState;
|
||||
|
||||
// DSP service event handles
|
||||
using DSPEvent = std::optional<Handle>;
|
||||
|
@ -36,10 +27,6 @@ class DSPService {
|
|||
DSPEvent interrupt0;
|
||||
DSPEvent interrupt1;
|
||||
std::array<DSPEvent, pipeCount> pipeEvents;
|
||||
std::array<std::vector<u8>, pipeCount> pipeData; // The data of each pipe
|
||||
|
||||
void resetAudioPipe();
|
||||
std::vector<u8> readPipe(u32 pipe, u32 size);
|
||||
|
||||
DSPEvent& getEventRef(u32 type, u32 pipe);
|
||||
static constexpr size_t maxEventCount = 6;
|
||||
|
@ -67,6 +54,7 @@ public:
|
|||
DSPService(Memory& mem, Kernel& kernel) : mem(mem), kernel(kernel) {}
|
||||
void reset();
|
||||
void handleSyncRequest(u32 messagePointer);
|
||||
void setDSPCore(Audio::DSPCore* pointer) { dsp = pointer; }
|
||||
|
||||
enum class SoundOutputMode : u8 {
|
||||
Mono = 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue