diff options
author | MerryMage <MerryMage@users.noreply.github.com> | 2016-03-06 22:13:12 +0100 |
---|---|---|
committer | MerryMage <MerryMage@users.noreply.github.com> | 2016-03-06 22:25:44 +0100 |
commit | 004991d79e991cf7825ab95fceecb4324d9b3c8c (patch) | |
tree | 066e17358e9debf470bd10f3bbc667631bfbbbd8 /src/audio_core/hle/pipe.h | |
parent | Merge pull request #1463 from yuriks/non-app-region (diff) | |
download | yuzu-004991d79e991cf7825ab95fceecb4324d9b3c8c.tar yuzu-004991d79e991cf7825ab95fceecb4324d9b3c8c.tar.gz yuzu-004991d79e991cf7825ab95fceecb4324d9b3c8c.tar.bz2 yuzu-004991d79e991cf7825ab95fceecb4324d9b3c8c.tar.lz yuzu-004991d79e991cf7825ab95fceecb4324d9b3c8c.tar.xz yuzu-004991d79e991cf7825ab95fceecb4324d9b3c8c.tar.zst yuzu-004991d79e991cf7825ab95fceecb4324d9b3c8c.zip |
Diffstat (limited to '')
-rw-r--r-- | src/audio_core/hle/pipe.h | 33 |
1 files changed, 26 insertions, 7 deletions
diff --git a/src/audio_core/hle/pipe.h b/src/audio_core/hle/pipe.h index ff6536950..382d35e87 100644 --- a/src/audio_core/hle/pipe.h +++ b/src/audio_core/hle/pipe.h @@ -4,6 +4,7 @@ #pragma once +#include <cstddef> #include <vector> #include "common/common_types.h" @@ -14,25 +15,43 @@ namespace HLE { /// Reset the pipes by setting pipe positions back to the beginning. void ResetPipes(); +enum class DspPipe { + Debug = 0, + Dma = 1, + Audio = 2, + Binary = 3, + DspPipe_MAX +}; + /** * Read a DSP pipe. - * Pipe IDs: - * pipe_number = 0: Debug - * pipe_number = 1: P-DMA - * pipe_number = 2: Audio - * pipe_number = 3: Binary * @param pipe_number The Pipe ID * @param length How much data to request. * @return The data read from the pipe. The size of this vector can be less than the length requested. */ -std::vector<u8> PipeRead(u32 pipe_number, u32 length); +std::vector<u8> PipeRead(DspPipe pipe_number, u32 length); + +/** + * How much data is left in pipe + * @param pipe_number The Pipe ID + * @return The amount of data remaning in the pipe. This is the maximum length PipeRead will return. + */ +size_t GetPipeReadableSize(DspPipe pipe_number); /** * Write to a DSP pipe. * @param pipe_number The Pipe ID * @param buffer The data to write to the pipe. */ -void PipeWrite(u32 pipe_number, const std::vector<u8>& buffer); +void PipeWrite(DspPipe pipe_number, const std::vector<u8>& buffer); + +enum class DspState { + Off, + On, + Sleeping +}; +/// Get the state of the DSP +DspState GetDspState(); } // namespace HLE } // namespace DSP |